PageSourceSearch

https://www.tullys.co.jp/common/js/common.js

js tullys.co.jp collected 2026-10-02 03:02:50 UTC 49,167 bytes, 1,548 lines download raw bytes

1// JS読込直後の処理 /////////////////////////////////////////////////////////////////////////////////////////////////////
2$(function () {
3  if ($(".long_height").length > 0) {
4    $(".long_height").each(function () {
5      var imgs = $(this).find(".image_title__image").find("img").attr("src");
6      $(this).css({
7        background: "url(" + imgs + ") no-repeat center",
8        backgroundSize: "cover",
9      });
10      $(this).find(".image_title__image").remove();
11    });
12  }
13
14  $("article")
15    .find("p")
16    .each(function () {
17      if ($(this).html() == "") {
18        $(this).html(" ");
19      }
20    });
21
22  //下部FYTの高さを調節する
23  if ($(".fyt_contents .col_liquid_5 li").length > 0) {
24    var asideFytHeight = new Array();
25    $(".fyt_contents .col_liquid_5 li p").each(function () {
26      var listHeight = $(this).height();
27      asideFytHeight.push(listHeight);
28    });
29    var asideFytHeightMax = Math.max.apply(null, asideFytHeight);
30    $(".fyt_contents .col_liquid_5 li p").height(asideFytHeightMax);
31  }
32
33  //TOP Pickupの高さを調節する
34  // if($("#pickups").length > 0){
35  //  var pickObj = $("#pickups .thumbnail_updown__multicolumn li p");
36  //  var pickLen = pickObj.length;
37
38  //  var pickupsHeight1 = new Array();
39  //  var pickupsHeight2 = new Array();
40
41  //  pickObj.each(function(i){
42  //    var listHeight = $(this).height();
43  //    if(i >= 1){
44  //      pickupsHeight1.push(listHeight);
45  //    }else{
46  //      pickupsHeight2.push(listHeight);
47  //    }
48  //  });
49  //  var pickupsHeight1Max = Math.max.apply(null, pickupsHeight1);
50  //  var pickupsHeight2Max = Math.max.apply(null, pickupsHeight2);
51
52  //  pickObj.each(function(i){
53  //    if(i >= 1){
54  //      pickObj.height(pickupsHeight1Max);
55  //    }else{
56  //      pickObj.height(pickupsHeight2Max);
57  //    }
58  //  });
59  // }
60
61  //
62  if ($(".image_title_content .item_list .item_list__title").length > 0) {
63    $(".image_title_content .item_list").each(function () {
64      var qualityList = new Array();
65      var record = $(this);
66      record.find(".item_list__title").each(function () {
67        var qualityListHeight = $(this).height();
68        qualityList.push(qualityListHeight);
69      });
70      var qualityListMax = Math.max.apply(null, qualityList);
71      record.find(".item_list__title").height(qualityListMax);
72    });
73  }
74
75  if ($(".main_course_list").length > 0) {
76    objHeightFix(".main_course_list", ".item_list__title", 0);
77    objHeightFix(".main_course_list", ".item_list__text", 0);
78  }
79  if ($(".optional_course_list").length > 0) {
80    objHeightFix(".optional_course_list", ".item_list__title", 0);
81    objHeightFix(".optional_course_list", ".item_list__text", 0);
82  }
83
84  //TOPのFYT専用
85  fytCupPosition();
86
87  qualityTitleFix();
88  fixBoxFix();
89
90  if ($("#topics").length > 0) {
91    objHeightFix("#topics .thumbnail_updown__3column", ".topicsText", 0);
92  }
93});
94
95//メニュー //////////////////////////////////////////////////////////////////////////////////////////////
96$(function () {
97  if ($(".list__navi").length > 0) {
98    //下層が存在しない場合は.activeを削除する
99    $(".list__navi .active").each(function () {
100      var findUl = $(this).children("ul").length;
101      if (findUl == 0) {
102        $(this).removeClass("active");
103      }
104    });
105
106    //▼クリック時の挙動
107    //オブジェクトのクリックでは無く、クリック座標で判断する
108    $(".list__navi .active")
109      .children("a")
110      .on("click", function (event) {
111        var eX = event.pageX;
112        if (eX >= 190) {
113          if ($(this).hasClass("open")) {
114            $(this).removeClass("open");
115          } else {
116            $(this).addClass("open");
117          }
118          $(this)
119            .next(".list__navi")
120            .children(".hide")
121            .slideToggle(function () {
122              leftPaneHeightFix();
123            });
124          return false;
125        }
126      });
127  }
128
129  //コミュニティ一覧のタイトルアニメーション
130
131  $(".community__list li").each(function () {
132    var hHeight = $(this).find("h3").height();
133    var bottomPx = $(this).find(".community__text").css("bottom");
134    var bottomPxNum = Number(bottomPx.split("px")[0]);
135    bottomPxNum = bottomPxNum + hHeight + 20;
136    $(this)
137      .find(".community__text")
138      .animate({
139        bottom: bottomPxNum + "px",
140      });
141  });
142  $(".community__list li")
143    .on("mouseenter", function () {
144      if ($("body").hasClass("pc") || $("body").hasClass("tb")) {
145        $(this).find(".community__text").animate({ bottom: 0 }, 200);
146      }
147    })
148    .on("mouseleave", function () {
149      if ($("body").hasClass("pc") || $("body").hasClass("tb")) {
150        var contentHeight = $(this).find(".community__text").outerHeight();
151        var titleHeight = $(this).find("h3").outerHeight();
152        var pos = contentHeight - titleHeight - 10; //-10は下のマージン分
153        $(this)
154          .find(".community__text")
155          .animate({ bottom: "-" + pos }, 200);
156      }
157    });
158
159  //article内最後のOBJにpaddingを設ける
160  //$("article>*:last").css("padding-bottom","60px");
161  $("article>*:last").addClass("js__pad_bottom");
162});
163
164//多言語選択 //////////////////////////////////////////////////////////////////////////////////////////////
165$(function () {
166  if ($(".lang-switcher").length > 0) {
167    $(".lang-switcher")
168      .children("a")
169      .on("click", function () {
170        $(this).next(".navi_global_child").slideToggle();
171        return false;
172      });
173  }
174});
175
176//モーダル //////////////////////////////////////////////////////////////////////////////////////////////
177$(function () {
178  $(".modal_trigger,.modal_link").on("click", function () {
179    var modalObj =
180      '<div class="modal_wrapper"><div class="modal_obj"></div><div class="modal_layer"></div></div>';
181    var obj = $(this).attr("href");
182    var imgs = new Array("jpg", "jpeg", "png", "gif");
183    var flg = 0;
184    $.each(imgs, function (i, record) {
185      if (obj.indexOf(record) != -1) {
186        flg++;
187      }
188    });
189    if (flg > 0) {
190      $("body").append(modalObj);
191      $(".modal_obj").append('<img src="' + obj + '" width="100%">');
192    } else {
193      $("body").append(modalObj);
194      $(".modal_obj").append($(obj).clone());
195    }
196
197    var winHeight = $("body").height();
198    var winScroll = $(window).scrollTop();
199    $(".modal_wrapper").height(winHeight);
200    $(".modal_obj").css({ marginTop: winScroll + 30 });
201
202    return false;
203  });
204
205  var uaEvent = "click touchend";
206  if (navigator.userAgent.indexOf("Android") != -1) {
207    uaEvent = "click";
208  }
209
210  $("body").on(uaEvent, ".modal_wrapper", function () {
211    $(this).fadeOut(function () {
212      $(this).remove();
213    });
214  });
215});
216
217//アンカーの挙動 //////////////////////////////////////////////////////////////////////////////////////////////
218$(function () {
219  //ロード時
220  var thisURL = location.hash;
221  if (thisURL != "") {
222    windowLoadAnchor(thisURL);
223  }
224
225  //クリックイベント
226  $("a[href^='#']").on("click", function () {
227    var thisHref = $(this).attr("href");
228    var sPos = 0;
229
230    if (thisHref != "#") {
231      var target = $(thisHref);
232      if (target.length == 0) {
233        return true;
234      }
235
236      var pos = target.offset().top;
237      if ($("body").hasClass("sp")) {
238        var head = $("header").height() || 0;
239        var addPos = $(".sp_gnavi_wrapper").height() || 0;
240        sPos = pos - head - addPos;
241      } else {
242        sPos = pos;
243      }
244    }
245    $("html, body").animate({ scrollTop: sPos }, 200);
246    return false;
247  });
248});
249
250// トップに戻る
251$(function () {
252  var showFlag = false;
253  var topBth = jQuery(".page_top");
254  topBth.css("bottom", "-100px");
255  var showFlag = false;
256  //スクロールが200に達したらボタン表示
257  jQuery(window).scroll(function () {
258    if (jQuery(this).scrollTop() > 200) {
259      if (showFlag == false) {
260        showFlag = true;
261        topBth.stop().animate({ bottom: "20px" }, 300);
262      }
263    } else {
264      if (showFlag) {
265        showFlag = false;
266        topBth.stop().animate({ bottom: "-100px" }, 300);
267      }
268    }
269  });
270});
271
272//カルーセル処理 //////////////////////////////////////////////////////////////////////////////////////////////
273//メインバナー
274$(window).on("load", function () {
275  if ($(".slider").length > 0) {
276    $(".slider").slider({
277      speed: 800,
278    });
279  }
280  footerLayoutFix();
281  $(".infomation__content").siblings(".local_navi_clone").remove();
282  if ($(".list__navi").length > 0) {
283    //コンテンツサイズに合わせて高さを制御する
284    leftPaneHeightFix();
285  }
286});
287
288//インタビューカルーセル
289$(function () {
290  if ($(".interview_list").length > 0) {
291    $(".interview_list").slick({
292      centerMode: false,
293      centerMode: false,
294      //slidesToShow: 5,
295      //slidesToScroll: 1,
296      arrows: true,
297      responsive: [
298        {
299          breakpoint: 10000,
300          settings: {
301            slidesToShow: 6,
302            slidesToScroll: 1,
303            infinite: true,
304          },
305        },
306        {
307          breakpoint: 1100,
308          settings: {
309            slidesToShow: 5,
310            slidesToScroll: 1,
311            infinite: true,
312          },
313        },
314        {
315          breakpoint: 768,
316          settings: {
317            centerMode: true,
318            slidesToShow: 1,
319            slidesToScroll: 1,
320            infinite: true,
321          },
322        },
323      ],
324    });
325  }
326
327  $(".box_content__long,.box_content__short,.box_content__default").each(
328    function (i) {
329      if (i == 0) {
330        $(this).addClass("js__pad_top");
331        //$(this).css("padding-top","60px")
332      }
333    },
334  );
335  // $(window).load(function () {
336  $(".slider-wrapper")
337    .css({
338      height: "auto",
339    })
340    .animate({ opacity: "1" }, 1000);
341  // $('.slider-wrapper .unit').removeClass('passive');
342  // });
343});
344
345//スマホ対応 //////////////////////////////////////////////////////////////////////////////////////////////
346$(function () {
347  var defaultWin = window.innerWidth;
348  if (defaultWin > 768 && defaultWin < 1080) {
349    $("body").addClass("tb");
350  } else if (defaultWin > 1080) {
351    $("body").addClass("pc");
352  } else {
353    $("body").addClass("sp");
354  }
355
356  $(window).resize(function () {
357    //var win = $(window).outerWidth();
358    var win = window.innerWidth;
359    if (win > 768 && win < 1080) {
360      $(".navi").show();
361      $(".sub_navigation").not(".clone_navi .sub_navigation").hide();
362      $("body").removeClass().addClass("tb");
363    } else if (win > 1081) {
364      $(".navi").show();
365      $(".sub_navigation").show();
366      $("body").removeClass().addClass("pc");
367    } else if (win < 768) {
368      if (!$(".navi").hasClass("activeNavi")) {
369        $(".navi").hide();
370      }
371
372      $(".sub_navigation").not(".clone_navi .sub_navigation").hide();
373      $("body").removeClass().addClass("sp");
374    }
375  });
376
377  //ハンバーガー追加
378  // $("header>a").after('<span class="hamburger"></span>');
379  // $(".hamburger").on("click", function(){
380  //   if($("body").hasClass("tb")){
381  //     $(".sub_navigation").toggle();
382  //   }else if($("body").hasClass("sp")){
383  //     $(".navi").toggle().toggleClass("activeNavi");
384  //   }
385  // });
386
387  //新サイズ(1080~820)用
388  //GNの一部を非表示にしてローカルナビに格納
389
390  if ($(".sub_navigation").length == 0) {
391    $("header").after("<div class='sub_navigation' />");
392  }
393  var langObj = $(".navi_global>li:nth-last-child(1)").clone(true);
394  var companyObj = $(".navi_global>li:nth-last-child(2)").clone(true);
395  var recruitObj = $(".navi_global>li:nth-last-child(3)").clone(true);
396
397  $(".sub_navigation").prepend(
398    '<nav class="tb__gn"><ul class="tb__gn_list"></ul></nav>'
399  );
400  $(".tb__gn_list").append(recruitObj);
401  $(".tb__gn_list").append(langObj);
402  $(".tb__gn_list").append(companyObj);
403
404  //ヘッダー加工
405  // $(".navi").before("<div class='sp_gnavi_wrapper'><ul id='sp_gnavi'></ul></div>");
406  //  $(".navi_global .navi_global__item").each(function(i){
407  //    if(i <= 7){
408  //      if(i == 0 || i == 1 || i == 6){
409  //        var obj = $(this).clone(true);
410  //        $("#sp_gnavi").append(obj);
411  //      }
412  //    }
413  //  });
414  // $(".navi_global .navi_global__item").each(function(i){
415  //  if(i <= 2){
416  //    var obj = $(this).clone(true);
417  //    $("#sp_gnavi").append(obj);
418  //  }
419  // });
420  // $("#sp_gnavi>li").each(function(){
421  //   var addMenuStr = $(this).children("a").text();
422  //   var addMenuHref = $(this).children("a").attr("href");
423  //   $(this).find("ul").prepend('<li class="navi_global_child__item"><a href="'+addMenuHref+'">'+addMenuStr+'TOP</a></li>');
424
425  //   var n = $(this).find("li").length;
426  //   if(n%2 != 0){
427  //     $(this).find("ul").append('<li class="navi_global_child__item"><span> </span></li>');
428  //   }
429  // });
430
431  // $("#sp_gnavi>li>a").on("click", function(){
432  //   $("#sp_gnavi>li ul").not($(this).next("ul")).hide();
433  //   var ulLen = $(this).next("ul").length;
434  //   if(ulLen > 0){
435  //     $(this).next("ul").toggle();
436  //     return false;
437  //   }
438  // });
439
440  //ローカルナビが存在した場合の挙動
441  if (!$("article").hasClass("only_pane")) {
442    //ローカルナビのクローン
443    var localNavi = $(".sub_navigation").clone(true);
444    $("#tullys_footer").before(localNavi);
445    $("#tullys_footer")
446      .prev(".sub_navigation")
447      .wrap("<div class='clone_navi' />");
448
449    //ローカルナビのセレクト化
450    // var localArray = new Array();
451    // var localHrefArray = new Array();
452    // $(".sub_navigation li").not(".clone_navi .sub_navigation li, .tb__gn li").each(function(i){
453    //   localArray[i] = $(this).children("a").text();
454    //   localHrefArray[i] = $(this).children("a").attr("href");
455    // });
456    // $(".page_title:first, .image_title:first,.interview__detail_header:first").before("<select class='local_navi_clone' />");
457    // if($(".local_navi_clone").length > 1){
458    //   $(".local_navi_clone:last").remove();
459    // }
460    // $.each(localArray, function(i, record){
461    //   if(record != ""){
462    //     $(".local_navi_clone").append("<option value='" + localHrefArray[i] + "'>
462" + record + "</option>")
463    //   }
464    // });
465    // //ローカルセレクトのアクション
466    // $(".local_navi_clone").change(function(){
467    //   var thisHref = $(".local_navi_clone").children(":selected").val();
468    //   location.href = thisHref;
469    // });
470  }
471});
472
473// ウィンドウ内オブジェクトの読込完了後の処理 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
474$(window).on("load", function () {
475  if ($("#item__detail").length > 0) {
476    //ペアリングが存在しない場合、CSSを制御
477    if ($(".pairing_contents").length == 0) {
478      $("#item__detail").css({ paddingRight: 0 });
479    }
480
481    //タイトル周りのアイコン位置を変更
482    $(".page_title").before('<div class="sp_detail_icons" />');
483    $(".fyt_contents").after('<div class="sp_sns_lists" />');
484    $(".page_title span").each(function () {
485      $(".sp_detail_icons").append($(this).clone());
486    });
487    $(".sp_sns_lists").append($(".flex_listarea").clone());
488  } else {
489    if ($(".flex_listarea").length) {
490      $(".flex_listarea").addClass("sp_hide");
491      $("article").append('<div class="sp_sns_lists__common" />');
492      $(".sp_sns_lists__common").append(
493        $(".flex_listarea").clone().removeClass("sp_hide")
494      );
495    }
496  }
497
498  //シーズナル一覧、アイテムの高さを揃える
499  if ($(".seasonal").length > 0) {
500    $(".seasonal .item_list").each(function () {
501      var list = $(this);
502      var maxWidth = list.find("img").width();
503      var maxHeight = new Array();
504      list.find("li").each(function () {
505        var item = $(this);
506        var xHeight = item.find("p").height();
507        maxHeight.push(xHeight);
508      });
509      var maxHeightAns = Math.max.apply(null, maxHeight);
510      list.find("li p").height(maxHeightAns);
511      list.find("li p").width(maxWidth);
512    });
513  }
514
515  //商品系、アイテムの高さを揃える
516  if ($("#menu").length > 0) {
517    $("#menu .item_list").each(function () {
518      var list = $(this);
519      var maxWidth = list.find("img").width();
520      var maxHeight = new Array();
521      list.find("li").each(function () {
522        var item = $(this);
523        var xHeight = item.find("p").height();
524        maxHeight.push(xHeight);
525      });
526      var maxHeightAns = Math.max.apply(null, maxHeight);
527      list.find("li p").height(maxHeightAns);
528      list.find("li p").width(maxWidth);
529    });
530  }
531
532  //商品詳細のFYTエリア、コンテンツが存在しない場合は非表示にする
533  if ($(".fyt_contents").length > 0) {
534    if ($(".fyt_contents li").length == 0) {
535      $(".fyt_contents").remove();
536    }
537  }
538
539  //インタビューの高さ揃える
540  if ($(".interview__detail_title").length > 0) {
541    absTopFix($(".interview__detail_title"), $(".interview__detail_header"));
542  }
543  //Wifiの高さ揃える
544  if ($("h1.no_border").length > 0) {
545    absTopFix($("h1.no_border"), $(".image_title"));
546  }
547});
548
549//一覧系、アイテムの高さを揃える
550$(window).on("load", function () {
551  if ($(".concept_fix_list").length > 0) {
552    listtHeightFix($(".concept_fix_list"), 4);
553  }
554  if ($(".list_col_6").length > 0) {
555    listtHeightFix($(".list_col_6"), 6);
556  }
557  fixBoxFix();
558});
559$(window).resize(function () {
560  if ($(".concept_fix_list").length > 0) {
561    listtHeightFix($(".concept_fix_list"), 4);
562  }
563  //インタビューの高さ揃える
564  if ($(".interview__detail_title").length > 0) {
565    absTopFix($(".interview__detail_title"), $(".interview__detail_header"));
566  }
567  //Wifiの高さ揃える
568  if ($("h1.no_border").length > 0) {
569    absTopFix($("h1.no_border"), $(".image_title"));
570  }
571  //商品系、アイテムの高さを揃える
572  if ($("#menu").length > 0) {
573    $("#menu .item_list").each(function () {
574      var list = $(this);
575      var maxWidth = list.find("img").width();
576      var maxHeight = new Array();
577      list.find("li").each(function () {
578        var item = $(this);
579        var xHeight = item.find("p").height();
580        maxHeight.push(xHeight);
581      });
582      var maxHeightAns = Math.max.apply(null, maxHeight);
583      list.find("li p").height(maxHeightAns);
584      list.find("li p").width(maxWidth);
585    });
586  }
587
588  qualityTitleFix();
589
590  //TOPのFYT専用
591  fytCupPosition();
592
593  footerLayoutFix();
594  fixBoxFix();
595});
596
597//SNS シェアボタン用(サマリ除く) /////////////////////////////////////////////
598$(function () {
599  //aTagでの制御が可能な4つをJSで制御する
600  //APIの無かったサマリは別途HTML上で制御
601  if (
602    $("#item__detail .flex_listarea").length > 0 ||
603    $(".press__content .sns__list").length > 0
604  ) {
605    //必要情報を変数に格納
606    var pathTitle = $("title").text().split("|")[0];
607    var pathText = $("meta[name=description]").attr("content");
608    var pathImage = $(".thumbnail__pic_image:first").children().attr("src");
609    var pathURL = location.href;
610
611    //商品情報詳細と、それ以外で制御方法が異なるため、ここで分岐
612    //ここでの制御は【商品情報】と【プレスリリース】の2つ
613    var target = $("article .sns__list li");
614    if ($("#item__detail .flex_listarea").length > 0) {
615      target = $("article .flex_listarea li");
616    }
617
618    target.each(function (i) {
619      switch (i) {
620        //twitter --------------------------------------------
621        case 0:
622          var thisHref =
623            "http://twitter.com/share?url=" + pathURL + "&text=" + pathText;
624          break;
625        //facebook ---------------------------------------------
626        case 1:
627          var thisHref = "http://www.facebook.com/sharer.php?u=" + pathURL;
628          break;
629        //line ------------------------------------------------
630        case 2:
631          var thisHref = "http://line.me/R/msg/text/?" + pathTitle + pathURL;
632          break;
633        //pintarest -------------------------------------------
634        case 3:
635          var thisHref =
636            "http://pinterest.com/pin/create/button/?url=" +
637            pathURL +
638            "&media=" +
639            pathImage +
640            "&description=" +
641            pathText;
642          break;
643      }
644
645      if (i < 4) {
646        $(this).find("a").attr("href", thisHref);
647      }
648    });
649
650    target
651      .not("article .flex_listarea li:nth-child(5)")
652      .on("click", function () {
653        var myHref = $(this).find("a").attr("href");
654        window.open(
655          myHref,
656          "FBwindow",
657          "width=650, height=450, menubar=no, toolbar=no, scrollbars=yes"
658        );
659        return false;
660      });
661  } else if ($(".page_title .flex_listarea").length > 0) {
662    //必要情報を変数に格納
663    var pathTitle = $("title").text().split("|")[0];
664    var pathText = $("meta[name=description]").attr("content");
665    var pathURL = location.href;
666
667    //商品情報詳細と、それ以外で制御方法が異なるため、ここで分岐
668    //ここでの制御は【商品情報】と【プレスリリース】の2つ
669    var target = $("article .flex_listarea li");
670
671    target.each(function (i) {
672      switch (i) {
673        //twitter --------------------------------------------
674        case 0:
675          if ($(this).find("a").attr("href").split("&text=")[1]) {
676            pathText = $(this).find("a").attr("href").split("&text=")[1];
677          }
678
679          pathText = pathText.replace(/\|/g, "・");
680          var thisHref =
681            "http://twitter.com/share?url=" + pathURL + "&text=" + pathText;
682          break;
683        //facebook ---------------------------------------------
684        case 1:
685          var thisHref = "http://www.facebook.com/sharer.php?u=" + pathURL;
686          break;
687        //line ------------------------------------------------
688        case 2:
689          var thisHref = "http://line.me/R/msg/text/?" + pathTitle + pathURL;
690          break;
691      }
692
693      if (i < 3) {
694        $(this).find("a").attr("href", thisHref);
695      }
696    });
697
698    target
699      .not(".page_title .flex_listarea li:nth-child(5)")
700      .on("click", function () {
701        var myHref = $(this).find("a").attr("href");
702        window.open(
703          myHref,
704          "FBwindow",
705          "width=650, height=450, menubar=no, toolbar=no, scrollbars=yes"
706        );
707        return false;
708      });
709  }
710});
711
712//フォームエラー処理
713$(function () {
714  if ($("td>.error").length > 0) {
715    $("td>.error").each(function () {
716      $(this).parent().parent().css("background", "#faf3f0");
717    });
718  }
719});
720
721//指定したコンテンツの高さを揃える
722function objHeightFix(parentObj, target, correction) {
723  $(parentObj).each(function () {
724    var objArray = new Array();
725    var parentObject = $(this);
726    parentObject.find(target).each(function () {
727      var targetHeight = $(this).height();
728      objArray.push(targetHeight);
729    });
730    var objArrayMax = Math.max.apply(null, objArray);
731    parentObject.find(target).height(objArrayMax + correction);
732  });
733}
734
735//コンセプトショップの一行の高さを揃える
736function listtHeightFix(target, col) {
737  target.find("li").css("height", "auto");
738  target.each(function (i, record) {
739    var itemArray = new Array();
740
741    $(record)
742      .children("li")
743      .each(function (n, item) {
744        var bp = col; //ブレイクする場所
745        if ($("body").hasClass("sp")) {
746          bp = 2;
747        }
748        var ip = n + 1; //自分
749        var heights = $(item).height();
750        itemArray.push(heights);
751
752        if (ip % bp == 0) {
753          $.each(itemArray, function (j) {
754            if (j <= n) {
755              var np = ip - j;
756              var maxHeight = Math.max.apply(null, itemArray);
757              $(record)
758                .children("li:nth-child(" + np + ")")
759                .height(maxHeight);
760            }
761          });
762          itemArray = new Array();
763        }
764      });
765  });
766}
767
768//ローカルナビとコンテンツエリアの縦幅をあわせる
769function leftPaneHeightFix() {
770  if ($("#pane_height").length > 0) {
771    $("#pane_height").remove();
772  }
773  var leftHeight = $(".sub_navigation").height();
774  var rightHeight = $("article").height();
775  var plusHeight = leftHeight - rightHeight + 20;
776  if (leftHeight > rightHeight) {
777    $("article").append("<div id='pane_height' width='100%' />");
778    $("#pane_height").height(plusHeight);
779  } else if (leftHeight < rightHeight) {
780    $("#pane_height").remove();
781  }
782}
783
784//指定したIDにスクロールする(ヘッダーの縦幅分削除)
785function windowLoadAnchor(target) {
786  setTimeout(function () {
787    var pos = $(target).offset().top;
788    // var headHeight = $("header").height();
789
790    // $("body,html").animate({scrollTop:pos-headHeight});
791    $("body,html").animate({ scrollTop: pos });
792  }, 500);
793}
794
795//position指定の場合、top,bottomを均等にする
796function absTopFix(target, wrapper) {
797  var targetHeight = target.outerHeight();
798  var wrapperHeight = wrapper.height();
799  var topPx = (wrapperHeight - targetHeight) / 2;
800  target.css("top", topPx);
801}
802
803//クオリティのタイトルを真ん中に
804function qualityTitleFix() {
805  if ($(".image_title .centering__title").length > 0) {
806    $(".image_title .centering__title").each(function (i) {
807      var thisWidth = $(this).width();
808      var winWidth = $("article").width();
809      var leftPx = (winWidth - thisWidth) / 2;
810      $(this).css("left", leftPx + "px");
811    });
812  }
813}
814
815function fytCupPosition() {
816  if ($("#fyt").length > 0) {
817    var wX = 1200;
818    var wY = 450;
819    var ww = wY / wX;
820    var win = $(window).width();
821    var hei = win * ww;
822    var yPos = 350;
823    var pos = yPos / wY;
824    var newPos = pos * hei;
825    $("#fyt .thumbnail_updown__multicolumn").css("padding-top", newPos + "px");
826  }
827}
828
829//Footer
830function footerLayoutFix() {
831  //初期値の設定
832  var defWidth = 1200;
833  var defHeight = 450;
834  var defPar = defHeight / defWidth;
835
836  //フッターの高さ制御
837  var win = $(window).width();
838  var fixHeight = win * defPar;
839
840  //ロゴの配置
841  var yPos = 182;
842  var pos = yPos / defHeight;
843  var newPos = pos * fixHeight;
844
845  if (fixHeight > 600) {
846    $(".footer_image_area").height(600);
847    $(".footer_image_area").css({ paddingTop: 253 + "px" });
848  } else if (fixHeight <= 600 && fixHeight >= 336) {
849    $(".footer_image_area").css({ paddingTop: newPos + "px" });
850    if (newPos < 160) {
851      $(".footer_image_area").css({ paddingTop: 120 + "px" });
852    }
853    $(".footer_image_area").height(fixHeight - newPos);
854  } else if ($("body").hasClass("tb")) {
855    $(".footer_image_area").height(216);
856    $(".footer_image_area").css({ paddingTop: 120 + "px" });
857  }
858}
859
860//fitç³»
861function fixBoxFix() {
862  if ($(".box_content__fit").length > 0) {
863    $(".box_content__fit").each(function () {
864      var wid = $(this).find(".thumbnail__pic_image").height();
865      $(this).find(".fit__left_box, .fit__right_box").height(wid);
866
867      var verticalHeight = $(this).find(".common__description").height();
868      var verticalMar = (wid - verticalHeight) / 2;
869      $(this).find(".common__description").css("padding-top", verticalMar);
870    });
871  }
872}
873
874//多言語ポケモンパネル //////////////////////////////////////////////////////////////////////////////////////////////
875$(function () {
876  $(".poke-btn").on("click", function () {
877    $(".poke-note-box").toggleClass("active");
878  });
879  $(".poke-close").on("click", function () {
880    $(".poke-note-box").toggleClass("active");
881  });
882});
883//グロナビ現在地 //////////////////////////////////////////////////////////////////////////////////////////////
884$(function () {
885  if ($("body.menu").length) {
886    $(".navi_global .navi_global__item:eq(0)").addClass("active");
887  }
888  if ($("body.fyt").length) {
889    $(".navi_global .navi_global__item:eq(2)").addClass("active");
890  }
891  if ($("body.school").length) {
892    $(".navi_global .navi_global__item:eq(4)").addClass("active");
893  }
894  if ($("body.company").length) {
895    if (document.URL.match("recruit")) {
896      $(".navi_global .navi_global__item:eq(5)").addClass("active");
897    }
898  }
899});
900
901//ドロップダウンメニュー//////////////////////////////////////////////////////////////////////////////////////////////
902
903$(function () {
904  var drop_btn = $(".navi_global__item"),
905    drop_link = $(".navi_global__item a"),
906    drop_wrap = $(".navi-drop-wrap"),
907    drop_menu = $(".navi-drop-list-menu"),
908    drop_fyt = $(".navi-drop-list-fyt"),
909    drop_quality = $(".navi-drop-list-quality"),
910    drop_school = $(".navi-drop-list-school"),
911    drop_recruit = $(".navi-drop-list-recruit"),
912    drop_list = $(".navi-drop-inner-list"),
913    menu_flag = 0,
914    fyt_flag = 0,
915    quality_flag = 0,
916    school_flag = 0,
917    recruit_flag = 0;
918  var ua = navigator.userAgent.toLowerCase();
919  // iPad
920  var isiPad = ua.indexOf("ipad") > -1;
921  // Android
922  var isAndroidTab = ua.indexOf("android") > -1 && ua.indexOf("mobile") == -1;
923  if (isAndroidTab || isiPad) {
924    $(drop_link).on("touchstart", function (event) {
925      // console.log(menu_flag);
926
927      if ($(this).parent().data("navi")) {
928        var data_value = $(this).parent().data("navi");
929        if (data_value == "menu") {
930          $(drop_fyt).removeClass("active");
931          $(drop_quality).removeClass("active");
932          $(drop_school).removeClass("active");
933          $(drop_recruit).removeClass("active");
934          $(drop_menu).toggleClass("active");
935          if (menu_flag == 0) {
936            event.preventDefault();
937            menu_flag = 1;
938            quality_flag = 0;
939            fyt_flag = 0;
940            school_flag = 0;
941            recruit_flag = 0;
942          } else {
943            menu_flag = 0;
944          }
945        }
946        if (data_value == "quality") {
947          $(drop_fyt).removeClass("active");
948          $(drop_menu).removeClass("active");
949          $(drop_school).removeClass("active");
950          $(drop_recruit).removeClass("active");
951          $(drop_quality).toggleClass("active");
952          if (quality_flag == 0) {
953            event.preventDefault();
954            quality_flag = 1;
955            menu_flag = 0;
956            fyt_flag = 0;
957            school_flag = 0;
958            recruit_flag = 0;
959          } else {
960            quality_flag = 0;
961          }
962        }
963        if (data_value == "fyt") {
964          $(drop_quality).removeClass("active");
965          $(drop_menu).removeClass("active");
966          $(drop_school).removeClass("active");
967          $(drop_recruit).removeClass("active");
968          $(drop_fyt).toggleClass("active");
969          if (fyt_flag == 0) {
970            event.preventDefault();
971            fyt_flag = 1;
972            quality_flag = 0;
973            menu_flag = 0;
974            school_flag = 0;
975            recruit_flag = 0;
976          } else {
977            fyt_flag = 0;
978          }
979        }
980        if (data_value == "school") {
981          $(drop_quality).removeClass("active");
982          $(drop_menu).removeClass("active");
983          $(drop_fyt).removeClass("active");
984          $(drop_recruit).removeClass("active");
985          $(drop_school).toggleClass("active");
986          if (school_flag == 0) {
987            event.preventDefault();
988            school_flag = 1;
989            quality_flag = 0;
990            menu_flag = 0;
991            fyt_flag = 0;
992            recruit_flag = 0;
993          } else {
994            school_flag = 0;
995          }
996        }
997        if (data_value == "recruit") {
998          $(drop_quality).removeClass("active");
999          $(drop_menu).removeClass("active");
1000          $(drop_fyt).removeClass("active");
1001          $(drop_school).removeClass("active");
1002          $(drop_recruit).toggleClass("active");
1003          if (recruit_flag == 0) {
1004            event.preventDefault();
1005            recruit_flag = 1;
1006            quality_flag = 0;
1007            menu_flag = 0;
1008            fyt_flag = 0;
1009            school_flag = 0;
1010          } else {
1011            recruit_flag = 0;
1012          }
1013        }
1014      }
1015    });
1016  } else {
1017    // console.log(drop_btn);
1018    $(drop_link).on({
1019      mouseenter: function () {
1020        if ($(this).parent().data("navi")) {
1021          var data_value = $(this).parent().data("navi");
1022          if (data_value == "menu") {
1023            $(drop_menu).addClass("active");
1024          }
1025          if (data_value == "quality") {
1026            $(drop_quality).addClass("active");
1027          }
1028          if (data_value == "fyt") {
1029            $(drop_fyt).addClass("active");
1030          }
1031          if (data_value == "school") {
1032            $(drop_school).addClass("active");
1033          }
1034          if (data_value == "recruit") {
1035            $(drop_recruit).addClass("active");
1036          }
1037        }
1038      },
1039    });
1040    $(drop_btn).on({
1041      mouseleave: function () {
1042        if ($(this).data("navi")) {
1043          var data_value = $(this).data("navi");
1044          if (data_value == "menu") {
1045            $(drop_menu).removeClass("active");
1046          }
1047          if (data_value == "quality") {
1048            $(drop_quality).removeClass("active");
1049          }
1050          if (data_value == "fyt") {
1051            $(drop_fyt).removeClass("active");
1052          }
1053          if (data_value == "school") {
1054            $(drop_school).removeClass("active");
1055          }
1056          if (data_value == "recruit") {
1057            $(drop_recruit).removeClass("active");
1058          }
1059        }
1060      },
1061    });
1062    $(drop_list).on({
1063      mouseenter: function () {
1064        $(this).addClass("active");
1065      },
1066      mouseleave: function () {
1067        $(this).removeClass("active");
1068      },
1069    });
1070  }
1071});
1072
1073// spナビ
1074$(function () {
1075  var navi_menu_btn = $(".js-nav-btn"),
1076    navi_menu = $(".sp-navi"),
1077    navi_child_btn = $(".sp-navi-list-title"),
1078    page_domain = "https://www.tullys.co.jp",
1079    page_url = location.href,
1080    page_location = page_url.replace(page_domain, ""),
1081    navi_menu_btn_count = 0;
1082  var winH;
1083  $(navi_menu_btn).on("click", function () {
1084    winH = $(window).height();
1085    $(navi_menu_btn).children().toggleClass("active");
1086    $(navi_menu).slideToggle();
1087    $("header").toggleClass("active");
1088    $(".header-bg").toggleClass("active");
1089    if (navi_menu_btn_count == 0) {
1090      $("header").css("height", winH + "px");
1091      navi_menu_btn_count = 1;
1092      $(".page_top").css("display", "none");
1093    } else {
1094      $("header").css("height", "");
1095      navi_menu_btn_count = 0;
1096      $("html, body").animate({ scrollTop: 0 }, 0);
1097      $(".page_top").css("display", "block");
1098    }
1099  });
1100  $(navi_child_btn).on("click", function () {
1101    $(this).siblings().toggleClass("active");
1102    $(this).siblings(".sp-navi-child-box").slideToggle();
1103  });
1104
1105  // リサイズ処理
1106  $(window).on("resize", function () {
1107    var winW = $(window).width(),
1108      winH = $(window).height();
1109    if (winW > 768) {
1110      $(navi_menu).css("display", "none");
1111      $(navi_menu_btn).children().removeClass("active");
1112      $("header").css("height", "");
1113      $("header").removeClass("active");
1114      navi_menu_btn_count = 0;
1115      $(".header-bg").removeClass("active");
1116      $(".page_top").css("display", "block");
1117    }
1118    if (winW < 769) {
1119      winH = $(window).height();
1120      // console.log(winH);
1121      if ($("header").hasClass("active")) {
1122        $("header").css("height", winH + "px");
1123      }
1124    }
1125  });
1126
1127  // spナビ分岐
1128  // menu分岐
1129  if (page_location.indexOf("/menu/") != -1) {
1130    $(".sp-navi-list-menu .sp-navi-child-open").addClass("active");
1131    $(".sp-navi-list-menu .sp-navi-child-box").css("display", "block");
1132    if (page_location == "/menu/" || page_location == "/menu/index.html") {
1133      $(
1134        ".sp-navi-child-menu .sp-navi-child:first-child .sp-navi-child-link"
1135      ).addClass("active");
1136    }
1137    if (page_location == "/menu/" || page_location == "/menu/index.html") {
1138      $(
1139        ".sp-navi-child-menu .sp-navi-child:first-child .sp-navi-child-link"
1140      ).addClass("active");
1141    }
1142    if (
1143      page_location == "/menu/seasonal/" ||
1144      page_location == "/menu/seasonal/index.html"
1145    ) {
1146      $(
1147        ".sp-navi-child-menu .sp-navi-child:nth-child(2) .sp-navi-child-link"
1148      ).addClass("active");
1149    }
1150    if (
1151      page_location == "/menu/seasonal_lineup/" ||
1152      page_location == "/menu/seasonal_lineup/index.html"
1153    ) {
1154      $(
1155        ".sp-navi-child-menu .sp-navi-child:nth-child(3) .sp-navi-child-link"
1156      ).addClass("active");
1157    }
1158    if (
1159      page_location == "/menu/drink/" ||
1160      page_location == "/menu/drink/index.html"
1161    ) {
1162      $(
1163        ".sp-navi-child-menu .sp-navi-child:nth-child(4) .sp-navi-child-link"
1164      ).addClass("active");
1165    }
1166    if (
1167      page_location == "/menu/beans/" ||
1168      page_location == "/menu/beans/index.html"
1169    ) {
1170      $(
1171        ".sp-navi-child-menu .sp-navi-child:nth-child(5) .sp-navi-child-link"
1172      ).addClass("active");
1173    }
1174    if (
1175      page_location == "/menu/food/" ||
1176      page_location == "/menu/food/index.html"
1177    ) {
1178      $(
1179        ".sp-navi-child-menu .sp-navi-child:nth-child(6) .sp-navi-child-link"
1180      ).addClass("active");
1181    }
1182    if (
1183      page_location == "/menu/sweets/" ||
1184      page_location == "/menu/sweets/index.html"
1185    ) {
1186      $(
1187        ".sp-navi-child-menu .sp-navi-child:nth-child(7) .sp-navi-child-link"
1188      ).addClass("active");
1189    }
1190    if (
1191      page_location == "/menu/ice/" ||
1192      page_location == "/menu/ice/index.html"
1193    ) {
1194      $(
1195        ".sp-navi-child-menu .sp-navi-child:nth-child(8) .sp-navi-child-link"
1196      ).addClass("active");
1197    }
1198    if (
1199      page_location == "/menu/set/" ||
1200      page_location == "/menu/set/index.html"
1201    ) {
1202      $(
1203        ".sp-navi-child-menu .sp-navi-child:nth-child(9) .sp-navi-child-link"
1204      ).addClass("active");
1205    }
1206    if (
1207      page_location == "/menu/tullys_honey/" ||
1208      page_location == "/menu/tullys_honey/index.html"
1209    ) {
1210      $(
1211        ".sp-navi-child-menu .sp-navi-child:nth-child(10) .sp-navi-child-link"
1212      ).addClass("active");
1213    }
1214    if (
1215      page_location == "/menu/goods/" ||
1216      page_location == "/menu/goods/index.html"
1217    ) {
1218      $(
1219        ".sp-navi-child-menu .sp-navi-child:nth-child(11) .sp-navi-child-link"
1220      ).addClass("active");
1221    }
1222    if (
1223      page_location == "/menu/kids/" ||
1224      page_location == "/menu/kids/index.html"
1225    ) {
1226      $(
1227        ".sp-navi-child-menu .sp-navi-child:nth-child(12) .sp-navi-child-link"
1228      ).addClass("active");
1229    }
1230    if (page_location == "/menu/allergy.html") {
1231      $(
1232        ".sp-navi-child-menu .sp-navi-child:nth-child(13) .sp-navi-child-link"
1233      ).addClass("active");
1234    }
1235    if (page_location == "/menu/qa.html") {
1236      $(
1237        ".sp-navi-child-menu .sp-navi-child:nth-child(14) .sp-navi-child-link"
1238      ).addClass("active");
1239    }
1240  }
1241  // recruit分岐
1242  if (page_location.indexOf("/company/recruit/") != -1) {
1243    $(".sp-navi-list-recruit .sp-navi-child-open").addClass("active");
1244    $(".sp-navi-list-recruit .sp-navi-child-box").css("display", "block");
1245    if (
1246      page_location == "/company/recruit/" ||
1247      page_location == "/company/recruit/index.html"
1248    ) {
1249      $(
1250        ".sp-navi-child-recruit .sp-navi-child:first-child .sp-navi-child-link"
1251      ).addClass("active");
1252    }
1253    if (
1254      page_location == "/company/recruit/staff/" ||
1255      page_location == "/company/recruit/staff/index.html"
1256    ) {
1257      $(
1258        ".sp-navi-child-recruit .sp-navi-child:nth-child(2) .sp-navi-child-link"
1259      ).addClass("active");
1260    }
1261    if (
1262      page_location == "/company/recruit/newgraduate/" ||
1263      page_location == "/company/recruit/newgraduate/index.html"
1264    ) {
1265      $(
1266        ".sp-navi-child-recruit .sp-navi-child:nth-child(3) .sp-navi-child-link"
1267      ).addClass("active");
1268    }
1269    if (
1270      page_location == "/company/recruit/career/" ||
1271      page_location == "/company/recruit/career/index.html"
1272    ) {
1273      $(
1274        ".sp-navi-child-recruit .sp-navi-child:nth-child(4) .sp-navi-child-link"
1275      ).addClass("active");
1276    }
1277    if (
1278      page_location == "/company/recruit/barista/" ||
1279      page_location == "/company/recruit/barista/index.html"
1280    ) {
1281      $(
1282        ".sp-navi-child-recruit .sp-navi-child:nth-child(5) .sp-navi-child-link"
1283      ).addClass("active");
1284    }
1285    if (
1286      page_location == "/company/recruit/coffee-adviser/" ||
1287      page_location == "/company/recruit/coffee-adviser/index.html"
1288    ) {
1289      $(
1290        ".sp-navi-child-recruit .sp-navi-child:nth-child(6) .sp-navi-child-link"
1291      ).addClass("active");
1292    }
1293  }
1294  // fyt分岐
1295  if (page_location.indexOf("/fyt/") != -1) {
1296    $(".sp-navi-list-fyt .sp-navi-child-open").addClass("active");
1297    $(".sp-navi-list-fyt .sp-navi-child-box").css("display", "block");
1298    if (page_location == "/fyt/" || page_location == "/fyt/index.html") {
1299      $(
1300        ".sp-navi-child-fyt .sp-navi-child:first-child .sp-navi-child-link"
1301      ).addClass("active");
1302    }
1303    if (
1304      page_location == "/fyt/interview/" ||
1305      page_location == "/fyt/interview/index.html"
1306    ) {
1307      $(
1308        ".sp-navi-child-fyt .sp-navi-child:nth-child(2) .sp-navi-child-link"
1309      ).addClass("active");
1310    }
1311    if (page_location == "/fyt/house.html") {
1312      $(
1313        ".sp-navi-child-fyt .sp-navi-child:nth-child(3) .sp-navi-child-link"
1314      ).addClass("active");
1315    }
1316    if (page_location == "/fyt/decafe_menu.html") {
1317      $(
1318        ".sp-navi-child-fyt .sp-navi-child:nth-child(4) .sp-navi-child-link"
1319      ).addClass("active");
1320    }
1321    if (page_location == "/fyt/pairing.html") {
1322      $(
1323        ".sp-navi-child-fyt .sp-navi-child:nth-child(6) .sp-navi-child-link"
1324      ).addClass("active");
1325    }
1326    if (page_location == "/fyt/mybottle.html") {
1327      $(
1328        ".sp-navi-child-fyt .sp-navi-child:nth-child(8) .sp-navi-child-link"
1329      ).addClass("active");
1330    }
1331    if (page_location == "/fyt/facility.html") {
1332      $(
1333        ".sp-navi-child-fyt .sp-navi-child:nth-child(10) .sp-navi-child-link"
1334      ).addClass("active");
1335    }
1336    if (page_location == "/fyt/potservice.html") {
1337      $(
1338        ".sp-navi-child-fyt .sp-navi-child:nth-child(11) .sp-navi-child-link"
1339      ).addClass("active");
1340    }
1341    if (page_location == "/fyt/gpoint_starflyer.html") {
1342      $(
1343        ".sp-navi-child-fyt .sp-navi-child:nth-child(12) .sp-navi-child-link"
1344      ).addClass("active");
1345    }
1346  }
1347  // quality分岐
1348  if (page_location.indexOf("/quality/") != -1) {
1349    $(".sp-navi-list-quality .sp-navi-child-open").addClass("active");
1350    $(".sp-navi-list-quality .sp-navi-child-box").css("display", "block");
1351    if (
1352      page_location == "/quality/" ||
1353      page_location == "/quality/index.html"
1354    ) {
1355      $(
1356        ".sp-navi-child-quality .sp-navi-child:first-child .sp-navi-child-link"
1357      ).addClass("active");
1358    }
1359    if (
1360      page_location == "/quality/coffee_tips/" ||
1361      page_location == "/quality/coffee_tips/index.html"
1362    ) {
1363      $(
1364        ".sp-navi-child-quality .sp-navi-child:nth-child(2) .sp-navi-child-link"
1365      ).addClass("active");
1366    }
1367    if (
1368      page_location == "/quality/coffee/" ||
1369      page_location == "/quality/coffee/index.html"
1370    ) {
1371      $(
1372        ".sp-navi-child-quality .sp-navi-child:nth-child(3) .sp-navi-child-link"
1373      ).addClass("active");
1374    }
1375    if (
1376      page_location == "/quality/food/" ||
1377      page_location == "/quality/food/index.html"
1378    ) {
1379      $(
1380        ".sp-navi-child-quality .sp-navi-child:nth-child(4) .sp-navi-child-link"
1381      ).addClass("active");
1382    }
1383    if (
1384      page_location == "/quality/coffee_master/" ||
1385  
1385    page_location == "/quality/coffee_master/index.html"
1386    ) {
1387      $(
1388        ".sp-navi-child-quality .sp-navi-child:nth-child(5) .sp-navi-child-link"
1389      ).addClass("active");
1390    }
1391    if (
1392      page_location == "/quality/brand/" ||
1393      page_location == "/quality/brand/index.html"
1394    ) {
1395      $(
1396        ".sp-navi-child-quality .sp-navi-child:nth-child(6) .sp-navi-child-link"
1397      ).addClass("active");
1398    }
1399  }
1400  // school分岐
1401  if (page_location.indexOf("/school/") != -1) {
1402    $(".sp-navi-list-school .sp-navi-child-open").addClass("active");
1403    $(".sp-navi-list-school .sp-navi-child-box").css("display", "block");
1404    if (page_location == "/school/" || page_location == "/school/index.html") {
1405      $(
1406        ".sp-navi-child-school .sp-navi-child:first-child .sp-navi-child-link"
1407      ).addClass("active");
1408    }
1409    if (page_location == "/school/course1.html") {
1410      $(
1411        ".sp-navi-child-school .sp-navi-child:nth-child(2) .sp-navi-child-link"
1412      ).addClass("active");
1413    }
1414    if (page_location == "/school/course2.html") {
1415      $(
1416        ".sp-navi-child-school .sp-navi-child:nth-child(3) .sp-navi-child-link"
1417      ).addClass("active");
1418    }
1419    if (page_location == "/school/course3.html") {
1420      $(
1421        ".sp-navi-child-school .sp-navi-child:nth-child(4) .sp-navi-child-link"
1422      ).addClass("active");
1423    }
1424    if (page_location == "/school/index.html#optional") {
1425      $(
1426        ".sp-navi-child-school .sp-navi-child:nth-child(5) .sp-navi-child-link"
1427      ).addClass("active");
1428    }
1429  }
1430  // company分岐
1431  if (
1432    page_location.indexOf("/company/") != -1 &&
1433    page_location.indexOf("/company/recruit/") == -1
1434  ) {
1435    $(".sp-navi-list-company .sp-navi-child-open").addClass("active");
1436    $(".sp-navi-list-company .sp-navi-child-box").css("display", "block");
1437    if (
1438      page_location == "/company/" ||
1439      page_location == "/company/index.html"
1440    ) {
1441      $(
1442        ".sp-navi-child-company .sp-navi-child:first-child .sp-navi-child-link"
1443      ).addClass("active");
1444    }
1445    if (page_location == "/company/outline.html") {
1446      $(
1447        ".sp-navi-child-company .sp-navi-child:nth-child(2) .sp-navi-child-link"
1448      ).addClass("active");
1449    }
1450    if (page_location == "/company/message.html") {
1451      $(
1452        ".sp-navi-child-company .sp-navi-child:nth-child(3) .sp-navi-child-link"
1453      ).addClass("active");
1454    }
1455    if (page_location == "/company/csr.html") {
1456      $(
1457        ".sp-navi-child-company .sp-navi-child:nth-child(4) .sp-navi-child-link"
1458      ).addClass("active");
1459    }
1460    if (page_location == "/company/policy.html") {
1461      $(
1462        ".sp-navi-child-company .sp-navi-child:nth-child(5) .sp-navi-child-link"
1463      ).addClass("active");
1464    }
1465    if (page_location == "/company/pressrelease/2017_index.html") {
1466      $(
1467        ".sp-navi-child-company .sp-navi-child:nth-child(6) .sp-navi-child-link"
1468      ).addClass("active");
1469    }
1470    if (
1471      page_location == "/company/franchise/" ||
1472      page_location == "/company/franchise/index.html"
1473    ) {
1474      $(
1475        ".sp-navi-child-company .sp-navi-child:nth-child(7) .sp-navi-child-link"
1476      ).addClass("active");
1477    }
1478  }
1479});
1480$(function () {
1481  function modal() {
1482    if ($(window).width() >= 750) {
1483      wn = "." + $(this).data("detail");
1484      //幅を計算
1485      var mW = $(wn).find(".card-maintenance-modal-inner").innerWidth() / 2;
1486      var el = $(wn).find(".card-maintenance-modal-inner").innerHeight() / 2;
1487      var mh = $(window).height() / 2;
1488      //スクロール位置をとってくる。
1489      var dElm = document.documentElement,
1490        dBody = document.body;
1491      var nY = dElm.scrollTop || dBody.scrollTop;
1492      var mt = nY + mh - el;
1493      $(wn)
1494        .find(".card-maintenance-modal-inner")
1495        .css({ "margin-left": -mW, "margin-top": mt });
1496      $(wn).fadeIn(500);
1497    } else {
1498      wn = "." + $(this).data("detail");
1499      var el = $(wn).find(".card-maintenance-modal-inner").outerHeight() / 2;
1500      var mh = $(window).height() / 2;
1501      var dElm = document.documentElement,
1502        dBody = document.body;
1503      var nY = dElm.scrollTop || dBody.scrollTop;
1504      var mt = nY + 50;
1505      $(wn)
1506        .find(".card-maintenance-modal-inner")
1507        .css({ "margin-left": 0, top: mt });
1508      $(wn).fadeIn(500);
1509    }
1510  }
1511  function modalclose() {
1512    $(wn).fadeOut(500);
1513  }
1514  $(".card-maintenance-modal-btn").on("click", modal);
1515  $(".card-maintenance-modal-close, .card-maintenance-modalbg").on(
1516    "click",
1517    modalclose
1518  );
1519});
1520// 2020replace
1521$(function () {
1522  if ($(".js_item_list_new").length) {
1523    var two_week_before = new Date();
1524    two_week_before.setDate(two_week_before.getDate() - 14);
1525    two_week_before = two_week_before.getTime();
1526    $(".js_item_list_new").each(function (index) {
1527      var listdata = $(this).data("new");
1528      listdata = new Date(listdata);
1529      listdata = listdata.getTime();
1530      if (two_week_before < listdata) {
1531        $(this).find("a").append('<span class="icon__new">New</span>');
1532      }
1533    });
1534  }
1535  if ($(".js_menu_icon_box").length) {
1536    var two_week_before = new Date();
1537    two_week_before.setDate(two_week_before.getDate() - 14);
1538    $(".js_menu_icon_box");
1539    var listdata = $(".js_menu_icon_box").data("new");
1540    listdata = new Date(listdata);
1541    listdata = listdata.getTime();
1542    if (two_week_before < listdata) {
1543      $(".js_menu_icon_box").append(
1544        '<span class="icon__detail_new">新商品</span>'
1545      );
1546    }
1547  }
1548});

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.