PageSourceSearch

https://enechange.co.jp/shared/js/common.js

js enechange.co.jp collected 2026-10-02 04:59:20 UTC 224,583 bytes, 6,565 lines download raw bytes

1/*//////////////////////////////////////////////////////初期化*/
2$(function () {
3  resize();
4  $(window).resize(function (event) {
5    resize();
6  });
7  
8  // ロゴのSVGを追加(index.jsと同じ実装)
9  if ($(".ttl_svg").hasClass("index_logo")) {
10    $(".index_logo").text("");
11    $(".index_logo").append(
12      '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.28 60.97"><defs><style>.cls-1{fill:red;}</style></defs><g id="レイヤー_2" data-name="レイヤー 2"><g id="レイヤー_1-2" data-name="レイヤー 1"><polygon class="cls-1" points="0 59.76 45.67 59.76 45.67 48.3 12.71 48.3 12.71 36.01 39.31 36.01 39.31 24.55 12.71 24.55 12.71 12.67 45.67 12.67 45.67 1.21 0 1.21 0 59.76"/><polygon class="cls-1" points="104.89 37.26 77.46 1.21 65.58 1.21 65.58 59.76 78.3 59.76 78.3 22.54 106.65 59.76 117.6 59.76 117.6 1.21 104.89 1.21 104.89 37.26"/><polygon class="cls-1" points="137.63 59.76 183.3 59.76 183.3 48.3 150.35 48.3 150.35 36.01 176.95 36.01 176.95 24.55 150.35 24.55 150.35 12.67 183.3 12.67 183.3 1.21 137.63 1.21 137.63 59.76"/><path class="cls-1" id="c" d="M240.79,30.49A17.76,17.76,0,0,1,210.47,43l-9,9a30.49,30.49,0,1,0,0-43.11l9,9a17.76,17.76,0,0,1,30.32,12.56"/><polygon class="cls-1" points="308.74 24.55 282.14 24.55 282.14 1.21 269.43 1.21 269.43 59.76 282.14 59.76 282.14 36.01 308.74 36.01 308.74 59.76 321.45 59.76 321.45 1.21 308.74 1.21 308.74 24.55"/><path class="cls-1" d="M358.34,1.21,337,59.76h12.71l4.47-12.29h21l4.47,12.29h12.71L371,1.21Zm0,34.79,6.31-17.33L371,36Z"/><polygon class="cls-1" points="447.25 37.26 419.81 1.21 407.94 1.21 407.94 59.76 420.65 59.76 420.65 22.54 449 59.76 459.96 59.76 459.96 1.21 447.25 1.21 447.25 37.26"/><path class="cls-1" d="M506.83,24.55V36H520v6.38a17.74,17.74,0,1,1-.6-24.45l9-9h0a30.49,30.49,0,1,0,4.34,37.61h0v-22Z"/><polygon class="cls-1" points="595.28 12.67 595.28 1.21 549.61 1.21 549.61 59.76 595.28 59.76 595.28 48.3 562.32 48.3 562.32 36.01 588.92 36.01 588.92 24.55 562.32 24.55 562.32 12.67 595.28 12.67"/></g></g></svg>'
13    );
14  }
15});
16
17
18/*//////////////////////////////////////////////////////リサイズ*/
19var winW, winH;
20
21function resize() {
22  winW = $(window).width();
23  winH = $(window).height();
24}
25
26/*!
27 * ScriptName: common.js
28 * Version: 1.8
29 *
30 * FoodConnection
31 * http://foodconnection.jp/
32 * http://foodconnection.vn/
33 *
34 */
35
36/*
37 * Catch errors
38 *
39 */
40
41window.onerror = function (message, url, line, column, error) {
42  if (message.indexOf("Script error.") > -1) return;
43
44  if ($("html").hasClass("fc-debugger")) {
45    var uid = md5(message + url + line + column),
46      filename = url,
47      consoleHTML = "",
48      msg = "",
49      total = 0,
50      $blkConsole = $(
51        "#fc-console .console-main > .console-block:first-child[data-uid='" +
52          uid +
53          "']"
54      );
55
56    consoleHTML += '<div id="fc-console">';
57    consoleHTML += '<div class="console-title">FC Console</div>';
58    consoleHTML += '<div class="console-clear">Clear</div>';
59    consoleHTML += '<div class="console-main">';
60    consoleHTML += "</div>";
61    consoleHTML += "</div>";
62
63    if ($("#fc-console").length < 1) $("body").append(consoleHTML);
64
65    if (typeof url !== "undefined") {
66      var fname = url.replace("\\", "/"); // correct slashes
67      if (fname.lastIndexOf("/"))
68        fname = fname.substr(fname.lastIndexOf("/") + 1);
69      filename =
70        fname.substr(0, fname.lastIndexOf(".")) +
71        "." +
72        fname.substr(fname.lastIndexOf(".") + 1);
73      if (filename.length < 3) filename = url;
74    }
75
76    msg += '<div class="console-block" data-uid="' + uid + '" data-count="1">';
77    msg += '<div class="console-message">' + message + "</div>";
78    msg += '<div class="console-stacktrace">';
79    msg +=
80      '<div class="console-file">Script: <a href="' +
81      url +
82      '" target="_blank">' +
83      filename +
84      "</a></div>";
85    msg +=
86      '<div class="console-line">Line: <strong>' + line + "</strong></div>";
87    msg +=
88      '<div class="console-column">Column: <strong>' +
89      column +
90      "</strong></div>";
91    msg += "</div>";
92    msg += '<div class="console-error">' + error + "</div>";
93    msg += "</div>";
94
95    if ($blkConsole.length > 0) {
96      var count = $blkConsole.attr("data-count");
97      if (count !== undefined && !isNaN(count) && Number(count) >= 0) {
98        count = Number(count);
99        count++;
100
101        $blkConsole.attr("data-count", count);
102      } else $blkConsole.attr("data-count", 1);
103    } else $("#fc-console .console-main").prepend(msg);
104
105    $("#fc-console .console-main > .console-block").each(function () {
106      var count = $(this).attr("data-count");
107      if (count !== undefined && !isNaN(count) && Number(count) >= 0)
108        total += Number(count);
109      else total++;
110    });
111
112    $("#fc-console .console-title").attr("data-total", total);
113  }
114};
115
116$(document).ready(function () {
117  var UA = navigator.userAgent;
118  if (UA.indexOf("iPhone") < 0 && UA.indexOf("Android") < 0)
119    $(".telhref").contents().unwrap(); // remove link [tel] on desktop
120  if (
121    /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
122      navigator.userAgent
123    )
124  )
125    $("html.mobile-no-animate").addClass("noanimated");
126  // to remove transition
127  else $("html.mobile-no-animate").removeClass("noanimated");
128
129  // fix bg parallax on mobile
130  if (isMobile.any()) $(".bg-parallax").css("background-attachment", "inherit");
131  else $(".bg-parallax").css("background-attachment", "");
132
133  var clipboardData = new Clipboard(".copy", {
134    // container: $(".copy").get(0),
135    text: function (trigger) {
136      var _text_ = document.title + " " + location.href,
137        _viewport_ = $("meta[name='viewport']").attr("content");
138
139      if (
140        $(trigger).attr("data-copy") &&
141        $(trigger).attr("data-copy").length > 0
142      )
143        _text_ = $(trigger).attr("data-copy");
144
145      if (_viewport_ && /(?:user-scalable\s*=\s*yes)/i.test(_viewport_))
146        $("meta[name='viewport']").attr(
147          "content",
148          _viewport_.replace(/(?:user-scalable\s*=\s*yes)/i, "user-scalable=no")
149        ); // disabled zoom
150
151      if ($(trigger).attr("data-replace-text"))
152        $(trigger).html($(trigger).attr("data-replace-text"));
153      else if ($(trigger).attr("data-replace-image")) {
154        if ($(trigger).children("img").length > 0) {
155          var _imgReplace_ = $(trigger).attr("data-replace-image");
156
157          if ($(trigger).children("img").hasClass("btn")) {
158            $(trigger).children("img").addClass("copy-change");
159
160            _imgReplace_ = _imgReplace_.replace(
161              /^(.*?)(_on)?\.(.*?)$/,
162              "$1_on.$3"
163            );
164          }
165
166          $(trigger).children("img").attr("src", _imgReplace_);
167        } else
168          $(trigger).html(
169            '<img src="' + $(trigger).attr("data-replace-image") + '" />'
170          );
171      }
172
173      $(trigger).addClass("copied");
174
175      if (_viewport_) $("meta[name='viewport']").attr("content", _viewport_); // enabled zoom
176
177      return _text_;
178    },
179  });
180
181  clipboardData
182    .on("success", function () {
183      var offsetX =
184          window.scrollX ||
185          window.pageXOffset ||
186          window.document.documentElement.scrollLeft,
187        offsetY =
188          window.scrollY ||
189          window.pageYOffset ||
190          window.document.documentElement.scrollTop;
191
192      // firefox jump - fixed
193      window.scroll(offsetX, offsetY); // started
194
195      setTimeout(function () {
196        // step 1
197        window.scroll(offsetX, offsetY);
198      }, 20);
199
200      setTimeout(function () {
201        // step 2
202        window.scroll(offsetX, offsetY);
203      }, 15);
204
205      setTimeout(function () {
206        // step 3
207        window.scroll(offsetX, offsetY);
208      }, 10);
209
210      setTimeout(function () {
211        // step 4
212        window.scroll(offsetX, offsetY);
213      }, 5);
214
215      setTimeout(function () {
216        // step 5
217        window.scroll(offsetX, offsetY);
218      }, 0);
219
220      window.scroll(offsetX, offsetY); // final
221    })
222    .on("error", function () {});
223
224  $("body")
225    .on("click", "#fc-console .console-title", function () {
226      $(this).parents("#fc-console").toggleClass("active");
227    })
228    .on("click", "#fc-console .console-clear", function () {
229      $("#fc-console").removeClass("active");
230      $("#fc-console .console-main").empty();
231      $("#fc-console .console-title").removeAttr("data-total");
232    })
233    .on("click", ".copy", function (e) {
234      e.preventDefault();
235
236      $(this).removeAttr("data-clipboard-text");
237    });
238
239  // BEGIN: bxSlider plugin
240  if ($(".bxSlider").length) {
241    if ($.fn.bxSlider) {
242      $(".bxSlider").each(function () {
243        var $bxSliderData = {
244          mode:
245            $.inArray($(this).attr("data-mode"), [
246              "horizontal",
247              "vertical",
248              "fade",
249            ]) >= 0
250              ? $(this).attr("data-mode")
251              : "fade",
252          auto:
253            $.inArray($(this).attr("data-auto"), [
254              "true",
255              "on",
256              "enable",
257              "enabled",
258              "1",
259            ]) >= 0
260              ? true
261              : false,
262          controls:
263            $.inArray($(this).attr("data-controls"), [
264              "true",
265              "on",
266              "enable",
267              "enabled",
268              "1",
269            ]) >= 0
270              ? true
271              : false,
272          randomStart:
273            $.inArray($(this).attr("data-randomStart"), [
274              "true",
275              "on",
276              "enable",
277              "enabled",
278              "1",
279            ]) >= 0
280              ? true
281              : false,
282          infiniteLoop:
283            $.inArray($(this).attr("data-infiniteLoop"), [
284              "true",
285              "on",
286              "enable",
287              "enabled",
288              "1",
289            ]) >= 0
290              ? true
291              : false,
292          responsive:
293            $.inArray($(this).attr("data-responsive"), [
294              "true",
295              "on",
296              "enable",
297              "enabled",
298              "1",
299            ]) >= 0
300              ? true
301              : false,
302          touchEnabled:
303            $.inArray($(this).attr("data-touchEnabled"), [
304              "true",
305              "on",
306              "enable",
307              "enabled",
308              "1",
309            ]) >= 0
310              ? true
311              : false,
312          ticker:
313            $.inArray($(this).attr("data-ticker"), [
314              "true",
315              "on",
316              "enable",
317              "enabled",
318              "1",
319            ]) >= 0
320              ? true
321              : false,
322          tickerHover:
323            $.inArray($(this).attr("data-tickerHover"), [
324              "true",
325              "on",
326              "enable",
327              "enabled",
328              "1",
329            ]) >= 0
330              ? true
331              : false,
332          pager:
333            $.inArray($(this).attr("data-pager"), [
334              "true",
335              "on",
336              "enable",
337              "enabled",
338              "1",
339            ]) >= 0
340              ? true
341              : false,
342          pagerCustom:
343            typeof $(this).attr("data-pagerCustom") != "undefined" &&
344            $(this).attr("data-pagerCustom").length > 0
345              ? $(this).attr("data-pagerCustom")
346              : null,
347          pagerSelector:
348            typeof $(this).attr("data-pagerSelector") != "undefined"
349              ? $(this).attr("data-pagerSelector")
350              : null,
351          useCSS:
352            $.inArray($(this).attr("data-useCSS"), [
353              "true",
354              "on",
355              "enable",
356              "enabled",
357              "1",
358            ]) >= 0
359              ? true
360              : false,
361          autoHover:
362            $.inArray($(this).attr("data-autoHover"), [
363              "true",
364              "on",
365              "enable",
366              "enabled",
367              "1",
368            ]) >= 0
369              ? true
370              : false,
371          preloadImages:
372            $.inArray($(this).attr("data-preloadImages"), ["all", "visible"]) >=
373            0
374              ? $(this).attr("data-preloadImages")
375              : "visible",
376          hideControlOnEnd:
377            $.inArray($(this).attr("data-hideControlOnEnd"), [
378              "true",
379              "on",
380              "enable",
381              "enabled",
382              "1",
383            ]) >= 0
384              ? true
385              : false,
386          captions:
387            $.inArray($(this).attr("data-captions"), [
388              "true",
389              "on",
390              "enable",
391              "enabled",
392              "1",
393            ]) >= 0
394              ? true
395              : false,
396          clickContinue:
397            $.inArray($(this).attr("data-clickContinue"), [
398              "true",
399              "on",
400              "enable",
401              "enabled",
402              "1",
403            ]) >= 0
404              ? true
405              : false,
406          speed:
407            typeof $(this).attr("data-speed") != "undefined"
408              ? parseInt($(this).attr("data-speed"))
409              : 1000,
410          pause:
411            typeof $(this).attr("data-pause") != "undefined"
412              ? parseInt($(this).attr("data-pause"))
413              : 4000,
414          slideMargin:
415            typeof $(this).attr("data-slideMargin") != "undefined"
416              ? parseInt($(this).attr("data-slideMargin"))
417              : 0,
418          startSlide:
419            typeof $(this).attr("data-startSlide") != "undefined"
420              ? parseInt($(this).attr("data-startSlide"))
421              : 0,
422          autoDelay:
423            typeof $(this).attr("data-autoDelay") != "undefined"
424              ? parseInt($(this).attr("data-autoDelay"))
425              : 0,
426          minSlides:
427            typeof $(this).attr("data-minSlides") != "undefined"
428              ? parseInt($(this).attr("data-minSlides"))
429              : 1,
430          maxSlides:
431            typeof $(this).attr("data-maxSlides") != "undefined"
432              ? parseInt($(this).attr("data-maxSlides"))
433              : 1,
434          moveSlides:
435            typeof $(this).attr("data-moveSlides") != "undefined"
436              ? parseInt($(this).attr("data-moveSlides"))
437              : 0,
438          slideWidth:
439            typeof $(this).attr("data-slideWidth") != "undefined"
440              ? parseInt($(this).attr("data-slideWidth"))
441              : 0,
442          autoDirection:
443            $.inArray($(this).attr("data-autoDirection"), ["next", "prev"]) >= 0
444              ? $(this).attr("data-autoDirection")
445              : "next",
446          preloadImages:
447            $.inArray($(this).attr("data-preloadImages"), ["all", "visible"]) >=
448            0
449              ? $(this).attr("data-preloadImages")
450              : "visible",
451          adaptiveHeight:
452            $.inArray($(this).attr("data-adaptiveHeight"), [
453              "true",
454              "on",
455              "enable",
456              "enabled",
457              "1",
458            ]) >= 0
459              ? true
460              : false,
461          adaptiveHeightSpeed:
462            typeof $(this).attr("data-adaptiveHeightSpeed") != "undefined"
463              ? parseInt($(this).attr("data-adaptiveHeightSpeed"))
464              : 500,
465          nextSelector:
466            typeof $(this).attr("data-nextSelector") != "undefined"
467              ? $(this).attr("data-nextSelector")
468              : null,
469          prevSelector:
470            typeof $(this).attr("data-prevSelector") != "undefined"
471              ? $(this).attr("data-prevSelector")
472              : null,
473          nextText:
474            typeof $(this).attr("data-nextText") != "undefined"
475              ? $(this).attr("data-nextText")
476              : "Next",
477          prevText:
478            typeof $(this).attr("data-prevText") != "undefined"
479              ? $(this).attr("data-prevText")
480              : "Prev",
481          easing:
482            typeof $(this).attr("data-easing") != "undefined"
483              ? $(this).attr("data-easing")
484              : null,
485        };
486
487        if (typeof $(this).attr("data-auto") == "undefined")
488          $bxSliderData.auto = true;
489        if (typeof $(this).attr("data-infiniteLoop") == "undefined")
490          $bxSliderData.infiniteLoop = true;
491        if (typeof $(this).attr("data-responsive") == "undefined")
492          $bxSliderData.responsive = true;
493        if (typeof $(this).attr("data-touchEnabled") == "undefined")
494          $bxSliderData.touchEnabled = true;
495        if (
496          typeof $(this).attr("data-useCSS") == "undefined" &&
497          $bxSliderData.mode === "fade"
498        )
499          $bxSliderData.useCSS = true;
500        if (
501          typeof $(this).attr("data-controls") == "undefined" &&
502          ($bxSliderData.pagerCustom !== null ||
503            $bxSliderData.pagerSelector !== null)
504        )
505          $bxSliderData.pager = true;
506        if (
507          typeof $(this).attr("data-controls") == "undefined" &&
508          ($bxSliderData.nextSelector !== null ||
509            $bxSliderData.nextSelector !== null)
510        )
511          $bxSliderData.controls = true;
512        if (
513          typeof $(this).attr("data-nextText") == "undefined" &&
514          $bxSliderData.nextSelector !== null
515        )
516          $bxSliderData.nextText = "";
517        if (
518          typeof $(this).attr("data-prevText") == "undefined" &&
519          $bxSliderData.prevSelector !== null
520        )
521          $bxSliderData.prevText = "";
522
523        if ($bxSliderData.ticker === true) {
524          $bxSliderData.mode =
525            $.inArray($bxSliderData.mode, ["horizontal", "vertical"]) >= 0
526              ? $bxSliderData.mode
527              : "horizontal";
528          $bxSliderData.auto = false;
529          $bxSliderData.autoStart = true;
530          $bxSliderData.autoDelay = 0;
531          $bxSliderData.autoHover = false;
532          $bxSliderData.useCSS = false;
533        }
534
535        var $bxSlider = $(this).bxSlider({
536          mode: $bxSliderData.mode,
537          auto: $bxSliderData.auto,
538          controls: $bxSliderData.controls,
539          randomStart: $bxSliderData.randomStart,
540          infiniteLoop: $bxSliderData.infiniteLoop,
541          responsive: $bxSliderData.responsive,
542          touchEnabled: $bxSliderData.touchEnabled,
543          ticker: $bxSliderData.ticker,
544          tickerHover: $bxSliderData.tickerHover,
545          pager: $bxSliderData.pager,
546          pagerCustom: $bxSliderData.pagerCustom,
547          useCSS: $bxSliderData.useCSS,
548          autoHover: $bxSliderData.autoHover,
549          preloadImages: $bxSliderData.preloadImages,
550          hideControlOnEnd: $bxSliderData.hideControlOnEnd,
551          captions: $bxSliderData.captions,
552          speed: $bxSliderData.speed,
553          pause: $bxSliderData.pause,
554          slideMargin: $bxSliderData.slideMargin,
555          startSlide: $bxSliderData.startSlide,
556          autoDelay: $bxSliderData.autoDelay,
557          minSlides: $bxSliderData.minSlides,
558          maxSlides: $bxSliderData.maxSlides,
559          moveSlides: $bxSliderData.moveSlides,
560          slideWidth: $bxSliderData.slideWidth,
561          autoDirection: $bxSliderData.autoDirection,
562          preloadImages: $bxSliderData.preloadImages,
563          adaptiveHeight: $bxSliderData.adaptiveHeight,
564          adaptiveHeightSpeed: $bxSliderData.adaptiveHeightSpeed,
565          nextSelector: $bxSliderData.nextSelector,
566          prevSelector: $bxSliderData.prevSelector,
567          nextText: $bxSliderData.nextText,
568          prevText: $bxSliderData.prevText,
569          easing: $bxSliderData.easing,
570          onSlideAfter: function () {
571            if (
572              $bxSliderData.ticker !== true &&
573              $bxSliderData.tickerHover !== true &&
574              $bxSliderData.auto !== false &&
575              $bxSliderData.clickContinue
576            ) {
577              $bxSlider.stopAuto();
578              $bxSlider.startAuto();
579            }
580          },
581        });
582
583        if ($(this).parents(".bxSlider-pager").length) {
584          $(this)
585            .parents(".bxSlider-pager")
586            .on("mouseenter", "a[data-slide-index]", function () {
587              var $idx = $(this).attr("data-slide-index");
588              if ($idx != $bxSlider.getCurrentSlide())
589                $bxSlider.goToSlide($idx);
590            });
591        }
592
593        if ($bxSliderData.autoHover === true) {
594          $(this).hover(
595            function () {
596              $bxSlider.stopAuto();
597            },
598            function () {
599              $bxSlider.startAuto();
600            }
601          );
602        }
603
604        $(window).resize(function () {
605          if (!$($bxSlider).hasClass("no-reload")) $bxSlider.reloadSlider();
606        });
607      });
608    } else console.error("required libs bxSlider");
609  }
610  // END: bxSlider plugin
611
612  // BEGIN: slide fading
613  if ($(".slide-fade").length > 0) {
614    $(".slide-fade").each(function () {
615      var $this = $(this),
616        __idx__ = $(".slide-fade").index($this),
617        $duration =
618          typeof $this.attr("data-duration") != "undefined"
619            ? parseInt($this.attr("data-duration"))
620            : 1000,
621        $timer =
622          typeof $this.attr("data-timer") != "undefined"
623            ? parseInt($this.attr("data-timer"))
624            : 4000,
625        $delay =
626          typeof $this.attr("data-delay") != "undefined"
627            ? parseInt($this.attr("data-delay"))
628            : false;
629
630      if ($timer < $duration) $timer = $duration * 2;
631
632      if (!$this.children(".active").length > 0) {
633        $this.children().hide();
634        $this.children().eq(0).show().addClass("active");
635
636        if ($this.siblings(".slide-page").length > 0)
637          $this.siblings(".slide-page").children().eq(0).addClass("active");
638      } else {
639        if ($this.siblings(".slide-page").length > 0)
640          $this
641            .siblings(".slide-page")
642            .children()
643            .eq($this.children(".active").index())
644            .addClass("active");
645      }
646
647      if ($(this).siblings(".slide-page").length > 0) {
648        $(this)
649          .siblings(".slide-page")
650          .children()
651          .each(function (i) {
652            $(this).attr("data", i);
653          });
654      }
655
656      if (!$(this).hasClass("stop")) {
657        // $slideFadeTimer[__idx__] = setInterval(function() {
658        // slideFade($this, $duration);
659        // }, $timer);
660
661        $(this)
662          .parents(".slideParent")
663          .addClass("move-start")
664          .attr("data", $this.children(".active").index());
665
666        if ($slideFadeTimer[__idx__]) clearTimeout($slideFadeTimer[__idx__]);
667        $slideFadeTimer[__idx__] = setTimeout(
668          function () {
669            slideFade($this, $duration);
670          },
671          $delay ? $delay : $timer
672        );
673      }
674    });
675
676    /*
677     * TODO:
678     * --- removeClass/addClass
679     * .move-next
680     * .move-prev
681     * .move-first
682     * .move-last
683     *
684     */
685
686    $("body").on("click", ".slide-btn > .slide-next", function () {
687      var $btn = $(this),
688        $this = $btn.parent().siblings(".slide-fade"),
689        __idx__ = $(".slide-fade").index($this),
690        $duration =
691          typeof $this.attr("data-duration") != "undefined"
692            ? parseInt($this.attr("data-duration"))
693            : 1000,
694        $timer =
695          typeof $this.attr("data-timer") != "undefined"
696            ? parseInt($this.attr("data-timer"))
697            : 4000;
698
699      if ($timer < $duration) $timer = $duration * 2;
700
701      if (!$btn.hasClass("clicked") && !$this.hasClass("stop")) {
702        // if ($slideFadeTimer[__idx__]) clearInterval($slideFadeTimer[__idx__]);
703        if ($slideFadeTimer[__idx__]) clearTimeout($slideFadeTimer[__idx__]);
704
705        $btn.addClass("clicked");
706
707        $this
708          .children(".active")
709          .stop()
710          .fadeOut($duration, function () {
711            $(this).removeClass("active").removeAttr("style").hide();
712          });
713
714        if ($this.children(".active").next().length) {
715          $this
716            .children(".active")
717            .next()
718            .stop()
719            .fadeIn($duration, function () {
720              $(this).addClass("active").removeAttr("style").show();
721              $btn.removeClass("clicked");
722
723              // $slideFadeTimer[__idx__] = setInterval(function() {
724              $slideFadeTimer[__idx__] = setTimeout(function () {
725                $this.siblings(".slide-btn").children(".slide-next").
725click();
726              }, $timer);
727            });
728        } else {
729          if (!$this.hasClass("once")) {
730            $this
731              .children()
732              .eq(0)
733              .stop()
734              .fadeIn($duration, function () {
735                $(this).addClass("active").removeAttr("style").show();
736                $btn.removeClass("clicked");
737
738                // $slideFadeTimer[__idx__] = setInterval(function() {
739                $slideFadeTimer[__idx__] = setTimeout(function () {
740                  $this.siblings(".slide-btn").children(".slide-next").click();
741                }, $timer);
742              });
743          }
744        }
745      }
746    });
747    $("body").on("click", ".slide-btn > .slide-prev", function () {
748      var $btn = $(this),
749        $this = $btn.parent().siblings(".slide-fade"),
750        __idx__ = $(".slide-fade").index($this),
751        $duration =
752          typeof $this.attr("data-duration") != "undefined"
753            ? parseInt($this.attr("data-duration"))
754            : 1000,
755        $timer =
756          typeof $this.attr("data-timer") != "undefined"
757            ? parseInt($this.attr("data-timer"))
758            : 4000;
759
760      if ($timer < $duration) $timer = $duration * 2;
761
762      if (!$btn.hasClass("clicked") && !$this.hasClass("stop")) {
763        // if ($slideFadeTimer[__idx__]) clearInterval($slideFadeTimer[__idx__]);
764        if ($slideFadeTimer[__idx__]) clearTimeout($slideFadeTimer[__idx__]);
765
766        $btn.addClass("clicked");
767
768        $this
769          .children(".active")
770          .stop()
771          .fadeOut($duration, function () {
772            $(this).removeClass("active").removeAttr("style").hide();
773          });
774
775        if ($this.children(".active").prev().length) {
776          $this
777            .children(".active")
778            .prev()
779            .stop()
780            .fadeIn($duration, function () {
781              $(this).addClass("active").removeAttr("style").show();
782              $btn.removeClass("clicked");
783
784              // $slideFadeTimer[__idx__] = setInterval(function() {
785              $slideFadeTimer[__idx__] = setTimeout(function () {
786                $this.siblings(".slide-btn").children(".slide-next").click();
787              }, $timer);
788            });
789        } else {
790          $this
791            .children()
792            .last()
793            .stop()
794            .fadeIn($duration, function () {
795              $(this).addClass("active").removeAttr("style").show();
796              $btn.removeClass("clicked");
797
798              // $slideFadeTimer[__idx__] = setInterval(function() {
799              $slideFadeTimer[__idx__] = setTimeout(function () {
800                $this.siblings(".slide-btn").children(".slide-next").click();
801              }, $timer);
802            });
803        }
804      }
805    });
806
807    $("body").on("click", ".slide-page > *", function () {
808      var $page = $(this).parent(),
809        $idx = $(this).index(),
810        $this = $(this).parents(".slideParent").length
811          ? $(this).parents(".slideParent").find(".slide-fade")
812          : $(this).siblings(".slide-fade"),
813        __idx__ = $(".slide-fade").index($this),
814        $duration =
815          typeof $this.attr("data-duration") != "undefined"
816            ? parseInt($this.attr("data-duration"))
817            : 1000,
818        $timer =
819          typeof $this.attr("data-timer") != "undefined"
820            ? parseInt($this.attr("data-timer"))
821            : 4000;
822
823      if ($timer < $duration) $timer = $duration * 2;
824
825      if ($this.length) {
826        if (!$page.hasClass("clicked") && !$this.hasClass("stop")) {
827          if ($(this).siblings(".active").length > 0) {
828            var idxOld = parseInt($(this).siblings(".active").attr("data")),
829              idxNew = parseInt($(this).attr("data")),
830              beside = idxOld - idxNew === 1 || idxNew - idxOld === 1;
831
832            $(this)
833              .parents(".slideParent")
834              .removeClass(
835                "move-start move-next move-prev move-first move-last"
836              );
837
838            if (idxNew > idxOld) {
839              $(this)
840                .parents(".slideParent")
841                .addClass("move-next")
842                .attr("data", idxNew);
843
844              if ($(this).is(":last-child"))
845                $(this).parents(".slideParent").addClass("move-last");
846            } else {
847              $(this)
848                .parents(".slideParent")
849                .addClass("move-prev")
850                .attr("data", idxNew);
851
852              if ($(this).is(":first-child"))
853                $(this).parents(".slideParent").addClass("move-first");
854            }
855          }
856
857          if ($this.children().eq($idx).length > 0) {
858            if ($slideFadeTimer[__idx__])
859              clearTimeout($slideFadeTimer[__idx__]);
860
861            $this
862              .siblings(".slide-page")
863              .children(".active")
864              .removeClass("active");
865            $(this).addClass("active");
866
867            $page.addClass("clicked");
868
869            $this
870              .children(".active")
871              .stop()
872              .fadeOut($duration, function () {
873                $(this).removeClass("active").removeAttr("style").hide();
874              });
875
876            $this
877              .children()
878              .eq($idx)
879              .stop()
880              .fadeIn($duration, function () {
881                $(this).addClass("active").removeAttr("style").show();
882                $page.removeClass("clicked");
883
884                // $slideFadeTimer[__idx__] = setInterval(function() {
885                // slideFade($this, $duration);
886                // }, $timer);
887
888                $slideFadeTimer[__idx__] = setTimeout(function () {
889                  slideFade($this, $duration);
890                }, $timer);
891              });
892          } else console.info("Slide not found");
893        }
894      } else console.info(".slideParent or .slide-fade not found!");
895    });
896  }
897  // BEGIN: slide fading
898
899  // navigation animate
900  if ($(".nav-animate").length) {
901    $(".nav-animate").each(function () {
902      var $timerNav,
903        $navNull = $(this).hasClass("nav-null"),
904        $navWidth = $(this).find("li").first().outerWidth(),
905        $navPosX = $navNull ? 0 : $(this).find("li").first().position().left,
906        // $navML = 0,
907        $navMR = 0;
908
909      if ($(this).find("li.active").length) {
910        ($navWidth = $(this).find("li.active").outerWidth()),
911          ($navPosX = $(this).find("li.active").position().left);
912
913        // $navML = $(this).find("li.active").next().length ? parseInt($(this).find("li.active").next().css("margin-left"), 10),
914        $navMR = $(this).find("li.active").prev().length
915          ? parseInt($(this).find("li.active").prev().css("margin-right"), 10)
916          : 0;
917      } else {
918        if (!$navNull) $(this).find("li").first().addClass("active");
919
920        // $navML = parseInt($(this).find("li").first().css("margin-left"), 10),
921        // $navMR = parseInt($(this).find("li").first().css("margin-right"), 10);
922      }
923
924      $navWidth += $navMR;
925      $navPosX -= $navMR;
926
927      $(this).children("span").css({
928        width: $navWidth,
929        left: $navPosX,
930      });
931
932      if ($navNull) $(this).children("span").css("opacity", 0);
933
934      $(this)
935        .find("li")
936        .mouseover(function () {
937          var $navW = $(this).outerWidth(),
938            $navX = $(this).position().left,
939            // $nML = $(this).next().length ? parseInt($(this).next().css("margin-left"), 10),
940            $nMR = $(this).prev().length
941              ? parseInt($(this).prev().css("margin-right"), 10)
942              : 0;
943
944          if ($navNull) {
945            clearTimeout($timerNav);
946
947            $navPosX = $navX - $nMR;
948
949            $(this).parents(".nav-animate").children("span").css("opacity", 1);
950            console.log($navPosX);
951          }
952
953          $(this)
954            .parents(".nav-animate")
955            .children("span")
956            .stop()
957            .animate(
958              {
959                width: $navW + $nMR,
960                left: $navX - $nMR,
961              },
962              "fast"
963            );
964        })
965        .mouseleave(function () {
966          var $span = $(this).parents(".nav-animate").children("span");
967
968          if ($navNull) {
969            clearTimeout($timerNav);
970            $timerNav = setTimeout(function () {
971              console.log($navPosX);
972              $span.stop().fadeOut(100, function () {
973                $(this).removeAttr("style").css({
974                  opacity: 0,
975                  width: $navWidth,
976                  left: $navPosX,
977                });
978              });
979            }, 500);
980          } else {
981            $span.stop().animate(
982              {
983                width: $navWidth,
984                left: $navPosX,
985              },
986              "fast"
987            );
988          }
989        });
990    });
991  }
992
993  // BEGIN: toggle
994  if ($(".toggle").length > 0) {
995    $("body").on("click", ".toggle-link", function () {
996      var $toggleDuration = 300,
997        $toggleElm = $(this).parents(".toggle").first();
998
999      if (typeof $toggleElm.attr("data-duration") != "undefined") {
1000        if (
1001          $.inArray($toggleElm.attr("data-duration"), [
1002            "slow",
1003            "normal",
1004            "fast",
1005          ]) >= 0
1006        )
1007          $toggleDuration = $toggleElm.attr("data-duration");
1008        else $toggleDuration = parseInt($toggleElm.attr("data-duration"));
1009      }
1010
1011      if ($(this).parents(".single").length > 0) {
1012        $(this)
1013          .parents(".single")
1014          .find(".toggle-main")
1015          .stop()
1016          .slideUp($toggleDuration, function () {
1017            $(this).removeAttr("style");
1018            $(this).parents(".toggle").first().removeClass("active");
1019          });
1020      }
1021
1022      if ($(this).parents(".toggle").first().hasClass("active")) {
1023        $(this)
1024          .siblings(".toggle-main")
1025          .stop()
1026          .slideUp($toggleDuration, function () {
1027            $(this).removeAttr("style");
1028            $(this).parents(".toggle").first().removeClass("active");
1029          });
1030      } else {
1031        $(this)
1032          .siblings(".toggle-main")
1033          .stop()
1034          .slideDown($toggleDuration, function () {
1035            $(this).removeAttr("style");
1036            $(this).parents(".toggle").first().addClass("active");
1037
1038            // if ($(this).find("[class*=heightLine]").length) heightLine();
1039
1040            $(window).trigger("resize");
1041          });
1042
1043        if ($(this).siblings(".toggle-main").find("[class*=heightLine]").length)
1044          heightLine();
1045      }
1046    });
1047  }
1048  // END: toggle
1049
1050  // BEGIN: tabs - switch
1051  if ($(".tabs-switch").length) {
1052    $(".tabs-switch").each(function () {
1053      var $tabsSwitch = $(this),
1054        $tabLink = $tabsSwitch.find(".tab-link"),
1055        $tabContent = $tabsSwitch.find(".tab-content");
1056
1057      $tabLink.children().each(function () {
1058        if (
1059          $(this).find("img").length > 0 &&
1060          $(this).find("img").hasClass("btn")
1061        ) {
1062          $(this).data("src", $(this).find("img").attr("src"));
1063
1064          $(this)
1065            .find("img")
1066            .attr("src")
1067            .match(/^(.*)(\.{1}.*)/g);
1068          $(this).data("active", RegExp.$1 + "_on" + RegExp.$2);
1069        }
1070      });
1071
1072      $tabContent.children().hide();
1073
1074      if (!$tabsSwitch.hasClass("stop")) {
1075        $tabLink.each(function () {
1076          // TODO: active by [data-active]
1077          var hash = window.location.hash || location.hash;
1078          if (hash) {
1079            if ($(this).children("[data-tab-anchor='" + hash + "']").length)
1080              $(this)
1081                .children("[data-tab-anchor='" + hash + "']")
1082                .addClass("active");
1083            else $(this).children().first().addClass("active");
1084          } else if (!$(this).children(".active").length) $(this).children().first().addClass("active");
1085
1086          $(this)
1087            .children(".active")
1088            .find("img")
1089            .attr("src", $(this).children(".active").data("active"))
1090            .removeClass("btn");
1091        });
1092
1093        if ($tabLink.children(".active").hasClass("all"))
1094          $tabContent.children().show();
1095        else
1096          $tabContent
1097            .children()
1098            .eq($tabLink.children(".active").index())
1099            .show();
1100      }
1101
1102      if ($(".bxSlider").length > 0) $(window).trigger("resize");
1103    });
1104
1105    $("body").on("click", ".tab-link > *", function () {
1106      var $this = $(this),
1107        $idxAll =
1108          $this.parents(".tab-link").children(".all").length > 0
1109            ? $this.parents(".tab-link").children(".all").index()
1110            : false,
1111        $idx = $this.index(),
1112        $act = $this.parents(".tab-link").children(".active"),
1113        $tabMode =
1114          $.inArray($this.parents(".tabs-switch").attr("data"), [
1115            "fade",
1116            "slide",
1117            "block",
1118          ]) >= 0
1119            ? $this.parents(".tabs-switch").attr("data")
1120            : "block",
1121        $tabDuration = $this.parents(".tabs-switch").attr("data-duration")
1122          ? parseInt($this.parents(".tabs-switch").attr("data-duration"))
1123          : 300,
1124        $tabContent = $this.parents(".tabs-switch").children(".tab-content"),
1125        $tabIdx = $this.attr("data-active") ? $this.attr("data-active") : false,
1126        $autoScroll =
1127          $.inArray($this.parents(".tabs-switch").attr("data-scroll"), [
1128            "true",
1129            "on",
1130            "enable",
1131            "enabled",
1132            "1",
1133          ]) >= 0
1134            ? true
1135            : false,
1136        $itself =
1137          $.inArray($this.parents(".tabs-switch").attr("data-toggle"), [
1138            "true",
1139            "on",
1140            "enable",
1141            "enabled",
1142            "1",
1143          ]) >= 0 && $this.hasClass("active")
1144            ? true
1145            : false,
1146        $itHide = $tabContent.children().eq($idx).is(":hidden");
1147
1148      if ($tabIdx) {
1149        $this
1150          .parents(".tabs-switch")
1151          .find(".tab-link")
1152          .each(function () {
1153            var $tabBtn = $(this).children("[data-active='" + $tabIdx + "']");
1154
1155            $(this)
1156              .children(".active")
1157              .find("img")
1158              .attr("src", $(this).children(".active").data("src"));
1159            $(this).children(".active").removeClass("active");
1160
1161            if ($itself) {
1162              if ($itHide) $tabBtn.addClass("active");
1163              else $tabBtn.removeClass("active");
1164            } else $tabBtn.addClass("active");
1165
1166            // if (!$tabBtn.find("img").hasClass("active")) $tabBtn.find("img").attr("src", $tabBtn.data("active"));
1167            if ($tabBtn.find("img").hasClass("btn"))
1168              $tabBtn
1169                .find("img")
1170                .attr("src", $tabBtn.data("active"))
1171                .removeClass("btn");
1172          });
1173      } else {
1174        if (/^(.*?)_on\.(.*?)$/.test($act.find("img").attr("src")))
1175          $act.find("img").addClass("btn");
1176
1177        $act.find("img").attr("src", $act.data("src"));
1178        $act.removeClass("active");
1179
1180        if ($itself) {
1181          if ($itHide) $this.addClass("active");
1182          else $this.removeClass("active");
1183        } else $this.addClass("active");
1184
1185        // if (!$this.find("img").hasClass("active")) $this.find("img").attr("src", $this.data("active"));
1186        if ($this.find("img").hasClass("btn"))
1187          $this
1188            .find("img")
1189            .attr("src", $this.data("active"))
1190            .removeClass("btn");
1191      }
1192
1193      if (!$this.parents(".tab-link").hasClass("clicked")) {
1194        $this.parents(".tab-link").addClass("clicked");
1195
1196        if ($this.hasClass("all")) {
1197          if ($tabMode == "fade") {
1198            $tabContent
1199              .children()
1200              .stop()
1201              .fadeIn($tabDuration, function () {
1202                $(this).removeAttr("style").show();
1203
1204                if ($(this).find("[class*=heightLine]").length) heightLine();
1205
1206                if ($this.children("a").length) $this.children("a").click();
1207
1208                $tabContent.css({
1209                  minHeight: "",
1210                });
1211
1212                $(window).trigger("resize");
1213
1214                $this.parents(".tab-link").removeClass("clicked");
1215              });
1216          } else if ($tabMode == "slide") {
1217            $tabContent.children().slideDown($tabDuration, function () {
1218              $(this).removeAttr("style").show();
1219
1220              if ($(this).find("[class*=heightLine]").length) heightLine();
1221
1222              if ($this.children("a").length) $this.children("a").click();
1223
1224              $(window).trigger("resize");
1225
1226              $this.parents(".tab-link").removeClass("clicked");
1227            });
1228          } else {
1229            $tabDuration = $(this).parents(".tabs-switch").attr("data-duration")
1230              ? parseInt($(this).parents(".tabs-switch").attr("data-duration"))
1231              : 0;
1232
1233            $tabContent
1234              .children()
1235              .stop()
1236              .show($tabDuration, function () {
1237                $(this).removeAttr("style").show();
1238
1239                if ($(this).find("[class*=heightLine]").length) heightLine();
1240
1241                if ($this.children("a").length) $this.children("a").click();
1242
1243                $(window).trigger("resize");
1244
1245                $this.parents(".tab-link").removeClass("clicked");
1246              });
1247          }
1248        } else {
1249          if ($idxAll !== false && $idxAll >= 0 && $idx >= $idxAll) $idx -= 1;
1250
1251          if ($tabMode == "fade") {
1252            if ($itself) {
1253              $tabContent
1254                .children()
1255                .eq($idx)
1256                .stop()
1257                .fadeToggle($tabDuration, function () {
1258                  if ($itHide) $(this).removeAttr("style").show();
1259                  else $(this).removeAttr("style").hide();
1260
1261                  if ($(this).find("[class*=heightLine]").length) heightLine();
1262
1263                  if ($this.children("a").length) $this.children("a").click();
1264
1265                  $tabContent.css({
1266                    minHeight: "",
1267                  });
1268
1269                  $(window).trigger("resize");
1270
1271                  $this.parents(".tab-link").removeClass("clicked");
1272                });
1273            } else {
1274              $tabContent.css({
1275                minHeight: $tabContent.outerHeight(),
1276              });
1277
1278              $tabContent
1279                .children()
1280                .stop()
1281                .fadeOut($tabDuration, function () {
1282                  $(this).removeAttr("style").hide();
1283                });
1284              $tabContent
1285                .children()
1286                .eq($idx)
1287                .stop()
1288                .delay($tabDuration)
1289                .fadeIn($tabDuration, function () {
1290                  $(this).removeAttr("style").show();
1291
1292                  if ($(this).find("[class*=heightLine]").length) heightLine();
1293
1294                  if ($this.children("a").length) $this.children("a").click();
1295
1296                  $tabContent.css({
1297                    minHeight: "",
1298                  });
1299
1300                  $(window).trigger("resize");
1301
1302                  $this.parents(".tab-link").removeClass("clicked");
1303                });
1304            }
1305          } else if ($tabMode == "slide") {
1306            if ($itself) {
1307              $tabContent
1308                .children()
1309                .eq($idx)
1310                .stop()
1311                .slideToggle($tabDuration, function () {
1312                  if ($itHide) $(this).removeAttr("style").show();
1313                  else $(this).removeAttr("style").hide();
1314
1315                  if ($(this).find("[class*=heightLine]").length) heightLine();
1316
1317                  if ($this.children("a").length) $this.children("a").click();
1318
1319                  $(window).trigger("resize");
1320
1321                  $this.parents(".tab-link").removeClass("clicked");
1322                });
1323            } else {
1324              $tabContent
1325                .children()
1326                .stop()
1327                .slideUp($tabDuration, function () {
1328                  $(this).removeAttr("style").hide();
1329                })
1330                .siblings()
1331                .eq($idx)
1332                .stop()
1333                .slideDown($tabDuration, function () {
1334                  $(this).removeAttr("style").show();
1335
1336                  if ($(this).find("[class*=heightLine]").length) heightLine();
1337
1338                  if ($this.children("a").length) $this.children("a").click();
1339
1340                  $(window).trigger("resize");
1341
1342                  $this.parents(".tab-link").removeClass("clicked");
1343                });
1344            }
1345          } else {
1346            $tabDuration = $this.parents(".tabs-switch").attr("data-duration")
1347              ? parseInt($this.parents(".tabs-switch").attr("data-duration"))
1348              : 0;
1349
1350            if ($itself) {
1351              $tabContent
1352                .children()
1353                .eq($idx)
1354                .stop()
1355                .toggle($tabDuration, function () {
1356                  if ($itHide) $(this).removeAttr("style").show();
1357                  else $(this).removeAttr("style").hide();
1358
1359                  if ($(this).find("[class*=heightLine]").length) heightLine();
1360
1361                  if ($this.children("a").length) $this.children("a").click();
1362
1363                  $(window).trigger("resize");
1364
1365                  $this.parents(".tab-link").removeClass("clicked");
1366                });
1367            } else {
1368              $tabContent
1369                .children()
1370                .stop()
1371                .hide($tabDuration, function () {
1372                  $(this).removeAttr("style").hide();
1373                })
1374                .siblings()
1375                .eq($idx)
1376                .stop()
1377                .show($tabDuration, function () {
1378                  $(this).removeAttr("style").show();
1379
1380                  if ($(this).find("[class*=heightLine]").length) heightLine();
1381
1382                  if ($this.children("a").length) $this.children("a").click();
1383
1384                  $(window).trigger("resize");
1385
1386                  $this.parents(".tab-link").removeClass("clicked");
1387                });
1388            }
1389          }
1390        }
1391
1392        if ($(".bxSlider").length > 0) {
1393          setTimeout(function () {
1394            $(window).trigger("resize");
1395          }, 50);
1396        }
1397
1398        if ($autoScroll) {
1399          var $offsetY = $tabContent.offset().top,
1400            $navOffset = 0;
1401
1402          if ($(".nav-fixed").length)
1403            $navOffset =
1404              typeof $(".nav-fixed").attr("data-height") != "undefined"
1405                ? parseInt($(".nav-fixed").attr("data-height"))
1406                : $(".nav-fixed").outerHeight();
1407
1408          if ($(".nav-target").length) {
1409            if ($(".nav-fixed").length)
1410              $navOffset =
1411                typeof $(".nav-fixed").attr("data-height") != "undefined"
1412                  ? parseInt($(".nav-fixed").attr("data-height"))
1413                  : $(".nav-fixed").outerHeight();
1414
1415            $("html, body")
1416              .stop()
1417              .animate(
1418                {
1419                  scrollTop: $offsetY - $navOffset,
1420                },
1421                500
1422              );
1423          } else {
1424            $("html, body")
1425              .stop()
1426              .animate(
1427                {
1428                  scrollTop: $offsetY - $navOffset,
1429                },
1430                500
1431              );
1432          }
1433        }
1434      }
1435    });
1436  }
1437  // END: tab - switch
1438
1439  // BEGIN: RSS
1440  if (typeof rss === "object" && isObjectVar(rss)) {
1441    var objRss = {};
1442
1443    for (var r in rss) {
1444      if (!isNaN(parseFloat(r)) && isFinite(r)) objRss = rss;
1445      // multiple
1446      else objRss[0] = rss; // single
1447    }
1448    for (var rssNum in objRss) {
1449      // eaching
1450      var rssData = objRss[rssNum];
1451      if (typeof rssData != "undefined" && typeof rssData == "object") {
1452        if (typeof rssData.dateFormat == "undefined") {
1453          rssData.dateFormat = {
1454            year: "-",
1455            month: "-",
1456            date: "",
1457          };
1458        }
1459        if (typeof rssData.imageSize == "undefined") {
1460          rssData.imageSize = {
1461            width: 300,
1462            height: 200,
1463          };
1464        }
1465        if (typeof rssData.elm != "undefined" && $(rssData.elm).length) {
1466          var content =
1467              typeof rssData.template != "undefined" ? rssData.template : "",
1468            rssCallbacks =
1469              typeof rssData.done === "function"
1470                ? rssData.done
1471                : function () {};
1472
1473          var $rssLoop = $(rssData.elm).feed(
1474            {
1475              Path:
1476                typeof rssData.url != "undefined" ? rssData.url : "rss/rss.php", //rss.phpの場所。階層が変わる時のみ変更。
1477              key: rssData.key, //RSSのURL。
1478              indention:
1479                typeof rssData.indention != "undefined"
1480                  ? rssData.indention
1481                  : false, //本文のソースを表示するかどうか
1482              MAX: typeof rssData.max != "undefined" ? rssData.max : 3, //記事の最大数。
1483              titleMax:
1484                typeof rssData.titleMax != "undefined" ? rssData.titleMax : 10, //タイトルの最大文字数。
1485              postMax:
1486                typeof rssData.postMax != "undefined" ? rssData.postMax : 50, //本文の最大文字数。
1487              endtext:
1488                typeof rssData.endText != "undefined" ? rssData.endText : "...", //最大文字数を超えた後に追加するテキスト。
1489              Datetype: rssData.dateFormat, //日付の形式 例)○○年○○月○○日
1490              Image:
1491                typeof rssData.image != "undefined"
1492                  ? rssData.image === true
1493                    ? "yes"
1494                    : rssData.image
1495                  : "no", //画像付きの記事かどうか yes、もしくはnoで。
1496              ImageSize: rssData.imageSize, //表示する画像のサイズ width=横幅 height="縦幅"
1497              noImage:
1498                typeof rssData.noImage != "undefined"
1499                  ? rssData.noImage === true
1500                    ? "yes"
1501                    : rssData.noImage
1502                  : "no", //No-image画像が必要かどうか yes、もしくはnoで。
1503              noImage_src:
1504                typeof rssData.noImageSRC != "undefined"
1505                  ? rssData.noImageSRC
1506                  : "shared/img/index/no_image.jpg", //No-image画像のパス。
1507              source: function (
1508                LINK,
1509                TITLE,
1510                DATE,
1511                POST,
1512                IMAGE,
1513                CATEGORY,
1514                AUTHOR,
1515                COUNT
1516              ) {
1517                var post = "";
1518
1519                if (typeof rssData.template != "undefined") {
1520                  post = rssData.template
1521                    .replace(/{title}/gi, TITLE)
1522                    .replace(/{name}/gi, TITLE)
1523                    .replace(/{content}/gi, POST)
1524                    .replace(/{desc}/gi, POST)
1525                    .replace(/{date}/gi, DATE)
1526                    .replace(/{image}/gi, IMAGE)
1527                    .replace(/{img}/gi, IMAGE)
1528                    .replace(/{photo}/gi, IMAGE)
1529                    .replace(/{pic}/gi, IMAGE)
1530                    .replace(/{picture}/gi, IMAGE)
1531                    .replace(/{url}/gi, LINK)
1532                    .replace(/{link}/gi, LINK)
1533                    .replace(/{cat}/gi, CATEGORY)
1534                    .replace(/{category}/gi, CATEGORY)
1535                    .replace(/{user}/gi, AUTHOR)
1536                    .replace(/{creator}/gi, AUTHOR)
1537                    .replace(/{author}/gi, AUTHOR)
1538                    .replace(/{count}/gi, COUNT)
1539                    .replace(/{total}/gi, COUNT);
1540                }
1541
1542                return post;
1543              },
1544            },
1545            rssCallbacks
1546          );
1547        } else console.error(rssData.elm + " not found", rssData);
1548      }
1549    }
1550  }
1551  // END: RSS
1552
1553  // BEGIN: gmap
1554  if (typeof gmap === "object" && isObjectVar(gmap)) {
1555    function init() {
1556      var errorsMap = {
1557          mapDiv: false,
1558          latLong: false,
1559        },
1560        objData = {}; // single || multiMap || multiPoint
1561
1562      // checking
1563      if (
1564        typeof gmap.maps != "undefined" &&
1565        Object.keys(gmap.maps).length > 0
1566      ) {
1567        // multi map
1568        if (typeof gmap.maps[0] == "undefined") {
1569          // associative array
1570          if (typeof gmap.maps.mapDiv == "undefined" || gmap.maps.mapDiv == "")
1571            errorsMap.mapDiv = 1;
1572          else if (
1573            (typeof gmap.maps.latitude == "undefined" &&
1574              typeof gmap.maps.latitude != "number") ||
1575            (typeof gmap.maps.longitude == "undefined" &&
1576              typeof gmap.maps.longitude != "number")
1577          )
1578            errorsMap.latLong = 1;
1579        } else {
1580          // object
1581          for (var s in gmap.maps) {
1582            // loop
1583            if (
1584              typeof gmap.maps[s].mapDiv == "undefined" ||
1585              gmap.maps[s].mapDiv == ""
1586            ) {
1587              errorsMap.mapDiv = 2;
1588              break;
1589            } else if (
1590              (typeof gmap.maps[s].latitude == "undefined" &&
1591                typeof gmap.maps[s].latitude != "number") ||
1592              (typeof gmap.maps[s].longitude == "undefined" &&
1593                typeof gmap.maps[s].longitude != "number")
1594            ) {
1595              errorsMap.latLong = 2;
1596              break;
1597            }
1598          }
1599        }
1600      } else {
1601        // single map
1602        if (typeof gmap.mapDiv == "undefined" || gmap.mapDiv == "")
1603          errorsMap.mapDiv = 3;
1604        else if (
1605          (typeof gmap.latitude == "undefined" &&
1606            typeof gmap.latitude != "number") ||
1607          typeof gmap.longitude == "undefined" ||
1608          typeof gmap.longitude != "number"
1609        )
1610          errorsMap.latLong = 3;
1611      }
1612
1613      if (errorsMap.mapDiv || errorsMap.latLong) {
1614        console.info("ERROR", errorsMap);
1615        return false;
1616      } else {
1617        // if ()
1618        var init = initMap(gmap);
1619        // console.log(init);
1620      }
1621
1622      /*
1623       * initialize
1624       *
1625       */
1626
1627      function initMap(data) {
1628        var dataMap = {
1629          mapDiv: false,
1630          latitude: false,
1631          longitude: false,
1632
1633          center: false,
1634
1635          zoom: 17,
1636          minZoom: 2,
1637          zoomControl: true,
1638          disableDoubleClickZoom: true,
1639          mapTypeControl: true,
1640          scaleControl: true,
1641          scrollwheel: false,
1642          panControl: true,
1643          streetViewControl: true,
1644          draggable: true,
1645          overviewMapControl: true,
1646
1647          styles: false,
1648          style: false,
1649
1650          name: false,
1651          desc: false,
1652          tel: false,
1653          email: false,
1654
1655          url: false,
1656          logo: false,
1657          size: false,
1658          scale: false,
1659          origin: false,
1660          anchor: false,
1661          optimized: false,
1662
1663          clickable: false,
1664          hover: false,
1665          html: false,
1666
1667          multi: false,
1668        };
1669
1670        // BEGIN: configs default
1671        if (typeof data.zoom != "undefined" && typeof data.zoom == "number")
1672          dataMap.zoom = data.zoom;
1673        if (
1674          typeof data.minZoom != "undefined" &&
1675          typeof data.minZoom == "number"
1676        )
1677          dataMap.minZoom = data.minZoom;
1678        if (
1679          typeof data.zoomControl != "undefined" &&
1680          typeof data.zoomControl == "boolean"
1681        )
1682          dataMap.zoomControl = data.zoomControl;
1683        if (
1684          typeof data.disableDoubleClickZoom != "undefined" &&
1685          typeof data.disableDoubleClickZoom == "boolean"
1686        )
1687          dataMap.disableDoubleClickZoom = data.disableDoubleClickZoom;
1688        if (
1689          typeof data.mapTypeControl != "undefined" &&
1690          typeof data.mapTypeControl == "boolean"
1691        )
1692          dataMap.mapTypeControl = data.mapTypeControl;
1693        if (
1694          typeof data.scaleControl != "undefined" &&
1695          typeof data.scaleControl == "boolean"
1696        )
1697          dataMap.scaleControl = data.scaleControl;
1698        if (
1699          typeof data.scrollwheel != "undefined" &&
1700          typeof data.scrollwheel == "boolean"
1701        )
1702          dataMap.scrollwheel = data.scrollwheel;
1703        if (
1704          typeof data.panControl != "undefined" &&
1705          typeof data.panControl == "boolean"
1706        )
1707          dataMap.panControl = data.panControl;
1708        if (
1709          typeof data.streetViewControl != "undefined" &&
1710          typeof data.streetViewControl == "boolean"
1711        )
1712          dataMap.streetViewControl = data.streetViewControl;
1713        if (
1714          typeof data.draggable != "undefined" &&
1715          typeof data.draggable == "boolean"
1716        )
1717          dataMap.draggable = data.draggable;
1718        if (
1719          typeof data.overviewMapControl != "undefined" &&
1720          typeof data.overviewMapControl == "boolean"
1721        )
1722          dataMap.overviewMapControl = data.overviewMapControl;
1723
1724        if (typeof data.name != "undefined" && data.name != "")
1725          dataMap.name = data.name;
1726        if (typeof data.desc != "undefined" && data.desc != "")
1727          dataMap.desc = data.desc;
1728        if (typeof data.tel != "undefined" && data.tel != "")
1729          dataMap.tel = data.tel;
1730        if (typeof data.email != "undefined" && data.email != "")
1731          dataMap.email = data.email;
1732        if (typeof data.url != "undefined" && data.url != "")
1733          dataMap.url = data.url;
1734        if (typeof data.logo != "undefined" && data.logo != "")
1735          dataMap.logo = data.logo;
1736        if (
1737          typeof data.size != "undefined" &&
1738          typeof data.size.width != "undefined" &&
1739          data.size.width != ""
1740        )
1741          dataMap.sizeWidth = data.size.width;
1742        if (
1743          typeof data.size != "undefined" &&
1744          typeof data.size.height != "undefined" &&
1745          data.size.height != ""
1746        )
1747          dataMap.sizeHeight = data.size.height;
1748        if (
1749          typeof data.scale != "undefined" &&
1750          typeof data.scale.width != "undefined" &&
1751          data.scale.width != ""
1752        )
1753          dataMap.scaleWidth = data.scale.width;
1754        if (
1755          typeof data.scale != "undefined" &&
1756          typeof data.scale.height != "undefined" &&
1757          data.scale.height != ""
1758        )
1759          dataMap.scaleHeight = data.scale.height;
1760        if (
1761          typeof data.origin != "undefined" &&
1762          typeof data.origin.x != "undefined" &&
1763          data.origin.x != ""
1764        )
1765          dataMap.originX = data.origin.x;
1766        if (
1767          typeof data.origin != "undefined" &&
1768          typeof data.origin.y != "undefined" &&
1769          data.origin.y != ""
1770        )
1771          dataMap.originY = data.origin.y;
1772        if (
1773          typeof data.anchor != "undefined" &&
1774          typeof data.anchor.x != "undefined" &&
1775          data.anchor.x != ""
1776        )
1777          dataMap.anchorX = data.anchor.x;
1778        if (
1779          typeof data.anchor != "undefined" &&
1780          typeof data.anchor.y != "undefined" &&
1781          data.anchor.y != ""
1782        )
1783          dataMap.anchorY = data.anchor.y;
1784        if (typeof data.optimized != "undefined" && data.optimized != "")
1785          dataMap.optimized = data.optimized;
1786
1787        if (typeof data.clickable != "undefined" && data.clickable != "")
1788          dataMap.clickable = data.clickable;
1789        if (typeof data.html != "undefined" && data.html != "")
1790          dataMap.html = data.html;
1791        if (typeof data.hover != "undefined" && typeof data.hover == "boolean")
1792          dataMap.hover = data.hover;
1793
1794        if (
1795          typeof data.multi != "undefined" &&
1796          Object.keys(data.multi).length > 0
1797        )
1798          dataMap.multi = data.multi;
1799
1800        if (typeof data.styles != "undefined") dataMap.styles = data.styles;
1801        else if (typeof data.style != "undefined") {
1802          dataMap.style = {};
1803          if (typeof data.style.hue != "undefined")
1804            dataMap.style.hue = data.style.hue;
1805          if (typeof data.style.gamma != "undefined")
1806            dataMap.style.gamma = data.style.gamma;
1807          if (typeof data.style.lightness != "undefined")
1808            dataMap.style.lightness = data.style.lightness;
1809          if (typeof data.style.saturation != "undefined")
1810            dataMap.style.saturation = data.style.saturation;
1811        }
1812        // END: configs default
1813
1814        dataMap.mapDiv = data.mapDiv;
1815        dataMap.latitude = data.latitude;
1816        dataMap.longitude = data.longitude;
1817
1818        if (
1819          typeof data.maps != "undefined" &&
1820          Object.keys(data.maps).length > 0
1821        ) {
1822          // multi map
1823          var objMap = {};
1824          if (typeof data.maps[0] == "undefined") objMap[0] = data.maps;
1825          // object
1826          else objMap = data.maps; // array
1827
1828          for (var g in objMap) {
1829            // loop
1830            var obj = objMap[g];
1831
1832            // BEGIN: override configs
1833            if (typeof obj.zoom != "undefined" && typeof obj.zoom == "number")
1834              dataMap.zoom = obj.zoom;
1835            if (
1836              typeof obj.minZoom != "undefined" &&
1837              typeof obj.minZoom == "number"
1838            )
1839              dataMap.minZoom = obj.minZoom;
1840            if (
1841              typeof obj.zoomControl != "undefined" &&
1842              typeof obj.zoomControl == "boolean"
1843            )
1844              dataMap.zoomControl = obj.zoomControl;
1845            if (
1846              typeof obj.disableDoubleClickZoom != "undefined" &&
1847              typeof obj.disableDoubleClickZoom == "boolean"
1848            )
1849              dataMap.disableDoubleClickZoom = obj.disableDoubleClickZoom;
1850            if (
1851              typeof obj.mapTypeControl != "undefined" &&
1852              typeof obj.mapTypeControl == "boolean"
1853            )
1854              dataMap.mapTypeControl = obj.mapTypeControl;
1855            if (
1856              typeof obj.scaleControl != "undefined" &&
1857              typeof obj.scaleControl == "boolean"
1858            )
1859              dataMap.scaleControl = obj.scaleControl;
1860            if (
1861              typeof obj.scrollwheel != "undefined" &&
1862              typeof obj.scrollwheel == "boolean"
1863            )
1864              dataMap.scrollwheel = obj.scrollwheel;
1865            if (
1866              typeof obj.panControl != "undefined" &&
1867              typeof obj.panControl == "boolean"
1868            )
1869              dataMap.panControl = obj.panControl;
1870            if (
1871              typeof obj.streetViewControl != "undefined" &&
1872              typeof obj.streetViewControl == "boolean"
1873            )
1874              dataMap.streetViewControl = obj.streetViewControl;
1875            if (
1876              typeof obj.draggable != "undefined" &&
1877              typeof obj.draggable == "boolean"
1878            )
1879              dataMap.draggable = obj.draggable;
1880            if (
1881              typeof obj.overviewMapControl != "undefined" &&
1882              typeof obj.overviewMapControl == "boolean"
1883            )
1884              dataMap.overviewMapControl = obj.overviewMapControl;
1885
1886            if (typeof obj.styles != "undefined") dataMap.styles = obj.styles;
1887            else if (typeof obj.style != "undefined") {
1888              dataMap.style = {};
1889              if (typeof obj.style.hue != "undefined")
1890                dataMap.style.hue = obj.style.hue;
1891              if (typeof obj.style.gamma != "undefined")
1892                dataMap.style.gamma = obj.style.gamma;
1893              if (typeof obj.style.lightness != "undefined")
1894                dataMap.style.lightness = obj.style.lightness;
1895              if (typeof obj.style.saturation != "undefined")
1896                dataMap.style.saturation = obj.style.saturation;
1897            }
1898
1899            if (typeof obj.name != "undefined" && obj.name != "")
1900              dataMap.name = obj.name;
1901            if (typeof obj.desc != "undefined" && obj.desc != "")
1902              dataMap.desc = obj.desc;
1903            if (typeof obj.tel != "undefined" && obj.tel != "")
1904              dataMap.tel = obj.tel;
1905            if (typeof obj.email != "undefined" && obj.email != "")
1906              dataMap.email = obj.email;
1907            if (typeof obj.url != "undefined" && obj.url != "")
1908              dataMap.url = obj.url;
1909            if (typeof obj.logo != "undefined" && obj.logo != "")
1910              dataMap.logo = obj.logo;
1911            if (typeof obj.sizeWidth != "undefined" && obj.sizeWidth != "")
1912              dataMap.sizeWidth = obj.sizeWidth;
1913            if (typeof obj.sizeHeight != "undefined" && obj.sizeHeight != "")
1914              dataMap.sizeHeight = obj.sizeHeight;
1915            if (typeof obj.scaleWidth != "undefined" && obj.scaleWidth != "")
1916              dataMap.scaleWidth = obj.scaleWidth;
1917            if (typeof obj.scaleHeight != "undefined" && obj.scaleHeight != "")
1918              dataMap.scaleHeight = obj.scaleHeight;
1919            if (typeof obj.originX != "undefined" && obj.originX != "")
1920              dataMap.originX = obj.originX;
1921            if (typeof obj.originY != "undefined" && obj.originY != "")
1922              dataMap.originY = obj.originY;
1923            if (typeof obj.anchorX != "undefined" && obj.anchorX != "")
1924              dataMap.anchorX = obj.anchorX;
1925            if (typeof obj.anchorY != "undefined" && obj.anchorY != "")
1926              dataMap.anchorY = obj.anchorY;
1927            if (typeof obj.optimized != "undefined" && obj.optimized != "")
1928              dataMap.optimized = obj.optimized;
1929            // END: override configs
1930
1931            if (typeof obj.clickable != "undefined" && obj.clickable != "")
1932              dataMap.clickable = obj.clickable;
1933            if (typeof obj.html != "undefined" && obj.html != "")
1934              dataMap.html = obj.html;
1935            if (
1936              typeof obj.hover != "undefined" &&
1937              typeof obj.hover == "boolean"
1938            )
1939              dataMap.hover = obj.hover;
1940            if (
1941              typeof obj.multi != "undefined" &&
1942              Object.keys(obj.multi).length > 0
1943            )
1944              dataMap.multi = obj.multi;
1945
1946            dataMap.mapDiv = obj.mapDiv;
1947            dataMap.latitude = obj.latitude;
1948            dataMap.longitude = obj.longitude;
1949
1950            if (typeof obj.center != "undefined") {
1951              dataMap.center = {};
1952              if (typeof obj.center.latitude != "undefined")
1953                dataMap.center.latitude = obj.center.latitude;
1954              if (typeof obj.center.longitude != "undefined")
1955                dataMap.center.longitude = obj.center.longitude;
1956            } else {
1957              dataMap.center = {
1958                latitude: obj.latitude,
1959                longitude: obj.longitude,
1960              };
1961            }
1962
1963            loadMap(dataMap);
1964          }
1965        } else {
1966          // single map
1967          if (typeof data.center != "undefined") {
1968            dataMap.center = {};
1969            if (typeof data.center.latitude != "undefined")
1970              dataMap.center.latitude = data.center.latitude;
1971            if (typeof data.center.longitude != "undefined")
1972              dataMap.center.longitude = data.center.longitude;
1973          } else {
1974            dataMap.center = {
1975              latitude: data.latitude,
1976              longitude: data.longitude,
1977            };
1978          }
1979
1980          loadMap(dataMap);
1981        }
1982
1983        return dataMap;
1984      }
1985
1986      function loadMap(data) {
1987        var elm = data.mapDiv;
1988
1989        elm = elm.substring(0, 1) == "#" ? elm.substring(1) : elm; // remove hash
1990
1991        var mapElement = document.getElementById(elm),
1992          styleOptions = [],
1993          mapOptions = {
1994            center: new google.maps.LatLng(
1995              data.center.latitude,
1996              data.center.longitude
1997            ),
1998            zoom: data.zoom,
1999            minZoom: data.minZoom,
2000            zoomControl: data.zoomControl,
2001            zoomControlOptions: {
2002              style: google.maps.ZoomControlStyle.DEFAULT,
2003            },
2004            disableDoubleClickZoom: data.disableDoubleClickZoom,
2005            scaleControl: data.scaleControl,
2006            scrollwheel: data.scrollwheel,
2007            panControl: data.panControl,
2008            streetViewControl: data.streetViewControl,
2009            draggable: data.draggable,
2010            mapTypeControl: data.mapTypeControl,
2011            mapTypeControlOptions: {
2012              style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
2013            },
2014            mapTypeId: google.maps.MapTypeId.ROADMAP,
2015            overviewMapControl: data.overviewMapControl,
2016            overviewMapControlOptions: {
2017              opened: false,
2018            },
2019          },
2020          googleMap = new google.maps.Map(mapElement, mapOptions);
2021
2022        if (data.multi === false) {
2023          var arr = {};
2024
2025          if (typeof data["name"] != "undefined") arr["name"] = data["name"];
2026          if (typeof data["desc"] != "undefined") arr["desc"] = data["desc"];
2027          if (typeof data["tel"] != "undefined") arr["tel"] = data["tel"];
2028          if (typeof data["email"] != "undefined") arr["email"] = data["email"];
2029          if (typeof data["url"] != "undefined") arr["url"] = data["url"];
2030          if (typeof data["logo"] != "undefined") arr["logo"] = data["logo"];
2031          if (typeof data["sizeWidth"] != "undefined")
2032            arr["sizeWidth"] = data["sizeWidth"];
2033          if (typeof data["sizeHeight"] != "undefined")
2034            arr["sizeHeight"] = data["sizeHeight"];
2035          if (typeof data["scaleWidth"] != "undefined")
2036            arr["scaleWidth"] = data["scaleWidth"];
2037          if (typeof data["scaleHeight"] != "undefined")
2038            arr["scaleHeight"] = data["scaleHeight"];
2039          if (typeof data["originX"] != "undefined")
2040            arr["originX"] = data["originX"];
2041          if (typeof data["originY"] != "undefined")
2042            arr["originY"] = data["originY"];
2043          if (typeof data["anchorX"] != "undefined")
2044            arr["anchorX"] = data["anchorX"];
2045          if (typeof data["anchorY"] != "undefined")
2046            arr["anchorY"] = data["anchorY"];
2047          if (typeof data["optimized"] != "undefined")
2048            arr["optimized"] = data["optimized"];
2049          if (typeof data["clickable"] != "undefined")
2050            arr["clickable"] = data["clickable"];
2051          if (typeof data["html"] != "undefined") arr["html"] = data["html"];
2052          if (typeof data["hover"] != "undefined") arr["hover"] = data["hover"];
2053
2054          arr["longitude"] = data["longitude"];
2055          arr["latitude"] = data["latitude"];
2056
2057          setMaps(arr, googleMap, data.center);
2058        } else {
2059          for (i = 0; i < Object.keys(data.multi).length; i++) {
2060            var arr = data.multi[i];
2061
2062            if (typeof data["clickable"] != "undefined")
2063              arr["clickable"] = data.clickable;
2064            if (typeof data["html"] != "undefined") arr["html"] = data.html;
2065            if (typeof data["hover"] != "undefined") arr["hover"] = data.hover;
2066
2067            if (typeof arr["size"] != "undefined") {
2068              if (typeof arr["size"]["width"] != "undefined")
2069                arr["sizeWidth"] = arr["size"]["width"];
2070              if (typeof arr["size"]["height"] != "undefined")
2071                arr["sizeHeight"] = arr["size"]["height"];
2072
2073              delete arr["size"];
2074            }
2075            if (typeof arr["scale"] != "undefined") {
2076              if (typeof arr["scale"]["width"] != "undefined")
2077                arr["scaleWidth"] = arr["scale"]["width"];
2078              if (typeof arr["scale"]["height"] != "undefined")
2079                arr["scaleHeight"] = arr["scale"]["height"];
2080
2081              delete arr["scale"];
2082            }
2083            if (typeof arr["origin"] != "undefined") {
2084              if (typeof arr["origin"]["x"] != "undefined")
2085                arr["originX"] = arr["origin"]["x"];
2086              if (typeof arr["origin"]["y"] != "undefined")
2087                arr["originY"] = arr["origin"]["y"];
2088
2089              delete arr["origin"];
2090            }
2091            if (typeof arr["anchor"] != "undefined") {
2092              if (typeof arr["anchor"]["x"] != "undefined")
2093                arr["anchorX"] = arr["anchor"]["x"];
2094              if (typeof arr["anchor"]["y"] != "undefined")
2095                arr["anchorY"] = arr["anchor"]["y"];
2096
2097              delete arr["anchor"];
2098            }
2099            if (typeof arr["optimized"] != "undefined")
2100              arr["optimized"] = arr["optimized"];
2101            setMaps(arr, googleMap, data.center);
2102          }
2103        }
2104
2105        // stylers
2106        if (data.styles !== false) styleOptions = data.styles;
2107        else if (data.style !== false) {
2108          if (
2109            typeof data.style.hue != "undefined" ||
2110            typeof data.style.gamma != "undefined" ||
2111            typeof data.style.lightness != "undefined" ||
2112            typeof data.style.saturation != "undefined"
2113          ) {
2114            if (typeof styleOptions[0] == "undefined") styleOptions[0] = {};
2115            if (typeof styleOptions[0].stylers == "undefined")
2116              styleOptions[0].stylers = [];
2117          }
2118
2119          if (typeof data.style.hue != "undefined") {
2120            styleOptions[0].stylers.push({
2121              hue: data.style.hue,
2122            });
2123          }
2124          if (typeof data.style.gamma != "undefined") {
2125            styleOptions[0].stylers.push({
2126              gamma: data.style.gamma,
2127            });
2128          }
2129          if (typeof data.style.lightness != "undefined") {
2130            styleOptions[0].stylers.push({
2131              lightness: data.style.lightness,
2132            });
2133          }
2134          if (typeof data.style.saturation != "undefined") {
2135            styleOptions[0].stylers.push({
2136              saturation: data.style.saturation,
2137            });
2138          }
2139        }
2140
2141        var styledMapOptions = {
2142            name: "MAP",
2143          },
2144          sampleType = new google.maps.StyledMapType(
2145            styleOptions,
2146            styledMapOptions
2147          );
2148
2149        googleMap.mapTypes.set("sample", sampleType);
2150        googleMap.setMapTypeId("sample");
2151
2152        // force reset
2153        googleMap.setZoom(data.zoom);
2154        googleMap.setCenter(
2155          new google.maps.LatLng(data.center.latitude, data.center.longitude)
2156        );
2157      }
2158      function setMaps(obj, map, center) {
2159        var options = {};
2160
2161        if (obj["html"] !== false) {
2162          if (typeof obj["name"] != "undefined") options["title"] = obj["name"];
2163          if (typeof obj["desc"] != "undefined") options["desc"] = obj["desc"];
2164          if (typeof obj["tel"] != "undefined") options["tel"] = obj["tel"];
2165          if (typeof obj["email"] != "undefined")
2166            options["email"] = obj["email"];
2167          if (typeof obj["url"] != "undefined") options["web"] = obj["url"];
2168        }
2169
2170        if (typeof obj["logo"] != "undefined") {
2171          var optIcon = {};
2172
2173          optIcon["url"] = obj["logo"];
2174
2175          if (
2176            typeof obj["sizeWidth"] != "undefined" &&
2177            typeof obj["sizeHeight"] != "undefined" &&
2178            Number.isInteger(obj["sizeWidth"]) &&
2179            Number.isInteger(obj["sizeHeight"])
2180          )
2181            optIcon["size"] = new google.maps.Size(
2182              obj["sizeWidth"],
2183              obj["sizeHeight"]
2184            );
2185
2186          if (
2187            typeof obj["scaleWidth"] != "undefined" &&
2188            typeof obj["scaleHeight"] != "undefined" &&
2189            Number.isInteger(obj["scaleWidth"]) &&
2190            Number.isInteger(obj["scaleHeight"])
2191          )
2192            optIcon["scaledSize"] = new google.maps.Size(
2193              obj["scaleWidth"],
2194              obj["scaleHeight"]
2195            );
2196
2197          if (
2198            typeof obj["originX"] != "undefined" &&
2199            typeof obj["originY"] != "undefined" &&
2200            Number.isInteger(obj["originX"]) &&
2201            Number.isInteger(obj["originY"])
2202          )
2203            optIcon["origin"] = new google.maps.Point(
2204              obj["originX"],
2205              obj["originY"]
2206            );
2207
2208          if (
2209            typeof obj["anchorX"] != "undefined" &&
2210            typeof obj["anchorY"] != "undefined" &&
2211            Number.isInteger(obj["anchorX"]) &&
2212            Number.isInteger(obj["anchorY"])
2213          )
2214            optIcon["anchor"] = new google.maps.Point(
2215              obj["anchorX"],
2216              obj["anchorY"]
2217            );
2218
2219          if (typeof obj["optimized"] != "undefined")
2220            optIcon["optimized"] = obj["optimized"];
2221
2222          if (
2223            typeof optIcon["size"] != "undefined" &&
2224            typeof optIcon["origin"] != "undefined" &&
2225            typeof optIcon["anchor"] != "undefined"
2226          )
2227            options["icon"] = optIcon;
2228          else
2229            options["icon"] = obj["logo"]
2230              ? new google.maps.MarkerImage(obj["logo"])
2231              : null;
2232        }
2233
2234        options["position"] = new google.maps.LatLng(
2235          obj["latitude"],
2236          obj["longitude"]
2237        );
2238        options["map"] = map;
2239
2240        var marker = new google.maps.Marker(options);
2241
2242        if (obj["html"] !== false) {
2243          var dialog = new google.maps.InfoWindow(),
2244            infoWindowVisible = (function () {
2245              var currentlyVisible = false;
2246              return function (visible) {
2247                if (visible !== undefined) currentlyVisible = visible;
2248                return currentlyVisible;
2249              };
2250            })(),
2251            dialogShow = (function () {
2252              return function () {
2253                if (infoWindowVisible()) {
2254                  dialog.close();
2255                  infoWindowVisible(false);
2256                } else {
2257                  var tpl = {};
2258                  tpl["name"] =
2259                    typeof obj["name"] != "undefined" ? obj["name"] : "";
2260                  tpl["desc"] =
2261                    typeof obj["desc"] != "undefined" ? obj["desc"] : "";
2262                  tpl["tel"] =
2263                    typeof obj["tel"] != "undefined" ? obj["tel"] : "";
2264                  tpl["email"] =
2265                    typeof obj["email"] != "undefined" ? obj["email"] : "";
2266                  tpl["url"] =
2267                    typeof obj["url"] != "undefined" ? obj["url"] : "";
2268
2269                  var html = obj["html"]
2270                    .replace(/{name}/gi, tpl["name"])
2271                    .replace(/{title}/gi, tpl["name"])
2272
2273                    .replace(/{txt}/gi, tpl["desc"])
2274                    .replace(/{text}/gi, tpl["desc"])
2275                    .replace(/{desc}/gi, tpl["desc"])
2276                    .replace(/{description}/gi, tpl["desc"])
2277
2278                    .replace(/{tel}/gi, tpl["tel"])
2279                    .replace(/{telephone}/gi, tpl["tel"])
2280                    .replace(/{phone}/gi, tpl["tel"])
2281                    .replace(/{moible}/gi, tpl["tel"])
2282
2283                    .replace(/{mail}/gi, tpl["email"])
2284                    .replace(/{email}/gi, tpl["email"])
2285
2286                    .replace(/{url}/gi, tpl["url"])
2287                    .replace(/{web}/gi, tpl["url"])
2288                    .replace(/{website}/gi, tpl["url"]);
2289
2290                  dialog = new google.maps.InfoWindow({
2291                    content: html,
2292                  });
2293                  dialog.open(map, marker);
2294                  infoWindowVisible(true);
2295                }
2296              };
2297            })();
2298
2299          // events
2300          google.maps.event.addListener(marker, "click", function () {
2301            if (
2302              obj["clickable"] == "link" &&
2303              typeof obj["url"] != "undefined" &&
2304              obj["url"] != ""
2305            ) {
2306              if (!isExternal(obj["url"]) && $(obj["url"]).length) {
2307                $("html, body")
2308                  .stop()
2309                  .animate(
2310                    {
2311                      scrollTop: $(obj["url"]).offset().top,
2312                    },
2313                    500
2314                  );
2315              } else window.open(obj["url"], "_parent");
2316            } else if (obj["clickable"] == "popup" && isHTML(obj.html)) dialogShow();
2317          });
2318          google.maps.event.addListener(dialog, "closeclick", function () {
2319            infoWindowVisible(false);
2320          });
2321
2322          if (obj["hover"] === true && obj["clickable"] == "link") {
2323            google.maps.event.addListener(marker, "mouseover", function () {
2324              dialogShow();
2325            });
2326            google.maps.event.addListener(marker, "mouseout", function () {
2327              dialog.close();
2328              infoWindowVisible(false);
2329            });
2330          }
2331        }
2332
2333        /*
2334				window.onresize = function(event) {
2335					google.maps.event.trigger(map, "resize");
2336					map.setCenter(new google.maps.LatLng(center.latitude, center.longitude));
2337				};
2338				*/
2339
2340        // always center
2341        google.maps.event.addDomListener(window, "resize", function () {
2342          var center = map.getCenter();
2343          google.maps.event.trigger(map, "resize");
2344          // map.setCenter(new google.maps.LatLng(center.latitude, center.longitude));
2345          map.setCenter(center);
2346        });
2347
2348        google.maps.event.addListenerOnce(map, "idle", function () {
2349          google.maps.event.trigger(map, "resize");
2350          map.setCenter(
2351            new google.maps.LatLng(center.latitude, center.longitude)
2352          );
2353        });
2354
2355        // google.maps.event.trigger(map, "resize"); // onload
2356
2357        $(window).resize(function () {
2358          google.maps.event.trigger(map, "resize");
2359        });
2360      }
2361    }
2362    google.maps.event.addDomListener(window, "load", init);
2363  }
2364  // END: gmap
2365
2366  // BEGIN: rollover button
2367  $("body").on(
2368    {
2369      mouseover: function () {
2370        if (!$(this).data("src-original"))
2371          $(this).data("src-original", $(this).attr("src"));
2372
2373        $(this)
2374          .attr("src")
2375          .match(/^(.*)(\.{1}.*)/g);
2376
2377        var $src = RegExp.$1 + "_on" + RegExp.$2;
2378
2379        $(this).attr("src", $src); // update src
2380      },
2381      mouseout: function () {
2382        if ($(this).hasClass("copy-change")) {
2383          var _src_ = $(this).attr("src");
2384
2385          _src_ = _src_.replace(/^(.*?)_on\.(.*)$/, "$1.$2");
2386
2387          $(this)
2388            .attr("src", _src_) // update src
2389            .removeClass("copy-change");
2390        } else if ($(this).data("src-original"))
2391          $(this).attr("src", $(this).data("src-original")); // update src
2392
2393        $(this).removeData("src-original");
2394      },
2395    },
2396    "img.btn"
2397  );
2398  // END: rollover button
2399
2400  // BEGIN: smooth scroll
2401  $("body").on("click", "a[href*='#']:not([href='#'])", function (e) {
2402    // .nav-fixed: elm sẽ cố định
2403    // .nav-target: tọa độ sẽ tính
2404    // .nav-pin: elm sẽ gắn .fixed
2405    if (
2406      location.pathname.replace(/^\//, "") ==
2407        this.pathname.replace(/^\//, "") &&
2408      location.hostname == this.hostname &&
2409      !$(this).hasClass("unsmooth")
2410    ) {
2411      var ptnHash = /([;
2411?%&,+*~\':"!^$[\]()=>|\/@])/g,
2412        hash = this.hash.replace(ptnHash, "\\$1"),
2413        $anchor = $(hash);
2414
2415      $anchor =
2416        $anchor.length > 0 ? $anchor : $("[name=" + hash.slice(1) + "]");
2417
2418      if ($anchor.length) {
2419        e.preventDefault();
2420
2421        if ($anchor.parents(".tab-content").first().length > 0)
2422          $anchor = $anchor.parents(".tab-content").first();
2423
2424        var $offsetY = $anchor.offset().top,
2425          $navOffset = 0;
2426
2427        if ($(".nav-fixed").length)
2428          $navOffset =
2429            typeof $(".nav-fixed").attr("data-height") != "undefined"
2430              ? parseInt($(".nav-fixed").attr("data-height"))
2431              : $(".nav-fixed").outerHeight();
2432
2433        if ($(".tabs-switch").length) {
2434          $(".tabs-switch").each(function () {
2435            var $tabsSwitch = $(this),
2436              $tabLink = $tabsSwitch.children(".tab-link");
2437
2438            if ($tabLink.children("[data-tab-anchor='" + hash + "']").length)
2439              $tabLink.children("[data-tab-anchor='" + hash + "']").click(); // trigger for set active tab
2440          });
2441        }
2442
2443        if ($(".nav-target").length) {
2444          // $("html, body").stop().animate({
2445          // scrollTop: $(".nav-target").offset().top + 10
2446          // }, 100, function() {
2447          if ($(".nav-fixed").length)
2448            $navOffset =
2449              typeof $(".nav-fixed").attr("data-height") != "undefined"
2450                ? parseInt($(".nav-fixed").attr("data-height"))
2451                : $(".nav-fixed").outerHeight();
2452
2453          $("html, body")
2454            .stop()
2455            .animate(
2456              {
2457                scrollTop: $offsetY - $navOffset,
2458              },
2459              500
2460            );
2461          // });
2462        } else {
2463          $("html, body")
2464            .stop()
2465            .animate(
2466              {
2467                scrollTop: $offsetY - $navOffset,
2468              },
2469              500
2470            );
2471        }
2472
2473        // window.location.hash = hash; // update location
2474
2475        return false;
2476      }
2477    }
2478  });
2479  // END: smooth scroll
2480
2481  // BEGIN: scroll to top
2482  if ($(window).scrollTop() > 0) $("#pagetop").addClass("visible");
2483  else $("#pagetop").removeClass("visible");
2484
2485  $("body").on("click", "#pagetop", function () {
2486    if (!$(this).hasClass("in-scroll")) {
2487      $(this).addClass("in-scroll");
2488
2489      var $scrollDuration =
2490        $.inArray($(this).attr("data-duration"), ["slow", "normal", "fast"]) >=
2491          0 || parseInt($(this).attr("data-duration")) > 0
2492          ? $(this).attr("data-duration")
2493          : "slow";
2494
2495      $("html, body")
2496        .stop()
2497        .animate(
2498          {
2499            scrollTop: 0,
2500          },
2501          $scrollDuration,
2502          function () {
2503            $("#pagetop").removeClass("in-scroll");
2504          }
2505        );
2506    }
2507  });
2508  // END: scroll to top
2509
2510  // BEGIN: text vertical
2511  $(".txt-vertical").each(function () {
2512    if (!$(this).hasClass("all-str")) {
2513      var $regex = /(\d{1,2})/g;
2514
2515      if ($(this).hasClass("per-line")) $regex = /(\d)/g;
2516
2517      $(this).html(function (idx, val) {
2518        return val.replace($regex, '<span class="int">$1</span>');
2519      });
2520    }
2521
2522    if ($(this).children(".txt-normal").length) {
2523      $(this)
2524        .children(".txt-normal")
2525        .html(function (idx, val) {
2526          var $characters = $.trim(val).split("");
2527          return (
2528            '<span class="int">' +
2529            $characters.join('</span><span class="int">') +
2530            "</span>"
2531          );
2532        });
2533    }
2534  });
2535  $(".txt-vertical-x").each(function () {
2536    $(this).html($(this).text().replace(/(.)/g, "<span>$1</span>"));
2537  });
2538  // END: text vertical
2539
2540  // BEGIN: social button
2541  var __socialsHTML__ = "",
2542    __socialsLang =
2543      $("html").attr("lang") !== undefined &&
2544      $.trim($("html").attr("lang")).length == 2
2545        ? $.trim($("html").attr("lang")).toLowerCase()
2546        : "ja",
2547    $socialsLine = "",
2548    $socialsTwitter = "",
2549    $socialsFacebook = "",
2550    $socialsGooglePlus = "",
2551    locationURL = window.location.href || location.href;
2552
2553  $socialsTwitter += '<div class="social-twitter">';
2554  $socialsTwitter +=
2555    '<a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>';
2556  $socialsTwitter +=
2557    '<script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>';
2558  $socialsTwitter += "</div>";
2559
2560  $socialsFacebook += '<div class="social-facebook">';
2561  $socialsFacebook +=
2562    '<div class="fb-like" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false"></div>';
2563  $socialsFacebook += "</div>";
2564
2565  $socialsGooglePlus += '<div class="social-google">';
2566  $socialsGooglePlus += '<div class="g-plusone" data-size="medium"></div>';
2567  $socialsGooglePlus += "</div>";
2568
2569  $socialsLine += '<div class="social-line">';
2570  $socialsLine +=
2571    '<div class="line-it-button" data-lang="' +
2572    __socialsLang +
2573    '" data-type="like" data-url="' +
2574    locationURL +
2575    '" data-share="true" style="display: none;">';
2576  $socialsLine +=
2577    '<script src="https://d.line-scdn.net/r/web/social-plugin/js/thirdparty/loader.min.js" async="async" defer="defer"></script>';
2578  $socialsLine += "</div>";
2579  $socialsLine += "</div>";
2580
2581  if ($("#socialbuttons").length) {
2582    var $socialsOrder =
2583      typeof $("#socialbuttons").attr("data") != "undefined"
2584        ? $("#socialbuttons").attr("data").split("")
2585        : false;
2586
2587    if (typeof $socialsOrder == "object" && $socialsOrder.length) {
2588      for (var socialsType in $socialsOrder) {
2589        if ($.trim(socialsType).length > 0) {
2590          socialsType = socialsType.toLowerCase();
2591
2592          if ($socialsOrder[socialsType].toLocaleLowerCase() === "f")
2593            __socialsHTML__ += $socialsFacebook;
2594          else if ($socialsOrder[socialsType].toLocaleLowerCase() === "t")
2595            __socialsHTML__ += $socialsTwitter;
2596          else if ($socialsOrder[socialsType].toLocaleLowerCase() === "g")
2597            __socialsHTML__ += $socialsGooglePlus;
2598          else if ($socialsOrder[socialsType].toLocaleLowerCase() === "l")
2599            __socialsHTML__ += $socialsLine;
2600        }
2601      }
2602    } else {
2603      __socialsHTML__ += $socialsTwitter;
2604      __socialsHTML__ += $socialsFacebook;
2605      __socialsHTML__ += $socialsGooglePlus;
2606      __socialsHTML__ += $socialsLine;
2607    }
2608
2609    $("#socialbuttons").html(__socialsHTML__);
2610  }
2611  // END: social button
2612
2613  /* fix smoothscroll on IE - jumpy fixed background */
2614  if (
2615    navigator.userAgent.match(/MSIE 10/i) ||
2616    navigator.userAgent.match(/Trident\/7\./) ||
2617    navigator.userAgent.match(/Edge\/12\./)
2618  ) {
2619    $("body.ie-smoothscroll").on("mousewheel", function (e) {
2620      if (event.preventDefault) event.preventDefault();
2621      else event.returnValue = false;
2622
2623      var delta = null,
2624        offsetX =
2625          window.scrollX ||
2626          window.pageXOffset ||
2627          window.document.documentElement.scrollLeft,
2628        offsetY =
2629          window.scrollY ||
2630          window.pageYOffset ||
2631          window.document.documentElement.scrollTop;
2632
2633      if (e.wheelDelta) delta = e.wheelDelta;
2634      else if (e.originalEvent) {
2635        if (e.originalEvent.wheelDelta) delta = e.originalEvent.wheelDelta;
2636        else if (e.originalEvent.deltaY) delta = 0 - e.originalEvent.deltaY;
2637        else if (e.originalEvent.detail) delta = e.originalEvent.detail * -40;
2638      } else if (event.originalEvent) {
2639        if (event.originalEvent.wheelDelta)
2640          delta = event.originalEvent.wheelDelta;
2641        else if (event.originalEvent.deltaY)
2642          delta = 0 - event.originalEvent.deltaY;
2643        else if (event.originalEvent.detail)
2644          delta = event.originalEvent.detail * -40;
2645      }
2646
2647      if (delta !== null) window.scrollTo(0, offsetY - delta);
2648    });
2649  }
2650
2651  // scrollBefore(); // smoothscroll before page loaded
2652
2653  $("body").on(
2654    {
2655      mouseup: function () {
2656        // $("html").addClass("break-jump");
2657        $(this).removeClass("scrollable");
2658      },
2659      mousedown: function () {
2660        // $("html").addClass("break-jump");
2661        $(this).addClass("scrollable");
2662      },
2663      mouseleave: function () {
2664        // $("html").addClass("break-jump");
2665        $(this).removeClass("scrollable");
2666      },
2667    },
2668    ".gmap"
2669  );
2670
2671  // BEGIN: .pagination
2672  $(".pagination").each(function () {
2673    initPager($(this));
2674  });
2675
2676  $(".pagination")
2677    .on("click", ".page-link .page-first", function () {
2678      var $pagination = $(this).parents(".pagination").first(),
2679        $pageContent = $pagination.children(".page-content"),
2680        $pageLink = $pagination.children(".page-link"),
2681        mode =
2682          $pagination.attr("data-mode") !== "undefined" &&
2683          $.inArray($pagination.attr("data-mode"), [
2684            "fade",
2685            "slide",
2686            "block",
2687          ]) >= 0
2688            ? $pagination.attr("data-mode")
2689            : "block",
2690        duration =
2691          typeof $pagination.attr("data-duration") !== "undefined" &&
2692          $pagination.attr("data-duration").length > 0
2693            ? parseInt($pagination.attr("data-duration"), 10)
2694            : mode == "block"
2695            ? 0
2696            : 300,
2697        scrollable =
2698          typeof $pagination.attr("data-scroll") !== "undefined" &&
2699          $.inArray($pagination.attr("data-scroll"), [
2700            "true",
2701            "on",
2702            "enable",
2703            "enabled",
2704            "1",
2705          ]) >= 0
2706            ? true
2707            : false,
2708        navOffset = 0;
2709
2710      if (!$pagination.hasClass("clicked")) {
2711        $pagination.addClass("clicked");
2712
2713        if ($(".nav-fixed").length > 0)
2714          navOffset =
2715            typeof $(".nav-fixed").attr("data-height") != "undefined"
2716              ? parseInt($(".nav-fixed").attr("data-height"))
2717              : $(".nav-fixed").outerHeight();
2718
2719        if (mode == "fade") {
2720          if ($pageContent.children().length > 1) {
2721            $pageContent
2722              .children()
2723              .stop()
2724              .fadeOut(duration, function () {
2725                $(this).removeAttr("style").removeClass("active");
2726              })
2727              .siblings()
2728              .first()
2729              .stop()
2730              .delay(duration)
2731              .fadeIn(duration, function () {
2732                $(this).removeAttr("style").addClass("active");
2733
2734                if (scrollable) {
2735                  $("body, html")
2736                    .stop()
2737                    .animate(
2738                      {
2739                        scrollTop: $pagination.offset().top - navOffset,
2740                      },
2741                      300
2742                    );
2743                }
2744
2745                $pagination.removeClass("clicked");
2746              });
2747          } else {
2748            $pageContent
2749              .children()
2750              .first()
2751              .stop()
2752              .fadeIn(duration, function () {
2753                $(this).removeAttr("style").addClass("active");
2754
2755                if (scrollable) {
2756                  $("body, html")
2757                    .stop()
2758                    .animate(
2759                      {
2760                        scrollTop: $pagination.offset().top - navOffset,
2761                      },
2762                      300
2763                    );
2764                }
2765
2766                $pagination.removeClass("clicked");
2767              });
2768          }
2769        } else if (mode == "slide") {
2770          if ($pageContent.children().length > 1) {
2771            $pageContent
2772              .children()
2773              .stop()
2774              .slideUp(duration, function () {
2775                $(this).removeAttr("style").removeClass("active");
2776              })
2777              .siblings()
2778              .first()
2779              .stop()
2780              .delay(duration)
2781              .slideDown(duration, function () {
2782                $(this).removeAttr("style").addClass("active");
2783
2784                if (scrollable) {
2785                  $("body, html")
2786                    .stop()
2787                    .animate(
2788                      {
2789                        scrollTop: $pagination.offset().top - navOffset,
2790                      },
2791                      300
2792                    );
2793                }
2794
2795                $pagination.removeClass("clicked");
2796              });
2797          } else {
2798            $pageContent
2799              .children()
2800              .first()
2801              .stop()
2802              .slideDown(duration, function () {
2803                $(this).removeAttr("style").addClass("active");
2804
2805                if (scrollable) {
2806                  $("body, html")
2807                    .stop()
2808                    .animate(
2809                      {
2810                        scrollTop: $pagination.offset().top - navOffset,
2811                      },
2812                      300
2813                    );
2814                }
2815
2816                $pagination.removeClass("clicked");
2817              });
2818          }
2819        } else {
2820          if ($pageContent.children().length > 1) {
2821            $pageContent
2822              .children()
2823              .stop()
2824              .hide(duration, function () {
2825                $(this).removeAttr("style").removeClass("active");
2826              })
2827              .siblings()
2828              .first()
2829              .stop()
2830              .delay(duration)
2831              .show(duration, function () {
2832                $(this).removeAttr("style").addClass("active");
2833
2834                if (scrollable) {
2835                  $("body, html")
2836                    .stop()
2837                    .animate(
2838                      {
2839                        scrollTop: $pagination.offset().top - navOffset,
2840                      },
2841                      300
2842                    );
2843                }
2844
2845                $pagination.removeClass("clicked");
2846              });
2847          } else {
2848            $pageContent
2849              .children()
2850              .first()
2851              .stop()
2852              .show(duration, function () {
2853                $(this).removeAttr("style").addClass("active");
2854
2855                if (scrollable) {
2856                  $("body, html")
2857                    .stop()
2858                    .animate(
2859                      {
2860                        scrollTop: $pagination.offset().top - navOffset,
2861                      },
2862                      300
2863                    );
2864                }
2865
2866                $pagination.removeClass("clicked");
2867              });
2868          }
2869        }
2870
2871        $pageLink.find(".page-item.active").removeClass("active");
2872        $pageLink.each(function () {
2873          $(this).find(".page-item").first().addClass("active");
2874        });
2875      }
2876    })
2877    .on("click", ".page-link .page-last", function () {
2878      var $pagination = $(this).parents(".pagination").first(),
2879        $pageContent = $pagination.children(".page-content"),
2880        $pageLink = $pagination.children(".page-link"),
2881        mode =
2882          $pagination.attr("data-mode") !== "undefined" &&
2883          $.inArray($pagination.attr("data-mode"), [
2884            "fade",
2885            "slide",
2886            "block",
2887          ]) >= 0
2888            ? $pagination.attr("data-mode")
2889            : "block",
2890        duration =
2891          typeof $pagination.attr("data-duration") !== "undefined" &&
2892          $pagination.attr("data-duration").length > 0
2893            ? parseInt($pagination.attr("data-duration"), 10)
2894            : mode == "block"
2895            ? 0
2896            : 300,
2897        scrollable =
2898          typeof $pagination.attr("data-scroll") !== "undefined" &&
2899          $.inArray($pagination.attr("data-scroll"), [
2900            "true",
2901            "on",
2902            "enable",
2903            "enabled",
2904            "1",
2905          ]) >= 0
2906            ? true
2907            : false,
2908        navOffset = 0;
2909
2910      if (!$pagination.hasClass("clicked")) {
2911        $pagination.addClass("clicked");
2912
2913        if ($(".nav-fixed").length > 0)
2914          navOffset =
2915            typeof $(".nav-fixed").attr("data-height") != "undefined"
2916              ? parseInt($(".nav-fixed").attr("data-height"))
2917              : $(".nav-fixed").outerHeight();
2918
2919        if (mode == "fade") {
2920          if ($pageContent.children().length > 1) {
2921            $pageContent
2922              .children()
2923              .stop()
2924              .fadeOut(duration, function () {
2925                $(this).removeAttr("style").removeClass("active");
2926              })
2927              .siblings()
2928              .last()
2929              .stop()
2930              .delay(duration)
2931              .fadeIn(duration, function () {
2932                $(this).removeAttr("style").addClass("active");
2933
2934                if (scrollable) {
2935                  $("body, html")
2936                    .stop()
2937                    .animate(
2938                      {
2939                        scrollTop: $pagination.offset().top - navOffset,
2940                      },
2941                      300
2942                    );
2943                }
2944
2945                $pagination.removeClass("clicked");
2946              });
2947          } else {
2948            $pageContent
2949              .children()
2950              .last()
2951              .stop()
2952              .fadeIn(duration, function () {
2953                $(this).removeAttr("style").addClass("active");
2954
2955                if (scrollable) {
2956                  $("body, html")
2957                    .stop()
2958                    .animate(
2959                      {
2960                        scrollTop: $pagination.offset().top - navOffset,
2961                      },
2962                      300
2963                    );
2964                }
2965
2966                $pagination.removeClass("clicked");
2967              });
2968          }
2969        } else if (mode == "slide") {
2970          if ($pageContent.children().length > 1) {
2971            $pageContent
2972              .children()
2973              .stop()
2974              .slideUp(duration, function () {
2975                $(this).removeAttr("style").removeClass("active");
2976              })
2977              .siblings()
2978              .last()
2979              .stop()
2980              .delay(duration)
2981              .slideDown(duration, function () {
2982                $(this).removeAttr("style").addClass("active");
2983
2984                if (scrollable) {
2985                  $("body, html")
2986                    .stop()
2987                    .animate(
2988                      {
2989                        scrollTop: $pagination.offset().top - navOffset,
2990                      },
2991                      300
2992                    );
2993                }
2994
2995                $pagination.removeClass("clicked");
2996              });
2997          } else {
2998            $pageContent
2999              .children()
3000              .last()
3001              .stop()
3002              .slideDown(duration, function () {
3003                $(this).removeAttr("style").addClass("active");
3004
3005                if (scrollable) {
3006                  $("body, html")
3007                    .stop()
3008                    .animate(
3009                      {
3010                        scrollTop: $pagination.offset().top - navOffset,
3011                      },
3012                      300
3013                    );
3014                }
3015
3016                $pagination.removeClass("clicked");
3017              });
3018          }
3019        } else {
3020          if ($pageContent.children().length > 1) {
3021            $pageContent
3022              .children()
3023              .stop()
3024              .hide(duration, function () {
3025                $(this).removeAttr("style").removeClass("active");
3026              })
3027              .siblings()
3028              .last()
3029              .stop()
3030              .delay(duration)
3031              .show(duration, function () {
3032                $(this).removeAttr("style").addClass("active");
3033
3034                if (scrollable) {
3035                  $("body, html")
3036                    .stop()
3037                    .animate(
3038                      {
3039                        scrollTop: $pagination.offset().top - navOffset,
3040                      },
3041                      300
3042                    );
3043                }
3044
3045                $pagination.removeClass("clicked");
3046              });
3047          } else {
3048            $pageContent
3049              .children()
3050              .last()
3051              .stop()
3052              .show(duration, function () {
3053                $(this).removeAttr("style").addClass("active");
3054
3055                if (scrollable) {
3056                  $("body, html")
3057                    .stop()
3058                    .animate(
3059                      {
3060                        scrollTop: $pagination.offset().top - navOffset,
3061                      },
3062                      300
3063                    );
3064                }
3065
3066                $pagination.removeClass("clicked");
3067              });
3068          }
3069        }
3070
3071        $pageLink.find(".page-item.active").removeClass("active");
3072        $pageLink.each(function () {
3073          $(this).find(".page-item").last().addClass("active");
3074        });
3075      }
3076    })
3077    .on("click", ".page-link .page-next", function () {
3078      var $pagination = $(this).parents(".pagination").first(),
3079        navOffset = 0;
3080
3081      if (!$pagination.hasClass("clicked")) {
3082        $pagination.addClass("clicked");
3083
3084        if ($(".nav-fixed").length > 0)
3085          navOffset =
3086            typeof $(".nav-fixed").attr("data-height") != "undefined"
3087              ? parseInt($(".nav-fixed").attr("data-height"))
3088              : $(".nav-fixed").outerHeight();
3089
3090        var $pageContent = $pagination.children(".page-content"),
3091          $pageLink = $pagination.children(".page-link"),
3092          mode =
3093            $pagination.attr("data-mode") !== "undefined" &&
3094            $.inArray($pagination.attr("data-mode"), [
3095              "fade",
3096              "slide",
3097              "block",
3098            ]) >= 0
3099              ? $pagination.attr("data-mode")
3100              : "block",
3101          duration =
3102            typeof $pagination.attr("data-duration") !== "undefined" &&
3103            $pagination.attr("data-duration").length > 0
3104              ? parseInt($pagination.attr("data-duration"), 10)
3105              : mode == "block"
3106              ? 0
3107              : 300,
3108          scrollable =
3109            typeof $pagination.attr("data-scroll") !== "undefined" &&
3110            $.inArray($pagination.attr("data-scroll"), [
3111              "true",
3112              "on",
3113              "enable",
3114              "enabled",
3115              "1",
3116            ]) >= 0
3117              ? true
3118              : false,
3119          $pageCurrent = $pageLink.find(".page-item.active"),
3120          $pageClone = $pageLink.clone(),
3121          idx = 0;
3122
3123        $pageClone
3124          .find(
3125            ".page-first, .page-last, .page-next, .page-prev, .page-ellipse"
3126          )
3127          .remove();
3128
3129        idx = $pageClone.find(".page-item.active").index();
3130
3131        $pageLink.find(".page-item.active").removeClass("active");
3132
3133        if (
3134          $pageClone.find(".page-item.active").next(".page-item").length > 0
3135        ) {
3136          if (mode == "fade") {
3137            if ($pageContent.children().length > 1) {
3138              $pageContent
3139                .children()
3140                .stop()
3141                .fadeOut(duration, function () {
3142                  $(this).removeAttr("style").removeClass("active");
3143                })
3144                .siblings()
3145                .eq(idx + 1)
3146                .stop()
3147                .delay(duration)
3148                .fadeIn(duration, function () {
3149                  $(this).removeAttr("style").addClass("active");
3150
3151                  if (scrollable) {
3152                    $("body, html")
3153                      .stop()
3154                      .animate(
3155                        {
3156                          scrollTop: $pagination.offset().top - navOffset,
3157                        },
3158                        300
3159                      );
3160                  }
3161
3162                  $pagination.removeClass("clicked");
3163                });
3164            } else {
3165              $pageContent
3166                .children()
3167                .eq(idx + 1)
3168                .stop()
3169                .fadeIn(duration, function () {
3170                  $(this).removeAttr("style").addClass("active");
3171
3172                  if (scrollable) {
3173                    $("body, html")
3174                      .stop()
3175                      .animate(
3176                        {
3177                          scrollTop: $pagination.offset().top - navOffset,
3178                        },
3179                        300
3180                      );
3181                  }
3182
3183                  $pagination.removeClass("clicked");
3184                });
3185            }
3186          } else if (mode == "slide") {
3187            if ($pageContent.children().length > 1) {
3188              $pageContent
3189                .children()
3190                .stop()
3191                .slideUp(duration, function () {
3192                  $(this).removeAttr("style").removeClass("active");
3193                })
3194                .siblings()
3195                .eq(idx + 1)
3196                .stop()
3197                .delay(duration)
3198                .slideDown(duration, function () {
3199                  $(this).removeAttr("style").addClass("active");
3200
3201                  if (scrollable) {
3202                    $("body, html")
3203                      .stop()
3204                      .animate(
3205                        {
3206                          scrollTop: $pagination.offset().top - navOffset,
3207                        },
3208                        300
3209                      );
3210                  }
3211
3212                  $pagination.removeClass("clicked");
3213                });
3214            } else {
3215              $pageContent
3216                .children()
3217                .eq(idx + 1)
3218                .stop()
3219                .slideDown(duration, function () {
3220                  $(this).removeAttr("style").addClass("active");
3221
3222                  if (scrollable) {
3223                    $("body, html")
3224                      .stop()
3225                      .animate(
3226                        {
3227                          scrollTop: $pagination.offset().top - navOffset,
3228                        },
3229                        300
3230                      );
3231                  }
3232
3233                  $pagination.removeClass("clicked");
3234                });
3235            }
3236          } else {
3237            if ($pageContent.children().length > 1) {
3238              $pageContent
3239                .children()
3240                .stop()
3241                .hide(duration, function () {
3242                  $(this).removeAttr("style").removeClass("active");
3243                })
3244                .siblings()
3245                .eq(idx + 1)
3246                .stop()
3247                .delay(duration)
3248                .show(duration, function () {
3249                  $(this).removeAttr("style").addClass("active");
3250
3251                  if (scrollable) {
3252                    $("body, html")
3253                      .stop()
3254                      .animate(
3255                        {
3256                          scrollTop: $pagination.offset().top - navOffset,
3257                        },
3258                        300
3259                      );
3260                  }
3261
3262                  $pagination.removeClass("clicked");
3263                });
3264            } else {
3265              $pageContent
3266                .children()
3267                .eq(idx + 1)
3268                .stop()
3269                .show(duration, function () {
3270                  $(this).removeAttr("style").addClass("active");
3271
3272                  if (scrollable) {
3273                    $("body, html")
3274                      .stop()
3275                      .animate(
3276                        {
3277                          scrollTop: $pagination.offset().top - navOffset,
3278                        },
3279                        300
3280                      );
3281                  }
3282
3283                  $pagination.removeClass("clicked");
3284                });
3285            }
3286          }
3287
3288          $pageCurrent.next(".page-item").addClass("active");
3289        } else {
3290          if (mode == "fade") {
3291            if ($pageContent.children().length > 1) {
3292              $pageContent
3293                .children()
3294                .stop()
3295                .fadeOut(duration, function () {
3296                  $(this).removeAttr("style").removeClass("active");
3297                })
3298                .siblings()
3299                .first()
3300                .stop()
3301                .delay(duration)
3302                .fadeIn(duration, function () {
3303                  $(this).removeAttr("style").addClass("active");
3304
3305                  if (scrollable) {
3306                    $("body, html")
3307                      .stop()
3308                      .animate(
3309                        {
3310                          scrollTop: $pagination.offset().top - navOffset,
3311                        },
3312                        300
3313                      );
3314                  }
3315
3316                  $pagination.removeClass("clicked");
3317                });
3318            } else {
3319              $pageContent
3320                .children()
3321                .first()
3322                .stop()
3323                .fadeIn(duration, function () {
3324                  $(this).removeAttr("style").addClass("active");
3325
3326                  if (scrollable) {
3327                    $("body, html")
3328                      .stop()
3329                      .animate(
3330                        {
3331                          scrollTop: $pagination.offset().top - navOffset,
3332                        },
3333                        300
3334                      );
3335                  }
3336
3337                  $pagination.removeClass("clicked");
3338                });
3339            }
3340          } else if (mode == "slide") {
3341            if ($pageContent.children().length > 1) {
3342              $pageContent
3343                .children()
3344                .stop()
3345                .slideUp(duration, function () {
3346                  $(this).removeAttr("style").removeClass("active");
3347                })
3348                .siblings()
3349                .first()
3350                .stop()
3351                .delay(duration)
3352                .slideDown(duration, function () {
3353                  $(this).removeAttr("style").addClass("active");
3354
3355                  if (scrollable) {
3356                    $("body, html")
3357                      .stop()
3358                      .animate(
3359                        {
3360                          scrollTop: $pagination.offset().top - navOffset,
3361                        },
3362                        300
3363                      );
3364                  }
3365
3366                  $pagination.removeClass("clicked");
3367                });
3368            } else {
3369              $pageContent
3370                .children()
3371                .first()
3372                .stop()
3373                .slideDown(duration, function () {
3374                  $(this).removeAttr("style").addClass("active");
3375
3376                  if (scrollable) {
3377                    $("body, html")
3378                      .stop()
3379                      .animate(
3380                        {
3381                          scrollTop: $pagination.offset().top - navOffset,
3382                        },
3383                        300
3384                      );
3385                  }
3386
3387                  $pagination.removeClass("clicked");
3388                });
3389            }
3390          } else {
3391            if ($pageContent.children().length > 1) {
3392              $pageContent
3393                .children()
3394                .stop()
3395                .hide(duration, function () {
3396                  $(this).removeAttr("style").removeClass("active");
3397                })
3398                .siblings()
3399                .first()
3400                .stop()
3401                .delay(duration)
3402                .show(duration, function () {
3403                  $(this).removeAttr("style").addClass("active");
3404
3405                  if (scrollable) {
3406                    $("body, html")
3407                      .stop()
3408                      .animate(
3409                        {
3410                          scrollTop: $pagination.offset().top - navOffset,
3411                        },
3412                        300
3413                      );
3414                  }
3415
3416                  $pagination.removeClass("clicked");
3417                });
3418            } else {
3419              $pageContent
3420                .children()
3421                .first()
3422                .stop()
3423                .show(duration, function () {
3424                  $(this).removeAttr("style").addClass("active");
3425
3426                  if (scrollable) {
3427                    $("body, html")
3428                      .stop()
3429                      .animate(
3430                        {
3431                          scrollTop: $pagination.offset().top - navOffset,
3432                        },
3433                        300
3434                      );
3435                  }
3436
3437                  $pagination.removeClass("clicked");
3438                });
3439            }
3440          }
3441
3442          $pageLink.each(function () {
3443            $(this).find(".page-item").first().addClass("active");
3444          });
3445        }
3446      }
3447    })
3448    .on("click", ".page-link .page-prev", function () {
3449      var $pagination = $(this).parents(".pagination").first(),
3450        navOffset = 0;
3451
3452      if (!$pagination.hasClass("clicked")) {
3453        $pagination.addClass("clicked");
3454
3455        if ($(".nav-fixed").length > 0)
3456          navOffset =
3457            typeof $(".nav-fixed").attr("data-height") != "undefined"
3458              ? parseInt($(".nav-fixed").attr("data-height"))
3459              : $(".nav-fixed").outerHeight();
3460
3461        var $pageContent = $pagination.children(".page-content"),
3462          $pageLink = $pagination.children(".page-link"),
3463          mode =
3464            $pagination.attr("data-mode") !== "undefined" &&
3465            $.inArray($pagination.attr("data-mode"), [
3466              "fade",
3467              "slide",
3468              "block",
3469            ]) >= 0
3470              ? $pagination.attr("data-mode")
3471              : "block",
3472          duration =
3473            typeof $pagination.attr("data-duration") !== "undefined" &&
3474            $pagination.attr("data-duration").length > 0
3475              ? parseInt($pagination.attr("data-duration"), 10)
3476              : mode == "block"
3477              ? 0
3478              : 300,
3479          scrollable =
3480            typeof $pagination.attr("data-scroll") !== "undefined" &&
3481            $.inArray($pagination.attr("data-scroll"), [
3482              "true",
3483              "on",
3484              "enable",
3485              "enabled",
3486              "1",
3487            ]) >= 0
3488              ? true
3489              : false,
3490          $pageCurrent = $pageLink.find(".page-item.active"),
3491          $pageClone = $pageLink.clone(),
3492          idx = 0;
3493
3494        $pageClone
3495          .find(
3496            ".page-first, .page-last, .page-next, .page-prev, .page-ellipse"
3497          )
3498          .remove();
3499
3500        idx = $pageClone.find(".page-item.active").index();
3501
3502        $pageLink.find(".page-item.active").removeClass("active");
3503
3504        if (
3505          $pageClone.find(".page-item.active").prev(".page-item").length > 0
3506        ) {
3507          if (mode == "fade") {
3508            if ($pageContent.children().length > 1) {
3509              $pageContent
3510                .children()
3511                .stop()
3512                .fadeOut(duration, function () {
3513                  $(this).removeAttr("style").removeClass("active");
3514                })
3515                .siblings()
3516                .eq(idx - 1)
3517                .stop()
3518                .delay(duration)
3519                .fadeIn(duration, function () {
3520                  $(this).removeAttr("style").addClass("active");
3521
3522                  if (scrollable) {
3523                    $("body, html")
3524                      .stop()
3525                      .animate(
3526                        {
3527                          scrollTop: $pagination.offset().top - navOffset,
3528                        },
3529                        300
3530                      );
3531                  }
3532
3533                  $pagination.removeClass("clicked");
3534                });
3535            } else {
3536              $pageContent
3537                .children()
3538                .eq(idx - 1)
3539                .stop()
3540                .fadeIn(duration, function () {
3541                  $(this).removeAttr("style").addClass("active");
3542
3543                  if (scrollable) {
3544                    $("body, html")
3545                      .stop()
3546                      .animate(
3547                        {
3548                          scrollTop: $pagination.offset().top - navOffset,
3549                        },
3550                        300
3551                      );
3552                  }
3553
3554                  $pagination.removeClass("clicked");
3555                });
3556            }
3557          } else if (mode == "slide") {
3558            if ($pageContent.children().length > 1) {
3559              $pageContent
3560                .children()
3561                .stop()
3562                .slideUp(duration, function () {
3563                  $(this).removeAttr("style").removeClass("active");
3564                })
3565                .siblings()
3566                .eq(idx - 1)
3567                .stop()
3568                .delay(duration)
3569                .slideDown(duration, function () {
3570                  $(this).removeAttr("style").addClass("active");
3571
3572                  if (scrollable) {
3573                    $("body, html")
3574                      .stop()
3575                      .animate(
3576                        {
3577                          scrollTop: $pagination.offset().top - navOffset,
3578                        },
3579                        300
3580                      );
3581                  }
3582
3583                  $pagination.removeClass("clicked");
3584                });
3585            } else {
3586              $pageContent
3587                .children()
3588                .eq(idx - 1)
3589                .stop()
3590                .slideDown(duration, function () {
3591                  $(this).removeAttr("style").addClass("active");
3592
3593                  if (scrollable) {
3594                    $("body, html")
3595                      .stop()
3596                      .animate(
3597                        {
3598                          scrollTop: $pagination.offset().top - navOffset,
3599                        },
3600                        300
3601                      );
3602                  }
3603
3604                  $pagination.removeClass("clicked");
3605                });
3606            }
3607          } else {
3608            if ($pageContent.children().length > 1) {
3609              $pageContent
3610                .children()
3611                .stop()
3612                .hide(duration, function () {
3613                  $(this).removeAttr("style").removeClass("active");
3614                })
3615                .siblings()
3616                .eq(idx - 1)
3617                .stop()
3618                .delay(duration)
3619                .show(duration, function () {
3620                  $(this).removeAttr("style").addClass("active");
3621
3622                  if (scrollable) {
3623                    $("body, html")
3624                      .stop()
3625                      .animate(
3626                        {
3627                          scrollTop: $pagination.offset().top - navOffset,
3628                        },
3629                        300
3630                      );
3631                  }
3632
3633                  $pagination.removeClass("clicked");
3634                });
3635            } else {
3636              $pageContent
3637                .children()
3638                .eq(idx - 1)
3639                .stop()
3640                .show(duration, function () {
3641                  $(this).removeAttr("style").addClass("active");
3642
3643                  if (scrollable) {
3644                    $("body, html")
3645                      .stop()
3646                      .animate(
3647                        {
3648                          scrollTop: $pagination.offset().top - navOffset,
3649                        },
3650                        300
3651                      );
3652                  }
3653
3654                  $pagination.removeClass("clicked");
3655                });
3656            }
3657          }
3658
3659          $pageCurrent.prev(".page-item").addClass("active");
3660        } else {
3661          if (mode == "fade") {
3662            if ($pageContent.children().length > 1) {
3663              $pageContent
3664                .children()
3665                .stop()
3666                .fadeOut(duration, function () {
3667                  $(this).removeAttr("style").removeClass("active");
3668                })
3669                .siblings()
3670                .last()
3671                .stop()
3672                .delay(duration)
3673                .fadeIn(duration, function () {
3674                  $(this).removeAttr("style").addClass("active");
3675
3676                  if (scrollable) {
3677                    $("body, html")
3678                      .stop()
3679                      .animate(
3680                        {
3681                          scrollTop: $pagination.offset().top - navOffset,
3682                        },
3683                        300
3684                      );
3685                  }
3686
3687                  $pagination.removeClass("clicked");
3688                });
3689            } else {
3690              $pageContent
3691                .children()
3692                .last()
3693                .stop()
3694                .fadeIn(duration, function () {
3695                  $(this).removeAttr("style").addClass("active");
3696
3697                  if (scrollable) {
3698                    $("body, html")
3699                      .stop()
3700                      .animate(
3701                        {
3702                          scrollTop: $pagination.offset().top - navOffset,
3703                        },
3704                        300
3705                      );
3706                  }
3707
3708                  $pagination.removeClass("clicked");
3709                });
3710            }
3711          } else if (mode == "slide") {
3712            if ($pageContent.children().length > 1) {
3713              $pageContent
3714                .children()
3715                .stop()
3716                .slideUp(duration, function () {
3717                  $(this).removeAttr("style").removeClass("active");
3718                })
3719                .siblings()
3720                .last()
3721                .stop()
3722                .delay(duration)
3723                .slideDown(duration, function () {
3724                  $(this).removeAttr("style").addClass("active");
3725
3726                  if (scrollable) {
3727                    $("body, html")
3728                      .stop()
3729                      .animate(
3730                        {
3731                          scrollTop: $pagination.offset().top - navOffset,
3732                        },
3733                        300
3734                      );
3735                  }
3736
3737                  $pagination.removeClass("clicked");
3738                });
3739            } else {
3740              $pageContent
3741                .children()
3742                .last()
3743                .stop()
3744                .slideDown(duration, function () {
3745                  $(this).removeAttr("style").addClass("active");
3746
3747                  if (scrollable) {
3748                    $("body, html")
3749                      .stop()
3750                      .animate(
3751                        {
3752                          scrollTop: $pagination.offset().top - navOffset,
3753                        },
3754                        300
3755                      );
3756                  }
3757
3758                  $pagination.removeClass("clicked");
3759                });
3760            }
3761          } else {
3762            if ($pageContent.children().length > 1) {
3763              $pageContent
3764                .children()
3765                .stop()
3766                .hide(duration, function () {
3767                  $(this).removeAttr("style").removeClass("active");
3768                })
3769                .siblings()
3770                .last()
3771                .stop()
3772                .delay(duration)
3773                .show(duration, function () {
3774                  $(this).removeAttr("style").addClass("active");
3775
3776                  if (scrollable) {
3777                    $("body, html")
3778                      .stop()
3779                      .animate(
3780                        {
3781                          scrollTop: $pagination.offset().top - navOffset,
3782                        },
3783                        300
3784                      );
3785                  }
3786
3787                  $pagination.removeClass("clicked");
3788                });
3789            } else {
3790              $pageContent
3791                .children()
3792                .last()
3793                .stop()
3794                .show(duration, function () {
3795                  $(this).removeAttr("style").addClass("active");
3796
3797                  if (scrollable) {
3798                    $("body, html")
3799                      .stop()
3800                      .animate(
3801                        {
3802                          scrollTop: $pagination.offset().top - navOffset,
3803                        },
3804                        300
3805                      );
3806                  }
3807
3808                  $pagination.removeClass("clicked");
3809                });
3810            }
3811          }
3812
3813          $pageLink.each(function () {
3814            $(this).find(".page-item").last().addClass("active");
3815          });
3816        }
3817      }
3818    })
3819    .on("click", ".page-link .page-item", function () {
3820      var $pagination = $(this).parents(".pagination").first(),
3821        navOffset = 0;
3822
3823      if (!$pagination.hasClass("clicked")) {
3824        $pagination.addClass("clicked");
3825
3826        if ($(".nav-fixed").length > 0)
3827          navOffset =
3828            typeof $(".nav-fixed").attr("data-height") != "undefined"
3829              ? parseInt($(".nav-fixed").attr("data-height"))
3830              : $(".nav-fixed").outerHeight();
3831
3832        $(this).addClass("current");
3833
3834        var $pageContent = $pagination.children(".page-content"),
3835          mode =
3836            $pagination.attr("data-mode") !== "undefined" &&
3837            $.inArray($pagination.attr("data-mode"), [
3838              "fade",
3839              "slide",
3840              "block",
3841            ]) >= 0
3842              ? $pagination.attr("data-mode")
3843              : "block",
3844          duration =
3845            typeof $pagination.attr("data-duration") !== "undefined" &&
3846            $pagination.attr("data-duration").length > 0
3847              ? parseInt($pagination.attr("data-duration"), 10)
3848              : mode == "block"
3849              ? 0
3850              : 300,
3851          scrollable =
3852            typeof $pagination.attr("data-scroll") !== "undefined" &&
3853            $.inArray($pagination.attr("data-scroll"), [
3854              "true",
3855              "on",
3856              "enable",
3857              "enabled",
3858              "1",
3859            ]) >= 0
3860              ? true
3861              : false,
3862          $pageClone = $pagination
3863            .children(".page-link")
3864            .find(".page-item.current")
3865            .parents(".page-link")
3866            .first()
3867            .clone(),
3868          idx = 0;
3869
3870        $pageClone
3871          .find(
3872            ".page-first, .page-last, .page-next, .page-prev, .page-ellipse"
3873          )
3874          .remove();
3875
3876        idx = $pageClone.find(".page-item.current").index();
3877
3878        if (mode == "fade") {
3879          if ($pageContent.children().length > 1) {
3880            $pageContent
3881              .children()
3882              .stop()
3883              .fadeOut(duration, function () {
3884                $(this).removeAttr("style").removeClass("active");
3885              })
3886              .siblings()
3887              .eq(idx)
3888              .stop()
3889              .delay(duration)
3890              .fadeIn(duration, function () {
3891                $(this).removeAttr("style").addClass("active");
3892
3893                if (scrollable) {
3894                  $("body, html")
3895                    .stop()
3896                    .animate(
3897                      {
3898                        scrollTop: $pagination.offset().top - navOffset,
3899                      },
3900                      300
3901                    );
3902                }
3903
3904                $pagination.removeClass("clicked");
3905              });
3906          } else {
3907            $pageContent
3908              .children()
3909              .eq(idx)
3910              .stop()
3911              .fadeIn(duration, function () {
3912                $(this).removeAttr("style").addClass("active");
3913
3914                if (scrollable) {
3915                  $("body, html")
3916                    .stop()
3917                    .animate(
3918                      {
3919                        scrollTop: $pagination.offset().top - navOffset,
3920                      },
3921                      300
3922                    );
3923                }
3924
3925                $pagination.removeClass("clicked");
3926              });
3927          }
3928        } else if (mode == "slide") {
3929          if ($pageContent.children().length > 1) {
3930            $pageContent
3931              .children()
3932              .stop()
3933              .slideUp(duration, function () {
3934                $(this).removeAttr("style").removeClass("active");
3935              })
3936              .siblings()
3937              .eq(idx)
3938              .stop()
3939              .delay(duration)
3940              .slideDown(duration, function () {
3941                $(this).removeAttr("style").addClass("active");
3942
3943                if (scrollable) {
3944                  $("body, html")
3945                    .stop()
3946                    .animate(
3947                      {
3948                        scrollTop: $pagination.offset().top - navOffset,
3949                      },
3950                      300
3951                    );
3952                }
3953
3954                $pagination.removeClass("clicked");
3955              });
3956          } else {
3957            $pageContent
3958              .children()
3959              .eq(idx)
3960              .stop()
3961              .slideDown(duration, function () {
3962                $(this).removeAttr("style").addClass("active");
3963
3964                if (scrollable) {
3965                  $("body, html")
3966                    .stop()
3967                    .animate(
3968                      {
3969                        scrollTop: $pagination.offset().top - navOffset,
3970                      },
3971                      300
3972                    );
3973                }
3974
3975                $pagination.removeClass("clicked");
3976              });
3977          }
3978        } else {
3979          if ($pageContent.children().length > 1) {
3980            $pageContent
3981              .children()
3982              .stop()
3983              .hide(duration, function () {
3984                $(this).removeAttr("style").removeClass("active");
3985              })
3986              .siblings()
3987              .eq(idx)
3988              .stop()
3989              .delay(duration)
3990              .show(duration, function () {
3991                $(this).removeAttr("style").addClass("active");
3992
3993                if (scrollable) {
3994                  $("body, html")
3995                    .stop()
3996                    .animate(
3997                      {
3998                        scrollTop: $pagination.offset().top - navOffset,
3999                      },
4000                      300
4001                    );
4002                }
4003
4004                $pagination.removeClass("clicked");
4005              });
4006          } else {
4007            $pageContent
4008              .children()
4009              .eq(idx)
4010              .stop()
4011              .show(duration, function () {
4012                $(this).removeAttr("style").addClass("active");
4013
4014                if (scrollable) {
4015                  $("body, html")
4016                    .stop()
4017                    .animate(
4018                      {
4019                        scrollTop: $pagination.offset().top - navOffset,
4020                      },
4021                      300
4022                    );
4023                }
4024
4025                $pagination.removeClass("clicked");
4026              });
4027          }
4028        }
4029
4030        $pagination
4031          .children(".page-link")
4032          .find(".page-item.current")
4033          .removeClass("current");
4034        $pagination
4035          .children(".page-link")
4036          .find(".page-item.active")
4037          .removeClass("active");
4038        $pagination.children(".page-link").each(function () {
4039          $(this).find(".page-item").eq(idx).addClass("active");
4040        });
4041      }
4042    })
4043    .on("click", ".page-link li.disabled", function () {});
4044  // END: .pagination
4045});
4046
4047// user agents
4048var isMobile = {
4049  Android: function () {
4050    return navigator.userAgent.match(/Android/i);
4051  },
4052  BlackBerry: function () {
4053    return navigator.userAgent.match(/BlackBerry/i);
4054  },
4055  iOS: function () {
4056    return navigator.userAgent.match(/iPhone|iPad|iPod/i);
4057  },
4058  Opera: function () {
4059    return navigator.userAgent.match(/Opera Mini/i);
4060  },
4061  Windows: function () {
4062    return navigator.userAgent.match(/IEMobile/i);
4063  },
4064  any: function () {
4065    return (
4066      isMobile.Android() ||
4067      isMobile.BlackBerry() ||
4068      isMobile.iOS() ||
4069      isMobile.Opera() ||
4070      isMobile.Windows()
4071    );
4072  },
4073};
4074
4075var fbTimer = null,
4076  fbCodes = {},
4077  fbPage = document.querySelectorAll(".fb-page");
4078
4079if (fbPage.length > 0) {
4080  for (var i in fbPage) {
4081    if (fbPage[i].constructor === HTMLDivElement)
4082      fbCodes[i] = fbPage[i].outerHTML;
4083  }
4084}
4085
4086$(window)
4087  .resize(function () {
4088    // fix bg parallax on mobile
4089    if (isMobile.any())
4090      $(".bg-parallax").css("background-attachment", "inherit");
4091    else $(".bg-parallax").css("background-attachment", "");
4092
4093    $(".pagination").removeClass("clicked");
4094
4095    if ($("#fb-root").attr("data-resize")) {
4096      if (fbTimer != null) clearTimeout(fbTimer);
4097
4098      // delay for document is loaded
4099      fbTimer = setTimeout(function () {
4100        if (typeof FB !== "undefined") {
4101          $(".fb-page").each(function (i) {
4102            if (fbCodes[i]) $(this).replaceWith(fbCodes[i]);
4103          });
4104
4105          FB.XFBML.parse();
4106        }
4107      }, 1000);
4108    }
4109  })
4110  .on("scroll resize", function () {
4111    var sTop = $(this).scrollTop();
4112
4113    if (sTop > 0) $("#pagetop").addClass("visible");
4114    else $("#pagetop").removeClass("visible");
4115
4116    if ($(".nav-fixed").length > 0) {
4117      var $navPos =
4118          $(".nav-target").offset().top - $(".nav-fixed").outerHeight() - 1,
4119        $navPinY = 0;
4120
4121      if ($(".nav-target").length > 0) {
4122        if ($navPos > 0) $navPinY = $navPos;
4123      } else $navPinY = $(".nav-fixed").offset().top;
4124
4125      if (sTop > $navPinY || ($navPinY < 0 && sTop > 0)) {
4126        if ($(".nav-pin").length) $(".nav-pin").addClass("fixed");
4127        else $(".nav-fixed").addClass("fixed");
4128      } else {
4129        if ($(".nav-pin").length) $(".nav-pin").removeClass("fixed");
4130        else $(".nav-fixed").removeClass("fixed");
4131      }
4132    }
4133  })
4134  .on("load", function () {
4135    // scrollBefore();
4136  });
4137
4138var scrollBefore = function () {
4139  var hash = window.location.hash || location.hash,
4140    ptnHash = /([;?%&,+*~\':"!^$[\]()=>|\/@])/g;
4141
4142  if (hash) {
4143    hash = hash.replace(ptnHash, "\\$1");
4144    if ($(hash).length > 0) {
4145      if ($(".tabs-switch").length > 0) {
4146        if (
4147          $(hash).length > 0 &&
4148          $(hash).parents(".tab-content").first().length > 0
4149        ) {
4150          var tabChild = $(hash);
4151          $(hash)
4152            .parents()
4153            .each(function () {
4154              if (
4155                $(this).attr("class") !== undefined &&
4156                $.inArray("tab-content", $(this).attr("class").split(" ")) >= 0
4157              )
4158                return false;
4159              else tabChild = $(this);
4160            });
4161
4162          setTimeout(function () {
4163            tabChild
4164              .parents(".tabs-switch")
4165              .first()
4166              .children(".tab-link")
4167              .children()
4168              .eq(tabChild.index())
4169              .click(); // trigger tab in multiple dim
4170          }, 10);
4171        } else {
4172          $(".tabs-switch").each(function () {
4173            var $tabLink = $(this).children(".tab-link");
4174
4175            if ($tabLink.children(hash).length > 0) {
4176              setTimeout(function () {
4177                $tabLink.children(hash).click(); // trigger for set active tab
4178              }, 10);
4179            }
4180          });
4181        }
4182      }
4183
4184      if ($(".bxSlider").length > 0) $(window).trigger("resize");
4185
4186      setTimeout(function () {
4187        if ($(".nav-fixed").length > 0) {
4188          var offsetY = $(hash).offset().top,
4189            navHeight =
4190              typeof $(".nav-fixed").attr("data-height") != "undefined"
4191                ? parseInt($(".nav-fixed").attr("data-height"), 10)
4192                : $(".nav-fixed").outerHeight();
4193
4194          // if ($(".nav-pin").length > 0) offsetY -= $(".nav-pin").outerHeight();
4195
4196          window.scroll(0, offsetY - navHeight);
4197
4198          // re-updated offset
4199          if ($(".nav-target").length > 0) {
4200            var reupdated = true;
4201            $(window).scroll(function () {
4202              if (
4203                reupdated &&
4204                $(this).scrollTop() >= $(".nav-target").offset().top
4205              ) {
4206                reupdated = false;
4207
4208                navHeight =
4209                  typeof $(".nav-fixed").attr("data-height") != "undefined"
4210                    ? parseInt($(".nav-fixed").attr("data-height"), 10)
4211                    : $(".nav-fixed").outerHeight();
4212
4213                window.scroll(0, $(hash).offset().top - navHeight);
4214              }
4215            });
4216          }
4217        } else window.scrollTo(0, $(hash).offset().top);
4218      }, 10);
4219
4220      $("a[href='" + hash + "']").click();
4221    } // else window.scrollTo(0, _offsetY);
4222  }
4223};
4224
4225scrollBefore(); // DOM loaded
4226
4227/*
4228 * Plugins/Functions
4229 *
4230 */
4231
4232// check object is variable or DOM elements
4233function isObjectVar(obj) {
4234  return (
4235    typeof obj != "undefined" &&
4236    typeof obj === "object" &&
4237    obj.nodeType !== 1 &&
4238    typeof obj.ownerDocument !== "object"
4239  );
4240}
4241
4242(function ($) {
4243  // BEGIN: $.feed
4244  $.fn.feed = function (option, callbacks) {
4245    var option = $.extend(
4246      {
4247        Path: "",
4248        BOX: $(this),
4249        key: 0,
4250        MAX: 5,
4251        titleMax: 40,
4252        postMax: 100,
4253        endtext: "...",
4254        indention: "no",
4255        Datetype: { year: "年", month: "月", date: "日" },
4256        Image: "no",
4257        ImageSize: { width: "200", height: "150" }, //表示する画像のサイズ
4258        noImage: "no",
4259        noImage_src: "shared/img/shared/no_image.jpg",
4260        source: "",
4261        done: false,
4262      },
4263      option
4264    );
4265
4266    $.support.cors = true; // fixed no transport error
4267    $.ajax({
4268      url: option["Path"],
4269      crossDomain: true,
4270      cache: false,
4271      async: false,
4272      type: "POST",
4273      dataType: "xml",
4274      data: {
4275        key: option["key"],
4276      },
4277      error: function (jqXHR, textStatus, errorThrown) {
4278        console.log(textStatus + ": " + errorThrown);
4279
4280        return false;
4281      },
4282      success: function (data) {
4283        var cnt = 0,
4284          imgTbl = [],
4285          img = "",
4286          src = "",
4287          ss = "",
4288          category = "", // FCV - added
4289          author = "", // FCV - added
4290          html = "";
4291
4292        $(option["BOX"]["selector"]).empty(); // clear template - FCV added
4293
4294        //要素を全て配列に
4295        $(data)
4296          .find("item")
4297          .each(function () {
4298            var title = $("title", this).text(), //タイトル
4299              link = $("link", this).text(), //リンク先
4300              category = $("category", this).text(), // FCV - added
4301              author = $("dc\\:creator", this).text(), // FCV - added
4302              ex = $("description", this).text(); //注釈文章
4303
4304            //本文のソースを表示するかどうか
4305            if (option.indention === "yes")
4306              ex = $("content\\:encoded", this).text();
4307
4308            //スペースを削除
4309            ex.replace(/\s+/g, "");
4310            ex.replace(" ", "");
4311
4312            //タイトルが1行に収まらない場合、調整
4313            if (title.length > option.titleMax) {
4314              var rename =
4315                title.substring(0, option.titleMax - 1) + option.endtext;
4316              title = rename;
4317            }
4318
4319            //本文の調整
4320            if (ex.length > option.postMax) {
4321              var retxt = ex.substring(0, option.postMax - 1) + option.endtext;
4322              ex = retxt;
4323            }
4324
4325            //日付取得
4326            // ISO date string - regex
4327            // ^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$
4328            var pubDate = $("pubDate", this).text().length > 0 ? true : false,
4329              Datetxt = pubDate
4330                ? $("pubDate", this).text()
4331                : $("dc\\:date", this).text(),
4332              dateISO = pubDate ? new Date() : new Date(Datetxt),
4333              year = pubDate
4334                ? Datetxt.substring(12, 16)
4335                : dateISO.getMonth() + 1,
4336              month = pubDate ? Datetxt.substring(8, 11) : dateISO.getDate(),
4337              date = pubDate ? Datetxt.substring(5, 7) : dateISO.getFullYear();
4338
4339            //英語表記の月を日本語に変換
4340            if (month == "Jan") month = "01";
4341            if (month == "Feb") month = "02";
4342            if (month == "Mar") month = "03";
4343            if (month == "Apr") month = "04";
4344            if (month == "May") month = "05";
4345            if (month == "Jun") month = "06";
4346            if (month == "Jul") month = "07";
4347            if (month == "Aug") month = "08";
4348            if (month == "Sep") month = "09";
4349            if (month == "Oct") month = "10";
4350            if (month == "Nov") month = "11";
4351            if (month == "Dec") month = "12";
4352
4353            //日付の形式
4354            date =
4355              year +
4356              option.Datetype.year +
4357              month +
4358              option.Datetype.month +
4359              date +
4360              option.Datetype.date;
4361
4362            //画像の取得
4363            if (option.Image !== "no") {
4364              ss = $(this).find('[nodeName="content:encoded"]').context
4365                .textContent;
4366              html = $.parseHTML(ss);
4367
4368              imgTbl.length = 0;
4369
4370              var AllImage = $(html).find("img");
4371
4372              for (i = 0, Max = AllImage.length; i < Max; i++) {
4373                //絵文字を除外する
4374                if (!$(AllImage)[i].src.match("s.w.org"))
4375                  Array.prototype.push.apply(imgTbl, [$(AllImage)[i].src]);
4376              }
4377
4378              if (imgTbl[0]) src = imgTbl[0];
4379              else src = option.noImage_src; //no-image画像
4380
4381              if (option.noImage === "yes") {
4382                img =
4383                  '<span style="display:block; background: url(' +
4384                  src +
4385                  ") no-repeat center center; background-size:cover; width:" +
4386                  option.ImageSize.width +
4387                  "px; height:" +
4388                  option.ImageSize.height +
4389                  'px;"></span>';
4390              }
4391
4392              if (option.noImage === "no") {
4393                if ($(html).find("img")[0])
4394                  img =
4395                    '<span style="display:block; background: url(' +
4396                    src +
4397                    ") no-repeat center center; background-size:cover; width:" +
4398                    option.ImageSize.width +
4399                    "px; height:" +
4400                    option.ImageSize.height +
4401                    'px;"></span>';
4402                else
4403                  img = '<span class="no-image" style="display:none;"></span>';
4404              }
4405            }
4406
4407            //出力のソース
4408            if (!title.match("PR")) {
4409              var postdata = option.source,
4410                post = postdata(
4411                  link,
4412                  title,
4413                  date,
4414                  ex,
4415                  img,
4416                  category,
4417                  author,
4418                  cnt
4419                ); // FCV - modified
4420
4421              $(option.BOX.selector).append(post);
4422            }
4423
4424            //終了フラグ
4425            cnt++;
4426            if (cnt > option.MAX - 1) return false;
4427          });
4428      },
4429    }).done(function () {
4430      if (typeof callbacks === "function") callbacks.call(this);
4431    });
4432  };
4433  // END: $.feed
4434
4435  // BEGIN: $.fcvScroll
4436  $.fn.fcvScroll = function (options) {
4437    var options = $.extend(
4438      {
4439        selector: ".section", // selector
4440        delay: 50, // time delay (ms)
4441        duration: 400, // time duration (ms)
4442        reference: 0.9,
4443      },
4444      options
4445    );
4446
4447    if (options.selector) {
4448      var $wrapper = $(this),
4449        $offsetSelectors = [],
4450        $scrollDown = true,
4451        $scrollPos = $(window).scrollTop(),
4452        $scrollTimer = null;
4453
4454      $wrapper.find(options.selector).each(function (i) {
4455        $offsetSelectors.push($(this).offset().top); // offsetY fined
4456      });
4457
4458      $(window)
4459        .scroll(function () {
4460          $scrollDown = $(window).scrollTop() >= $scrollPos;
4461          $scrollPos = $(window).scrollTop();
4462
4463          clearTimeout($scrollTimer);
4464
4465          if ($.inArray($(window).scrollTop(), $offsetSelectors) < 0) {
4466            // not in area fined
4467            $scrollTimer = setTimeout(function () {
4468              // fcv-snap
4469              var $scrollTop = $(window).scrollTop(),
4470                $posY = $(window).height() * options.reference,
4471                $position = 0,
4472                $target;
4473
4474              if ($scrollDown) {
4475                // direction down
4476                $position = $scrollTop + $posY - 1;
4477                $wrapper.find(options.selector).each(function () {
4478                  var $offsetY = $(this).offset().top;
4479                  if ($offsetY > $scrollTop && $offsetY <= $position) {
4480                    $target = $(this);
4481                    return false;
4482                  }
4483                });
4484              } else {
4485                // direction up
4486                $position = $scrollTop - $posY + 1;
4487                $wrapper.find(options.selector).each(function () {
4488                  var $offsetY = $(this).offset().top;
4489                  if ($offsetY < $scrollTop && $offsetY >= $position) {
4490                    $target = $(this);
4491                    return false;
4492                  }
4493                });
4494              }
4495
4496              if ($target) {
4497                $("html, body")
4498                  .stop()
4499                  .animate(
4500                    {
4501                      scrollTop: $target.offset().top,
4502                    },
4503                    options.duration,
4504                    function () {
4505                      clearTimeout($scrollTimer);
4506                    }
4507                  );
4508              }
4509            }, options.delay);
4510          }
4511        })
4512        .resize(function () {
4513          if ($(options.selector).hasClass("minHeight")) {
4514            $(options.selector).css({
4515              minHeight: $(window).height(),
4516            });
4517          } else {
4518            $(options.selector).css({
4519              height: $(window).height(),
4520            });
4521          }
4522        })
4523        .trigger("resize");
4524    } else console.error("Missing selector");
4525
4526    return this;
4527  };
4528
4529  window.addEventListener("wovnApiReady", function (evt) {
4530    //WOVN.io.changeLang('en');
4531  });
4532
4533  window.addEventListener("wovnLangChanged", function (evt) {
4534    var newLang = WOVN.io.getCurrentLang().code;
4535    if (newLang == "en") {
4536      $(".__wvonJP").hide();
4537      $(".__wvonEN").show();
4538      $("body").addClass("__langEN");
4539    } else {
4540      $(".__wvonJP").show();
4541      $(".__wvonEN").hide();
4542      console.log("changeJP");
4543      $("body").removeClass("__langEN");
4544    }
4545    heightLine();
4546  });
4547
4548  $(window).load(function () {
4549    heightLine();
4550  });
4551  // END: $.fcvScroll
4552})(jQuery);
4553
4554// BEGIN: heightLine
4555function heightLine() {
4556  this.className = "heightLine";
4557  this.parentClassName = "heightLineParent";
4558  reg = new RegExp(this.className + "-([a-zA-Z0-9-_]+)", "i");
4559  objCN = new Array();
4560  var objAll = document.getElementsByTagName
4561    ? document.getElementsByTagName("*")
4562    : document.all;
4563  for (var i = 0; i < objAll.length; i++) {
4564    if (typeof objAll[i].className == "string") {
4565      var eltClass = objAll[i].className.split(/\s+/);
4566      for (var j = 0; j < eltClass.length; j++) {
4567        if (eltClass[j] == this.className) {
4568          if (!objCN["main CN"]) objCN["main CN"] = new Array();
4569          objCN["main CN"].push(objAll[i]);
4570          break;
4571        } else if (eltClass[j] == this.parentClassName) {
4572          if (!objCN["parent CN"]) objCN["parent CN"] = new Array();
4573          objCN["parent CN"].push(objAll[i]);
4574          break;
4575        } else if (eltClass[j].match(reg)) {
4576          var OCN = eltClass[j].match(reg);
4577          if (!objCN[OCN]) objCN[OCN] = new Array();
4578          objCN[OCN].push(objAll[i]);
4579          break;
4580        }
4581      }
4582    }
4583  }
4584
4585  //check font size
4586  var e = document.createElement("div");
4587  var s = document.createTextNode("S");
4588  e.appendChild(s);
4589  e.style.classname = "check-fontsize";
4590  e.style.visibility = "hidden";
4591  e.style.position = "absolute";
4592  e.style.top = "0";
4593  document.body.appendChild(e);
4594  var defHeight = e.offsetHeight;
4595
4596  changeBoxSize = function () {
4597    for (var key in objCN) {
4598      if (objCN.hasOwnProperty(key)) {
4599        //parent type
4600        if (key == "parent CN") {
4601          for (var i = 0; i < objCN[key].length; i++) {
4602            var max_height = 0;
4603            var CCN = objCN[key][i].childNodes;
4604            for (var j = 0; j < CCN.length; j++) {
4605              if (CCN[j] && CCN[j].nodeType == 1) {
4606                CCN[j].style.height = "auto";
4607                max_height =
4608                  max_height > CCN[j].offsetHeight
4609                    ? max_height
4610                    : CCN[j].offsetHeight;
4611              }
4612            }
4613            for (var j = 0; j < CCN.length; j++) {
4614              if (CCN[j].style) {
4615                var stylea =
4616                  CCN[j].currentStyle ||
4617                  document.defaultView.getComputedStyle(CCN[j], "");
4618                var newheight = max_height;
4619                if (stylea.paddingTop)
4620                  newheight -= stylea.paddingTop.replace("px", "");
4621                if (stylea.paddingBottom)
4622                  newheight -= stylea.paddingBottom.replace("px", "");
4623                if (stylea.borderTopWidth && stylea.borderTopWidth != "medium")
4624                  newheight -= stylea.borderTopWidth.replace("px", "");
4625                if (
4626                  stylea.borderBottomWidth &&
4627                  stylea.borderBottomWidth != "medium"
4628                )
4629                  newheight -= stylea.borderBottomWidth.replace("px", "");
4630                CCN[j].style.height = newheight + "px";
4631              }
4632            }
4633          }
4634        } else {
4635          var max_height = 0;
4636          for (var i = 0; i < objCN[key].length; i++) {
4637            objCN[key][i].style.height = "auto";
4638            max_height =
4639              max_height > objCN[key][i].offsetHeight
4640                ? max_height
4641                : objCN[key][i].offsetHeight;
4642          }
4643          for (var i = 0; i < objCN[key].length; i++) {
4644            if (objCN[key][i].style) {
4645              var stylea =
4646                objCN[key][i].currentStyle ||
4647                document.defaultView.getComputedStyle(objCN[key][i], "");
4648              var newheight = max_height;
4649              if (stylea.paddingTop)
4650                newheight -= stylea.paddingTop.replace("px", "");
4651              if (stylea.paddingBottom)
4652                newheight -= stylea.paddingBottom.replace("px", "");
4653              if (stylea.borderTopWidth && stylea.borderTopWidth != "medium")
4654                newheight -= stylea.borderTopWidth.replace("px", "");
4655              if (
4656                stylea.borderBottomWidth &&
4657                stylea.borderBottomWidth != "medium"
4658              )
4659                newheight -= stylea.borderBottomWidth.replace("px", "");
4660              objCN[key][i].style.height = newheight + "px";
4661            }
4662          }
4663        }
4664      }
4665    }
4666  };
4667
4668  checkBoxSize = function () {
4669    if (defHeight != e.offsetHeight) {
4670      changeBoxSize();
4671      defHeight = e.offsetHeight;
4672    }
4673
4674    // var elm = document.querySelector(".check-fontsize");
4675    // if (elm) elm.parentNode.removeChild(elm);
4676  };
4677  changeBoxSize();
4678  setInterval(checkBoxSize, 1000);
4679  window.onresize = changeBoxSize;
4680}
4681
4682function addEvent(elm, listener, fn) {
4683  try {
4684    elm.addEventListener(listener, fn, false);
4685  } catch (e) {
4686    elm.attachEvent("on" + listener, fn);
4687  }
4688}
4689//addEvent(window, "load", heightLine);
4690
4691// END: heightLine
4692
4693(function () {
4694  // DOM loaded
4695  // facebook
4696  var fbRoot = document.getElementById("fb-root");
4697  if (fbRoot) {
4698    var fbScript = document.createElement("script"),
4699      fbScriptContent = "",
4700      fbVersion = fbRoot.getAttribute("data-version")
4701        ? fbRoot.getAttribute("data-version")
4702        : "v3.0",
4703      fbLanguage = fbRoot.getAttribute("data-language")
4704        ? fbRoot.getAttribute("data-language")
4705        : "ja_JP";
4706
4707    fbVersion =
4708      fbVersion.substr(0, 1).toLowerCase() == "v"
4709        ? fbVersion.substr(1)
4710        : fbVersion;
4711
4712    fbScriptContent += "(function(d, s, id) {";
4713    fbScriptContent += "var js, fjs = d.getElementsByTagName(s)[0];";
4714    fbScriptContent += "if (d.getElementById(id)) return;";
4715    fbScriptContent += "js = d.createElement(s);";
4716    fbScriptContent += "js.id = id;";
4717    fbScriptContent +=
4718      'js.src = "https://connect.facebook.net/' +
4719      fbLanguage +
4720      "/sdk.js#xfbml=1&version=v" +
4721      fbVersion +
4722      '";';
4723    fbScriptContent += "fjs.parentNode.insertBefore(js, fjs);";
4724    fbScriptContent += '}(document, "script", "facebook-jssdk"));';
4725
4726    fbScript.innerHTML = fbScriptContent;
4727    document.body.appendChild(fbScript);
4728  }
4729
4730  // WOW js
4731  if (typeof window["WOW"] === "function") {
4732    var wowData = {
4733      box:
4734        typeof $("body").attr("data-wow-box") != "undefined"
4735          ? $("body").attr("data-wow-box")
4736          : "wow",
4737      animate:
4738        typeof $("body").attr("data-wow-animate") != "undefined"
4739          ? $("body").attr("data-wow-animate")
4740          : "animated",
4741      offset:
4742        typeof $("body").attr("data-wow-offset") != "undefined"
4743          ? parseInt($("body").attr("data-wow-offset"))
4744          : 0,
4745      mobile:
4746        $.inArray($("body").attr("data-wow-mobile"), [
4747          "true",
4748          "on",
4749          "enable",
4750          "enabled",
4751          "1",
4752        ]) >= 0
4753          ? true
4754          : false,
4755      live:
4756        $.inArray($("body").attr("data-wow-live"), [
4757          "true",
4758          "on",
4759          "enable",
4760          "enabled",
4761          "1",
4762        ]) >= 0
4763          ? true
4764          : false,
4765      callback: function () {},
4766      scrollContainer: null,
4767    };
4768
4769    if (typeof $("body").attr("data-wow-offset") == "undefined")
4770      wowData.mobile = true;
4771    if (typeof $("body").attr("data-wow-live") == "undefined")
4772      wowData.live = true;
4773    if (
4774      $("body").attr("data-wow-callback") &&
4775      window[$("body").attr("data-wow-callback")] != undefined
4776    )
4777      wowData.callback = window[$("body").attr("data-wow-callback")];
4778
4779    new WOW(wowData).init();
4780  }
4781})();
4782
4783// conflicts
4784if (!Object.keys) {
4785  Object.keys = (function () {
4786    "use strict";
4787    var hasOwnProperty = Object.prototype.hasOwnProperty,
4788      hasDontEnumBug = !{
4789        toString: null,
4790      }.propertyIsEnumerable("toString"),
4791      dontEnums = [
4792        "toString",
4793        "toLocaleString",
4794        "valueOf",
4795        "hasOwnProperty",
4796        "isPrototypeOf",
4797        "propertyIsEnumerable",
4798        "constructor",
4799      ],
4800      dontEnumsLength = dontEnums.length;
4801
4802    return function (obj) {
4803      if (
4804        typeof obj !== "object" &&
4805        (typeof obj !== "function" || obj === null)
4806      ) {
4807        throw new TypeError("Object.keys called on non-object");
4808      }
4809
4810      var result = [],
4811        prop,
4812        i;
4813
4814      for (prop in obj) {
4815        if (hasOwnProperty.call(obj, prop)) {
4816          result.push(prop);
4817        }
4818      }
4819
4820      if (hasDontEnumBug) {
4821        for (i = 0; i < dontEnumsLength; i++) {
4822          if (hasOwnProperty.call(obj, dontEnums[i])) {
4823            result.push(dontEnums[i]);
4824          }
4825        }
4826      }
4827      return result;
4828    };
4829  })();
4830}
4831
4832function isHTML(str) {
4833  var a = document.createElement("div");
4834  a.innerHTML = str;
4835  for (var child = a.childNodes, i = child.length; i--; ) {
4836    if (child[i].nodeType == 1) return true;
4837  }
4838  return false;
4839}
4840
4841// BEGIN: slide fading
4842var $slideFadeTimer = {};
4843
4844function slideFadeStart(elm) {
4845  var $this = elm,
4846    __idx__ = $(".slide-fade").index($this),
4847    $duration =
4848      typeof $this.attr("data-duration") != "undefined"
4849        ? parseInt($this.attr("data-duration"))
4850        : 1000,
4851    $timer =
4852      typeof $this.attr("data-timer") != "undefined"
4853        ? parseInt($this.attr("data-timer"))
4854        : 4000,
4855    $delay =
4856      typeof $this.attr("data-delay") != "undefined"
4857        ? parseInt($this.attr("data-delay"))
4858        : false;
4859
4860  if ($timer < $duration) $timer = $duration * 2;
4861
4862  $this.removeClass("stop");
4863  if (!$this.children(".active").length) {
4864    $this.children().hide();
4865    $this.children().eq(0).show().addClass("active");
4866
4867    if ($this.siblings(".slide-page").length)
4868      $this.siblings(".slide-page").children().eq(0).addClass("active");
4869  } else {
4870    if ($this.siblings(".slide-page").length)
4871      $this
4872        .siblings(".slide-page")
4873        .children()
4874        .eq($this.children(".active").index())
4875        .addClass("active");
4876  }
4877
4878  // $slideFadeTimer[__idx__] = setInterval(function() {
4879  // slideFade($this, $duration);
4880  // }, $timer);
4881
4882  $this
4883    .parents(".slideParent")
4884    .addClass("move-start")
4885    .attr("data", $this.children(".active").index());
4886
4887  if ($slideFadeTimer[__idx__]) clearTimeout($slideFadeTimer[__idx__]);
4888  $slideFadeTimer[__idx__] = setTimeout(
4889    function () {
4890      slideFade($this, $duration);
4891    },
4892    $delay ? $delay : $timer
4893  );
4894}
4895
4896function slideFade(elm, duration) {
4897  var elmActive = elm.children(".active"),
4898    slideContinue =
4899      elm.hasClass("stop") ||
4900      (elm.hasClass("once") && elmActive.next().length < 1)
4901        ? false
4902        : true;
4903
4904  if (slideContinue) {
4905    var __idx__ = $(".slide-fade").index(elm),
4906      timer =
4907        typeof elm.attr("data-timer") != "undefined"
4908          ? parseInt(elm.attr("data-timer"))
4909          : 4000;
4910
4911    if (elmActive.next().length) {
4912      if (typeof elmActive.next().attr("data-duration") != "undefined")
4913        duration = parseInt(elmActive.next().attr("data-duration"));
4914    } else {
4915      if (typeof elm.children().eq(0).attr("data-duration") != "undefined")
4916        duration = parseInt(elm.children().eq(0).attr("data-duration"));
4917    }
4918
4919    if ($slideFadeTimer[__idx__]) clearTimeout($slideFadeTimer[__idx__]);
4920
4921    elmActive.stop().fadeOut(duration, function () {
4922      $(this).removeClass("active").removeAttr("style").hide();
4923    });
4924
4925    elm
4926      .parents(".slideParent")
4927      .removeClass("move-start move-next move-prev move-first move-last");
4928
4929    if (elmActive.next().length > 0) {
4930      if (typeof elmActive.next().attr("data-timer") != "undefined")
4931        timer = parseInt(elmActive.next().attr("data-timer"));
4932      if (timer < duration) timer = duration * 2;
4933
4934      if (elm.siblings(".slide-page").length > 0) {
4935        elm.siblings(".slide-page").children(".active").removeClass("active");
4936        elm
4937          .siblings(".slide-page")
4938          .children()
4939          .eq(elmActive.next().index())
4940          .addClass("active");
4941      }
4942
4943      elm
4944        .parents(".slideParent")
4945        .addClass("move-next")
4946        .attr("data", elmActive.next().index());
4947      if (elmActive.next().is(":last-child"))
4948        elm.parents(".slideParent").addClass("move-last");
4949
4950      elmActive
4951        .next()
4952        .stop()
4953        .fadeIn(duration, function () {
4954          $(this).addClass("active").removeAttr("style").show();
4955
4956          if (elm.siblings(".slide-btn").hasClass("clicked"))
4957            elm.siblings(".slide-btn.clicked").removeClass("clicked");
4958          if (elm.siblings(".slide-page").hasClass("clicked"))
4959            elm.siblings(".slide-page.clicked").removeClass("clicked");
4960
4961          if ($(this).next().length < 1 && elm.hasClass("once"))
4962            elm.addClass("slide-finished");
4963
4964          $slideFadeTimer[__idx__] = setTimeout(function () {
4965            slideFade(elm, duration);
4966          }, timer);
4967        });
4968    } else {
4969      if (typeof elm.children().eq(0).attr("data-timer") != "undefined")
4970        timer = parseInt(elm.children().eq(0).attr("data-timer"));
4971      if (timer < duration) timer = duration * 2;
4972
4973      if (elm.siblings(".slide-page").length > 0) {
4974        elm.siblings(".slide-page").children(".active").removeClass("active");
4975        elm.siblings(".slide-page").children().eq(0).addClass("active");
4976      }
4977
4978      elm.parents(".slideParent").addClass("move-first").attr("data", 0);
4979
4980      elm
4981        .children()
4982        .eq(0)
4983        .stop()
4984        .fadeIn(duration, function () {
4985          $(this).addClass("active").removeAttr("style").show();
4986
4987          if (elm.siblings(".slide-btn").hasClass("clicked"))
4988            elm.siblings(".slide-btn.clicked").removeClass("clicked");
4989          if (elm.siblings(".slide-page").hasClass("clicked"))
4990            elm.siblings(".slide-page.clicked").removeClass("clicked");
4991
4992          if ($(this).next().length < 1 && elm.hasClass("once"))
4993            elm.addClass("slide-finished");
4994
4995          $slideFadeTimer[__idx__] = setTimeout(function () {
4996            slideFade(elm, duration);
4997          }, timer);
4998        });
4999    }
5000  } else elm.addClass("slide-finished");
5001}
5002// END: slide fading
5003
5004// BEGIN: .pagination
5005function reloadPager(elm) {
5006  if (elm) {
5007    if (elm instanceof jQuery && elm.length > 0) {
5008      elm.each(function () {
5009        initPager($(this));
5010      });
5011    }
5012  } else {
5013    $(".pagination").each(function () {
5014      initPager($(this));
5015    });
5016  }
5017}
5018function initPager(elm) {
5019  // if (elm.children(".page-content").children().length > 0) {
5020  var $pagination = elm,
5021    $pageContent = $pagination.children(".page-content"),
5022    total = $pageContent.children().length;
5023
5024  var dataPage = {
5025    first:
5026      typeof $pagination.attr("data-first") !== "undefined" &&
5027      $pagination.attr("data-first").length > 0
5028        ? $pagination.attr("data-first")
5029        : false,
5030    last:
5031      typeof $pagination.attr("data-last") !== "undefined" &&
5032      $pagination.attr("data-last").length > 0
5033        ? $pagination.attr("data-last")
5034        : false,
5035    next:
5036      typeof $pagination.attr("data-next") !== "undefined" &&
5037      $pagination.attr("data-next").length > 0
5038        ? $pagination.attr("data-next")
5039        : false,
5040    prev:
5041      typeof $pagination.attr("data-prev") !== "undefined" &&
5042      $pagination.attr("data-prev").length > 0
5043        ? $pagination.attr("data-prev")
5044        : false,
5045    active:
5046      typeof $pagination.attr("data-active") !== "undefined" &&
5047      $pagination.attr("data-active").length > 0
5048        ? parseInt($pagination.attr("data-active"), 10)
5049        : 1,
5050    max:
5051      typeof $pagination.attr("data-max") !== "undefined" &&
5052      $pagination.attr("data-max").length > 0
5053        ? parseInt($pagination.attr("data-max"), 10)
5054        : false,
5055    page:
5056      typeof $pagination.attr("data-page") !== "undefined" &&
5057      $.inArray($pagination.attr("data-page"), ["top", "bottom", "both"]) >= 0
5058        ? $pagination.attr("data-page")
5059        : false,
5060  };
5061
5062  if (dataPage.active > total) dataPage.active = 1;
5063
5064  if (dataPage.max) {
5065    // && $pageContent.children().length > 0
5066    if ($pageContent.children(".page-wrap").length > 0) {
5067      if ($pageContent.children(".page-wrap").children().length > 0)
5068        $pageContent.children(".page-wrap").children().unwrap();
5069      else $pageContent.children(".page-wrap").remove();
5070    }
5071
5072    $pageContent
5073      .children()
5074      .not(".page-wrap")
5075      .each(function (i) {
5076        if (i % dataPage.max === 0)
5077          $pageContent.append('<div class="page-wrap" />');
5078
5079        $(this).appendTo($pageContent.children(".page-wrap").last());
5080      });
5081
5082    total = $pageContent.children().length;
5083  }
5084
5085  if ($pagination.children(".page-link").length > 0)
5086    $pagination.children(".page-link").remove();
5087
5088  if (dataPage.page && total > 0) {
5089    if (dataPage.page == "top")
5090      $pagination.prepend('<div class="page-link" />');
5091    else if (dataPage.page == "bottom")
5092      $pagination.append('<div class="page-link" />');
5093    else {
5094      $pagination.prepend('<div class="page-link" />');
5095      $pagination.append('<div class="page-link" />');
5096    }
5097
5098    $pagination.children(".page-link").each(function (p) {
5099      var $pageLink = $(this);
5100
5101      var htmlItem = [];
5102      htmlItem.push("<ul>");
5103      if (dataPage.first)
5104        htmlItem.push('<li class="page-first">' + dataPage.first + "</li>");
5105      if (dataPage.prev)
5106        htmlItem.push('<li class="page-prev">' + dataPage.prev + "</li>");
5107      for (var i = 1; i <= total; i++) {
5108        // if (i == dataPage.active) htmlItem.push('<li class="page-item active">' + i + '</li>');
5109        // else htmlItem.push('<li class="page-item">' + i + '</li>');
5110        htmlItem.push('<li class="page-item">' + i + "</li>");
5111      }
5112      if (dataPage.next)
5113        htmlItem.push('<li class="page-next">' + dataPage.next + "</li>");
5114      if (dataPage.last)
5115        htmlItem.push('<li class="page-last">' + dataPage.last + "</li>");
5116      htmlItem.push("</ul>");
5117
5118      htmlItem = htmlItem.join("\n");
5119      $pageLink.html(htmlItem);
5120
5121      var scrollable = $pagination.attr("data-scroll"),
5122        duration = $pagination.attr("data-duration"),
5123        modeable = $pagination.attr("data-mode");
5124
5125      $pagination.attr("data-scroll", false); // off scroll on first loaded
5126      $pagination.attr("data-duration", 0); // off duration on first loaded
5127      $pagination.attr("data-mode", false); // off mode on first loaded
5128
5129      if (p >= $pagination.children(".page-link").length - 1) {
5130        // last
5131        setTimeout(function () {
5132          $pageLink
5133            .find(".page-item")
5134            .eq(dataPage.active - 1)
5135            .click();
5136        }, 1);
5137      }
5137 // else $pageLink.find(".page-item").eq(dataPage.active - 1).addClass("active");
5138    });
5139
5140    // re-setting for data-scroll
5141    if (typeof scrollable === "undefined")
5142      $pagination.removeAttr("data-scroll");
5143    else $pagination.attr("data-scroll", scrollable);
5144
5145    // re-setting for data-duration
5146    if (typeof duration === "undefined")
5147      $pagination.removeAttr("data-duration");
5148    else $pagination.attr("data-duration", duration);
5149
5150    // re-setting for data-mode
5151    if (typeof modeable === "undefined") $pagination.removeAttr("data-mode");
5152    else $pagination.attr("data-mode", modeable);
5153  } else {
5154    $pageContent.children(".page-wrap").first().addClass("active"); // show
5155  }
5156  // }
5157}
5158// END: .pagination
5159
5160var checkDomain = function (url) {
5161  if (url.indexOf("//") === 0) url = location.protocol + url;
5162  return url
5163    .toLowerCase()
5164    .replace(/([a-z])?:\/\//, "$1")
5165    .split("/")[0];
5166};
5167var isExternal = function (url) {
5168  return (
5169    (url.indexOf(":") > -1 || url.indexOf("//") > -1) &&
5170    checkDomain(location.href) !== checkDomain(url)
5171  );
5172};
5173
5174var Cookie = function () {};
5175Cookie.prototype.set = function (cname, cvalue, exdays) {
5176  var d = new Date();
5177  d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
5178  var expires = "expires=" + d.toUTCString();
5179  document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
5180};
5181Cookie.prototype.get = function (cname) {
5182  var name = cname + "=";
5183  var decodedCookie = decodeURIComponent(document.cookie);
5184  var ca = decodedCookie.split(";");
5185  for (var i = 0; i < ca.length; i++) {
5186    var c = ca[i];
5187    while (c.charAt(0) == " ") {
5188      c = c.substring(1);
5189    }
5190    if (c.indexOf(name) == 0) {
5191      return c.substring(name.length, c.length);
5192    }
5193  }
5194  return "";
5195};
5196Cookie.prototype.remove = function (cname) {
5197  this.set(cname, null, 0);
5198};
5199
5200/*************************************************
5201 *
5202 * Libraries
5203 *
5204 ************************************************/
5205
5206/**
5207 * [js-md5]{@link https://github.com/emn178/js-md5}
5208 *
5209 * @namespace md5
5210 * @version 0.7.2
5211 * @author Chen, Yi-Cyuan [[email protected]]
5212 * @copyright Chen, Yi-Cyuan 2014-2017
5213 * @license MIT
5214 */
5215
5216!(function () {
5217  "use strict";
5218  function Md5(t) {
5219    if (t)
5220      (blocks[0] =
5221        blocks[16] =
5222        blocks[1] =
5223        blocks[2] =
5224        blocks[3] =
5225        blocks[4] =
5226        blocks[5] =
5227        blocks[6] =
5228        blocks[7] =
5229        blocks[8] =
5230        blocks[9] =
5231        blocks[10] =
5232        blocks[11] =
5233        blocks[12] =
5234        blocks[13] =
5235        blocks[14] =
5236        blocks[15] =
5237          0),
5238        (this.blocks = blocks),
5239        (this.buffer8 = buffer8);
5240    else if (ARRAY_BUFFER) {
5241      var r = new ArrayBuffer(68);
5242      (this.buffer8 = new Uint8Array(r)), (this.blocks = new Uint32Array(r));
5243    } else this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
5244    (this.h0 =
5245      this.h1 =
5246      this.h2 =
5247      this.h3 =
5248      this.start =
5249      this.bytes =
5250      this.hBytes =
5251        0),
5252      (this.finalized = this.hashed = !1),
5253      (this.first = !0);
5254  }
5255  var ERROR = "input is invalid type",
5256    WINDOW = "object" == typeof window,
5257    root = WINDOW ? window : {};
5258  root.JS_MD5_NO_WINDOW && (WINDOW = !1);
5259  var WEB_WORKER = !WINDOW && "object" == typeof self,
5260    NODE_JS =
5261      !root.JS_MD5_NO_NODE_JS &&
5262      "object" == typeof process &&
5263      process.versions &&
5264      process.versions.node;
5265  NODE_JS ? (root = global) : WEB_WORKER && (root = self);
5266  var COMMON_JS =
5267      !root.JS_MD5_NO_COMMON_JS && "object" == typeof module && module.exports,
5268    AMD = "function" == typeof define && define.amd,
5269    ARRAY_BUFFER =
5270      !root.JS_MD5_NO_ARRAY_BUFFER && "undefined" != typeof ArrayBuffer,
5271    HEX_CHARS = "0123456789abcdef".split(""),
5272    EXTRA = [128, 32768, 8388608, -2147483648],
5273    SHIFT = [0, 8, 16, 24],
5274    OUTPUT_TYPES = [
5275      "hex",
5276      "array",
5277      "digest",
5278      "buffer",
5279      "arrayBuffer",
5280      "base64",
5281    ],
5282    BASE64_ENCODE_CHAR =
5283      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
5283+/".split(
5284        ""
5285      ),
5286    blocks = [],
5287    buffer8;
5288  if (ARRAY_BUFFER) {
5289    var buffer = new ArrayBuffer(68);
5290    (buffer8 = new Uint8Array(buffer)), (blocks = new Uint32Array(buffer));
5291  }
5292  (root.JS_MD5_NO_NODE_JS || !Array.isArray) &&
5293    (Array.isArray = function (t) {
5294      return "[object Array]" === Object.prototype.toString.call(t);
5295    }),
5296    !ARRAY_BUFFER ||
5297      (!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW && ArrayBuffer.isView) ||
5298      (ArrayBuffer.isView = function (t) {
5299        return (
5300          "object" == typeof t &&
5301          t.buffer &&
5302          t.buffer.constructor === ArrayBuffer
5303        );
5304      });
5305  var createOutputMethod = function (t) {
5306      return function (r) {
5307        return new Md5(!0).update(r)[t]();
5308      };
5309    },
5310    createMethod = function () {
5311      var t = createOutputMethod("hex");
5312      NODE_JS && (t = nodeWrap(t)),
5313        (t.create = function () {
5314          return new Md5();
5315        }),
5316        (t.update = function (r) {
5317          return t.create().update(r);
5318        });
5319      for (var r = 0; r < OUTPUT_TYPES.length; ++r) {
5320        var e = OUTPUT_TYPES[r];
5321        t[e] = createOutputMethod(e);
5322      }
5323      return t;
5324    },
5325    nodeWrap = function (method) {
5326      var crypto = eval("require('crypto')"),
5327        Buffer = eval("require('buffer').Buffer"),
5328        nodeMethod = function (t) {
5329          if ("string" == typeof t)
5330            return crypto.createHash("md5").update(t, "utf8").digest("hex");
5331          if (null === t || void 0 === t) throw ERROR;
5332          return (
5333            t.constructor === ArrayBuffer && (t = new Uint8Array(t)),
5334            Array.isArray(t) ||
5335            ArrayBuffer.isView(t) ||
5336            t.constructor === Buffer
5337              ? crypto.createHash("md5").update(new Buffer(t)).digest("hex")
5338              : method(t)
5339          );
5340        };
5341      return nodeMethod;
5342    };
5343  (Md5.prototype.update = function (t) {
5344    if (!this.finalized) {
5345      var r,
5346        e = typeof t;
5347      if ("string" !== e) {
5348        if ("object" !== e) throw ERROR;
5349        if (null === t) throw ERROR;
5350        if (ARRAY_BUFFER && t.constructor === ArrayBuffer)
5351          t = new Uint8Array(t);
5352        else if (!(Array.isArray(t) || (ARRAY_BUFFER && ArrayBuffer.isView(t))))
5353          throw ERROR;
5354        r = !0;
5355      }
5356      for (
5357        var s, i, o = 0, h = t.length, f = this.blocks, a = this.buffer8;
5358        h > o;
5359
5360      ) {
5361        if (
5362          (this.hashed &&
5363            ((this.hashed = !1),
5364            (f[0] = f[16]),
5365            (f[16] =
5366              f[1] =
5367              f[2] =
5368              f[3] =
5369              f[4] =
5370              f[5] =
5371              f[6] =
5372              f[7] =
5373              f[8] =
5374              f[9] =
5375              f[10] =
5376              f[11] =
5377              f[12] =
5378              f[13] =
5379              f[14] =
5380              f[15] =
5381                0)),
5382          r)
5383        )
5384          if (ARRAY_BUFFER)
5385            for (i = this.start; h > o && 64 > i; ++o) a[i++] = t[o];
5386          else
5387            for (i = this.start; h > o && 64 > i; ++o)
5388              f[i >> 2] |= t[o] << SHIFT[3 & i++];
5389        else if (ARRAY_BUFFER)
5390          for (i = this.start; h > o && 64 > i; ++o)
5391            (s = t.charCodeAt(o)),
5392              128 > s
5393                ? (a[i++] = s)
5394                : 2048 > s
5395                ? ((a[i++] = 192 | (s >> 6)), (a[i++] = 128 | (63 & s)))
5396                : 55296 > s || s >= 57344
5397                ? ((a[i++] = 224 | (s >> 12)),
5398                  (a[i++] = 128 | ((s >> 6) & 63)),
5399                  (a[i++] = 128 | (63 & s)))
5400                : ((s =
5401                    65536 + (((1023 & s) << 10) | (1023 & t.charCodeAt(++o)))),
5402                  (a[i++] = 240 | (s >> 18)),
5403                  (a[i++] = 128 | ((s >> 12) & 63)),
5404                  (a[i++] = 128 | ((s >> 6) & 63)),
5405                  (a[i++] = 128 | (63 & s)));
5406        else
5407          for (i = this.start; h > o && 64 > i; ++o)
5408            (s = t.charCodeAt(o)),
5409              128 > s
5410                ? (f[i >> 2] |= s << SHIFT[3 & i++])
5411                : 2048 > s
5412                ? ((f[i >> 2] |= (192 | (s >> 6)) << SHIFT[3 & i++]),
5413                  (f[i >> 2] |= (128 | (63 & s)) << SHIFT[3 & i++]))
5414                : 55296 > s || s >= 57344
5415                ? ((f[i >> 2] |= (224 | (s >> 12)) << SHIFT[3 & i++]),
5416                  (f[i >> 2] |= (128 | ((s >> 6) & 63)) << SHIFT[3 & i++]),
5417                  (f[i >> 2] |= (128 | (63 & s)) << SHIFT[3 & i++]))
5418                : ((s =
5419                    65536 + (((1023 & s) << 10) | (1023 & t.charCodeAt(++o)))),
5420                  (f[i >> 2] |= (240 | (s >> 18)) << SHIFT[3 & i++]),
5421                  (f[i >> 2] |= (128 | ((s >> 12) & 63)) << SHIFT[3 & i++]),
5422                  (f[i >> 2] |= (128 | ((s >> 6) & 63)) << SHIFT[3 & i++]),
5423                  (f[i >> 2] |= (128 | (63 & s)) << SHIFT[3 & i++]));
5424        (this.lastByteIndex = i),
5425          (this.bytes += i - this.start),
5426          i >= 64
5427            ? ((this.start = i - 64), this.hash(), (this.hashed = !0))
5428            : (this.start = i);
5429      }
5430      return (
5431        this.bytes > 4294967295 &&
5432          ((this.hBytes += (this.bytes / 4294967296) << 0),
5433          (this.bytes = this.bytes % 4294967296)),
5434        this
5435      );
5436    }
5437  }),
5438    (Md5.prototype.finalize = function () {
5439      if (!this.finalized) {
5440        this.finalized = !0;
5441        var t = this.blocks,
5442          r = this.lastByteIndex;
5443        (t[r >> 2] |= EXTRA[3 & r]),
5444          r >= 56 &&
5445            (this.hashed || this.hash(),
5446            (t[0] = t[16]),
5447            (t[16] =
5448              t[1] =
5449              t[2] =
5450              t[3] =
5451              t[4] =
5452              t[5] =
5453              t[6] =
5454              t[7] =
5455              t[8] =
5456              t[9] =
5457              t[10] =
5458              t[11] =
5459              t[12] =
5460              t[13] =
5461              t[14] =
5462              t[15] =
5463                0)),
5464          (t[14] = this.bytes << 3),
5465          (t[15] = (this.hBytes << 3) | (this.bytes >> 29)),
5466          this.hash();
5467      }
5468    }),
5469    (Md5.prototype.hash = function () {
5470      var t,
5471        r,
5472        e,
5473        s,
5474        i,
5475        o,
5476        h = this.blocks;
5477      this.first
5478        ? ((t = h[0] - 680876937),
5479          (t = (((t << 7) | (t >>> 25)) - 271733879) << 0),
5480          (s = (-1732584194 ^ (2004318071 & t)) + h[1] - 117830708),
5481          (s = (((s << 12) | (s >>> 20)) + t) << 0),
5482          (e = (-271733879 ^ (s & (-271733879 ^ t))) + h[2] - 1126478375),
5483          (e = (((e << 17) | (e >>> 15)) + s) << 0),
5484          (r = (t ^ (e & (s ^ t))) + h[3] - 1316259209),
5485          (r = (((r << 22) | (r >>
5485> 10)) + e) << 0))
5486        : ((t = this.h0),
5487          (r = this.h1),
5488          (e = this.h2),
5489          (s = this.h3),
5490          (t += (s ^ (r & (e ^ s))) + h[0] - 680876936),
5491          (t = (((t << 7) | (t >>> 25)) + r) << 0),
5492          (s += (e ^ (t & (r ^ e))) + h[1] - 389564586),
5493          (s = (((s << 12) | (s >>> 20)) + t) << 0),
5494          (e += (r ^ (s & (t ^ r))) + h[2] + 606105819),
5495          (e = (((e << 17) | (e >>> 15)) + s) << 0),
5496          (r += (t ^ (e & (s ^ t))) + h[3] - 1044525330),
5497          (r = (((r << 22) | (r >>> 10)) + e) << 0)),
5498        (t += (s ^ (r & (e ^ s))) + h[4] - 176418897),
5499        (t = (((t << 7) | (t >>> 25)) + r) << 0),
5500        (s += (e ^ (t & (r ^ e))) + h[5] + 1200080426),
5501        (s = (((s << 12) | (s >>> 20)) + t) << 0),
5502        (e += (r ^ (s & (t ^ r))) + h[6] - 1473231341),
5503        (e = (((e << 17) | (e >>> 15)) + s) << 0),
5504        (r += (t ^ (e & (s ^ t))) + h[7] - 45705983),
5505        (r = (((r << 22) | (r >>> 10)) + e) << 0),
5506        (t += (s ^ (r & (e ^ s))) + h[8] + 1770035416),
5507        (t = (((t << 7) | (t >>> 25)) + r) << 0),
5508        (s += (e ^ (t & (r ^ e))) + h[9] - 1958414417),
5509        (s = (((s << 12) | (s >>> 20)) + t) << 0),
5510        (e += (r ^ (s & (t ^ r))) + h[10] - 42063),
5511        (e = (((e << 17) | (e >>> 15)) + s) << 0),
5512        (r += (t ^ (e & (s ^ t))) + h[11] - 1990404162),
5513        (r = (((r << 22) | (r >>> 10)) + e) << 0),
5514        (t += (s ^ (r & (e ^ s))) + h[12] + 1804603682),
5515        (t = (((t << 7) | (t >>> 25)) + r) << 0),
5516        (s += (e ^ (t & (r ^ e))) + h[13] - 40341101),
5517        (s = (((s << 12) | (s >>> 20)) + t) << 0),
5518        (e += (r ^ (s & (t ^ r))) + h[14] - 1502002290),
5519        (e = (((e << 17) | (e >>> 15)) + s) << 0),
5520        (r += (t ^ (e & (s ^ t))) + h[15] + 1236535329),
5521        (r = (((r << 22) | (r >>> 10)) + e) << 0),
5522        (t += (e ^ (s & (r ^ e))) + h[1] - 165796510),
5523        (t = (((t << 5) | (t >>> 27)) + r) << 0),
5524        (s += (r ^ (e & (t ^ r))) + h[6] - 1069501632),
5525        (s = (((s << 9) | (s >>> 23)) + t) << 0),
5526        (e += (t ^ (r & (s ^ t))) + h[11] + 643717713),
5527        (e = (((e << 14) | (e >>> 18)) + s) << 0),
5528        (r += (s ^ (t & (e ^ s))) + h[0] - 373897302),
5529        (r = (((r << 20) | (r >>> 12)) + e) << 0),
5530        (t += (e ^ (s & (r ^ e))) + h[5] - 701558691),
5531        (t = (((t << 5) | (t >>> 27)) + r) << 0),
5532        (s += (r ^ (e & (t ^ r))) + h[10] + 38016083),
5533        (s = (((s << 9) | (s >>> 23)) + t) << 0),
5534        (e += (t ^ (r & (s ^ t))) + h[15] - 660478335),
5535        (e = (((e << 14) | (e >>> 18)) + s) << 0),
5536        (r += (s ^ (t & (e ^ s))) + h[4] - 405537848),
5537        (r = (((r << 20) | (r >>> 12)) + e) << 0),
5538        (t += (e ^ (s & (r ^ e))) + h[9] + 568446438),
5539        (t = (((t << 5) | (t >>> 27)) + r) << 0),
5540        (s += (r ^ (e & (t ^ r))) + h[14] - 1019803690),
5541        (s = (((s << 9) | (s >>> 23)) + t) << 0),
5542        (e += (t ^ (r & (s ^ t))) + h[3] - 187363961),
5543        (e = (((e << 14) | (e >>> 18)) + s) << 0),
5544        (r += (s ^ (t & (e ^ s))) + h[8] + 1163531501),
5545        (r = (((r << 20) | (r >>> 12)) + e) << 0),
5546        (t += (e ^ (s & (r ^ e))) + h[13] - 1444681467),
5547        (t = (((t << 5) | (t >>> 27)) + r) << 0),
5548        (s += (r ^ (e & (t ^ r))) + h[2] - 51403784),
5549        (s = (((s << 9) | (s >>> 23)) + t) << 0),
5550        (e += (t ^ (r & (s ^ t))) + h[7] + 1735328473),
5551        (e = (((e << 14) | (e >>> 18)) + s) << 0),
5552        (r += (s ^ (t & (e ^ s))) + h[12] - 1926607734),
5553        (r = (((r << 20) | (r >>> 12)) + e) << 0),
5554        (i = r ^ e),
5555        (t += (i ^ s) + h[5] - 378558),
5556        (t = (((t << 4) | (t >>> 28)) + r) << 0),
5557        (s += (i ^ t) + h[8] - 2022574463),
5558        (s = (((s << 11) | (s >>> 21)) + t) << 0),
5559        (o = s ^ t),
5560        (e += (o ^ r) + h[11] + 1839030562),
5561        (e = (((e << 16) | (e >>> 16)) + s) << 0),
5562        (r += (o ^ e) + h[14] - 35309556),
5563        (r = (((r << 23) | (r >>> 9)) + e) << 0),
5564        (i = r ^ e),
5565        (t += (i ^ s) + h[1] - 1530992060),
5566        (t = (((t << 4) | (t >>> 28)) + r) << 0),
5567        (s += (i ^ t) + h[4] + 1272893353),
5568        (s = (((s << 11) | (s >>> 21)) + t) << 0),
5569        (o = s ^ t),
5570        (e += (o ^ r) + h[7] - 155497632),
5571        (e = (((e << 16) | (e >>> 16)) + s) << 0),
5572        (r += (o ^ e) + h[10] - 1094730640),
5573        (r = (((r << 23) | (r >>
5573> 9)) + e) << 0),
5574        (i = r ^ e),
5575        (t += (i ^ s) + h[13] + 681279174),
5576        (t = (((t << 4) | (t >>> 28)) + r) << 0),
5577        (s += (i ^ t) + h[0] - 358537222),
5578        (s = (((s << 11) | (s >>> 21)) + t) << 0),
5579        (o = s ^ t),
5580        (e += (o ^ r) + h[3] - 722521979),
5581        (e = (((e << 16) | (e >>> 16)) + s) << 0),
5582        (r += (o ^ e) + h[6] + 76029189),
5583        (r = (((r << 23) | (r >>> 9)) + e) << 0),
5584        (i = r ^ e),
5585        (t += (i ^ s) + h[9] - 640364487),
5586        (t = (((t << 4) | (t >>> 28)) + r) << 0),
5587        (s += (i ^ t) + h[12] - 421815835),
5588        (s = (((s << 11) | (s >>> 21)) + t) << 0),
5589        (o = s ^ t),
5590        (e += (o ^ r) + h[15] + 530742520),
5591        (e = (((e << 16) | (e >>> 16)) + s) << 0),
5592        (r += (o ^ e) + h[2] - 995338651),
5593        (r = (((r << 23) | (r >>> 9)) + e) << 0),
5594        (t += (e ^ (r | ~s)) + h[0] - 198630844),
5595        (t = (((t << 6) | (t >>> 26)) + r) << 0),
5596        (s += (r ^ (t | ~e)) + h[7] + 1126891415),
5597        (s = (((s << 10) | (s >>> 22)) + t) << 0),
5598        (e += (t ^ (s | ~r)) + h[14] - 1416354905),
5599        (e = (((e << 15) | (e >>> 17)) + s) << 0),
5600        (r += (s ^ (e | ~t)) + h[5] - 57434055),
5601        (r = (((r << 21) | (r >>> 11)) + e) << 0),
5602        (t += (e ^ (r | ~s)) + h[12] + 1700485571),
5603        (t = (((t << 6) | (t >>> 26)) + r) << 0),
5604        (s += (r ^ (t | ~e)) + h[3] - 1894986606),
5605        (s = (((s << 10) | (s >>> 22)) + t) << 0),
5606        (e += (t ^ (s | ~r)) + h[10] - 1051523),
5607        (e = (((e << 15) | (e >>> 17)) + s) << 0),
5608        (r += (s ^ (e | ~t)) + h[1] - 2054922799),
5609        (r = (((r << 21) | (r >>> 11)) + e) << 0),
5610        (t += (e ^ (r | ~s)) + h[8] + 1873313359),
5611        (t = (((t << 6) | (t >>> 26)) + r) << 0),
5612        (s += (r ^ (t | ~e)) + h[15] - 30611744),
5613        (s = (((s << 10) | (s >>> 22)) + t) << 0),
5614        (e += (t ^ (s | ~r)) + h[6] - 1560198380),
5615        (e = (((e << 15) | (e >>> 17)) + s) << 0),
5616        (r += (s ^ (e | ~t)) + h[13] + 1309151649),
5617        (r = (((r << 21) | (r >>> 11)) + e) << 0),
5618        (t += (e ^ (r | ~s)) + h[4] - 145523070),
5619        (t = (((t << 6) | (t >>> 26)) + r) << 0),
5620        (s += (r ^ (t | ~e)) + h[11] - 1120210379),
5621        (s = (((s << 10) | (s >>> 22)) + t) << 0),
5622        (e += (t ^ (s | ~r)) + h[2] + 718787259),
5623        (e = (((e << 15) | (e >>> 17)) + s) << 0),
5624        (r += (s ^ (e | ~t)) + h[9] - 343485551),
5625        (r = (((r << 21) | (r >>> 11)) + e) << 0),
5626        this.first
5627          ? ((this.h0 = (t + 1732584193) << 0),
5628            (this.h1 = (r - 271733879) << 0),
5629            (this.h2 = (e - 1732584194) << 0),
5630            (this.h3 = (s + 271733878) << 0),
5631            (this.first = !1))
5632          : ((this.h0 = (this.h0 + t) << 0),
5633            (this.h1 = (this.h1 + r) << 0),
5634            (this.h2 = (this.h2 + e) << 0),
5635            (this.h3 = (this.h3 + s) << 0));
5636    }),
5637    (Md5.prototype.hex = function () {
5638      this.finalize();
5639      var t = this.h0,
5640        r = this.h1,
5641        e = this.h2,
5642        s = this.h3;
5643      return (
5644        HEX_CHARS[(t >> 4) & 15] +
5645        HEX_CHARS[15 & t] +
5646        HEX_CHARS[(t >> 12) & 15] +
5647        HEX_CHARS[(t >> 8) & 15] +
5648        HEX_CHARS[(t >> 20) & 15] +
5649        HEX_CHARS[(t >> 16) & 15] +
5650        HEX_CHARS[(t >> 28) & 15] +
5651        HEX_CHARS[(t >> 24) & 15] +
5652        HEX_CHARS[(r >> 4) & 15] +
5653        HEX_CHARS[15 & r] +
5654        HEX_CHARS[(r >> 12) & 15] +
5655        HEX_CHARS[(r >> 8) & 15] +
5656        HEX_CHARS[(r >> 20) & 15] +
5657        HEX_CHARS[(r >> 16) & 15] +
5658        HEX_CHARS[(r >> 28) & 15] +
5659        HEX_CHARS[(r >> 24) & 15] +
5660        HEX_CHARS[(e >> 4) & 15] +
5661        HEX_CHARS[15 & e] +
5662        HEX_CHARS[(e >> 12) & 15] +
5663        HEX_CHARS[(e >> 8) & 15] +
5664        HEX_CHARS[(e >> 20) & 15] +
5665        HEX_CHARS[(e >> 16) & 15] +
5666        HEX_CHARS[(e >> 28) & 15] +
5667        HEX_CHARS[(e >> 24) & 15] +
5668        HEX_CHARS[(s >> 4) & 15] +
5669        HEX_CHARS[15 & s] +
5670        HEX_CHARS[(s >> 12) & 15] +
5671        HEX_CHARS[(s >> 8) & 15] +
5672        HEX_CHARS[(s >> 20) & 15] +
5673        HEX_CHARS[(s >> 16) & 15] +
5674        HEX_CHARS[(s >> 28) & 15] +
5675        HEX_CHARS[(s >> 24) & 15]
5676      );
5677    }),
5678    (Md5.prototype.toString = Md5.prototype.hex),
5679    (Md5.prototype.digest = function () {
5680      this.finalize();
5681      var t = this.h0,
5682        r = this.h1,
5683        e = this.h2,
5684        s = this.h3;
5685      return [
5686        255 & t,
5687        (t >> 8) & 255,
5688        (t >> 16) & 255,
5689        (t >> 24) & 255,
5690        255 & r,
5691        (r >> 8) & 255,
5692        (r >> 16) & 255,
5693        (r >> 24) & 255,
5694        255 & e,
5695        (e >> 8) & 255,
5696        (e >> 16) & 255,
5697        (e >> 24) & 255,
5698        255 & s,
5699        (s >> 8) & 255,
5700        (s >> 16) & 255,
5701        (s >> 24) & 255,
5702      ];
5703    }),
5704    (Md5.prototype.array = Md5.prototype.digest),
5705    (Md5.prototype.arrayBuffer = function () {
5706      this.finalize();
5707      var t = new ArrayBuffer(16),
5708        r = new Uint32Array(t);
5709      return (
5710        (r[0] = this.h0),
5711        (r[1] = this.h1),
5712        (r[2] = this.h2),
5713        (r[3] = this.h3),
5714        t
5715      );
5716    }),
5717    (Md5.prototype.buffer = Md5.prototype.arrayBuffer),
5718    (Md5.prototype.base64 = function () {
5719      for (var t, r, e, s = "", i = this.array(), o = 0; 15 > o; )
5720        (t = i[o++]),
5721          (r = i[o++]),
5722          (e = i[o++]),
5723          (s +=
5724            BASE64_ENCODE_CHAR[t >>> 2] +
5725            BASE64_ENCODE_CHAR[63 & ((t << 4) | (r >>
5725> 4))] +
5726            BASE64_ENCODE_CHAR[63 & ((r << 2) | (e >>> 6))] +
5727            BASE64_ENCODE_CHAR[63 & e]);
5728      return (
5729        (t = i[o]),
5730        (s +=
5731          BASE64_ENCODE_CHAR[t >>> 2] +
5732          BASE64_ENCODE_CHAR[(t << 4) & 63] +
5733          "==")
5734      );
5735    });
5736  var exports = createMethod();
5737  COMMON_JS
5738    ? (module.exports = exports)
5739    : ((root.md5 = exports),
5740      AMD &&
5741        define(function () {
5742          return exports;
5743        }));
5744})();
5745
5746/*!
5747 * clipboard.js v1.7.1
5748 * https://zenorocha.github.io/clipboard.js
5749 *
5750 * Licensed MIT © Zeno Rocha
5751 */
5752
5753!(function (t) {
5754  if ("object" == typeof exports && "undefined" != typeof module)
5755    module.exports = t();
5756  else if ("function" == typeof define && define.amd) define([], t);
5757  else {
5758    var e;
5759    (e =
5760      "undefined" != typeof window
5761        ? window
5762        : "undefined" != typeof global
5763        ? global
5764        : "undefined" != typeof self
5765        ? self
5766        : this),
5767      (e.Clipboard = t());
5768  }
5769})(function () {
5770  var t, e, n;
5771  return (function t(e, n, o) {
5772    function i(a, c) {
5773      if (!n[a]) {
5774        if (!e[a]) {
5775          var l = "function" == typeof require && require;
5776          if (!c && l) return l(a, !0);
5777          if (r) return r(a, !0);
5778          var s = new Error("Cannot find module '" + a + "'");
5779          throw ((s.code = "MODULE_NOT_FOUND"), s);
5780        }
5781        var u = (n[a] = { exports: {} });
5782        e[a][0].call(
5783          u.exports,
5784          function (t) {
5785            var n = e[a][1][t];
5786            return i(n || t);
5787          },
5788          u,
5789          u.exports,
5790          t,
5791          e,
5792          n,
5793          o
5794        );
5795      }
5796      return n[a].exports;
5797    }
5798    for (
5799      var r = "function" == typeof require && require, a = 0;
5800      a < o.length;
5801      a++
5802    )
5803      i(o[a]);
5804    return i;
5805  })(
5806    {
5807      1: [
5808        function (t, e, n) {
5809          function o(t, e) {
5810            for (; t && t.nodeType !== i; ) {
5811              if ("function" == typeof t.matches && t.matches(e)) return t;
5812              t = t.parentNode;
5813            }
5814          }
5815          var i = 9;
5816          if ("undefined" != typeof Element && !Element.prototype.matches) {
5817            var r = Element.prototype;
5818            r.matches =
5819              r.matchesSelector ||
5820              r.mozMatchesSelector ||
5821              r.msMatchesSelector ||
5822              r.oMatchesSelector ||
5823              r.webkitMatchesSelector;
5824          }
5825          e.exports = o;
5826        },
5827        {},
5828      ],
5829      2: [
5830        function (t, e, n) {
5831          function o(t, e, n, o, r) {
5832            var a = i.apply(this, arguments);
5833            return (
5834              t.addEventListener(n, a, r),
5835              {
5836                destroy: function () {
5837                  t.removeEventListener(n, a, r);
5838                },
5839              }
5840            );
5841          }
5842          function i(t, e, n, o) {
5843            return function (n) {
5844              (n.delegateTarget = r(n.target, e)),
5845                n.delegateTarget && o.call(t, n);
5846            };
5847          }
5848          var r = t("./closest");
5849          e.exports = o;
5850        },
5851        { "./closest": 1 },
5852      ],
5853      3: [
5854        function (t, e, n) {
5855          (n.node = function (t) {
5856            return void 0 !== t && t instanceof HTMLElement && 1 === t.nodeType;
5857          }),
5858            (n.nodeList = function (t) {
5859              var e = Object.prototype.toString.call(t);
5860              return (
5861                void 0 !== t &&
5862                ("[object NodeList]" === e ||
5863                  "[object HTMLCollection]" === e) &&
5864                "length" in t &&
5865                (0 === t.length || n.node(t[0]))
5866              );
5867            }),
5868            (n.string = function (t) {
5869              return "string" == typeof t || t instanceof String;
5870            }),
5871            (n.fn = function (t) {
5872              return "[object Function]" === Object.prototype.toString.call(t);
5873            });
5874        },
5875        {},
5876      ],
5877      4: [
5878        function (t, e, n) {
5879          function o(t, e, n) {
5880            if (!t && !e && !n) throw new Error("Missing required arguments");
5881            if (!c.string(e))
5882              throw new TypeError("Second argument must be a String");
5883            if (!c.fn(n))
5884              throw new TypeError("Third argument must be a Function");
5885            if (c.node(t)) return i(t, e, n);
5886            if (c.nodeList(t)) return r(t, e, n);
5887            if (c.string(t)) return a(t, e, n);
5888            throw new TypeError(
5889              "First argument must be a String, HTMLElement, HTMLCollection, or NodeList"
5890            );
5891          }
5892          function i(t, e, n) {
5893            return (
5894              t.addEventListener(e, n),
5895              {
5896                destroy: function () {
5897                  t.removeEventListener(e, n);
5898                },
5899              }
5900            );
5901          }
5902          function r(t, e, n) {
5903            return (
5904              Array.prototype.forEach.call(t, function (t) {
5905                t.addEventListener(e, n);
5906              }),
5907              {
5908                destroy: function () {
5909                  Array.prototype.forEach.call(t, function (t) {
5910                    t.removeEventListener(e, n);
5911                  });
5912                },
5913              }
5914            );
5915          }
5916          function a(t, e, n) {
5917            return l(document.body, t, e, n);
5918          }
5919          var c = t("./is"),
5920            l = t("delegate");
5921          e.exports = o;
5922        },
5923        { "./is": 3, delegate: 2 },
5924      ],
5925      5: [
5926        function (t, e, n) {
5927          function o(t) {
5928            var e;
5929            if ("SELECT" === t.nodeName) t.focus(), (e = t.value);
5930            else if ("INPUT" === t.nodeName || "TEXTAREA" === t.nodeName) {
5931              var n = t.hasAttribute("readonly");
5932              n || t.setAttribute("readonly", ""),
5933                t.select(),
5934                t.setSelectionRange(0, t.value.length),
5935                n || t.removeAttribute("readonly"),
5936                (e = t.value);
5937            } else {
5938              t.hasAttribute("contenteditable") && t.focus();
5939              var o = window.getSelection(),
5940                i = document.createRange();
5941              i.selectNodeContents(t),
5942                o.removeAllRanges(),
5943                o.addRange(i),
5944                (e = o.toString());
5945            }
5946            return e;
5947          }
5948          e.exports = o;
5949        },
5950        {},
5951      ],
5952      6: [
5953        function (t, e, n) {
5954          function o() {}
5955          (o.prototype = {
5956            on: function (t, e, n) {
5957              var o = this.e || (this.e = {});
5958              return (o[t] || (o[t] = [])).push({ fn: e, ctx: n }), this;
5959            },
5960            once: function (t, e, n) {
5961              function o() {
5962                i.off(t, o), e.apply(n, arguments);
5963              }
5964              var i = this;
5965              return (o._ = e), this.on(t, o, n);
5966            },
5967            emit: function (t) {
5968              var e = [].slice.call(arguments, 1),
5969                n = ((this.e || (this.e = {}))[t] || []).slice(),
5970                o = 0,
5971                i = n.length;
5972              for (o; o < i; o++) n[o].fn.apply(n[o].ctx, e);
5973              return this;
5974            },
5975            off: function (t, e) {
5976              var n = this.e || (this.e = {}),
5977                o = n[t],
5978                i = [];
5979              if (o && e)
5980                for (var r = 0, a = o.length; r < a; r++)
5981                  o[r].fn !== e && o[r].fn._ !== e && i.push(o[r]);
5982              return i.length ? (n[t] = i) : delete n[t], this;
5983            },
5984          }),
5985            (e.exports = o);
5986        },
5987        {},
5988      ],
5989      7: [
5990        function (e, n, o) {
5991          !(function (i, r) {
5992            if ("function" == typeof t && t.amd) t(["module", "select"], r);
5993            else if (void 0 !== o) r(n, e("select"));
5994            else {
5995              var a = { exports: {} };
5996              r(a, i.select), (i.clipboardAction = a.exports);
5997            }
5998          })(this, function (t, e) {
5999            "use strict";
6000            function n(t) {
6001              return t && t.__esModule ? t : { default: t };
6002            }
6003            function o(t, e) {
6004              if (!(t instanceof e))
6005                throw new TypeError("Cannot call a class as a function");
6006            }
6007            var i = n(e),
6008              r =
6009                "function" == typeof Symbol &&
6010                "symbol" == typeof Symbol.iterator
6011                  ? function (t) {
6012                      return typeof t;
6013                    }
6014                  : function (t) {
6015                      return t &&
6016                        "function" == typeof Symbol &&
6017                        t.constructor === Symbol &&
6018                        t !== Symbol.prototype
6019                        ? "symbol"
6020                        : typeof t;
6021                    },
6022              a = (function () {
6023                function t(t, e) {
6024                  for (var n = 0; n < e.length; n++) {
6025                    var o = e[n];
6026                    (o.enumerable = o.enumerable || !1),
6027                      (o.configurable = !0),
6028                      "value" in o && (o.writable = !0),
6029                      Object.defineProperty(t, o.key, o);
6030                  }
6031                }
6032                return function (e, n, o) {
6033                  return n && t(e.prototype, n), o && t(e, o), e;
6034                };
6035              })(),
6036              c = (function () {
6037                function t(e) {
6038                  o(this, t), this.resolveOptions(e), this.initSelection();
6039                }
6040                return (
6041                  a(t, [
6042                    {
6043                      key: "resolveOptions",
6044                      value: function t() {
6045                        var e =
6046                          arguments.length > 0 && void 0 !== arguments[0]
6047                            ? arguments[0]
6048                            : {};
6049                        (this.action = e.action),
6050                          (this.container = e.container),
6051                          (this.emitter = e.emitter),
6052                          (this.target = e.target),
6053                          (this.text = e.text),
6054                          (this.trigger = e.trigger),
6055                          (this.selectedText = "");
6056                      },
6057                    },
6058                    {
6059                      key: "initSelection",
6060                      value: function t() {
6061                        this.text
6062                          ? this.selectFake()
6063                          : this.target && this.selectTarget();
6064                      },
6065                    },
6066                    {
6067                      key: "selectFake",
6068                      value: function t() {
6069                        var e = this,
6070                          n =
6071                            "rtl" ==
6072                            document.documentElement.getAttribute("dir");
6073                        this.removeFake(),
6074                          (this.fakeHandlerCallback = function () {
6075                            return e.removeFake();
6076                          }),
6077                          (this.fakeHandler =
6078                            this.container.addEventListener(
6079                              "click",
6080                              this.fakeHandlerCallback
6081                            ) || !0),
6082                          (this.fakeElem = document.createElement("textarea")),
6083                          (this.fakeElem.style.fontSize = "12pt"),
6084                          (this.fakeElem.style.border = "0"),
6085                          (this.fakeElem.style.padding = "0"),
6086                          (this.fakeElem.style.margin = "0"),
6087                          (this.fakeElem.style.position = "absolute"),
6088                          (this.fakeElem.style[n ? "right" : "left"] =
6089                            "-9999px");
6090                        var o =
6091                          window.pageYOffset ||
6092                          document.documentElement.scrollTop;
6093                        (this.fakeElem.style.top = o + "px"),
6094                          this.fakeElem.setAttribute("readonly", ""),
6095                          (this.fakeElem.value = this.text),
6096                          this.container.appendChild(this.fakeElem),
6097                          (this.selectedText = (0, i.default)(this.fakeElem)),
6098                          this.copyText();
6099                      },
6100                    },
6101                    {
6102                      key: "removeFake",
6103                      value: function t() {
6104                        this.fakeHandler &&
6105                          (this.container.removeEventListener(
6106                            "click",
6107                            this.fakeHandlerCallback
6108                          ),
6109                          (this.fakeHandler = null),
6110                          (this.fakeHandlerCallback = null)),
6111                          this.fakeElem &&
6112                            (this.container.removeChild(this.fakeElem),
6113                            (this.fakeElem = null));
6114                      },
6115                    },
6116                    {
6117                      key: "selectTarget",
6118                      value: function t() {
6119                        (this.selectedText = (0, i.default)(this.target)),
6120                          this.copyText();
6121                      },
6122                    },
6123                    {
6124                      key: "copyText",
6125                      value: function t() {
6126                        var e = void 0;
6127                        try {
6128                          e = document.execCommand(this.action);
6129                        } catch (t) {
6130                          e = !1;
6131                        }
6132                        this.handleResult(e);
6133                      },
6134                    },
6135                    {
6136                      key: "handleResult",
6137                      value: function t(e) {
6138                        this.emitter.emit(e ? "success" : "error", {
6139                          action: this.action,
6140                          text: this.selectedText,
6141                          trigger: this.trigger,
6142                          clearSelection: this.clearSelection.bind(this),
6143                        });
6144                      },
6145                    },
6146                    {
6147                      key: "clearSelection",
6148                      value: function t() {
6149                        this.trigger && this.trigger.focus(),
6150                          window.getSelection().removeAllRanges();
6151                      },
6152                    },
6153                    {
6154                      key: "destroy",
6155                      value: function t() {
6156                        this.removeFake();
6157                      },
6158                    },
6159                    {
6160                      key: "action",
6161                      set: function t() {
6162                        var e =
6163                          arguments.length > 0 && void 0 !== arguments[0]
6164                            ? arguments[0]
6165                            : "copy";
6166                        if (
6167                          ((this._action = e),
6168                          "copy" !== this._action && "cut" !== this._action)
6169                        )
6170                          throw new Error(
6171                            'Invalid "action" value, use either "copy" or "cut"'
6172                          );
6173                      },
6174                      get: function t() {
6175                        return this._action;
6176                      },
6177                    },
6178                    {
6179                      key: "target",
6180                      set: function t(e) {
6181                        if (void 0 !== e) {
6182                          if (
6183                            !e ||
6184                            "object" !== (void 0 === e ? "undefined" : r(e)) ||
6185                            1 !== e.nodeType
6186                          )
6187                            throw new Error(
6188                              'Invalid "target" value, use a valid Element'
6189                            );
6190                          if (
6191                            "copy" === this.action &&
6192                            e.hasAttribute("disabled")
6193                          )
6194                            throw new Error(
6195                              'Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'
6196                            );
6197                          if (
6198                            "cut" === this.action &&
6199                            (e.hasAttribute("readonly") ||
6200                              e.hasAttribute("disabled"))
6201                          )
6202                            throw new Error(
6203                              'Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'
6204                            );
6205                          this._target = e;
6206                        }
6207                      },
6208                      get: function t() {
6209                        return this._target;
6210                      },
6211                    },
6212                  ]),
6213                  t
6214                );
6215              })();
6216            t.exports = c;
6217          });
6218        },
6219        { select: 5 },
6220      ],
6221      8: [
6222        function (e, n, o) {
6223          !(function (i, r) {
6224            if ("function" == typeof t && t.amd)
6225              t(
6226                [
6227                  "module",
6228                  "./clipboard-action",
6229                  "tiny-emitter",
6230                  "good-listener",
6231                ],
6232                r
6233              );
6234            else if (void 0 !== o)
6235              r(
6236                n,
6237                e("./clipboard-action"),
6238                e("tiny-emitter"),
6239                e("good-listener")
6240              );
6241            else {
6242              var a = { exports: {} };
6243              r(a, i.clipboardAction, i.tinyEmitter, i.goodListener),
6244                (i.clipboard = a.exports);
6245            }
6246          })(this, function (t, e, n, o) {
6247            "use strict";
6248            function i(t) {
6249              return t && t.__esModule ? t : { default: t };
6250            }
6251            function r(t, e) {
6252              if (!(t instanceof e))
6253                throw new TypeError("Cannot call a class as a function");
6254            }
6255            function a(t, e) {
6256              if (!t)
6257                throw new ReferenceError(
6258                  "this hasn't been initialised - super() hasn't been called"
6259                );
6260              return !e || ("object" != typeof e && "function" != typeof e)
6261                ? t
6262                : e;
6263            }
6264            function c(t, e) {
6265              if ("function" != typeof e && null !== e)
6266                throw new TypeError(
6267                  "Super expression must either be null or a function, not " +
6268                    typeof e
6269                );
6270              (t.prototype = Object.create(e && e.prototype, {
6271                constructor: {
6272                  value: t,
6273                  enumerable: !1,
6274                  writable: !0,
6275                  configurable: !0,
6276                },
6277              })),
6278                e &&
6279                  (Object.setPrototypeOf
6280                    ? Object.setPrototypeOf(t, e)
6281                    : (t.__proto__ = e));
6282            }
6283            function l(t, e) {
6284              var n = "data-clipboard-" + t;
6285              if (e.hasAttribute(n)) return e.getAttribute(n);
6286            }
6287            var s = i(e),
6288              u = i(n),
6289              f = i(o),
6290              d =
6291                "function" == typeof Symbol &&
6292                "symbol" == typeof Symbol.iterator
6293                  ? function (t) {
6294                      return typeof t;
6295                    }
6296                  : function (t) {
6297                      return t &&
6298                        "function" == typeof Symbol &&
6299                        t.constructor === Symbol &&
6300                        t !== Symbol.prototype
6301                        ? "symbol"
6302                        : typeof t;
6303                    },
6304              h = (function () {
6305                function t(t, e) {
6306                  for (var n = 0; n < e.length; n++) {
6307                    var o = e[n];
6308                    (o.enumerable = o.enumerable || !1),
6309                      (o.configurable = !0),
6310                      "value" in o && (o.writable = !0),
6311                      Object.defineProperty(t, o.key, o);
6312                  }
6313                }
6314                return function (e, n, o) {
6315                  return n && t(e.prototype, n), o && t(e, o), e;
6316                };
6317              })(),
6318              p = (function (t) {
6319                function e(t, n) {
6320                  r(this, e);
6321                  var o = a(
6322                    this,
6323                    (e.__proto__ || Object.getPrototypeOf(e)).call(this)
6324                  );
6325                  return o.resolveOptions(n), o.listenClick(t), o;
6326                }
6327                return (
6328                  c(e, t),
6329                  h(
6330                    e,
6331                    [
6332                      {
6333                        key: "resolveOptions",
6334                        value: function t() {
6335                          var e =
6336                            arguments.length > 0 && void 0 !== arguments[0]
6337                              ? arguments[0]
6338                              : {};
6339                          (this.action =
6340                            "function" == typeof e.action
6341                              ? e.action
6342                              : this.defaultAction),
6343                            (this.target =
6344                              "function" == typeof e.target
6345                                ? e.target
6346                                : this.defaultTarget),
6347                            (this.text =
6348                              "function" == typeof e.text
6349                                ? e.text
6350                                : this.defaultText),
6351                            (this.container =
6352                              "object" === d(e.container)
6353                                ? e.container
6354                                : document.body);
6355                        },
6356                      },
6357                      {
6358                        key: "listenClick",
6359                        value: function t(e) {
6360                          var n = this;
6361                          this.listener = (0, f.default)(
6362                            e,
6363                            "click",
6364                            function (t) {
6365                              return n.onClick(t);
6366                            }
6367                          );
6368                        },
6369                      },
6370                      {
6371                        key: "onClick",
6372                        value: function t(e) {
6373                          var n = e.delegateTarget || e.currentTarget;
6374                          this.clipboardAction && (this.clipboardAction = null),
6375                            (this.clipboardAction = new s.default({
6376                              action: this.action(n),
6377                              target: this.target(n),
6378                              text: this.text(n),
6379                              container: this.container,
6380                              trigger: n,
6381                              emitter: this,
6382                            }));
6383                        },
6384                      },
6385                      {
6386                        key: "defaultAction",
6387                        value: function t(e) {
6388                          return l("action", e);
6389                        },
6390                      },
6391                      {
6392                        key: "defaultTarget",
6393                        value: function t(e) {
6394                          var n = l("target", e);
6395                          if (n) return document.querySelector(n);
6396                        },
6397                      },
6398                      {
6399                        key: "defaultText",
6400                        value: function t(e) {
6401                          return l("text", e);
6402                        },
6403                      },
6404                      {
6405                        key: "destroy",
6406                        value: function t() {
6407                          this.listener.destroy(),
6408                            this.clipboardAction &&
6409                              (this.clipboardAction.destroy(),
6410                              (this.clipboardAction = null));
6411                        },
6412                      },
6413                    ],
6414                    [
6415                      {
6416                        key: "isSupported",
6417                        value: function t() {
6418                          var e =
6419                              arguments.length > 0 && void 0 !== arguments[0]
6420                                ? arguments[0]
6421                                : ["copy", "cut"],
6422                            n = "string" == typeof e ? [e] : e,
6423                            o = !!document.queryCommandSupported;
6424                          return (
6425                            n.forEach(function (t) {
6426                              o = o && !!document.queryCommandSupported(t);
6427                            }),
6428                            o
6429                          );
6430                        },
6431                      },
6432                    ]
6433                  ),
6434                  e
6435                );
6436              })(u.default);
6437            t.exports = p;
6438          });
6439        },
6440        { "./clipboard-action": 7, "good-listener": 4, "tiny-emitter": 6 },
6441      ],
6442    },
6443    {},
6444    [8]
6445  )(8);
6446});
6447
6448var vhUnitFix = function (selectors) {
6449  var self = this;
6450
6451  if (/(chrome|android|crios)/i.test(navigator.userAgent)) {
6452    this.getElements(selectors);
6453    this.fixAll();
6454
6455    this.windowWidth = window.innerWidth;
6456    this.windowHeight = window.innerHeight;
6457
6458    window.addEventListener("resize", function () {
6459      if (
6460        self.windowWidth !== window.innerWidth &&
6461        self.windowHeight !== window.innerHeight
6462      ) {
6463        self.windowWidth = window.innerWidth;
6464        self.windowHeight = window.innerHeight;
6465        self.fixAll();
6466      }
6467    });
6468  }
6469
6470  self.prototype = {
6471    getElements: function (selectors) {
6472      this.elements = [];
6473      selectors = this.isArray(selectors) ? selectors : [selectors];
6474
6475      for (var i = 0; i < selectors.length; i++) {
6476        var selector = selectors[i].selector;
6477        var elements = document.querySelectorAll(selector);
6478
6479        for (var j = 0; j < elements.length; j++) {
6480          this.elements.push({
6481            domElement: elements[j],
6482            vh: selectors[i].vh,
6483          });
6484        }
6485      }
6486    },
6487    isArray: function (array) {
6488      return Object.prototype.toString.call(array) === "[object Array]";
6489    },
6490    fixAll: function () {
6491      for (var i = 0; i < this.elements.length; i++) {
6492        var element = this.elements[i];
6493        element.domElement.style.height =
6494          (window.innerHeight * element.vh) / 100 + "px";
6495      }
6496    },
6497  };
6498};
6499/*
6500vhUnitFix.prototype.getElements = function(selectors) {
6501	this.elements = [];
6502	selectors = this.isArray(selectors) ? selectors : [selectors];
6503
6504	for (var i = 0; i < selectors.length; i++) {
6505		var selector = selectors[i].selector;
6506		var elements = document.querySelectorAll(selector);
6507
6508		for (var j = 0; j < elements.length; j++) {
6509			this.elements.push({
6510				domElement: elements[j],
6511				vh: selectors[i].vh
6512			});
6513		}
6514	}
6515};
6516vhUnitFix.prototype.isArray = function(array) {
6517	return Object.prototype.toString.call(array) === "[object Array]";
6518};
6519vhUnitFix.prototype.fixAll = function() {
6520	for (var i = 0; i < this.elements.length; i++) {
6521		var element = this.elements[i];
6522		element.domElement.style.height = (window.innerHeight * element.vh / 100) + "px";
6523	}
6524};
6525*/
6526
6527var options = [
6528  {
6529    selector: ".Bears",
6530    vh: 150,
6531  },
6532];
6533// var vhUnitFix = new vhUnitFix(options);
6534
6535/*************************************************
6536 *
6537 * IntersectionObserver
6538 *
6539 ************************************************/
6540// IntersectionObserverの作成
6541const observer = new IntersectionObserver(
6542  function (entries) {
6543    for (let i = 0; i < entries.length; i++) {
6544      // 領域内なら処理を実行
6545      if (entries[i].intersectionRatio <= 0) continue;
6546      showElm(entries[i].target);
6547    }
6548  },
6549  {
6550    // オプション
6551    rootMargin: "-10% 0% -10% 0%",
6552  }
6553);
6554// 監視対象の追加
6555const elements = document.querySelectorAll(".js-target");
6556for (let i = 0; i < elements.length; i++) {
6557  observer.observe(elements[i]);
6558  console.log(elements[i]);
6559}
6560// 領域内に入ったとき実行する処理
6561function showElm(e) {
6562  e.classList.add("is-active");
6563  observer.unobserve(e);
6564}
6565

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.