1/*! 2 * ScriptName: common.js 3 * Version: 3.0.8 4 */ 5 6/* 7 * Catch errors 8 * 9 */ 10 11window.onerror = function(message, url, line, column, error) { 12 if (message.indexOf("Script error.") > -1) return; 13 14 if ($("html").hasClass("fc-debugger")) { 15 var uid = md5(message + url + line + column), 16 filename = url, 17 consoleHTML = "", 18 msg = "", 19 total = 0, 20 $blkConsole = $("#fc-console .console-main > .console-block:first-child[data-uid='" + uid + "']"); 21 22 consoleHTML += '<div id="fc-console">'; 23 consoleHTML += '<div class="console-title">FC Console</div>'; 24 consoleHTML += '<div class="console-clear">Clear</div>'; 25 consoleHTML += '<div class="console-main">'; 26 consoleHTML += '</div>'; 27 consoleHTML += '</div>'; 28 29 if ($("#fc-console").length < 1) $("body").append(consoleHTML); 30 31 if (typeof url !== "undefined") { 32 var fname = url.replace("\\", "/"); // correct slashes 33 if (fname.lastIndexOf("/")) fname = fname.substr(fname.lastIndexOf("/") + 1); 34 filename = fname.substr(0, fname.lastIndexOf(".")) + "." + fname.substr(fname.lastIndexOf(".") + 1); 35 if (filename.length < 3) filename = url; 36 } 37 38 msg += '<div class="console-block" data-uid="' + uid + '" data-count="1">'; 39 msg += '<div class="console-message">' + message + '</div>'; 40 msg += '<div class="console-stacktrace">'; 41 msg += '<div class="console-file">Script: <a href="' + url + '" target="_blank">' + filename + '</a></div>'; 42 msg += '<div class="console-line">Line: <strong>' + line + '</strong></div>'; 43 msg += '<div class="console-column">Column: <strong>' + column + '</strong></div>'; 44 msg += '</div>'; 45 msg += '<div class="console-error">' + error + '</div>'; 46 msg += '</div>'; 47 48 if ($blkConsole.length > 0) { 49 var count = $blkConsole.attr("data-count"); 50 if (count !== undefined && !isNaN(count) && Number(count) >= 0) { 51 count = Number(count); 52 count++; 53 54 $blkConsole.attr("data-count", count); 55 } else $blkConsole.attr("data-count", 1); 56 } else $("#fc-console .console-main").prepend(msg); 57 58 $("#fc-console .console-main > .console-block").each(function() { 59 var count = $(this).attr("data-count"); 60 if (count !== undefined && !isNaN(count) && Number(count) >= 0) total += Number(count); 61 else total++; 62 }); 63 64 $("#fc-console .console-title").attr("data-total", total); 65 } 66}; 67 68 69/* 70 * Switch fonts to Noto Serif 71 * 72 */ 73 74if ("ontouchstart" in document.documentElement || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0) { // remove all :hover stylesheets 75 try { // prevent exception on browsers not supporting DOM styleSheets properly 76 for (var si in document.styleSheets) { 77 var styleSheet = document.styleSheets[si]; 78 79 if (!styleSheet.rules) continue; 80 81 for (var ri = styleSheet.rules.length - 1; ri >= 0; ri--) { 82 if (!styleSheet.rules[ri].cssText || !styleSheet.rules[ri].style || !styleSheet.rules[ri].style.fontFamily) continue; 83 84 var fontFamily = styleSheet.rules[ri].style.fontFamily; 85 if (/^\s*(游æËÂæÅÂ|Yu-?Mincho|ÄÆâÄÆÂ©ÄâÂ®ÄÆÂæËÂæÅÂ|Hiragino[\s|-]*Mincho|(MS|ï¼Âï¼³)[\s|-]*æËÂæÅÂ)/i.test(fontFamily)) { 86 // styleSheet.rules[ri].style.fontFamily = fontFamily.replace(fontFamily, "'Noto Serif JP', " + fontFamily); 87 $(styleSheet.rules[ri].selectorText).css("font-family", "'Noto Serif JP', " + fontFamily); 88 } 89 } 90 } 91 } catch (ex) {} 92} 93 94 95+ 96 97function($) { 98 "use strict"; 99 var transitionEnd = function() { 100 var el = document.createElement("fcvndev"); 101 102 var transitionEndEventNames = { 103 transition: "transitionend", 104 OTransition: "oTransitionEnd", 105 MozTransition: "transitionend", 106 WebkitTransition: "webkitTransitionEnd" 107 }; 108 109 for (var name in transitionEndEventNames) { 110 if (el.style[name] !== undefined) { 111 return { 112 end: transitionEndEventNames[name] 113 }; 114 } 115 } 116 117 return false;
118 }, 119 animationEnd = function() { 120 var el = document.createElement("fcvndev"); 121 122 var animationEndEventNames = { 123 animation: "animationend", 124 OAnimation: "oAnimationEnd", 125 MozAnimation: "animationend", 126 WebkitAnimation: "webkitAnimationEnd" 127 }; 128 129 for (var name in animationEndEventNames) { 130 if (el.style[name] !== undefined) { 131 return { 132 end: animationEndEventNames[name] 133 }; 134 } 135 } 136 137 return false; 138 }; 139 140 $(function() { 141 $.support.transition = transitionEnd(); 142 143 $.support.animation = animationEnd(); 144 }); 145}(jQuery); 146 147$(document).ready(function() { 148 var UA = navigator.userAgent; 149 if (UA.indexOf("iPhone") < 0 && UA.indexOf("Android") < 0) $(".telhref").contents().unwrap(); // remove link [tel] on desktop 150 151 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) $("html.mobile-no-animate").addClass("noanimated"); // to remove transition 152 else $("html.mobile-no-animate").removeClass("noanimated"); 153 154 // fix bg parallax on mobile 155 if (isMobile.any()) $(".bg-parallax").css("background-attachment", "inherit"); 156 else $(".bg-parallax").css("background-attachment", ""); 157 158 /* 159 if ((UA.indexOf("iPad") > -1) || (UA.indexOf("iPhone") > -1) || (UA.indexOf("iPod") > -1)) { // iOS 160 window.onpageshow = function(e) { 161 if (e.persisted || window.performance && window.performance.navigation.type == 2) window.location.reload(); // go back by hit back button 162 }; 163 } 164 */ 165 166 167 168 // forcing a page to reload when the back button is clicked 169 window.onpageshow = function(event) { 170 if (event.persisted && $("body").hasClass("reload-on-back")) window.location.reload(); 171 }; 172 /* 173 if(navigator.userAgent.match(/Trident\/7\./)) { 174 $('body').on("mousewheel", function () { 175 event.preventDefault(); 176 var wd = event.wheelDelta; 177 var csp = window.pageYOffset; 178 window.scrollTo(0, csp - wd); 179 }); 180 } 181 */ 182 var clipboardData = new ClipboardJS(".copy", { 183 // container: $(".copy").get(0), 184 text: function(trigger) { 185 var _text_ = "{TITLE} {URL}", 186 _viewport_ = $("meta[name='viewport']").last().attr("content"); 187 188 if ($(trigger).attr("data-copy") && $(trigger).attr("data-copy").length > 0) _text_ = $(trigger).attr("data-copy"); 189 190 // if (_viewport_ && /(?:user-scalable\s*=\s*yes)/i.test(_viewport_)) $("meta[name='viewport']").last().attr("content", _viewport_.replace(/(?:user-scalable\s*=\s*yes)/i, "user-scalable=no")); // disabled zoom 191 if (_viewport_) { // disabled zoom 192 var _vpt_ = _viewport_.replace(/(?:user-scalable\s*=\s*yes)/i, "user-scalable=no"), 193 _spt_ = _vpt_.split(","), 194 _arr_ = []; 195 196 for (var i in _spt_) { 197 if (!/initial-scale/i.test(_spt_[i])) _arr_.push(_spt_[i].trim()); 198 } 199 _arr_.push("initial-scale=1"); 200 201 $("meta[name='viewport']").last().attr("content", _arr_.join(", ")); // disabled zoom 202 } 203 204 if ($(trigger).attr("data-replace-text")) $(trigger).html($(trigger).attr("data-replace-text")); 205 else if ($(trigger).attr("data-replace-image")) { 206 var _imgReplace_ = $(trigger).attr("data-replace-image"); 207 208 if ($(trigger).children("picture").length > 0) { 209 $(trigger).children("picture").addClass("copy-change"); 210 $(trigger).children("picture").children().each(function() { 211 if ($(this).prop("tagName").toLowerCase() == "img") $(this).attr("src", _imgReplace_).removeClass("btn"); 212 else if ($(this).prop("tagName").toLowerCase() == "source") $(this).attr("srcset", $(this).attr("src-replace") ? $(this).attr("src-replace") : _imgReplace_); 213 }); 214 } else if ($(trigger).children("img").length > 0) { 215 if ($(trigger).children("img").hasClass("btn")) { 216 $(trigger).children("img").addClass("copy-change"); 217 218 _imgReplace_ = 219 _imgReplace_ 220 .replace(/^(.*?)(_on)?\.(.*?)$/, "$1_on.$3"); 221 } 222 223 $(trigger).children("img").attr("src", _imgReplace_); 224 } else $(trigger).html('<img src="' + _imgReplace_ + '" />'); 225 } 226 227 $(trigger).addClass("copied"); 228 229 if (_viewport_) $("meta[name='viewport']").last().attr("content", _viewport_); // enabled zoom 230 231 _text_ = _text_.replace("{TITLE}", document.title).replace("{URL}", location.href); 232 233 return _text_; 234 } 235 }); 236 237 clipboardData 238 .on("success", function() { 239 var offsetX = window.scrollX || window.pageXOffset || window.document.documentElement.scrollLeft, 240 offsetY = window.scrollY || window.pageYOffset || window.document.documentElement.scrollTop; 241 242 // firefox jump - fixed 243 window.scroll(offsetX, offsetY); // started 244 245 setTimeout(function() { // step 1 246 window.scroll(offsetX, offsetY); 247 }, 20); 248 249 setTimeout(function() { // step 2 250 window.scroll(offsetX, offsetY); 251 }, 15); 252 253 setTimeout(function() { // step 3 254 window.scroll(offsetX, offsetY); 255 }, 10); 256 257 setTimeout(function() { // step 4 258 window.scroll(offsetX, offsetY); 259 }, 5); 260 261 setTimeout(function() { // step 5 262 window.scroll(offsetX, offsetY); 263 }, 0); 264 265 window.scroll(offsetX, offsetY); // final 266 }) 267 .on("error", function() {}); 268 269 $("body") 270 .on("click", "#fc-console .console-title", function() { 271 $(this).parents("#fc-console").toggleClass("active"); 272 }) 273 .on("click", "#fc-console .console-clear", function() { 274 $("#fc-console").removeClass("active"); 275 $("#fc-console .console-main").empty(); 276 $("#fc-console .console-title").removeAttr("data-total"); 277 }) 278 .on("click", ".copy", function(e) { 279 e.preventDefault(); 280 281 $(this).removeAttr("data-clipboard-text"); 282 }) 283 284 285 // BEGIN: slide fading 286 if ($(".slide-fade").length > 0) { 287 $(".slide-fade").each(function() { 288 var $this = $(this), 289 __idx__ = $(".slide-fade").index($this), 290 $duration = typeof $this.attr("data-duration") != "undefined" ? parseInt($this.attr("data-duration")) : 1000, 291 $timer = typeof $this.attr("data-timer") != "undefined" ? parseInt($this.attr("data-timer")) : 4000, 292 $delay = typeof $this.attr("data-delay") != "undefined" ? parseInt($this.attr("data-delay")) : false;
293 294 if ($timer < $duration) $timer = $duration * 2; 295 296 if (!$this.children(".active").length > 0) { 297 $this.children().hide(); 298 $this.children().eq(0).show().addClass("active"); 299 300 if ($this.siblings(".slide-page").length > 0) $this.siblings(".slide-page").children().eq(0).addClass("active"); 301 } else { 302 if ($this.siblings(".slide-page").length > 0) $this.siblings(".slide-page").children().eq($this.children(".active").index()).addClass("active"); 303 } 304 305 if ($(this).siblings(".slide-page").length > 0) { 306 $(this).siblings(".slide-page").children().each(function(i) { 307 $(this).attr("data", i); 308 }); 309 } 310 311 if (!$(this).hasClass("stop")) { 312 // $slideFadeTimer[__idx__] = setInterval(function() { 313 // slideFade($this, $duration); 314 // }, $timer); 315 316 $(this).parents(".slideParent").addClass("move-start").attr("data", $this.children(".active").index()); 317 318 if ($slideFadeTimer[__idx__]) clearTimeout($slideFadeTimer[__idx__]); 319 $slideFadeTimer[__idx__] = setTimeout(function() { 320 slideFade($this, $duration); 321 }, $delay ? $delay : $timer); 322 } 323 }); 324 325 /* 326 * TODO: 327 * --- removeClass/addClass 328 * .move-next 329 * .move-prev 330 * .move-first 331 * .move-last 332 * 333 */ 334 335 $("body").on("click", ".slide-btn > .slide-next", function() { 336 var $btn = $(this), 337 $this = $btn.parent().siblings(".slide-fade"), 338 __idx__ = $(".slide-fade").index($this), 339 $duration = typeof $this.attr("data-duration") != "undefined" ? parseInt($this.attr("data-duration")) : 1000, 340 $timer = typeof $this.attr("data-timer") != "undefined" ? parseInt($this.attr("data-timer")) : 4000; 341 342 if ($timer < $duration) $timer = $duration * 2; 343 344 if (!$btn.hasClass("clicked") && !$this.hasClass("stop")) { 345 // if ($slideFadeTimer[__idx__]) clearInterval($slideFadeTimer[__idx__]); 346 if ($slideFadeTimer[__idx__]) clearTimeout($slideFadeTimer[__idx__]); 347 348 $btn.addClass("clicked"); 349 350 $this.children(".active").stop().fadeOut($duration, function() { 351 $(this).removeClass("active").removeAttr("style").hide(); 352 }); 353 354 if ($this.children(".active").next().length) { 355 $this.children(".active").next().stop().fadeIn($duration, function() { 356 $(this).addClass("active").removeAttr("style").show(); 357 $btn.removeClass("clicked"); 358 359 // $slideFadeTimer[__idx__] = setInterval(function() { 360 $slideFadeTimer[__idx__] = setTimeout(function() { 361 $this.siblings(".slide-btn").children(".slide-next").click(); 362 }, $timer); 363 }); 364 } else { 365 if (!$this.hasClass("once")) { 366 $this.children().eq(0).stop().fadeIn($duration, function() { 367 $(this).addClass("active").removeAttr("style").show(); 368 $btn.removeClass("clicked"); 369 370 // $slideFadeTimer[__idx__] = setInterval(function() { 371 $slideFadeTimer[__idx__] = setTimeout(function() { 372 $this.siblings(".slide-btn").children(".slide-next").click(); 373 }, $timer); 374 }); 375 } 376 } 377 } 378 }); 379 $("body").on("click", ".slide-btn > .slide-prev", function() { 380 var $btn = $(this), 381 $this = $btn.parent().siblings(".slide-fade"), 382 __idx__ = $(".slide-fade").index($this), 383 $duration = typeof $this.attr("data-duration") != "undefined" ? parseInt($this.attr("data-duration")) : 1000, 384 $timer = typeof $this.attr("data-timer") != "undefined" ? parseInt($this.attr("data-timer")) : 4000; 385 386 if ($timer < $duration) $timer = $duration * 2; 387 388 if (!$btn.hasClass("clicked") && !$this.hasClass("stop")) { 389 // if ($slideFadeTimer[__idx__]) clearInterval($slideFadeTimer[__idx__]); 390 if ($slideFadeTimer[__idx__]) clearTimeout($slideFadeTimer[__idx__]); 391 392 $btn.addClass("clicked"); 393 394 $this.children(".active").stop().fadeOut($duration, function() { 395 $(this).removeClass("active").removeAttr("style").hide(); 396 }); 397 398 if ($this.children(".active").prev().length) { 399 $this.children(".active").prev().stop().fadeIn($duration, function() { 400 $(this).addClass("active").removeAttr("style").show(); 401 $btn.removeClass("clicked"); 402 403 // $slideFadeTimer[__idx__] = setInterval(function() { 404 $slideFadeTimer[__idx__] = setTimeout(function() { 405 $this.siblings(".slide-btn").children(".slide-next").
405click(); 406 }, $timer); 407 }); 408 } else { 409 $this.children().last().stop().fadeIn($duration, function() { 410 $(this).addClass("active").removeAttr("style").show(); 411 $btn.removeClass("clicked"); 412 413 // $slideFadeTimer[__idx__] = setInterval(function() { 414 $slideFadeTimer[__idx__] = setTimeout(function() { 415 $this.siblings(".slide-btn").children(".slide-next").click(); 416 }, $timer); 417 }); 418 } 419 } 420 }); 421 422 $("body").on("click", ".slide-page > *", function() { 423 var $page = $(this).parent(), 424 $idx = $(this).index(), 425 $this = $(this).parents(".slideParent").length ? $(this).parents(".slideParent").find(".slide-fade") : $(this).siblings(".slide-fade"), 426 __idx__ = $(".slide-fade").index($this), 427 $duration = typeof $this.attr("data-duration") != "undefined" ? parseInt($this.attr("data-duration")) : 1000, 428 $timer = typeof $this.attr("data-timer") != "undefined" ? parseInt($this.attr("data-timer")) : 4000; 429 430 if ($timer < $duration) $timer = $duration * 2; 431 432 if ($this.length) { 433 if (!$page.hasClass("clicked") && !$this.hasClass("stop")) { 434 if ($(this).siblings(".active").length > 0) { 435 var idxOld = parseInt($(this).siblings(".active").attr("data")), 436 idxNew = parseInt($(this).attr("data")), 437 beside = idxOld - idxNew === 1 || idxNew - idxOld === 1; 438 439 $(this).parents(".slideParent").removeClass("move-start move-next move-prev move-first move-last"); 440 441 if (idxNew > idxOld) { 442 $(this).parents(".slideParent").addClass("move-next").attr("data", idxNew); 443 444 if ($(this).is(":last-child")) $(this).parents(".slideParent").addClass("move-last"); 445 } else { 446 $(this).parents(".slideParent").addClass("move-prev").attr("data", idxNew); 447 448 if ($(this).is(":first-child")) $(this).parents(".slideParent").addClass("move-first"); 449 } 450 } 451 452 if ($this.children().eq($idx).length > 0) { 453 if ($slideFadeTimer[__idx__]) clearTimeout($slideFadeTimer[__idx__]); 454 455 $this.siblings(".slide-page").children(".active").removeClass("active"); 456 $(this).addClass("active"); 457 458 $page.addClass("clicked"); 459 460 $this.children(".active").stop().fadeOut($duration, function() { 461 $(this).removeClass("active").removeAttr("style").hide(); 462 }); 463 464 $this.children().eq($idx).stop().fadeIn($duration, function() { 465 $(this).addClass("active").removeAttr("style").show(); 466 $page.removeClass("clicked"); 467 468 // $slideFadeTimer[__idx__] = setInterval(function() { 469 // slideFade($this, $duration); 470 // }, $timer); 471 472 $slideFadeTimer[__idx__] = setTimeout(function() { 473 slideFade($this, $duration); 474 }, $timer); 475 }); 476 } else console.info("Slide not found"); 477 } 478 } else console.info(".slideParent or .slide-fade not found!"); 479 }); 480 } 481 // BEGIN: slide fading 482 483 // navigation animate 484 if ($(".nav-animate").length) { 485 $(".nav-animate").each(function() { 486 var $timerNav, 487 $navNull = $(this).hasClass("nav-null"), 488 $navWidth = $(this).find("li").first().outerWidth(), 489 $navPosX = $navNull ? 0 : $(this).find("li").first().position().left, 490 // $navML = 0, 491 $navMR = 0; 492 493 if ($(this).find("li.active").length) { 494 $navWidth = $(this).find("li.active").outerWidth(), 495 $navPosX = $(this).find("li.active").position().left; 496 497 // $navML = $(this).find("li.active").next().length ? parseInt($(this).find("li.active").next().css("margin-left"), 10), 498 $navMR = $(this).find("li.active").prev().length ? parseInt($(this).find("li.active").prev().css("margin-right"), 10) : 0; 499 } else { 500 if (!$navNull) $(this).find("li").first().addClass("active"); 501 502 // $navML = parseInt($(this).find("li").first().css("margin-left"), 10), 503 // $navMR = parseInt($(this).find("li").first().css("margin-right"), 10); 504 } 505 506 $navWidth += $navMR; 507 $navPosX -= $navMR; 508 509 $(this).children("span").css({ 510 width: $navWidth, 511 left: $navPosX 512 }); 513 514 if ($navNull) $(this).children("span").css("opacity", 0); 515 516 $(this).find("li").mouseover(function() {
517 var $navW = $(this).outerWidth(), 518 $navX = $(this).position().left, 519 // $nML = $(this).next().length ? parseInt($(this).next().css("margin-left"), 10), 520 $nMR = $(this).prev().length ? parseInt($(this).prev().css("margin-right"), 10) : 0; 521 522 if ($navNull) { 523 clearTimeout($timerNav); 524 525 $navPosX = $navX - $nMR; 526 527 $(this).parents(".nav-animate").children("span").css("opacity", 1); 528 console.log($navPosX); 529 } 530 531 $(this).parents(".nav-animate").children("span").stop().animate({ 532 width: $navW + $nMR, 533 left: $navX - $nMR 534 }, "fast"); 535 }).mouseleave(function() { 536 var $span = $(this).parents(".nav-animate").children("span"); 537 538 if ($navNull) { 539 clearTimeout($timerNav); 540 $timerNav = setTimeout(function() { 541 console.log($navPosX); 542 $span.stop().fadeOut(100, function() { 543 $(this).removeAttr("style").css({ 544 opacity: 0, 545 width: $navWidth, 546 left: $navPosX 547 }) 548 }); 549 }, 500); 550 } else { 551 $span.stop().animate({ 552 width: $navWidth, 553 left: $navPosX 554 }, "fast"); 555 } 556 }); 557 }); 558 } 559 560 561 // BEGIN: toggle 562 if ($(".toggle").length > 0) { 563 $("body").on("click", ".toggle-link", function() { 564 var $toggleDuration = 500, 565 $toggleElm = $(this).parents(".toggle").first(); 566 567 if (typeof $toggleElm.attr("data-duration") != "undefined") { 568 if ($.inArray($toggleElm.attr("data-duration"), ["slow", "normal", "fast"]) >= 0) $toggleDuration = $toggleElm.attr("data-duration"); 569 else $toggleDuration = parseInt($toggleElm.attr("data-duration")); 570 } 571 572 if ($(this).parents(".single").length > 0) { 573 $(this).parents(".single").find(".toggle-main").stop().slideUp($toggleDuration, function() { 574 $(this).removeAttr("style"); 575 $(this).parents(".toggle").first().removeClass("active"); 576 }); 577 } 578 579 if ($(this).parents(".toggle").first().hasClass("active")) { 580 $(this).siblings(".toggle-main").stop().slideUp($toggleDuration, function() { 581 $(this).removeAttr("style"); 582 $(this).parents(".toggle").first().removeClass("active"); 583 }); 584 } else { 585 $(this).siblings(".toggle-main").stop().slideDown($toggleDuration, function() { 586 $(this).removeAttr("style"); 587 $(this).parents(".toggle").first().addClass("active"); 588 589 // if ($(this).find("[class*=heightLine]").length) heightLine(); 590 591 $(window).trigger("resize"); 592 }); 593 594 if ($(this).siblings(".toggle-main").find("[class*=heightLine]").length) heightLine(); 595 } 596 }); 597 } 598 // END: toggle 599 600 // BEGIN: tabs - switch 601 if ($(".tabs-switch").length) { 602 $(".tabs-switch").each(function() { 603 var $tabsSwitch = $(this), 604 $tabLink = $tabsSwitch.find(".tab-link"), 605 $tabContent = $tabsSwitch.find(".tab-content"); 606 607 $tabLink.children().each(function() { 608 if ($(this).find("img").length > 0 && $(this).find("img").hasClass("btn")) { 609 $(this).data("src", $(this).find("img").attr("src")); 610 611 $(this).find("img").attr("src").match(/^(.*)(\.{1}.*)/g); 612 $(this).data("active", RegExp.$1 + "_on" + RegExp.$2); 613 } 614 }); 615 616 $tabContent.children().hide(); 617 618 if (!$tabsSwitch.hasClass("stop")) { 619 $tabLink.each(function() { 620 // TODO: active by [data-active] 621 var hash = window.location.hash || location.hash; 622 if (hash) { 623 if ($(this).children("[data-tab-anchor='" + hash + "']").length) $(this).children("[data-tab-anchor='" + hash + "']").addClass("active"); 624 else $(this).children().first().addClass("active"); 625 } else if (!$(this).children(".active").length) $(this).children().first().addClass("active"); 626 627 $(this).children(".active").find("img").attr("src", $(this).children(".active").data("active")).removeClass("btn"); 628 }); 629 630 if ($tabLink.children(".active").hasClass("all")) $tabContent.children().show(); 631 else $tabContent.children().eq($tabLink.children(".active").index()).show(); 632 } 633 634 if ($(".bx-wrapper").length > 0) $(window).trigger("resize"); 635 }); 636 637 $("body").on("click", ".tabs-switch-close", function() { 638 var $content = $(this).parents(".tab-content").first(), 639 $switch = $(this).parents(".tabs-switch").first(); 640 641 if ($content.length > 0 && $switch.length > 0) { 642 var $tabMode = $.inArray($switch.attr("data"), ["fade", "slide", "block"]) >= 0 ? $switch.attr("data") : "block", 643 $tabDuration = $switch.attr("data-duration") ? parseInt($switch.attr("data-duration")) : 300; 644 645 if ($tabMode == "fade") $content.children().stop().fadeOut($tabDuration); 646 else if ($tabMode == "slide") $content.children().stop().slideUp($tabDuration); 647 else $content.children().stop().hide($tabDuration); 648 } 649 }); 650 651 $("body").on("click", ".tab-link .tab-item, .tab-link > *", function() { 652 var $itemMode = $(this).hasClass("tab-item"), 653 $this = $itemMode ? $(this, ".tab-item") : $(this), 654 $idxAll = $this.parents(".tab-link").first().children(".all").length > 0 ? $this.parents(".tab-link").first().children(".all").index() : false, 655 $idx = $itemMode ? $this.parents(".tab-link").first().find(".tab-item").index($this) : $this.parents(".tab-link").first().children().index($this), 656 $act = $itemMode ? $this.parents(".tab-link").first().find(".tab-item.active") : $this.parents(".tab-link").first().children(".active"), 657 $tabMode = $.inArray($this.parents(".tabs-switch").first().attr("data"), ["fade", "slide", "block"]) >= 0 ? $this.parents(".tabs-switch").first().attr("data") : "block", 658 $tabDuration = $this.parents(".tabs-switch").first().attr("data-duration") ? parseInt($this.parents(".tabs-switch").first().attr("data-duration")) : 300, 659 $tabContent = $this.parents(".tabs-switch").first().children(".tab-content"), 660 $tabIdx = $this.attr("data-active") ? $this.attr("data-active") : false, 661 $autoScroll = $.inArray($this.parents(".tabs-switch").first().attr("data-scroll"), ["true", "on", "enable", "enabled", "1"]) >= 0 ? true : false, 662 $itself = $.inArray($this.parents(".tabs-switch").first().attr("data-toggle"), ["true", "on", "enable", "enabled", "1"]) >= 0 && $this.hasClass("active") ? true : false, 663 $itHide = $tabContent.children().eq($idx).is(":hidden"); 664 665 if ($tabIdx) { 666 $this.parents(".tabs-switch").first().find(".tab-link").each(function() { 667 var $tabBtn = $itemMode ? $(this).find(".tab-item[data-active='" + $tabIdx + "']") : $(this).children("[data-active='" + $tabIdx + "']"), 668 $elmActive = $itemMode ? $(this).find(".tab-item.active") : $(this).children(".active"); 669 670 $elmActive.find("img").attr("src", $elmActive.data("src")); 671 $elmActive.removeClass("active"); 672 673 if ($itself) { 674 if ($itHide) $tabBtn.addClass("active"); 675 else $tabBtn.removeClass("active"); 676 } else $tabBtn.addClass("active"); 677 678 // if (!$tabBtn.find("img").hasClass("active")) $tabBtn.find("img").attr("src", $tabBtn.data("active")); 679 if ($tabBtn.find("img").hasClass("btn")) $tabBtn.find("img").attr("src", $tabBtn.data("active")).removeClass("btn"); 680 }); 681 } else { 682 if (/^(.*?)_on\.(.*?)$/.test($act.find("img").attr("src"))) $act.find("img").addClass("btn"); 683 684 $act.find("img").attr("src", $act.data("src")); 685 $act.removeClass("active"); 686 687 if ($itself) { 688 if ($itHide) $this.addClass("active"); 689 else $this.removeClass("active"); 690 } else $this.addClass("active"); 691 692 // if (!$this.find("img").hasClass("active")) $this.find("img").attr("src", $this.data("active")); 693 if ($this.find("img").hasClass("btn")) $this.find("img").attr("src", $this.data("active")).removeClass("btn"); 694 } 695 696 if (!$this.parents(".tab-link").first().hasClass("clicked")) { 697 $this.parents(".tab-link").first().addClass("clicked"); 698 699 if ($this.hasClass("all")) { 700 if ($tabMode == "fade") { 701 $tabContent.children().stop().fadeIn($tabDuration, function() { 702 $(this).removeAttr("style").show(); 703 704 if ($(this).find("[class*=heightLine]").length) heightLine(); 705 706 if ($this.children("a").length) $this.children("a").click(); 707 708 $tabContent.css({ 709 minHeight: "" 710 }); 711 712 $(window).trigger("resize"); 713 714 $this.parents(".tab-link").first().removeClass("clicked"); 715 }); 716 } else if ($tabMode == "slide") { 717 $tabContent.children().slideDown($tabDuration, function() { 718 $(this).removeAttr("style").show(); 719 720 if ($(this).find("[class*=heightLine]").length) heightLine(); 721 722 if ($this.children("a").length) $this.children("a").click(); 723 724 $(window).trigger("resize"); 725 726 $this.parents(".tab-link").first().removeClass("clicked"); 727 }); 728 } else { 729 $tabDuration = $(this).parents(".tabs-switch").first().attr("data-duration") ? parseInt($(this).parents(".tabs-switch").first().attr("data-duration")) : 0; 730 731 $tabContent.children().stop().show($tabDuration, function() { 732 $(this).removeAttr("style").show(); 733 734 if ($(this).find("[class*=heightLine]").length) heightLine(); 735 736 if ($this.children("a").length) $this.children("a").click(); 737 738 $(window).trigger("resize"); 739 740 $this.parents(".tab-link").first().removeClass("clicked"); 741 }); 742 } 743 } else { 744 if ($idxAll !== false && $idxAll >= 0 && $idx >= $idxAll) $idx -= 1; 745 746 if ($tabMode == "fade") { 747 if ($itself) { 748 $tabContent.children().eq($idx).stop().fadeToggle($tabDuration, function() { 749 if ($itHide) $(this).removeAttr("style").show(); 750 else $(this).removeAttr("style").hide(); 751 752 if ($(this).find("[class*=heightLine]").length) heightLine(); 753 754 if ($this.children("a").length) $this.children("a").click(); 755 756 $tabContent.css({ 757 minHeight: "" 758 }); 759 760 $(window).trigger("resize"); 761 762 $this.parents(".tab-link").first().removeClass("clicked"); 763 }); 764 } else { 765 $tabContent.css({ 766 minHeight: $tabContent.outerHeight() 767 }); 768 769 $tabContent.children().stop().fadeOut($tabDuration, function() { 770 $(this).removeAttr("style").hide(); 771 }); 772 $tabContent.children().eq($idx).stop().delay($tabDuration).fadeIn($tabDuration, function() { 773 $(this).removeAttr("style").show(); 774 775 if ($(this).find("[class*=heightLine]").length) heightLine(); 776 777 if ($this.children("a").length) $this.children("a").click(); 778 779 $tabContent.css({ 780 minHeight: "" 781 }); 782 783 $(window).trigger("resize"); 784 785 $this.parents(".tab-link").first().removeClass("clicked"); 786 }); 787 } 788 } else if ($tabMode == "slide") { 789 if ($itself) { 790 $tabContent.children().eq($idx).stop().slideToggle($tabDuration, function() { 791 if ($itHide) $(this).removeAttr("style").show(); 792 else $(this).removeAttr("style").hide(); 793 794 if ($(this).find("[class*=heightLine]").length) heightLine(); 795 796 if ($this.children("a").length) $this.children("a").click(); 797 798 $(window).trigger("resize"); 799 800 $this.parents(".tab-link").first().removeClass("clicked"); 801 }); 802 } else { 803 $tabContent.children().stop().slideUp($tabDuration, function() { 804 $(this).removeAttr("style").hide(); 805 }).siblings().eq($idx).stop().slideDown($tabDuration, function() { 806 $(this).removeAttr("style").show(); 807 808 if ($(this).find("[class*=heightLine]").length) heightLine(); 809 810 if ($this.children("a").length) $this.children("a").click(); 811 812 $(window).trigger("resize"); 813 814 $this.parents(".tab-link").first().removeClass("clicked"); 815 }); 816 } 817 } else { 818 $tabDuration = $this.parents(".tabs-switch").first().attr("data-duration") ? parseInt($this.parents(".tabs-switch").first().attr("data-duration")) : 0; 819 820 if ($itself) { 821 $tabContent.children().eq($idx).stop().toggle($tabDuration, function() { 822 if ($itHide) $(this).removeAttr("style").show(); 823 else $(this).removeAttr("style").hide(); 824 825 if ($(this).find("[class*=heightLine]").length) heightLine(); 826 827 if ($this.children("a").length) $this.children("a").click(); 828 829 $(window).trigger("resize"); 830 831 $this.parents(".tab-link").first().removeClass("clicked"); 832 }); 833 } else { 834 $tabContent.children().stop().hide($tabDuration, function() { 835 $(this).removeAttr("style").hide(); 836 }).siblings().eq($idx).stop().show($tabDuration, function() { 837 $(this).removeAttr("style").show(); 838 839 if ($(this).find("[class*=heightLine]").length) heightLine(); 840 841
841 if ($this.children("a").length) $this.children("a").click(); 842 843 $(window).trigger("resize"); 844 845 $this.parents(".tab-link").first().removeClass("clicked"); 846 }); 847 } 848 } 849 } 850 851 setTimeout(function() { 852 $this.parents(".tab-link").first().removeClass("clicked"); 853 }, $tabDuration); 854 855 if ($(".slick-slider").length > 0) { 856 $(window).trigger("resize"); 857 } 858 859 if ($(".bx-wrapper").length > 0) { 860 setTimeout(function() { 861 $(window).trigger("resize"); 862 }, 1); 863 } 864 865 if ($autoScroll) { 866 var $offsetY = $tabContent.offset().top, 867 $navOffset = 0; 868 869 if ($(".nav-fixed").length) $navOffset = typeof $(".nav-fixed").attr("data-height") != "undefined" ? parseInt($(".nav-fixed").attr("data-height")) : $(".nav-fixed").outerHeight(); 870 871 if ($(".nav-target").length) { 872 if ($(".nav-fixed").length) $navOffset = typeof $(".nav-fixed").attr("data-height") != "undefined" ? parseInt($(".nav-fixed").attr("data-height")) : $(".nav-fixed").outerHeight(); 873 874 $("html, body").stop().animate({ 875 scrollTop: $offsetY - $navOffset 876 }, 500); 877 } else { 878 $("html, body").stop().animate({ 879 scrollTop: $offsetY - $navOffset 880 }, 500); 881 } 882 } 883 } 884 }); 885 } 886 // END: tabs - switch 887 888 // BEGIN: gmap 889 if (typeof gmap === "object" && isObjectVar(gmap)) { 890 var _dialogs_ = [], 891 _dialogsOpen_ = true; 892 893 function init() { 894 var errorsMap = { 895 mapDiv: false, 896 latLong: false 897 }, 898 objData = {}; // single || multiMap || multiPoint 899 900 901 // checking 902 if (typeof gmap.maps != "undefined" && Object.keys(gmap.maps).length > 0) { // multi map 903 if (typeof gmap.maps[0] == "undefined") { // associative array 904 if (typeof gmap.maps.mapDiv == "undefined" || gmap.maps.mapDiv == "") errorsMap.mapDiv = 1; 905 else if ((typeof gmap.maps.latitude == "undefined" && typeof gmap.maps.latitude != "number") || (typeof gmap.maps.longitude == "undefined" && typeof gmap.maps.longitude != "number")) errorsMap.latLong = 1; 906 } else { // object 907 for (var s in gmap.maps) { // loop 908 if (typeof gmap.maps[s].mapDiv == "undefined" || gmap.maps[s].mapDiv == "") { 909 errorsMap.mapDiv = 2; 910 break; 911 } else if ((typeof gmap.maps[s].latitude == "undefined" && typeof gmap.maps[s].latitude != "number") || (typeof gmap.maps[s].longitude == "undefined" && typeof gmap.maps[s].longitude != "number")) { 912 errorsMap.latLong = 2; 913 break; 914 } 915 } 916 } 917 } else { // single map 918 if (typeof gmap.mapDiv == "undefined" || gmap.mapDiv == "") errorsMap.mapDiv = 3; 919 else if ((typeof gmap.latitude == "undefined" && typeof gmap.latitude != "number") || (typeof gmap.longitude == "undefined" || typeof gmap.longitude != "number")) errorsMap.latLong = 3; 920 } 921 922 923 if (errorsMap.mapDiv || errorsMap.latLong) { 924 console.info("ERROR", errorsMap); 925 return false; 926 } else { 927 // if () 928 var init = initMap(gmap); 929 // console.log(init); 930 } 931 932 /* 933 * initialize 934 * 935 */ 936 937 function initMap(data) { 938 var dataMap = { 939 mapDiv: false, 940 latitude: false, 941 longitude: false, 942 943 center: false, 944 945 zoom: 17, 946 minZoom: 2, 947 zoomControl: true, 948 disableDoubleClickZoom: true, 949 mapTypeControl: true, 950 scaleControl: true, 951 scrollwheel: false, 952 panControl: true, 953 streetViewControl: true, 954 draggable: true, 955 overviewMapControl: true, 956 957 styles: false, 958 style: false, 959 960 name: false,
961 desc: false, 962 tel: false, 963 email: false, 964 965 url: false, 966 logo: false, 967 size: false, 968 scale: false, 969 origin: false, 970 anchor: false, 971 optimized: false, 972 973 clickable: false, 974 hover: false, 975 html: false, 976 977 multi: false 978 }; 979 980 // BEGIN: configs default 981 if (typeof data.zoom != "undefined" && typeof data.zoom == "number") dataMap.zoom = data.zoom; 982 if (typeof data.minZoom != "undefined" && typeof data.minZoom == "number") dataMap.minZoom = data.minZoom; 983 if (typeof data.zoomControl != "undefined" && typeof data.zoomControl == "boolean") dataMap.zoomControl = data.zoomControl; 984 if (typeof data.disableDoubleClickZoom != "undefined" && typeof data.disableDoubleClickZoom == "boolean") dataMap.disableDoubleClickZoom = data.disableDoubleClickZoom; 985 if (typeof data.mapTypeControl != "undefined" && typeof data.mapTypeControl == "boolean") dataMap.mapTypeControl = data.mapTypeControl; 986 if (typeof data.scaleControl != "undefined" && typeof data.scaleControl == "boolean") dataMap.scaleControl = data.scaleControl; 987 if (typeof data.scrollwheel != "undefined" && typeof data.scrollwheel == "boolean") dataMap.scrollwheel = data.scrollwheel; 988 if (typeof data.panControl != "undefined" && typeof data.panControl == "boolean") dataMap.panControl = data.panControl; 989 if (typeof data.streetViewControl != "undefined" && typeof data.streetViewControl == "boolean") dataMap.streetViewControl = data.streetViewControl; 990 if (typeof data.draggable != "undefined" && typeof data.draggable == "boolean") dataMap.draggable = data.draggable; 991 if (typeof data.overviewMapControl != "undefined" && typeof data.overviewMapControl == "boolean") dataMap.overviewMapControl = data.overviewMapControl; 992 993 if (typeof data.name != "undefined" && data.name != "") dataMap.name = data.name; 994 if (typeof data.desc != "undefined" && data.desc != "") dataMap.desc = data.desc; 995 if (typeof data.tel != "undefined" && data.tel != "") dataMap.tel = data.tel; 996 if (typeof data.email != "undefined" && data.email != "") dataMap.email = data.email; 997 if (typeof data.url != "undefined" && data.url != "") dataMap.url = data.url; 998 if (typeof data.logo != "undefined" && data.logo != "") dataMap.logo = data.logo; 999 if (typeof data.size != "undefined" && typeof data.size.width != "undefined" && data.size.width != "") dataMap.sizeWidth = data.size.width; 1000 if (typeof data.size != "undefined" && typeof data.size.height != "undefined" && data.size.height != "") dataMap.sizeHeight = data.size.height; 1001 if (typeof data.scale != "undefined" && typeof data.scale.width != "undefined" && data.scale.width != "") dataMap.scaleWidth = data.scale.width; 1002 if (typeof data.scale != "undefined" && typeof data.scale.height != "undefined" && data.scale.height != "") dataMap.scaleHeight = data.scale.height; 1003 if (typeof data.origin != "undefined" && typeof data.origin.x != "undefined" && data.origin.x != "") dataMap.originX = data.origin.x; 1004 if (typeof data.origin != "undefined" && typeof data.origin.y != "undefined" && data.origin.y != "") dataMap.originY = data.origin.y; 1005 if (typeof data.anchor != "undefined" && typeof data.anchor.x != "undefined" && data.anchor.x != "") dataMap.anchorX = data.anchor.x; 1006 if (typeof data.anchor != "undefined" && typeof data.anchor.y != "undefined" && data.anchor.y != "") dataMap.anchorY = data.anchor.y; 1007 if (typeof data.optimized != "undefined" && data.optimized != "") dataMap.optimized = data.optimized; 1008 1009 if (typeof data.clickable != "undefined" && data.clickable != "") dataMap.clickable = data.clickable; 1010 if (typeof data.html != "undefined" && data.html != "") dataMap.html = data.html; 1011 if (typeof data.hover != "undefined" && typeof data.hover == "boolean") dataMap.hover = data.hover; 1012 1013 if (typeof data.multi != "undefined" && Object.keys(data.multi).length > 0) dataMap.multi = data.multi; 1014 1015 if (typeof data.styles != "undefined") dataMap.styles = data.styles; 1016 else if (typeof data.style != "undefined") { 1017 dataMap.style = {}; 1018 if (typeof data.style.hue != "undefined") dataMap.style.hue = data.style.hue; 1019 if (typeof data.style.gamma != "undefined") dataMap.style.gamma = data.style.gamma; 1020 if (typeof data.style.lightness != "undefined") dataMap.style.lightness = data.style.lightness; 1021 if (typeof data.style.saturation != "undefined") dataMap.style.saturation = data.style.saturation; 1022 } 1023 // END: configs default 1024 1025 dataMap.mapDiv = data.mapDiv; 1026 dataMap.latitude = data.latitude; 1027 dataMap.longitude = data.longitude; 1028 1029 if (typeof data.maps != "undefined" && Object.keys(data.maps).length > 0) { // multi map 1030 var objMap = {}; 1031 if (typeof data.maps[0] == "undefined") objMap[0] = data.maps; // object 1032 else objMap = data.maps; // array 1033 1034 for (var g in objMap) { // loop 1035 var obj = objMap[g]; 1036 1037 // BEGIN: override configs 1038 if (typeof obj.zoom != "undefined" && typeof obj.zoom == "number") dataMap.zoom = obj.zoom; 1039 if (typeof obj.minZoom != "undefined" && typeof obj.minZoom == "number") dataMap.minZ
1039oom = obj.minZoom; 1040 if (typeof obj.zoomControl != "undefined" && typeof obj.zoomControl == "boolean") dataMap.zoomControl = obj.zoomControl; 1041 if (typeof obj.disableDoubleClickZoom != "undefined" && typeof obj.disableDoubleClickZoom == "boolean") dataMap.disableDoubleClickZoom = obj.disableDoubleClickZoom; 1042 if (typeof obj.mapTypeControl != "undefined" && typeof obj.mapTypeControl == "boolean") dataMap.mapTypeControl = obj.mapTypeControl; 1043 if (typeof obj.scaleControl != "undefined" && typeof obj.scaleControl == "boolean") dataMap.scaleControl = obj.scaleControl; 1044 if (typeof obj.scrollwheel != "undefined" && typeof obj.scrollwheel == "boolean") dataMap.scrollwheel = obj.scrollwheel; 1045 if (typeof obj.panControl != "undefined" && typeof obj.panControl == "boolean") dataMap.panControl = obj.panControl; 1046 if (typeof obj.streetViewControl != "undefined" && typeof obj.streetViewControl == "boolean") dataMap.streetViewControl = obj.streetViewControl; 1047 if (typeof obj.draggable != "undefined" && typeof obj.draggable == "boolean") dataMap.draggable = obj.draggable; 1048 if (typeof obj.overviewMapControl != "undefined" && typeof obj.overviewMapControl == "boolean") dataMap.overviewMapControl = obj.overviewMapControl; 1049 1050 if (typeof obj.styles != "undefined") dataMap.styles = obj.styles; 1051 else if (typeof obj.style != "undefined") { 1052 dataMap.style = {}; 1053 if (typeof obj.style.hue != "undefined") dataMap.style.hue = obj.style.hue; 1054 if (typeof obj.style.gamma != "undefined") dataMap.style.gamma = obj.style.gamma; 1055 if (typeof obj.style.lightness != "undefined") dataMap.style.lightness = obj.style.lightness; 1056 if (typeof obj.style.saturation != "undefined") dataMap.style.saturation = obj.style.saturation; 1057 } 1058 1059 if (typeof obj.name != "undefined" && obj.name != "") dataMap.name = obj.name; 1060 if (typeof obj.desc != "undefined" && obj.desc != "") dataMap.desc = obj.desc; 1061 if (typeof obj.tel != "undefined" && obj.tel != "") dataMap.tel = obj.tel; 1062 if (typeof obj.email != "undefined" && obj.email != "") dataMap.email = obj.email; 1063 if (typeof obj.url != "undefined" && obj.url != "") dataMap.url = obj.url; 1064 if (typeof obj.logo != "undefined" && obj.logo != "") dataMap.logo = obj.logo; 1065 if (typeof obj.sizeWidth != "undefined" && obj.sizeWidth != "") dataMap.sizeWidth = obj.sizeWidth; 1066 if (typeof obj.sizeHeight != "undefined" && obj.sizeHeight != "") dataMap.sizeHeight = obj.sizeHeight; 1067 if (typeof obj.scaleWidth != "undefined" && obj.scaleWidth != "") dataMap.scaleWidth = obj.scaleWidth; 1068 if (typeof obj.scaleHeight != "undefined" && obj.scaleHeight != "") dataMap.scaleHeight = obj.scaleHeight; 1069 if (typeof obj.originX != "undefined" && obj.originX != "") dataMap.originX = obj.originX; 1070 if (typeof obj.originY != "undefined" && obj.originY != "") dataMap.originY = obj.originY; 1071 if (typeof obj.anchorX != "undefined" && obj.anchorX != "") dataMap.anchorX = obj.anchorX; 1072 if (typeof obj.anchorY != "undefined" && obj.anchorY != "") dataMap.anchorY = obj.anchorY; 1073 if (typeof obj.optimized != "undefined" && obj.optimized != "") dataMap.optimized = obj.optimized; 1074 // END: override configs 1075 1076 if (typeof obj.clickable != "undefined" && obj.clickable != "") dataMap.clickable = obj.clickable; 1077 if (typeof obj.html != "undefined" && obj.html != "") dataMap.html = obj.html; 1078 if (typeof obj.hover != "undefined" && typeof obj.hover == "boolean") dataMap.hover = obj.hover; 1079 if (typeof obj.multi != "undefined" && Object.keys(obj.multi).length > 0) dataMap.multi = obj.multi; 1080 1081 dataMap.mapDiv = obj.mapDiv; 1082 dataMap.latitude = obj.latitude; 1083 dataMap.longitude = obj.longitude; 1084 1085 if (typeof obj.center != "undefined") { 1086 dataMap.center = {}; 1087 if (typeof obj.center.latitude != "undefined") dataMap.center.latitude = obj.center.latitude; 1088 if (typeof obj.center.longitude != "undefined") dataMap.center.longitude = obj.center.longitude; 1089 } else { 1090 dataMap.center = { 1091 latitude: obj.latitude, 1092 longitude: obj.longitude 1093 }; 1094 } 1095 1096 loadMap(dataMap); 1097 } 1098 } else { // single map 1099 if (typeof data.center != "undefined") { 1100 dataMap.center = {}; 1101 if (typeof data.center.latitude != "undefined") dataMap.center.latitude = data.center.latitude; 1102 if (typeof data.center.longitude != "undefined") dataMap.center.longitude = data.center.longitude; 1103 } else { 1104 dataMap.center = { 1105 latitude: data.latitude, 1106 longitude: data.longitude 1107 }; 1108 } 1109 1110 loadMap(dataMap); 1111 } 1112 1113 return dataMap; 1114 } 1115 1116 function loadMap(data) { 1117 var elm = data.mapDiv; 1118 1119 elm = elm.substring(0, 1) == "#" ? elm.substring(1) : elm; // remove hash 1120 1121 var mapElement = document.getElementById(elm), 1122 styleOptions = [], 1123 mapOptions = { 1124 center: new google.maps.LatLng(data.center.latitude, data.center.longitude), 1125 zoom: data.zoom, 1126 minZoom: data.minZoom, 1127 zoomControl: data.zoomControl, 1128 zoomControlOptions: { 1129 style: google.maps.ZoomControlStyle.DEFAULT, 1130 }, 1131 disableDoubleClickZoom: data.disableDoubleClickZoom, 1132 scaleControl: data.scaleControl, 1133 scrollwheel: data.scrollwheel, 1134 panControl: data.panControl, 1135 streetViewControl: data.streetViewControl, 1136 draggable: data.draggable, 1137 mapTypeControl: data.mapTypeControl, 1138 mapTypeControlOptions: { 1139 style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, 1140 }, 1141 mapTypeId: google.maps.MapTypeId.ROADMAP, 1142 overviewMapControl: data.overviewMapControl, 1143 overviewMapControlOptions: { 1144 opened: false, 1145 } 1146 }, 1147 googleMap = new google.maps.Map(mapElement, mapOptions); 1148 1149 if (data.multi === false) { 1150 var arr = {}; 1151 1152 if (typeof data["name"] != "undefined") arr["name"] = data["name"]; 1153 if (typeof data["desc"] != "undefined") arr["de
1153sc"] = data["desc"]; 1154 if (typeof data["tel"] != "undefined") arr["tel"] = data["tel"]; 1155 if (typeof data["email"] != "undefined") arr["email"] = data["email"]; 1156 if (typeof data["url"] != "undefined") arr["url"] = data["url"]; 1157 if (typeof data["logo"] != "undefined") arr["logo"] = data["logo"]; 1158 if (typeof data["sizeWidth"] != "undefined") arr["sizeWidth"] = data["sizeWidth"]; 1159 if (typeof data["sizeHeight"] != "undefined") arr["sizeHeight"] = data["sizeHeight"]; 1160 if (typeof data["scaleWidth"] != "undefined") arr["scaleWidth"] = data["scaleWidth"]; 1161 if (typeof data["scaleHeight"] != "undefined") arr["scaleHeight"] = data["scaleHeight"]; 1162 if (typeof data["originX"] != "undefined") arr["originX"] = data["originX"]; 1163 if (typeof data["originY"] != "undefined") arr["originY"] = data["originY"]; 1164 if (typeof data["anchorX"] != "undefined") arr["anchorX"] = data["anchorX"]; 1165 if (typeof data["anchorY"] != "undefined") arr["anchorY"] = data["anchorY"]; 1166 if (typeof data["optimized"] != "undefined") arr["optimized"] = data["optimized"]; 1167 if (typeof data["clickable"] != "undefined") arr["clickable"] = data["clickable"]; 1168 if (typeof data["html"] != "undefined") arr["html"] = data["html"]; 1169 if (typeof data["hover"] != "undefined") arr["hover"] = data["hover"]; 1170 1171 arr["longitude"] = data["longitude"]; 1172 arr["latitude"] = data["latitude"]; 1173 1174 setMaps(arr, googleMap, data.center); 1175 } else { 1176 for (var i = 0; i < Object.keys(data.multi).length; i++) { 1177 var arr = data.multi[i]; 1178 1179 if (typeof data["clickable"] != "undefined") arr["clickable"] = data.clickable; 1180 if (typeof data["html"] != "undefined") arr["html"] = data.html; 1181 if (typeof data["hover"] != "undefined") arr["hover"] = data.hover; 1182 1183 if (typeof arr["size"] != "undefined") { 1184 if (typeof arr["size"]["width"] != "undefined") arr["sizeWidth"] = arr["size"]["width"]; 1185 if (typeof arr["size"]["height"] != "undefined") arr["sizeHeight"] = arr["size"]["height"]; 1186 1187 delete arr["size"]; 1188 } 1189 if (typeof arr["scale"] != "undefined") { 1190 if (typeof arr["scale"]["width"] != "undefined") arr["scaleWidth"] = arr["scale"]["width"]; 1191 if (typeof arr["scale"]["height"] != "undefined") arr["scaleHeight"] = arr["scale"]["height"]; 1192 1193 delete arr["scale"]; 1194 } 1195 if (typeof arr["origin"] != "undefined") { 1196 if (typeof arr["origin"]["x"] != "undefined") arr["originX"] = arr["origin"]["x"]; 1197 if (typeof arr["origin"]["y"] != "undefined") arr["originY"] = arr["origin"]["y"]; 1198 1199 delete arr["origin"]; 1200 } 1201 if (typeof arr["anchor"] != "undefined") { 1202 if (typeof arr["anchor"]["x"] != "undefined") arr["anchorX"] = arr["anchor"]["x"]; 1203 if (typeof arr["anchor"]["y"] != "undefined") arr["anchorY"] = arr["anchor"]["y"]; 1204 1205 delete arr["anchor"]; 1206 } 1207 if (typeof arr["optimized"] != "undefined") arr["optimized"] = arr["optimized"]; 1208 setMaps(arr, googleMap, data.center); 1209 } 1210 } 1211 1212 // stylers 1213 if (data.styles !== false) styleOptions = data.styles; 1214 else if (data.style !== false) { 1215 if (typeof data.style.hue != "undefined" || typeof data.style.gamma != "undefined" || typeof data.style.lightness != "undefined" || typeof data.style.saturation != "undefined") { 1216 if (typeof styleOptions[0] == "undefined") styleOptions[0] = {}; 1217 if (typeof styleOptions[0].stylers == "undefined") styleOptions[0].stylers = []; 1218 } 1219 1220 if (typeof data.style.hue != "undefined") { 1221 styleOptions[0].stylers.push({ 1222 hue: data.style.hue 1223 }); 1224 } 1225 if (typeof data.style.gamma != "undefined") { 1226 styleOptions[0].stylers.push({ 1227 gamma: data.style.gamma 1228 }); 1229 } 1230 if (typeof data.style.lightness != "undefined") { 1231 styleOptions[0].stylers.push({ 1232 lightness: data.style.lightness 1233 }); 1234 } 1235 if (typeof data.style.saturation != "undefined") { 1236 styleOptions[0].stylers.push({ 1237 saturation: data.style.saturation 1238 }); 1239 } 1240 } 1241 1242 var styledMapOptions = { 1243 name: "MAP" 1244 }, 1245 sampleType = new google.maps.StyledMapType(styleOptions, styledMapOptions); 1246 1247 googleMap.mapTypes.set("sample", sampleType); 1248 googleMap.setMapTypeId("sample"); 1249 1250 // force reset 1251 googleMap.setZoom(data.zoom); 1252 googleMap.setCenter(new google.maps.LatLng(data.center.latitude, data.center.longitude)); 1253 } 1254 1255 function setMaps(obj, map, center) { 1256 var options = {}; 1257 1258 if (obj["html"] !== false) { 1259 if (typeof obj["name"] != "undefined") options["title"] = obj["name"]; 1260 if (typeof obj["desc"] != "undefined") options["desc"] = obj["desc"]; 1261 if (typeof obj["tel"] != "undefined") options["tel"] = obj["tel"]; 1262 if (typeof obj["email"] != "undefined") options["email"] = obj["email"]; 1263 if (typeof obj["url"] != "undefined") options["web"] = obj["url"]; 1264 } 1265 1266 if (typeof obj["logo"] != "undefined") { 1267 var optIcon = {}; 1268 1269 optIcon["url"] = obj["logo"]; 1270 1271 if (typeof obj["sizeWidth"] != "undefined" && typeof obj["sizeHeight"] != "undefined" && Number.isInteger(obj["sizeWidth"]) && Number.isInteger(obj["sizeHeight"])) optIcon["size"] = new google.maps.Size(obj["sizeWidth"], obj["sizeHeight"]); 1272 1273 if (typeof obj["scaleWidth"] != "undefined" && typeof obj["scaleHeight"] != "undefined" && Number.isInteger(obj["scaleWidth"]) && Number.isInteger(obj["scaleHeight"])) optIcon["scaledSize"] = new google.maps.Size(obj["scaleWidth"], obj["scaleHeight"]); 1274 1275 if (typeof obj["originX"] != "undefined" && typeof obj["originY"] != "undefined" && Number.isInteger(obj["originX"]) && Number.isInteger(obj["originY"])) optIcon["origin"] = new google.maps.Point(obj["originX"], obj["originY"]); 1276 1277 if (typeof obj["anchorX"] != "undefined" && typeof obj["anchorY"] != "undefined" && Number.isInteger(obj["anchorX"]) && Number.isInteger(obj["anchorY"])) optIcon["anchor"] = new google.maps.Point(obj["anchorX"], obj["anchorY"]); 1278 1279 if (typeof obj["optimized"] != "undefined") optIcon["optimized"] = obj["optimized"]; 1280 1281 if (typeof optIcon["size"] != "undefined" && typeof optIcon["origin"] != "undefined" && typeof optIcon["anchor"] != "undefined") options["icon"] = optIcon; 1282 else options["icon"] = obj["logo"] ? new google.maps.MarkerImage(obj["logo"]) : null; 1283 } 1284 1285 options["position"] = new google.maps.LatLng(obj["latitude"], obj["longitude"]); 1286 options["map"] = map; 1287 1288 var marker = new google.maps.Marker(options); 1289 gmarkers[gnum] = marker; 1290 gnum++; 1291 1292 if (obj["clickable"] == "js") { 1293 google.maps.event.addListener(marker, "click", function() { 1294 if (obj["click"].constructor == Function) obj["click"].apply(this, [].concat(Array.prototype.slice.call(arguments))); 1295 }); 1296 } 1297 1298 if (obj["html"] !== false) { 1299 var dialog = new google.maps.InfoWindow(), 1300 infoWindowVisible = (function() { 1301 var currentlyVisible = false;
1302 return function(visible) { 1303 for (var z in visible) { 1304 if (/closure_uid/i.test(z)) { 1305 currentlyVisible = visible[z]; 1306 1307 break; 1308 } 1309 } 1310 1311 return currentlyVisible; 1312 1313 1314 if (visible !== undefined) currentlyVisible = visible; 1315 return currentlyVisible; 1316 }; 1317 }()), 1318 dialogShow = (function() { 1319 return function() { 1320 var vCheck = infoWindowVisible(marker); 1321 if (vCheck == _dialogsOpen_) { 1322 dialog.close(); 1323 _dialogsOpen_ = true; 1324 } else { 1325 var tpl = {}; 1326 tpl["name"] = typeof obj["name"] != "undefined" ? obj["name"] : ""; 1327 tpl["desc"] = typeof obj["desc"] != "undefined" ? obj["desc"] : ""; 1328 tpl["tel"] = typeof obj["tel"] != "undefined" ? obj["tel"] : ""; 1329 tpl["email"] = typeof obj["email"] != "undefined" ? obj["email"] : ""; 1330 tpl["url"] = typeof obj["url"] != "undefined" ? obj["url"] : ""; 1331 1332 var html = 1333 obj["html"] 1334 .replace(/{name}/ig, tpl["name"]) 1335 .replace(/{title}/ig, tpl["name"]) 1336 1337 .replace(/{txt}/ig, tpl["desc"]) 1338 .replace(/{text}/ig, tpl["desc"]) 1339 .replace(/{desc}/ig, tpl["desc"]) 1340 .replace(/{description}/ig, tpl["desc"]) 1341 1342 .replace(/{tel}/ig, tpl["tel"]) 1343 .replace(/{telephone}/ig, tpl["tel"]) 1344 .replace(/{phone}/ig, tpl["tel"]) 1345 .replace(/{moible}/ig, tpl["tel"]) 1346 1347 .replace(/{mail}/ig, tpl["email"]) 1348 .replace(/{email}/ig, tpl["email"]) 1349 1350 .replace(/{url}/ig, tpl["url"]) 1351 .replace(/{web}/ig, tpl["url"]) 1352 .replace(/{website}/ig, tpl["url"]); 1353 1354 _dialogs_.forEach(function(d, ix) { 1355 google.maps.event.trigger(d, "closeclick"); 1356 d.close(map, marker); 1357 }); 1358 1359 dialog = new google.maps.InfoWindow({ 1360 content: html 1361 }); 1362 1363 // reset 1364 _dialogs_ = []; 1365 _dialogs_.push(dialog); 1366 1367 dialog.open(map, marker); 1368 _dialogsOpen_ = vCheck; 1369 } 1370 }; 1371 }()); 1372 1373 // _dialogs_.push(dialog); 1374 1375 // events 1376 google.maps.event.addListener(marker, "click", function() { 1377 if (obj["clickable"] == "link" && typeof obj["url"] != "undefined" && obj["url"] != "") { 1378 if (!isExternal(obj["url"]) && $(obj["url"]).length) { 1379 $("html, body").stop().animate({ 1380 scrollTop: $(obj["url"]).offset().top 1381 }, 500); 1382 } else window.open(obj["url"], "_parent"); 1383 } else if (obj["clickable"] == "popup" && isHTML(obj.html)) { 1384 map.panTo(marker.getPosition()); 1385 dialogShow(); 1386 } 1387 }); 1388 google.maps.event.addListener(dialog, "closeclick", function() { 1389 infoWindowVisible(marker); 1390 }); 1391 1392 if (obj["hover"] === true && obj["clickable"] == "link") { 1393 google.maps.event.addListener(marker, "mouseover", function() { 1394 dialogShow(); 1395 }); 1396 1397 google.maps.event.addListener(marker, "mouseout", function() { 1398 dialog.close(); 1399 infoWindowVisible(false); 1400 }); 1401 } 1402 } 1403 1404 /* 1405 window.onresize = function(event) { 1406 google.maps.event.trigger(map, "resize"); 1407 map.setCenter(new google.maps.LatLng(center.latitude, center.longitude)); 1408 }; 1409 */ 1410 1411 // always center 1412 google.maps.event.addDomListener(window, "resize", function() { 1413 var center = map.getCenter(); 1414 google.maps.event.trigger(map, "resize"); 1415 // map.setCenter(new google.maps.LatLng(center.latitude, center.longitude)); 1416 map.setCenter(center); 1417 }); 1418 1419 google.maps.event.addListenerOnce(map, "idle", function() { 1420 google.maps.event.trigger(map, "resize"); 1421 map.setCenter(new google.maps.LatLng(center.latitude, center.longitude)); 1422 }); 1423 1424 // google.maps.event.trigger(map, "resize"); // onload 1425 1426 $(window).resize(function() { 1427 google.maps.event.trigger(map, "resize"); 1428 }); 1429 } 1430 } 1431 google.maps.event.addDomListener(window, "load", init); 1432 } 1433 // END: gmap 1434 1435 // BEGIN: rollover button 1436 $("body").on({ 1437 click: function() { 1438 $(this).parents(".bxSlider-pager").find("img.btn").trigger("mouseout"); 1439 1440 if ((UA.indexOf("iPad") < 0) && (UA.indexOf("iPhone") < 0) && (UA.indexOf("iPod") < 0)) $(this).trigger("mouseout").trigger("mouseover"); // not iOS 1441 }, 1442 touchstart: function() { 1443 $(this).trigger("click"); 1444 }, 1445 mouseover: function() { 1446 if ((UA.indexOf("iPad") < 0) && (UA.indexOf("iPhone") < 0) && (UA.indexOf("iPod") < 0)) { // not iOS 1447 if (!$(this).data("src-original")) $(this).data("src-original", $(this).attr("src")); 1448 1449 $(this).attr("src").match(/^(.*)(\.{1}.*)/g); 1450 1451 var $src = RegExp.$1 + "_on" + RegExp.$2; 1452 1453 $(this).attr("src", $src); // update src 1454 } 1455 }, 1456 mouseout: function() { 1457 if ((UA.indexOf("iPad") < 0) && (UA.indexOf("iPhone") < 0) && (UA.indexOf("iPod") < 0)) { // not iOS 1458 if ($(this).hasClass("copy-change")) { 1459 var _src_ = $(this).attr("src"); 1460 1461 _src_ = _src_.replace(/^(.*?)_on\.(.*)$/, "$1.$2"); 1462 1463 $(this) 1464 .attr("src", _src_) // update src 1465 .removeClass("copy-change"); 1466 } else if ($(this).data("src-original")) $(this).attr("src", $(this).data("src-original")); // update src 1467 1468 $(this).removeData("src-original"); 1469 } 1470 } 1471 }, "img.btn"); 1472 1473 $("body").on({ 1474 click: function() { 1475 $(this).parents(".bxSlider-pager").find("picture.btn").trigger("mouseout"); 1476 1477 $(this).trigger("mouseout").trigger("mouseover"); 1478 }, 1479 touchstart: function() { 1480 $(this).trigger("click"); 1481 }, 1482 mouseover: function() { 1483 $(this).children().each(function() { 1484 var _attr_ = false;
1485 if ($(this).prop("tagName").toLowerCase() == "img") _attr_ = "src"; 1486 else if ($(this).prop("tagName").toLowerCase() == "source") _attr_ = "srcset"; 1487 1488 if (_attr_ && $(this).attr(_attr_)) { 1489 if (!$(this).data("src-original")) $(this).data("src-original", $(this).attr(_attr_)); 1490 1491 $(this).attr(_attr_).match(/^(.*)(\.{1}.*)/g); 1492 1493 var $src = RegExp.$1 + "_on" + RegExp.$2; 1494 1495 $(this).attr(_attr_, $src); // update src 1496 } 1497 }); 1498 }, 1499 mouseout: function() { 1500 var $picture = $(this); 1501 1502 $picture.children().each(function() { 1503 var _attr_ = false; 1504 if ($(this).prop("tagName").toLowerCase() == "img") _attr_ = "src"; 1505 else if ($(this).prop("tagName").toLowerCase() == "source") _attr_ = "srcset"; 1506 1507 if (_attr_ && $(this).attr(_attr_)) { 1508 if ($picture.hasClass("copy-change")) { 1509 var _src_ = $(this).attr(_attr_); 1510 1511 _src_ = _src_.replace(/^(.*?)_on\.(.*)$/, "$1.$2"); 1512 1513 $(this) 1514 .attr(_attr_, _src_) // update src 1515 .removeClass("copy-change"); 1516 } else if ($(this).data("src-original")) $(this).attr(_attr_, $(this).data("src-original")); // update src 1517 1518 $(this).removeData("src-original"); 1519 } 1520 }); 1521 } 1522 }, "picture.btn"); 1523 // END: rollover button 1524 1525 // BEGIN: smooth scroll 1526 // $("body").on("click", "a[href*='#']:not([href='#'])", function(e) { 1527 // $("body").on("click", "a[*|href*='#']:not([href='#'])", function(e) { 1528 $("body").on("click", "a[href*='#']:not([href='#']), a[xlink\\:href*='#']:not([xlink\\:href='#'])", function(e) { 1529 var parseURL = function(url) { 1530 var tag = document.createElement("a"); 1531 tag.href = url; 1532 1533 return tag; 1534 }, 1535 parser = null; 1536 1537 if ($(this).attr("href")) parser = parseURL($(this).attr("href")); 1538 else if ($(this).attr("xlink:href")) parser = parseURL($(this).attr("xlink:href")); 1539 1540 1541 1542 // .nav-fixed: elm sẽ cá»â Ãâá»â¹nh 1543 // .nav-target: tá»Âa Ãâá»⢠sẽ tÄÂnh 1544 // .nav-pin: elm sẽ gắn .fixed 1545 if (parser && location.pathname.replace(/^\//, "") == parser.pathname.replace(/^\//, "") && location.hostname == parser.hostname && !$(this).hasClass("unsmooth")) { 1546 var _hash_ = this.hash || $(this).attr("href") || $(this).attr("xlink:href"), 1547 ptnHash = /([;?%&,+*~\':"!^$[\]()=>|\/@])/g, // [storage] FCBase.regex.trimHash 1548 trimHash = _hash_.replace(ptnHash, "\\$1"), 1549 $anchor = $(trimHash); 1550 1551 $anchor = $anchor.length > 0 ? $anchor : $("[name=" + trimHash.slice(1) + "]"); 1552 1553 if ($anchor.length) { 1554 e.preventDefault(); 1555 1556 if ($anchor.parents(".tab-content").first().length > 0) $anchor = $anchor.parents(".tab-content").first(); 1557 1558 var $offsetY = $anchor.offset().top, 1559 $navOffset = 0; 1560 1561 if ($(".nav-fixed").length) $navOffset = typeof $(".nav-fixed").attr("data-height") != "undefined" ? parseInt($(".nav-fixed").attr("data-height")) : $(".nav-fixed").outerHeight(); 1562 1563 if ($(".tabs-switch").length) { 1564 $(".tabs-switch").each(function() { 1565 var $tabsSwitch = $(this), 1566 $tabLink = $tabsSwitch.children(".tab-link"); 1567 1568 if ($tabLink.children("[data-tab-anchor='" + trimHash + "']").length) $tabLink.children("[data-tab-anchor='" + trimHash + "']").click(); // trigger for set active tab 1569 }); 1570 } 1571 1572 if ($(".nav-target").length) { 1573 // $("html, body").stop().animate({ 1574 // scrollTop: $(".nav-target").offset().top + 10 1575 // }, 100, function() { 1576 if ($(".nav-fixed").length) $navOffset = typeof $(".nav-fixed").attr("data-height") != "undefined" ? parseInt($(".nav-fixed").attr("data-height")) : $(".nav-fixed").outerHeight(); 1577 1578 $("html, body").stop().animate({ 1579 scrollTop: $offsetY - $navOffset +2 1580 }, 500); 1581 // }); 1582 } else { 1583 $("html, body").stop().animate({ 1584 scrollTop: $offsetY - $navOffset +2 1585 }, 500); 1586 } 1587 1588 // window.location.hash = trimHash; // update location 1589 1590 return false;
1591 } else console.log("[smooth-scroll] Anchor element not found"); 1592 } 1593 }); 1594 // END: smooth scroll 1595 1596 // BEGIN: scroll to top 1597 // if ($(window).scrollTop() > 0) $("#pagetop").addClass("visible"); 1598 // else $("#pagetop").removeClass("visible"); 1599 1600 var lastScrollTop = 0; 1601 1602 $(window).scroll(function() { 1603 var st = $(this).scrollTop(); 1604 if (lastScrollTop != 0) { 1605 if (st < lastScrollTop) { 1606 $("#pagetop").addClass("visible"); 1607 if (st < 10) { 1608 $("#pagetop").removeClass("visible"); 1609 } 1610 } else if (st > lastScrollTop) { 1611 1612 $("#pagetop").removeClass("visible"); 1613 1614 } 1615 } 1616 lastScrollTop = st; 1617 1618 }); 1619 1620 $("body").on("click", "#pagetop", function() { 1621 if (!$(this).hasClass("in-scroll")) { 1622 $(this).addClass("in-scroll"); 1623 1624 var $scrollDuration = $.inArray($(this).attr("data-duration"), ["slow", "normal", "fast"]) >= 0 || parseInt($(this).attr("data-duration")) > 0 ? $(this).attr("data-duration") : "slow"; 1625 1626 $("html, body").stop().animate({ 1627 scrollTop: 0 1628 }, $scrollDuration, function() { 1629 $("#pagetop").removeClass("in-scroll"); 1630 }); 1631 } 1632 }); 1633 // END: scroll to top 1634 1635 // BEGIN: text vertical 1636 $(".txt-vertical").each(function() { 1637 if (!$(this).hasClass("all-str")) { 1638 var $regex = /(\d{1,2})/g; 1639 1640 if ($(this).hasClass("per-line")) $regex = /(\d)/g; 1641 1642 $(this).html(function(idx, val) { 1643 return val.replace($regex, '<span class="int">$1</span>'); 1644 }); 1645 } 1646 1647 if ($(this).children(".txt-normal").length) { 1648 $(this).children(".txt-normal").html(function(idx, val) { 1649 var $characters = $.trim(val).split(""); 1650 return '<span class="int">' + $characters.join('</span><span class="int">') + '</span>'; 1651 }); 1652 } 1653 }); 1654 $(".txt-vertical-x").each(function() { 1655 $(this).html($(this).text().replace(/(.)/g, "<span>$1</span>")); 1656 }); 1657 // END: text vertical 1658 1659 // BEGIN: social button 1660 $(document).ready(function () { 1661 function reloadLineButton() { 1662 1663 const existingScript = document.querySelector('script[src*="loader.min.js"]'); 1664 if (existingScript) { 1665 existingScript.remove(); 1666 } 1667 1668 const script = document.createElement('script'); 1669 script.src = "https://www.line-website.com/social-plugins/js/thirdparty/loader.min.js"; 1670 script.async = true; 1671 script.defer = true; 1672 script.onload = function () { 1673 1674 1675 window.LineIt.loadButton(); 1676 1677 }; 1678 document.body.appendChild(script); 1679 } 1680 var loadsns = false; 1681 1682 1683 var __socialsHTML__ = "", 1684 __socialsLang = $("html").attr("lang") !== undefined && $.trim($("html").attr("lang")).length == 2 ? $.trim($("html").attr("lang")).toLowerCase() : "ja", 1685 $socialsLine = "", 1686 $socialsTwitter = "", 1687 $socialsFacebook = "", 1688 locationURL = window.location.href || location.href; 1689 1690 $socialsTwitter += '<div class="social-twitter">'; 1691 $socialsTwitter += '<a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>'; 1692 $socialsTwitter += '<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>'; 1693 $socialsTwitter += '</div>'; 1694 1695 $socialsFacebook += '<div class="social-facebook">'; 1696 $socialsFacebook += '<div class="fb-share-button" data-href="' + locationURL + '" data-layout="button_count" data-size="small"></div>'; 1697 $socialsFacebook += '</div>'; 1698 1699 $socialsLine += '<div class="social-line">'; 1700 $socialsLine += '<div class="line-it-button" data-lang="' + __socialsLang + '" data-type="like" data-url="' + locationURL + '" data-share="true">'; 1701 1702 $socialsLine += '</div>'; 1703 $socialsLine += '</div>'; 1704 1705 1706 function CheckForDisplay() { 1707 var element = document.getElementById("socialbuttons"); 1708 1709 if (elementInViewport(element) && loadsns == false) { 1710 1711 if ($("#socialbuttons").length) { 1712 var $socialsOrder = typeof $("#socialbuttons").attr("data") != "undefined" ? $("#socialbuttons").attr("data").split("") : false;
1713 1714 if (typeof $socialsOrder == "object" && $socialsOrder.length) { 1715 for (var socialsType in $socialsOrder) { 1716 if ($.trim(socialsType).length > 0) { 1717 socialsType = socialsType.toLowerCase(); 1718 1719 if ($socialsOrder[socialsType].toLocaleLowerCase() === "f") __socialsHTML__ += $socialsFacebook; 1720 else if ($socialsOrder[socialsType].toLocaleLowerCase() === "t") __socialsHTML__ += $socialsTwitter; 1721 else if ($socialsOrder[socialsType].toLocaleLowerCase() === "l") __socialsHTML__ += $socialsLine; 1722 } 1723 } 1724 } else { 1725 __socialsHTML__ += $socialsTwitter; 1726 __socialsHTML__ += $socialsFacebook; 1727 __socialsHTML__ += $socialsLine; 1728 } 1729 1730 $("#socialbuttons").html(__socialsHTML__); 1731 if (typeof window.LineIt !== 'undefined' && window.LineIt.loadButton) { 1732 window.LineIt.loadButton(); 1733 } 1734 } 1735 1736 loadsns = true; 1737 1738 // facebook 1739 var fbRoot = document.getElementById("fb-root"); 1740 if (fbRoot) { 1741 var fbScript = document.createElement("script"), 1742 fbScriptContent = "", 1743 fbVersion = fbRoot.getAttribute("data-version") ? fbRoot.getAttribute("data-version") : "v2.12", 1744 fbLanguage = fbRoot.getAttribute("data-language") ? fbRoot.getAttribute("data-language") : "ja_JP"; 1745 1746 fbVersion = fbVersion.substr(0, 1).toLowerCase() == "v" ? fbVersion.substr(1) : fbVersion; 1747 1748 fbScriptContent += '(function(d, s, id) {'; 1749 fbScriptContent += 'var js, fjs = d.getElementsByTagName(s)[0];'; 1750 fbScriptContent += 'if (d.getElementById(id)) return;'; 1751 fbScriptContent += 'js = d.createElement(s);'; 1752 fbScriptContent += 'js.id = id;'; 1753 fbScriptContent += 'js.src = "https://connect.facebook.net/' + fbLanguage + '/sdk.js#xfbml=1&version=v' + fbVersion + '";'; 1754 fbScriptContent += 'fjs.parentNode.insertBefore(js, fjs);'; 1755 fbScriptContent += '}(document, "script", "facebook-jssdk"));'; 1756 1757 fbScript.innerHTML = fbScriptContent; 1758 document.body.appendChild(fbScript); 1759 } 1760 1761 1762 const lineButton = document.querySelector('.line-it-button'); 1763 const observer = new IntersectionObserver((entries) => { 1764 entries.forEach(entry => { 1765 if (entry.isIntersecting) { 1766 1767 reloadLineButton(); 1768 observer.unobserve(lineButton); 1769 } 1770 }); 1771 }); 1772 1773 observer.observe(lineButton); 1774 } 1775 } 1776 1777 function elementInViewport(el) { 1778 if (!el) return false; 1779 var rect = el.getBoundingClientRect(); 1780 return ( 1781 rect.top >= 0 1782 && rect.left >= 0 1783 && rect.bottom <= window.innerHeight 1784 && rect.right <= window.innerWidth 1785 ); 1786 } 1787 $(window).on('resize', CheckForDisplay).on('scroll', CheckForDisplay); 1788 1789 1790 }); 1791 // END: social button 1792 1793 /* fix smoothscroll on IE - jumpy fixed background */ 1794 if (navigator.userAgent.match(/MSIE 10/i) || navigator.userAgent.match(/Trident\/7\./) || navigator.userAgent.match(/Edge\/12\./)) { 1795 $("body.ie-smoothscroll") 1796 .on("mousewheel", function(e) { 1797 if (event.preventDefault) event.preventDefault(); 1798 else event.returnValue = false; 1799 1800 var delta = null, 1801 offsetX = window.scrollX || window.pageXOffset || window.document.documentElement.scrollLeft, 1802 offsetY = window.scrollY || window.pageYOffset || window.document.documentElement.scrollTop; 1803 1804 if (e.wheelDelta) delta = e.wheelDelta; 1805 else if (e.originalEvent) { 1806 if (e.originalEvent.wheelDelta) delta = e.originalEvent.wheelDelta; 1807 else if (e.originalEvent.deltaY) delta = 0 - e.originalEvent.deltaY; 1808 else if (e.originalEvent.detail) delta = e.originalEvent.detail * -40; 1809 } else if (event.originalEvent) { 1810 if (event.originalEvent.wheelDelta) delta = event.originalEvent.wheelDelta; 1811 else if (event.originalEvent.deltaY) delta = 0 - event.originalEvent.deltaY; 1812 else if (event.originalEvent.detail) delta = event.originalEvent.detail * -40; 1813 } 1814 1815 if (delta !== null) window.scrollTo(0, offsetY - delta); 1816 }); 1817 } 1818 1819 // scrollBefore(); // smoothscroll before page loaded 1820 1821 $("body").on({ 1822 mouseup: function() { 1823 // $("html").addClass("break-jump"); 1824 $(this).removeClass("scrollable"); 1825 }, 1826 mousedown: function() { 1827 // $("html").addClass("break-jump"); 1828 $(this).addClass("scrollable"); 1829 }, 1830 mouseleave: function() { 1831 // $("html").addClass("break-jump"); 1832 $(this).removeClass("scrollable"); 1833 } 1834 }, ".gmap"); 1835 1836 // BEGIN: .pagination 1837 $(".pagination").each(function() {
1838 initPager($(this)); 1839 }); 1840 1841 $(".pagination") 1842 .on("click", ".page-link .page-first", function() { 1843 var $pagination = $(this).parents(".pagination").first(), 1844 $pageContent = $pagination.children(".page-content"), 1845 $pageLink = $pagination.children(".page-link"), 1846 mode = $pagination.attr("data-mode") !== "undefined" && $.inArray($pagination.attr("data-mode"), ["fade", "slide", "block"]) >= 0 ? $pagination.attr("data-mode") : "block", 1847 duration = typeof $pagination.attr("data-duration") !== "undefined" && $pagination.attr("data-duration").length > 0 ? parseInt($pagination.attr("data-duration"), 10) : (mode == "block" ? 0 : 300), 1848 scrollable = typeof $pagination.attr("data-scroll") !== "undefined" && $.inArray($pagination.attr("data-scroll"), ["true", "on", "enable", "enabled", "1"]) >= 0 ? true : false, 1849 navOffset = 0; 1850 1851 if (!$pagination.hasClass("clicked")) { 1852 $pagination.addClass("clicked"); 1853 1854 if ($(".nav-fixed").length > 0) navOffset = typeof $(".nav-fixed").attr("data-height") != "undefined" ? parseInt($(".nav-fixed").attr("data-height")) : $(".nav-fixed").outerHeight(); 1855 1856 if (mode == "fade") { 1857 if ($pageContent.children().length > 1) { 1858 $pageContent.children().stop().fadeOut(duration, function() { 1859 $(this).removeAttr("style").removeClass("active"); 1860 }).siblings().first().stop().delay(duration).fadeIn(duration, function() { 1861 $(this).removeAttr("style").addClass("active"); 1862 1863 if (scrollable) { 1864 $("body, html").stop().animate({ 1865 scrollTop: $pagination.offset().top - navOffset 1866 }, 300); 1867 } 1868 1869 $pagination.removeClass("clicked"); 1870 }); 1871 } else { 1872 $pageContent.children().first().stop().fadeIn(duration, function() { 1873 $(this).removeAttr("style").addClass("active"); 1874 1875 if (scrollable) { 1876 $("body, html").stop().animate({ 1877 scrollTop: $pagination.offset().top - navOffset 1878 }, 300); 1879 } 1880 1881 $pagination.removeClass("clicked"); 1882 }); 1883 } 1884 } else if (mode == "slide") { 1885 if ($pageContent.children().length > 1) { 1886 $pageContent.children().stop().slideUp(duration, function() { 1887 $(this).removeAttr("style").removeClass("active"); 1888 }).siblings().first().stop().delay(duration).slideDown(duration, function() { 1889 $(this).removeAttr("style").addClass("active"); 1890 1891 if (scrollable) { 1892 $("body, html").stop().animate({ 1893 scrollTop: $pagination.offset().top - navOffset 1894 }, 300); 1895 } 1896 1897 $pagination.removeClass("clicked"); 1898 }); 1899 } else { 1900 $pageContent.children().first().stop().slideDown(duration, function() { 1901 $(this).removeAttr("style").addClass("active"); 1902 1903 if (scrollable) { 1904 $("body, html").stop().animate({ 1905 scrollTop: $pagination.offset().top - navOffset 1906 }, 300); 1907 } 1908 1909 $pagination.removeClass("clicked"); 1910 }); 1911 } 1912 } else { 1913 if ($pageContent.children().length > 1) { 1914 $pageContent.children().stop().hide(duration, function() { 1915 $(this).removeAttr("style").removeClass("active"); 1916 }).siblings().first().stop().delay(duration).show(duration, function() { 1917 $(this).removeAttr("style").addClass("active"); 1918 1919 if (scrollable) { 1920 $("body, html").stop().animate({ 1921 scrollTop: $pagination.offset().top - navOffset 1922 }, 300); 1923 } 1924 1925 $pagination.removeClass("clicked"); 1926 }); 1927 } else { 1928 $pageContent.children().first().stop().show(duration, function() { 1929 $(this).removeAttr("style").addClass("active"); 1930 1931 if (scrollable) { 1932 $("body, html").stop().animate({ 1933 scrollTop: $pagination.offset().top - navOffset 1934 }, 300); 1935 } 1936 1937 $pagination.removeClass("clicked"); 1938 }); 1939 } 1940 } 1941 1942 $pageLink.find(".page-item.active").removeClass("active"); 1943 $pageLink.each(function() { 1944 $(this).find(".page-item").first().addClass("active"); 1945 }); 1946 } 1947 }) 1948 .on("click", ".page-link .page-last", function() { 1949 var $pagination = $(this).parents(".pagination").first(), 1950 $pageContent = $pagination.children(".page-content"), 1951 $pageLink = $pagination.children(".page-link"), 1952 mode = $pagination.attr("data-mode") !== "undefined" && $.inArray($pagination.attr("data-mode"), ["fade", "slide", "block"]) >= 0 ? $pagination.attr("data-mode") : "block", 1953 duration = typeof $pagination.attr("data-duration") !== "undefined" && $pagination.attr("data-duration").length > 0 ? parseInt($pagination.attr("data-duration"), 10) : (mode == "block" ? 0 : 300), 1954 scrollable = typeof $pagination.attr("data-scroll") !== "undefined" && $.inArray($pagination.attr("data-scroll"), ["true", "on", "enable", "enabled", "1"]) >= 0 ? true : false, 1955 navOffset = 0; 1956 1957 if (!$pagination.hasClass("clicked")) { 1958 $pagination.addClass("clicked"); 1959 1960 if ($(".nav-fixed").length > 0) navOffset = typeof $(".nav-fixed").attr("data-height") != "undefined" ? parseInt($(".nav-fixed").attr("data-height")) : $(".nav-fixed").outerHeight(); 1961 1962 if (mode == "fade") { 1963 if ($pageContent.children().length > 1) { 1964 $pageContent.children().stop().fadeOut(duration, function() { 1965 $(this).removeAttr("style").removeClass("active"); 1966 }
1966).siblings().last().stop().delay(duration).fadeIn(duration, function() { 1967 $(this).removeAttr("style").addClass("active"); 1968 1969 if (scrollable) { 1970 $("body, html").stop().animate({ 1971 scrollTop: $pagination.offset().top - navOffset 1972 }, 300); 1973 } 1974 1975 $pagination.removeClass("clicked"); 1976 }); 1977 } else { 1978 $pageContent.children().last().stop().fadeIn(duration, function() { 1979 $(this).removeAttr("style").addClass("active"); 1980 1981 if (scrollable) { 1982 $("body, html").stop().animate({ 1983 scrollTop: $pagination.offset().top - navOffset 1984 }, 300); 1985 } 1986 1987 $pagination.removeClass("clicked"); 1988 }); 1989 } 1990 } else if (mode == "slide") { 1991 if ($pageContent.children().length > 1) { 1992 $pageContent.children().stop().slideUp(duration, function() { 1993 $(this).removeAttr("style").removeClass("active"); 1994 }).siblings().last().stop().delay(duration).slideDown(duration, function() { 1995 $(this).removeAttr("style").addClass("active"); 1996 1997 if (scrollable) { 1998 $("body, html").stop().animate({ 1999 scrollTop: $pagination.offset().top - navOffset 2000 }, 300); 2001 } 2002 2003 $pagination.removeClass("clicked"); 2004 }); 2005 } else { 2006 $pageContent.children().last().stop().slideDown(duration, function() { 2007 $(this).removeAttr("style").addClass("active"); 2008 2009 if (scrollable) { 2010 $("body, html").stop().animate({ 2011 scrollTop: $pagination.offset().top - navOffset 2012 }, 300); 2013 } 2014 2015 $pagination.removeClass("clicked"); 2016 }); 2017 } 2018 } else { 2019 if ($pageContent.children().length > 1) { 2020 $pageContent.children().stop().hide(duration, function() { 2021 $(this).removeAttr("style").removeClass("active"); 2022 }).siblings().last().stop().delay(duration).show(duration, function() { 2023 $(this).removeAttr("style").addClass("active"); 2024 2025 if (scrollable) { 2026 $("body, html").stop().animate({ 2027 scrollTop: $pagination.offset().top - navOffset 2028 }, 300); 2029 } 2030 2031 $pagination.removeClass("clicked"); 2032 }); 2033 } else { 2034 $pageContent.children().last().stop().show(duration, function() { 2035 $(this).removeAttr("style").addClass("active"); 2036 2037 if (scrollable) { 2038 $("body, html").stop().animate({ 2039 scrollTop: $pagination.offset().top - navOffset 2040 }, 300); 2041 } 2042 2043 $pagination.removeClass("clicked"); 2044 }); 2045 } 2046 } 2047 2048 $pageLink.find(".page-item.active").removeClass("active"); 2049 $pageLink.each(function() { 2050 $(this).find(".page-item").last().addClass("active"); 2051 }); 2052 } 2053 }) 2054 .on("click", ".page-link .page-next", function() { 2055 var $pagination = $(this).parents(".pagination").first(), 2056 navOffset = 0; 2057 2058 if (!$pagination.hasClass("clicked")) { 2059 $pagination.addClass("clicked"); 2060 2061 if ($(".nav-fixed").length > 0) navOffset = typeof $(".nav-fixed").attr("data-height") != "undefined" ? parseInt($(".nav-fixed").attr("data-height")) : $(".nav-fixed").outerHeight(); 2062
2063 var $pageContent = $pagination.children(".page-content"), 2064 $pageLink = $pagination.children(".page-link"), 2065 mode = $pagination.attr("data-mode") !== "undefined" && $.inArray($pagination.attr("data-mode"), ["fade", "slide", "block"]) >= 0 ? $pagination.attr("data-mode") : "block", 2066 duration = typeof $pagination.attr("data-duration") !== "undefined" && $pagination.attr("data-duration").length > 0 ? parseInt($pagination.attr("data-duration"), 10) : (mode == "block" ? 0 : 300), 2067 scrollable = typeof $pagination.attr("data-scroll") !== "undefined" && $.inArray($pagination.attr("data-scroll"), ["true", "on", "enable", "enabled", "1"]) >= 0 ? true : false, 2068 $pageCurrent = $pageLink.find(".page-item.active"), 2069 $pageClone = $pageLink.clone(), 2070 idx = 0; 2071 2072 $pageClone.find(".page-first, .page-last, .page-next, .page-prev, .page-ellipse").remove(); 2073 2074 idx = $pageClone.find(".page-item.active").index(); 2075 2076 $pageLink.find(".page-item.active").removeClass("active"); 2077 2078 if ($pageClone.find(".page-item.active").next(".page-item").length > 0) { 2079 if (mode == "fade") { 2080 if ($pageContent.children().length > 1) { 2081 $pageContent.children().stop().fadeOut(duration, function() { 2082 $(this).removeAttr("style").removeClass("active"); 2083 }).siblings().eq(idx + 1).stop().delay(duration).fadeIn(duration, function() { 2084 $(this).removeAttr("style").addClass("active"); 2085 2086 if (scrollable) { 2087 $("body, html").stop().animate({ 2088 scrollTop: $pagination.offset().top - navOffset 2089 }, 300); 2090 } 2091 2092 $pagination.removeClass("clicked"); 2093 }); 2094 } else { 2095 $pageContent.children().eq(idx + 1).stop().fadeIn(duration, function() { 2096 $(this).removeAttr("style").addClass("active"); 2097 2098 if (scrollable) { 2099 $("body, html").stop().animate({ 2100 scrollTop: $pagination.offset().top - navOffset 2101 }, 300); 2102 } 2103 2104 $pagination.removeClass("clicked"); 2105 }); 2106 } 2107 } else if (mode == "slide") { 2108 if ($pageContent.children().length > 1) { 2109 $pageContent.children().stop().slideUp(duration, function() { 2110 $(this).removeAttr("style").removeClass("active"); 2111 }).siblings().eq(idx + 1).stop().delay(duration).slideDown(duration, function() { 2112 $(this).removeAttr("style").addClass("active"); 2113 2114 if (scrollable) { 2115 $("body, html").stop().animate({ 2116 scrollTop: $pagination.offset().top - navOffset 2117 }, 300); 2118 } 2119 2120 $pagination.removeClass("clicked"); 2121 }); 2122 } else { 2123 $pageContent.children().eq(idx + 1).stop().slideDown(duration, function() { 2124 $(this).removeAttr("style").addClass("active"); 2125 2126 if (scrollable) { 2127 $("body, html").stop().animate({ 2128 scrollTop: $pagination.offset().top - navOffset 2129 }, 300); 2130 } 2131 2132 $pagination.removeClass("clicked"); 2133 }); 2134 } 2135 } else { 2136 if ($pageContent.children().length > 1) { 2137 $pageContent.children().stop().hide(duration, function() { 2138 $(this).removeAttr("style").removeClass("active"); 2139 }).siblings().eq(idx + 1).stop().delay(duration).show(duration, function() { 2140 $(this).removeAttr("style").addClass("active"); 2141 2142 if (scrollable) { 2143 $("body, html").stop().animate({ 2144 scrollTop: $pagination.offset().top - navOffset 2145 }, 300); 2146 } 2147 2148 $pagination.removeClass("clicked"); 2149 }); 2150 } else { 2151 $pageContent.children().eq(idx + 1).stop().show(duration, function() { 2152 $(this).removeAttr("style").addClass("active"); 2153 2154 if (scrollable) { 2155 $("body, html").stop().animate({ 2156 scrollTop: $pagination.offset().top - navOffset 2157 }, 300); 2158 } 2159 2160 $pagination.removeClass("clicked"); 2161 }); 2162 } 2163 } 2164 2165 $pageCurrent.next(".page-item").addClass("active"); 2166 } else { 2167 if (mode == "fade") { 2168 if ($pageContent.children().length > 1) { 2169 $pageContent.children().stop().fadeOut(duration, function() { 2170 $(this).removeAttr("style").removeClass("active"); 2171 }).siblings().first().stop().delay(duration).fadeIn(duration, function() { 2172 $(this).removeAttr("style").addClass("active"); 2173 2174 if (scrollable) { 2175 $("body, html").stop().animate({ 2176 scrollTop: $pagination.offset().top - navOffset 2177 }, 300); 2178 } 2179 2180 $pagination.removeClass("clicked"); 2181 }); 2182 } else { 2183 $pageContent.children().first().stop().fadeIn(duration, function() { 2184 $(this).removeAttr("style").addClass("active"); 2185 2186 if (scrollable) { 2187 $("body, html").stop().animate({ 2188 scrollTop: $pagination.offset().top - navOffset 2189 }, 300); 2190 } 2191 2192 $pagination.removeClass("clicked"); 2193 }); 2194 } 2195 } else if (mode == "slide") { 2196 if ($pageContent.children().length > 1) { 2197 $pageContent.children().stop().slideUp(duration, function() { 2198 $(this).removeAttr("style").removeClass("active"); 2199 }).siblings().first().stop().delay(duration).slideDown(duration, function() { 2200 $(this).removeAttr("style").addClass("active"); 2201 2202 if (scrollable) { 2203 $("body, html").stop().animate({ 2204 scrollTop: $pagination.offset().top - navOffset 2205 }, 300); 2206 } 2207 2208 $pagination.removeClass("clicked"); 2209 }); 2210 } else { 2211 $pageContent.children().first().stop().slideDown(duration, function() { 2212 $(this).removeAttr("style").addClass("active"); 2213 2214 if (scrollable) { 2215 $("body, html").stop().animate({ 2216 scrollTop: $pagination.offset().top - navOffset 2217 }, 300); 2218 } 2219 2220 $pagination.removeClass("clicked"); 2221 }); 2222 } 2223 } else { 2224 if ($pageContent.children().length > 1) { 2225 $pageContent.children().stop().hide(duration, function() { 2226 $(this).removeAttr("style").removeClass("active"); 2227 }).siblings().first().stop().delay(duration).show(duration, function() { 2228 $(this).removeAttr("style").addClass("active"); 2229 2230 if (scrollable) { 2231 $("body, html").stop().animate({ 2232 scrollTop: $pagination.offset().top - navOffset 2233 }, 300); 2234 } 2235 2236 $pagination.removeClass("clicked"); 2237 }); 2238 } else { 2239 $pageContent.children().first().stop().show(duration, function() { 2240 $(this).removeAttr("style").addClass("active"); 2241 2242 if (scrollable) { 2243 $("body, html").stop().animate({ 2244 scrollTop: $pagination.offset().top - navOffset 2245 }, 300); 2246 } 2247 2248 $pagination.removeClass("clicked"); 2249 }); 2250 } 2251 } 2252 2253 $pageLink.each(function() { 2254 $(this).find(".page-item").first().addClass("active"); 2255 }); 2256 } 2257 } 2258 }) 2259 .on("click", ".page-link .page-prev", function() { 2260 var $pagination = $(this).parents(".pagination").first(), 2261 navOffset = 0; 2262 2263 if (!$pagination.hasClass("clicked")) { 2264 $pagination.addClass("clicked"); 2265 2266 if ($(".nav-fixed").length > 0) navOffset = typeof $(".nav-fixed").attr("data-height") != "undefined" ? parseInt($(".nav-fixed").attr("data-height")) : $(".nav-fixed").outerHeight(); 2267
2268 var $pageContent = $pagination.children(".page-content"), 2269 $pageLink = $pagination.children(".page-link"), 2270 mode = $pagination.attr("data-mode") !== "undefined" && $.inArray($pagination.attr("data-mode"), ["fade", "slide", "block"]) >= 0 ? $pagination.attr("data-mode") : "block", 2271 duration = typeof $pagination.attr("data-duration") !== "undefined" && $pagination.attr("data-duration").length > 0 ? parseInt($pagination.attr("data-duration"), 10) : (mode == "block" ? 0 : 300), 2272 scrollable = typeof $pagination.attr("data-scroll") !== "undefined" && $.inArray($pagination.attr("data-scroll"), ["true", "on", "enable", "enabled", "1"]) >= 0 ? true : false, 2273 $pageCurrent = $pageLink.find(".page-item.active"), 2274 $pageClone = $pageLink.clone(), 2275 idx = 0; 2276 2277 $pageClone.find(".page-first, .page-last, .page-next, .page-prev, .page-ellipse").remove(); 2278 2279 idx = $pageClone.find(".page-item.active").index(); 2280 2281 $pageLink.find(".page-item.active").removeClass("active"); 2282 2283 if ($pageClone.find(".page-item.active").prev(".page-item").length > 0) { 2284 if (mode == "fade") { 2285 if ($pageContent.children().length > 1) { 2286 $pageContent.children().stop().fadeOut(duration, function() { 2287 $(this).removeAttr("style").removeClass("active"); 2288 }).siblings().eq(idx - 1).stop().delay(duration).fadeIn(duration, function() { 2289 $(this).removeAttr("style").addClass("active"); 2290 2291 if (scrollable) { 2292 $("body, html").stop().animate({ 2293 scrollTop: $pagination.offset().top - navOffset 2294 }, 300); 2295 } 2296 2297 $pagination.removeClass("clicked"); 2298 }); 2299 } else { 2300 $pageContent.children().eq(idx - 1).stop().fadeIn(duration, function() { 2301 $(this).removeAttr("style").addClass("active"); 2302 2303 if (scrollable) { 2304 $("body, html").stop().animate({ 2305 scrollTop: $pagination.offset().top - navOffset 2306 }, 300); 2307 } 2308 2309 $pagination.removeClass("clicked"); 2310 }); 2311 } 2312 } else if (mode == "slide") { 2313 if ($pageContent.children().length > 1) { 2314 $pageContent.children().stop().slideUp(duration, function() { 2315 $(this).removeAttr("style").removeClass("active"); 2316 }).siblings().eq(idx - 1).stop().delay(duration).slideDown(duration, function() { 2317 $(this).removeAttr("style").addClass("active"); 2318 2319 if (scrollable) { 2320 $("body, html").stop().animate({ 2321 scrollTop: $pagination.offset().top - navOffset 2322 }, 300); 2323 } 2324 2325 $pagination.removeClass("clicked"); 2326 }); 2327 } else { 2328 $pageContent.children().eq(idx - 1).stop().slideDown(duration, function() { 2329 $(this).removeAttr("style").addClass("active"); 2330 2331 if (scrollable) { 2332 $("body, html").stop().animate({ 2333 scrollTop: $pagination.offset().top - navOffset 2334 }, 300); 2335 } 2336 2337 $pagination.removeClass("clicked"); 2338 }); 2339 } 2340 } else { 2341 if ($pageContent.children().length > 1) { 2342 $pageContent.children().stop().hide(duration, function() { 2343 $(this).removeAttr("style").removeClass("active"); 2344 }).siblings().eq(idx - 1).stop().delay(duration).show(duration, function() { 2345 $(this).removeAttr("style").addClass("active"); 2346 2347 if (scrollable) { 2348 $("body, html").stop().animate({ 2349 scrollTop: $pagination.offset().top - navOffset 2350 }, 300); 2351 } 2352 2353 $pagination.removeClass("clicked"); 2354 }); 2355 } else { 2356 $pageContent.children().eq(idx - 1).stop().show(duration, function() { 2357 $(this).removeAttr("style").addClass("active"); 2358 2359 if (scrollable) { 2360 $("body, html").stop().animate({ 2361 scrollTop: $pagination.offset().top - navOffset 2362 }, 300); 2363 } 2364 2365 $pagination.removeClass("clicked"); 2366 }); 2367 } 2368 } 2369 2370 $pageCurrent.prev(".page-item").addClass("active"); 2371 } else { 2372 if (mode == "fade") { 2373 if ($pageContent.children().length > 1) { 2374 $pageContent.children().stop().fadeOut(duration, function() { 2375 $(this).removeAttr("style").removeClass("active"); 2376 }
2376).siblings().last().stop().delay(duration).fadeIn(duration, function() { 2377 $(this).removeAttr("style").addClass("active"); 2378 2379 if (scrollable) { 2380 $("body, html").stop().animate({ 2381 scrollTop: $pagination.offset().top - navOffset 2382 }, 300); 2383 } 2384 2385 $pagination.removeClass("clicked"); 2386 }); 2387 } else { 2388 $pageContent.children().last().stop().fadeIn(duration, function() { 2389 $(this).removeAttr("style").addClass("active"); 2390 2391 if (scrollable) { 2392 $("body, html").stop().animate({ 2393 scrollTop: $pagination.offset().top - navOffset 2394 }, 300); 2395 } 2396 2397 $pagination.removeClass("clicked"); 2398 }); 2399 } 2400 } else if (mode == "slide") { 2401 if ($pageContent.children().length > 1) { 2402 $pageContent.children().stop().slideUp(duration, function() { 2403 $(this).removeAttr("style").removeClass("active"); 2404 }).siblings().last().stop().delay(duration).slideDown(duration, function() { 2405 $(this).removeAttr("style").addClass("active"); 2406 2407 if (scrollable) { 2408 $("body, html").stop().animate({ 2409 scrollTop: $pagination.offset().top - navOffset 2410 }, 300); 2411 } 2412 2413 $pagination.removeClass("clicked"); 2414 }); 2415 } else { 2416 $pageContent.children().last().stop().slideDown(duration, function() { 2417 $(this).removeAttr("style").addClass("active"); 2418 2419 if (scrollable) { 2420 $("body, html").stop().animate({ 2421 scrollTop: $pagination.offset().top - navOffset 2422 }, 300); 2423 } 2424 2425 $pagination.removeClass("clicked"); 2426 }); 2427 } 2428 } else { 2429 if ($pageContent.children().length > 1) { 2430 $pageContent.children().stop().hide(duration, function() { 2431 $(this).removeAttr("style").removeClass("active"); 2432 }).siblings().last().stop().delay(duration).show(duration, function() { 2433 $(this).removeAttr("style").addClass("active"); 2434 2435 if (scrollable) { 2436 $("body, html").stop().animate({ 2437 scrollTop: $pagination.offset().top - navOffset 2438 }, 300); 2439 } 2440 2441 $pagination.removeClass("clicked"); 2442 }); 2443 } else { 2444 $pageContent.children().last().stop().show(duration, function() { 2445 $(this).removeAttr("style").addClass("active"); 2446 2447 if (scrollable) { 2448 $("body, html").stop().animate({ 2449 scrollTop: $pagination.offset().top - navOffset 2450 }, 300); 2451 } 2452 2453 $pagination.removeClass("clicked"); 2454 }); 2455 } 2456 } 2457 2458 $pageLink.each(function() { 2459 $(this).find(".page-item").last().addClass("active"); 2460 }); 2461 } 2462 } 2463 }) 2464 .on("click", ".page-link .page-item", function() { 2465 var $pagination = $(this).parents(".pagination").first(), 2466 navOffset = 0; 2467 2468 if (!$pagination.hasClass("clicked")) { 2469 $pagination.addClass("clicked"); 2470 2471 if ($(".nav-fixed").length > 0) navOffset = typeof $(".nav-fixed").attr("data-height") != "undefined" ? parseInt($(".nav-fixed").attr("data-height")) : $(".nav-fixed").outerHeight(); 2472 2473 $(this).addClass("current"); 2474
2475 var $pageContent = $pagination.children(".page-content"), 2476 mode = $pagination.attr("data-mode") !== "undefined" && $.inArray($pagination.attr("data-mode"), ["fade", "slide", "block"]) >= 0 ? $pagination.attr("data-mode") : "block", 2477 duration = typeof $pagination.attr("data-duration") !== "undefined" && $pagination.attr("data-duration").length > 0 ? parseInt($pagination.attr("data-duration"), 10) : (mode == "block" ? 0 : 300), 2478 scrollable = typeof $pagination.attr("data-scroll") !== "undefined" && $.inArray($pagination.attr("data-scroll"), ["true", "on", "enable", "enabled", "1"]) >= 0 ? true : false, 2479 $pageClone = $pagination.children(".page-link").find(".page-item.current").parents(".page-link").first().clone(), 2480 idx = 0; 2481 2482 $pageClone.find(".page-first, .page-last, .page-next, .page-prev, .page-ellipse").remove(); 2483 2484 idx = $pageClone.find(".page-item.current").index(); 2485 2486 if (mode == "fade") { 2487 if ($pageContent.children().length > 1) { 2488 $pageContent.children().stop().fadeOut(duration, function() { 2489 $(this).removeAttr("style").removeClass("active"); 2490 }).siblings().eq(idx).stop().delay(duration).fadeIn(duration, function() { 2491 $(this).removeAttr("style").addClass("active"); 2492 2493 if (scrollable) { 2494 $("body, html").stop().animate({ 2495 scrollTop: $pagination.offset().top - navOffset 2496 }, 300); 2497 } 2498 2499 $pagination.removeClass("clicked"); 2500 }); 2501 } else { 2502 $pageContent.children().eq(idx).stop().fadeIn(duration, function() { 2503 $(this).removeAttr("style").addClass("active"); 2504 2505 if (scrollable) { 2506 $("body, html").stop().animate({ 2507 scrollTop: $pagination.offset().top - navOffset 2508 }, 300); 2509 } 2510 2511 $pagination.removeClass("clicked"); 2512 }); 2513 } 2514 } else if (mode == "slide") { 2515 if ($pageContent.children().length > 1) { 2516 $pageContent.children().stop().slideUp(duration, function() { 2517 $(this).removeAttr("style").removeClass("active"); 2518 }).siblings().eq(idx).stop().delay(duration).slideDown(duration, function() { 2519 $(this).removeAttr("style").addClass("active"); 2520 2521 if (scrollable) { 2522 $("body, html").stop().animate({ 2523 scrollTop: $pagination.offset().top - navOffset 2524 }, 300); 2525 } 2526 2527 $pagination.removeClass("clicked"); 2528 }); 2529 } else { 2530 $pageContent.children().eq(idx).stop().slideDown(duration, function() { 2531 $(this).removeAttr("style").addClass("active"); 2532 2533 if (scrollable) { 2534 $("body, html").stop().animate({ 2535 scrollTop: $pagination.offset().top - navOffset 2536 }, 300); 2537 } 2538 2539 $pagination.removeClass("clicked"); 2540 }); 2541 } 2542 } else { 2543 if ($pageContent.children().length > 1) { 2544 $pageContent.children().stop().hide(duration, function() { 2545 $(this).removeAttr("style").removeClass("active"); 2546 }).siblings().eq(idx).stop().delay(duration).show(duration, function() { 2547 $(this).removeAttr("style").addClass("active"); 2548 2549 if (scrollable) { 2550 $("body, html").stop().animate({ 2551 scrollTop: $pagination.offset().top - navOffset 2552 }, 300); 2553 } 2554 2555 $pagination.removeClass("clicked"); 2556 }); 2557 } else { 2558 $pageContent.children().eq(idx).stop().show(duration, function() { 2559 $(this).removeAttr("style").addClass("active"); 2560 2561 if (scrollable) { 2562 $("body, html").stop().animate({ 2563 scrollTop: $pagination.offset().top - navOffset 2564 }, 300); 2565 } 2566 2567 $pagination.removeClass("clicked"); 2568 }); 2569 } 2570 } 2571 2572 $pagination.children(".page-link").find(".page-item.current").removeClass("current"); 2573 $pagination.children(".page-link").find(".page-item.active").removeClass("active"); 2574 $pagination.children(".page-link").each(function() { 2575 $(this).find(".page-item").eq(idx).addClass("active"); 2576 }); 2577 } 2578 }) 2579 .on("click", ".page-link li.disabled", function() {}); 2580 // END: .pagination 2581}); 2582 2583// user agents 2584var isMobile = { 2585 Android: function() { 2586 return navigator.userAgent.match(/Android/i); 2587 }, 2588 BlackBerry: function() { 2589 return navigator.userAgent.match(/BlackBerry/i); 2590 }, 2591 iOS: function() { 2592 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 2593 }, 2594 Opera: function() { 2595 return navigator.userAgent.match(/Opera Mini/i); 2596 }, 2597 Windows: function() { 2598 return navigator.userAgent.match(/IEMobile/i); 2599 }, 2600 any: function() { 2601 return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); 2602 } 2603}; 2604 2605var fbTimer = null, 2606 fbCodes = {}, 2607 fbPage = document.querySelectorAll(".fb-page"); 2608 2609if (fbPage.length > 0) { 2610 for (var i in fbPage) { 2611 if (fbPage[i].constructor === HTMLDivElement) fbCodes[i] = fbPage[i].outerHTML; 2612 } 2613} 2614 2615$(window).resize(function() { 2616 // fix bg parallax on mobile 2617 if (isMobile.any()) $(".bg-parallax").css("background-attachment", "inherit"); 2618 else $(".bg-parallax").css("background-attachment", ""); 2619 2620 $(".pagination").removeClass("clicked"); 2621 2622 if ($("#fb-root").attr("data-resize")) { 2623 if (fbTimer != null) clearTimeout(fbTimer); 2624 2625 // delay for document is loaded 2626 fbTimer = setTimeout(function() { 2627 if (typeof FB !== "undefined") { 2628 $(".fb-page").each(function(i) { 2629 if (fbCodes[i]) $(this).replaceWith(fbCodes[i]); 2630 }); 2631 2632 FB.XFBML.parse(document, function() { 2633 if ($("#fb-root").attr("data-resize") == "once") $("#fb-root").removeAttr("data-resize"); 2634 }); 2635 } 2636 }, 1000); 2637 } 2638}).on("scroll resize", function() { 2639 // if ($(this).scrollTop() > 0) $("#pagetop").addClass("visible"); 2640 // else $("#pagetop").removeClass("visible"); 2641 2642 if ($(".nav-fixed").length) {
2643 var $navPinY = $(".nav-target").length ? $(".nav-target").offset().top - $(".nav-fixed").outerHeight() - 1 : $(".nav-fixed").offset().top; 2644 if ($(this).scrollTop() > $navPinY || ($navPinY < 0 && $(this).scrollTop() > 0)) { 2645 if ($(".nav-pin").length) $(".nav-pin").addClass("fixed"); 2646 else $(".nav-fixed").addClass("fixed"); 2647 } else { 2648 if ($(".nav-pin").length) $(".nav-pin").removeClass("fixed"); 2649 else $(".nav-fixed").removeClass("fixed"); 2650 } 2651 } 2652}).on("load", function() { 2653 // scrollBefore(); 2654}); 2655 2656var scrollBefore = function() { 2657 var hash = window.location.hash || location.hash, 2658 ptnHash = /([;?%&,+*~\':"!^$[\]()=>|\/@])/g; 2659 2660 if (hash) { 2661 hash = hash.replace(ptnHash, "\\$1"); 2662 if ($(hash).length > 0) { 2663 if ($(".tabs-switch").length > 0) { 2664 if ($(hash).length > 0 && $(hash).parents(".tab-content").first().length > 0) { 2665 var tabChild = $(hash); 2666 $(hash).parents().each(function() { 2667 if ($(this).attr("class") !== undefined && $.inArray("tab-content", $(this).attr("class").split(" ")) >= 0) return false; 2668 else tabChild = $(this); 2669 }); 2670 2671 setTimeout(function() { 2672 tabChild.parents(".tabs-switch").first().children(".tab-link").children().eq(tabChild.index()).click(); // trigger tab in multiple dim 2673 }, 10); 2674 } else { 2675 $(".tabs-switch").each(function() { 2676 var $tabLink = $(this).children(".tab-link"); 2677 2678 if ($tabLink.children(hash).length > 0) { 2679 setTimeout(function() { 2680 $tabLink.children(hash).click(); // trigger for set active tab 2681 }, 10); 2682 } 2683 }); 2684 } 2685 } 2686 2687 if ($(".bx-wrapper").length > 0) $(window).trigger("resize"); 2688 2689 setTimeout(function() { 2690 if ($(".nav-fixed").length > 0) { 2691 var offsetY = $(hash).offset().top, 2692 navHeight = typeof $(".nav-fixed").attr("data-height") != "undefined" ? parseInt($(".nav-fixed").attr("data-height"), 10) : $(".nav-fixed").outerHeight(); 2693 2694 // if ($(".nav-pin").length > 0) offsetY -= $(".nav-pin").outerHeight(); 2695 2696 window.scroll(0, offsetY - navHeight); 2697 2698 // re-updated offset 2699 if ($(".nav-target").length > 0) { 2700 var reupdated = true; 2701 $(window).scroll(function() { 2702 if (reupdated && $(this).scrollTop() >= $(".nav-target").offset().top) { 2703 reupdated = false; 2704 2705 navHeight = typeof $(".nav-fixed").attr("data-height") != "undefined" ? parseInt($(".nav-fixed").attr("data-height"), 10) : $(".nav-fixed").outerHeight(); 2706 2707 window.scroll(0, $(hash).offset().top - navHeight); 2708 } 2709 }); 2710 } 2711 } else window.scrollTo(0, $(hash).offset().top); 2712 }, 10); 2713 2714 $("a[href='" + hash + "']").click(); 2715 } // else window.scrollTo(0, _offsetY); 2716 } 2717}; 2718 2719scrollBefore(); // DOM loaded 2720 2721 2722 2723/* 2724 * Plugins/Functions 2725 * 2726 */ 2727 2728// check object is variable or DOM elements 2729function isObjectVar(obj) { 2730 return ((typeof obj != "undefined") && (typeof obj === "object") && (obj.nodeType !== 1) && (typeof obj.ownerDocument !== "object")); 2731} 2732 2733(function($) { 2734 // BEGIN: $.fcvScroll 2735 $.fn.fcvScroll = function(options) { 2736 var options = $.extend({ 2737 selector: ".section", // selector 2738 delay: 50, // time delay (ms) 2739 duration: 400, // time duration (ms) 2740 reference: .9, 2741 }, options); 2742 2743 if (options.selector) { 2744 var $wrapper = $(this), 2745 $offsetSelectors = [], 2746 $scrollDown = true, 2747 $scrollPos = $(window).scrollTop(), 2748 $scrollTimer = null; 2749 2750 $wrapper.find(options.selector).each(function(i) { 2751 $offsetSelectors.push($(this).offset().top); // offsetY fined 2752 }); 2753 2754 $(window).scroll(function() { 2755 $scrollDown = $(window).scrollTop() >= $scrollPos; 2756 $scrollPos = $(window).scrollTop(); 2757 2758 clearTimeout($scrollTimer); 2759 2760 if ($.inArray($(window).scrollTop(), $offsetSelectors) < 0) { // not in area fined 2761 $scrollTimer = setTimeout(function() { // fcv-snap 2762 var $scrollTop = $(window).scrollTop(), 2763 $posY = $(window).height() * options.reference, 2764 $position = 0, 2765 $target; 2766 2767 if ($scrollDown) { // direction down 2768 $position = $scrollTop + $posY - 1; 2769 $wrapper.find(options.selector).each(function() { 2770 var $offsetY = $(this).offset().top; 2771 if (($offsetY > $scrollTop) && ($offsetY <= $position)) { 2772 $target = $(this); 2773 return false;
2774 } 2775 }); 2776 } else { // direction up 2777 $position = $scrollTop - $posY + 1; 2778 $wrapper.find(options.selector).each(function() { 2779 var $offsetY = $(this).offset().top; 2780 if (($offsetY < $scrollTop) && ($offsetY >= $position)) { 2781 $target = $(this); 2782 return false; 2783 } 2784 }); 2785 } 2786 2787 if ($target) { 2788 $("html, body").stop().animate({ 2789 scrollTop: $target.offset().top 2790 }, options.duration, function() { 2791 clearTimeout($scrollTimer); 2792 }); 2793 } 2794 }, options.delay); 2795 } 2796 }).resize(function() { 2797 if ($(options.selector).hasClass("minHeight")) { 2798 $(options.selector).css({ 2799 minHeight: $(window).height() 2800 }); 2801 } else { 2802 $(options.selector).css({ 2803 height: $(window).height() 2804 }); 2805 } 2806 }).trigger("resize"); 2807 } else console.error("Missing selector"); 2808 2809 return this; 2810 }; 2811 // END: $.fcvScroll 2812})(jQuery); 2813 2814var gmarkers = [], 2815 gnum = 0; 2816 2817 2818 2819// BEGIN: heightLine 2820function heightLine() { 2821 this.className = "heightLine"; 2822 this.parentClassName = "heightLineParent" 2823 reg = new RegExp(this.className + "-([a-zA-Z0-9-_]+)", "i"); 2824 objCN = new Array(); 2825 var objAll = document.getElementsByTagName ? document.getElementsByTagName("*") : document.all; 2826 for (var i = 0; i < objAll.length; i++) { 2827 if (typeof objAll[i].className == "string") { 2828 var eltClass = objAll[i].className.split(/\s+/); 2829 for (var j = 0; j < eltClass.length; j++) { 2830 if (eltClass[j] == this.className) { 2831 if (!objCN["main CN"]) objCN["main CN"] = new Array(); 2832 objCN["main CN"].push(objAll[i]); 2833 break; 2834 } else if (eltClass[j] == this.parentClassName) { 2835 if (!objCN["parent CN"]) objCN["parent CN"] = new Array(); 2836 objCN["parent CN"].push(objAll[i]); 2837 break; 2838 } else if (eltClass[j].match(reg)) { 2839 var OCN = eltClass[j].match(reg) 2840 if (!objCN[OCN]) objCN[OCN] = new Array(); 2841 objCN[OCN].push(objAll[i]); 2842 break; 2843 } 2844 } 2845 } 2846 } 2847 2848 //check font size 2849 var e = document.createElement("div"); 2850 var s = document.createTextNode("S"); 2851 e.appendChild(s); 2852 e.style.classname = "check-fontsize"; 2853 e.style.visibility = "hidden"; 2854 e.style.position = "absolute"; 2855 e.style.top = "0"; 2856 document.body.appendChild(e); 2857 var defHeight = e.offsetHeight; 2858 2859 changeBoxSize = function() { 2860 for (var key in objCN) { 2861 if (objCN.hasOwnProperty(key)) { 2862 //parent type 2863 if (key == "parent CN") { 2864 for (var i = 0; i < objCN[key].length; i++) { 2865 var max_height = 0; 2866 var CCN = objCN[key][i].childNodes; 2867 for (var j = 0; j < CCN.length; j++) { 2868 if (CCN[j] && CCN[j].nodeType == 1) { 2869 CCN[j].style.height = "auto"; 2870 max_height = max_height > CCN[j].offsetHeight ? max_height : CCN[j].offsetHeight; 2871 } 2872 } 2873 for (var j = 0; j < CCN.length; j++) { 2874 if (CCN[j].style) { 2875 var stylea = CCN[j].currentStyle || document.defaultView.getComputedStyle(CCN[j], ''); 2876 var newheight = max_height; 2877 if (stylea.paddingTop) newheight -= stylea.paddingTop.replace("px", ""); 2878 if (stylea.paddingBottom) newheight -= stylea.paddingBottom.replace("px", ""); 2879 if (stylea.borderTopWidth && stylea.borderTopWidth != "medium") newheight -= stylea.borderTopWidth.replace("px", ""); 2880 if (stylea.borderBottomWidth && stylea.borderBottomWidth != "medium") newheight -= stylea.borderBottomWidth.replace("px", ""); 2881 CCN[j].style.height = newheight + "px"; 2882 } 2883 } 2884 } 2885 } else { 2886 var max_height = 0; 2887 for (var i = 0; i < objCN[key].length; i++) { 2888 objCN[key][i].style.height = "auto"; 2889 max_height = max_height > objCN[key][i].offsetHeight ? max_height : objCN[key][i].offsetHeight; 2890 } 2891 for (var i = 0; i < objCN[key].length; i++) { 2892 if (objCN[key][i].style) { 2893 var stylea = objCN[key][i].currentStyle || document.defaultView.getComputedStyle(objCN[key][i], ''); 2894 var newheight = max_height; 2895 if (stylea.paddingTop) newheight -= stylea.paddingTop.replace("px", ""); 2896 if (stylea.paddingBottom) newheight -= stylea.paddingBottom.replace("px", ""); 2897 if (stylea.borderTopWidth && stylea.borderTopWidth != "medium") newheight -= stylea.borderTopWidth.replace("px", "") 2898 if (stylea.borderBottomWidth && stylea.borderBottomWidth != "medium") newheight -= stylea.borderBottomWidth.replace("px", ""); 2899 objCN[key][i].style.height = newheight + "px"; 2900 } 2901 } 2902 } 2903 } 2904 } 2905 } 2906 2907 checkBoxSize = function() { 2908 if (defHeight != e.offsetHeight) { 2909 changeBoxSize(); 2910 defHeight = e.offsetHeight; 2911 } 2912 2913 // var elm = document.querySelector(".check-fontsize"); 2914 // if (elm) elm.parentNode.removeChild(elm); 2915 } 2916 changeBoxSize(); 2917 setInterval(checkBoxSize, 1000) 2918 window.onresize = changeBoxSize; 2919} 2920 2921function addEvent(elm, listener, fn) { 2922 try { 2923 elm.addEventListener(listener, fn, false); 2924 } catch (e) { 2925 elm.attachEvent("on" + listener, fn); 2926 } 2927} 2928addEvent(window, "load", heightLine); 2929// END: heightLine 2930 2931(function() { // DOM loaded 2932 // facebook 2933 var fbRoot = document.getElementById("fb-root"); 2934 if (fbRoot) { 2935 var fbScript = document.createElement("script"), 2936 fbScriptContent = "", 2937 fbVersion = fbRoot.getAttribute("data-version") ? fbRoot.getAttribute("data-version") : "v2.12", 2938 fbLanguage = fbRoot.getAttribute("data-language") ? fbRoot.getAttribute("data-language") : "ja_JP"; 2939 2940 fbVersion = fbVersion.substr(0, 1).toLowerCase() == "v" ? fbVersion.substr(1) : fbVersion; 2941 2942 fbScriptContent += '(function(d, s, id) {'; 2943 fbScriptContent += 'var js, fjs = d.getElementsByTagName(s)[0];'; 2944 fbScriptContent += 'if (d.getElementById(id)) return;'; 2945 fbScriptContent += 'js = d.createElement(s);'; 2946 fbScriptContent += 'js.id = id;'; 2947 fbScriptContent += 'js.async = true;'; 2948 fbScriptContent += 'js.src = "https://connect.facebook.net/' + fbLanguage + '/sdk.js#xfbml=1&version=v' + fbVersion + '";'; 2949 fbScriptContent += 'fjs.parentNode.insertBefore(js, fjs);'; 2950 fbScriptContent += '}(document, "script", "facebook-jssdk"));'; 2951 2952 fbScript.innerHTML = fbScriptContent; 2953 document.body.appendChild(fbScript); 2954 } 2955 2956 // WOW js 2957 if (typeof window["WOW"] === "function") { 2958 var wowData = { 2959 boxClass: typeof $("body").attr("data-wow-box") != "undefined" ? $("body").attr("data-wow-box") : "wow", 2960 animateClass: typeof $("body").attr("data-wow-animate") != "undefined" ? $("body").attr("data-wow-animate") : "animated", 2961 offset: typeof $("body").attr("data-wow-offset") != "undefined" ? parseInt($("body").attr("data-wow-offset")) : 0, 2962 mobile: $.inArray($("body").attr("data-wow-mobile"), ["false", "off", "disable", "disabled", "0"]) >= 0 ? false : true, 2963 live: $.inArray($("body").attr("data-wow-live"), ["false", "off", "disable", "disabled", "0"]) >= 0 ? false : true, 2964 resetAnimation: $.inArray($("body").attr("data-wow-reset"), ["false", "off", "disable", "disabled", "0"]) >= 0 ? false : true, 2965 callback: function(box) {}, 2966 scrollContainer: null 2967 }, 2968 _wow_ = new WOW(wowData); 2969 2970 _wow_.init(); 2971 } 2972})(); 2973 2974// conflicts 2975if (!Object.keys) { 2976 Object.keys = (function() { 2977 "use strict"; 2978 var hasOwnProperty = Object.prototype.hasOwnProperty, 2979 hasDontEnumBug = !({ 2980 toString: null 2981 }).propertyIsEnumerable("toString"), 2982 dontEnums = [ 2983 "toString",
2984 "toLocaleString", 2985 "valueOf", 2986 "hasOwnProperty", 2987 "isPrototypeOf", 2988 "propertyIsEnumerable", 2989 "constructor" 2990 ], 2991 dontEnumsLength = dontEnums.length; 2992 2993 return function(obj) { 2994 if (typeof obj !== "object" && (typeof obj !== "function" || obj === null)) { 2995 throw new TypeError("Object.keys called on non-object"); 2996 } 2997 2998 var result = [], 2999 prop, i; 3000 3001 for (prop in obj) { 3002 if (hasOwnProperty.call(obj, prop)) { 3003 result.push(prop); 3004 } 3005 } 3006 3007 if (hasDontEnumBug) { 3008 for (i = 0; i < dontEnumsLength; i++) { 3009 if (hasOwnProperty.call(obj, dontEnums[i])) { 3010 result.push(dontEnums[i]); 3011 } 3012 } 3013 } 3014 return result; 3015 }; 3016 }()); 3017} 3018 3019function isHTML(str) { 3020 var a = document.createElement("div"); 3021 a.innerHTML = str; 3022 for (var child = a.childNodes, i = child.length; i--;) { 3023 if (child[i].nodeType == 1) return true; 3024 } 3025 return false; 3026} 3027 3028// BEGIN: slide fading 3029var $slideFadeTimer = {}; 3030 3031function slideFadeStart(elm) { 3032 var $this = elm, 3033 __idx__ = $(".slide-fade").index($this), 3034 $duration = typeof $this.attr("data-duration") != "undefined" ? parseInt($this.attr("data-duration")) : 1000, 3035 $timer = typeof $this.attr("data-timer") != "undefined" ? parseInt($this.attr("data-timer")) : 4000, 3036 $delay = typeof $this.attr("data-delay") != "undefined" ? parseInt($this.attr("data-delay")) : false; 3037 3038 if ($timer < $duration) $timer = $duration * 2; 3039 3040 $this.removeClass("stop"); 3041 if (!$this.children(".active").length) { 3042 $this.children().hide(); 3043 $this.children().eq(0).show().addClass("active"); 3044 3045 if ($this.siblings(".slide-page").length) $this.siblings(".slide-page").children().eq(0).addClass("active"); 3046 } else { 3047 if ($this.siblings(".slide-page").length) $this.siblings(".slide-page").children().eq($this.children(".active").index()).addClass("active"); 3048 } 3049 3050 // $slideFadeTimer[__idx__] = setInterval(function() { 3051 // slideFade($this, $duration); 3052 // }, $timer); 3053 3054 $this.parents(".slideParent").addClass("move-start").attr("data", $this.children(".active").index()); 3055 3056 if ($slideFadeTimer[__idx__]) clearTimeout($slideFadeTimer[__idx__]); 3057 $slideFadeTimer[__idx__] = setTimeout(function() { 3058 slideFade($this, $duration); 3059 }, $delay ? $delay : $timer); 3060} 3061 3062function slideFade(elm, duration) { 3063 var elmActive = elm.children(".active"), 3064 slideContinue = elm.hasClass("stop") || (elm.hasClass("once") && elmActive.next().length < 1) ? false : true; 3065 3066 if (slideContinue) { 3067 var __idx__ = $(".slide-fade").index(elm), 3068 timer = typeof elm.attr("data-timer") != "undefined" ? parseInt(elm.attr("data-timer")) : 4000; 3069 3070 if (elmActive.next().length) { 3071 if (typeof elmActive.next().attr("data-duration") != "undefined") duration = parseInt(elmActive.next().attr("data-duration")); 3072 } else { 3073 if (typeof elm.children().eq(0).attr("data-duration") != "undefined") duration = parseInt(elm.children().eq(0).attr("data-duration")); 3074 } 3075 3076 if ($slideFadeTimer[__idx__]) clearTimeout($slideFadeTimer[__idx__]); 3077 3078 elmActive.stop().fadeOut(duration, function() { 3079 $(this).removeClass("active").removeAttr("style").hide(); 3080 }); 3081 3082 elm.parents(".slideParent").removeClass("move-start move-next move-prev move-first move-last"); 3083 3084 if (elmActive.next().length > 0) { 3085 if (typeof elmActive.next().attr("data-timer") != "undefined") timer = parseInt(elmActive.next().attr("data-timer")); 3086 if (timer < duration) timer = duration * 2; 3087 3088 if (elm.siblings(".slide-page").length > 0) { 3089 elm.siblings(".slide-page").children(".active").removeClass("active"); 3090 elm.siblings(".slide-page").children().eq(elmActive.next().index()).addClass("active"); 3091 } 3092 3093 elm.parents(".slideParent").addClass("move-next").attr("data", elmActive.next().index()); 3094 if (elmActive.next().is(":last-child")) elm.parents(".slideParent").addClass("move-last"); 3095 3096 elmActive.next().stop().fadeIn(duration, function() { 3097 $(this).addClass("active").removeAttr("style").show(); 3098 3099 if (elm.siblings(".slide-btn").hasClass("clicked")) elm.siblings(".slide-btn.clicked").removeClass("clicked"); 3100 if (elm.siblings(".slide-page").hasClass("clicked")) elm.siblings(".slide-page.clicked").removeClass("clicked"); 3101 3102 if ($(this).next().length < 1 && elm.hasClass("once")) elm.addClass("slide-finished"); 3103 3104 $slideFadeTimer[__idx__] = setTimeout(function() { 3105 slideFade(elm, duration); 3106 }, timer); 3107 }); 3108 } else { 3109 if (typeof elm.children().eq(0).attr("data-timer") != "undefined") timer = parseInt(elm.children().eq(0).attr("data-timer")); 3110 if (timer < duration) timer = duration * 2; 3111 3112 if (elm.siblings(".slide-page").length > 0) { 3113 elm.siblings(".slide-page").children(".active").removeClass("active"); 3114 elm.siblings(".slide-page").children().eq(0).addClass("active"); 3115 } 3116 3117 elm.parents(".slideParent").addClass("move-first").attr("data", 0); 3118 3119 elm.children().eq(0).stop().fadeIn(duration, function() { 3120 $(this).addClass("active").removeAttr("style").show(); 3121 3122 if (elm.siblings(".slide-btn").hasClass("clicked")) elm.siblings(".slide-btn.clicked").removeClass("clicked"); 3123 if (elm.siblings(".slide-page").hasClass("clicked")) elm.siblings(".slide-page.clicked").removeClass("clicked"); 3124 3125 if ($(this).next().length < 1 && elm.hasClass("once")) elm.addClass("slide-finished"); 3126 3127 $slideFadeTimer[__idx__] = setTimeout(function() { 3128 slideFade(elm, duration); 3129 }, timer); 3130 }); 3131 } 3132 } else elm.addClass("slide-finished"); 3133} 3134// END: slide fading 3135 3136// BEGIN: .pagination 3137function reloadPager(elm) { 3138 if (elm) { 3139 if (elm instanceof jQuery && elm.length > 0) { 3140 elm.each(function() {
3141 initPager($(this)); 3142 }); 3143 } 3144 } else { 3145 $(".pagination").each(function() { 3146 initPager($(this)); 3147 }); 3148 } 3149} 3150 3151function initPager(elm) { 3152 // if (elm.children(".page-content").children().length > 0) { 3153 var $pagination = elm, 3154 $pageContent = $pagination.children(".page-content"), 3155 total = $pageContent.children().length; 3156 3157 var dataPage = { 3158 first: typeof $pagination.attr("data-first") !== "undefined" && $pagination.attr("data-first").length > 0 ? $pagination.attr("data-first") : false, 3159 last: typeof $pagination.attr("data-last") !== "undefined" && $pagination.attr("data-last").length > 0 ? $pagination.attr("data-last") : false, 3160 next: typeof $pagination.attr("data-next") !== "undefined" && $pagination.attr("data-next").length > 0 ? $pagination.attr("data-next") : false, 3161 prev: typeof $pagination.attr("data-prev") !== "undefined" && $pagination.attr("data-prev").length > 0 ? $pagination.attr("data-prev") : false, 3162 active: typeof $pagination.attr("data-active") !== "undefined" && $pagination.attr("data-active").length > 0 ? parseInt($pagination.attr("data-active"), 10) : 1, 3163 max: typeof $pagination.attr("data-max") !== "undefined" && $pagination.attr("data-max").length > 0 ? parseInt($pagination.attr("data-max"), 10) : false, 3164 page: typeof $pagination.attr("data-page") !== "undefined" && $.inArray($pagination.attr("data-page"), ["top", "bottom", "both"]) >= 0 ? $pagination.attr("data-page") : false 3165 }; 3166 3167 if (dataPage.active > total) dataPage.active = 1; 3168 3169 if (dataPage.max) { // && $pageContent.children().length > 0 3170 if ($pageContent.children(".page-wrap").length > 0) { 3171 if ($pageContent.children(".page-wrap").children().length > 0) $pageContent.children(".page-wrap").children().unwrap(); 3172 else $pageContent.children(".page-wrap").remove(); 3173 } 3174 3175 $pageContent.children().not(".page-wrap").each(function(i) { 3176 if (i % dataPage.max === 0) $pageContent.append('<div class="page-wrap" />'); 3177 3178 $(this).appendTo($pageContent.children(".page-wrap").last()); 3179 }); 3180 3181 total = $pageContent.children().length; 3182 } 3183 3184 if ($pagination.children(".page-link").length > 0) $pagination.children(".page-link").remove(); 3185 3186 if (dataPage.page && total > 0) { 3187 if (dataPage.page == "top") $pagination.prepend('<div class="page-link" />'); 3188 else if (dataPage.page == "bottom") $pagination.append('<div class="page-link" />'); 3189 else { 3190 $pagination.prepend('<div class="page-link" />'); 3191 $pagination.append('<div class="page-link" />'); 3192 } 3193 3194 $pagination.children(".page-link").each(function(p) { 3195 var $pageLink = $(this); 3196 3197 var htmlItem = []; 3198 htmlItem.push('<ul>'); 3199 if (dataPage.first) htmlItem.push('<li class="page-first">' + dataPage.first + '</li>'); 3200 if (dataPage.prev) htmlItem.push('<li class="page-prev">' + dataPage.prev + '</li>'); 3201 for (var i = 1; i <= total; i++) { 3202 // if (i == dataPage.active) htmlItem.push('<li class="page-item active">' + i + '</li>'); 3203 // else htmlItem.push('<li class="page-item">' + i + '</li>'); 3204 htmlItem.push('<li class="page-item">' + i + '</li>'); 3205 } 3206 if (dataPage.next) htmlItem.push('<li class="page-next">' + dataPage.next + '</li>'); 3207 if (dataPage.last) htmlItem.push('<li class="page-last">' + dataPage.last + '</li>'); 3208 htmlItem.push('</ul>'); 3209 3210 htmlItem = htmlItem.join("\n"); 3211 $pageLink.html(htmlItem); 3212 3213 var scrollable = $pagination.attr("data-scroll"), 3214 duration = $pagination.attr("data-duration"), 3215 modeable = $pagination.attr("data-mode"); 3216 3217 $pagination.attr("data-scroll", false); // off scroll on first loaded 3218 $pagination.attr("data-duration", 0); // off duration on first loaded 3219 $pagination.attr("data-mode", false); // off mode on first loaded 3220 3221 if (p >= $pagination.children(".page-link").length - 1) { // last 3222 setTimeout(function() {
3223 $pageLink.find(".page-item").eq(dataPage.active - 1).click(); 3224 }, 1); 3225 } // else $pageLink.find(".page-item").eq(dataPage.active - 1).addClass("active"); 3226 }); 3227 3228 // re-setting for data-scroll 3229 if (typeof scrollable === "undefined") $pagination.removeAttr("data-scroll"); 3230 else $pagination.attr("data-scroll", scrollable); 3231 3232 // re-setting for data-duration 3233 if (typeof duration === "undefined") $pagination.removeAttr("data-duration"); 3234 else $pagination.attr("data-duration", duration); 3235 3236 // re-setting for data-mode 3237 if (typeof modeable === "undefined") $pagination.removeAttr("data-mode"); 3238 else $pagination.attr("data-mode", modeable); 3239 } else { 3240 $pageContent.children(".page-wrap").first().addClass("active"); // show 3241 } 3242 // } 3243} 3244// END: .pagination 3245 3246var checkDomain = function(url) { 3247 if (url.indexOf('//') === 0) url = location.protocol + url; 3248 return url.toLowerCase().replace(/([a-z])?:\/\//, "$1").split("/")[0]; 3249}; 3250var isExternal = function(url) { 3251 return ((url.indexOf(":") > -1 || url.indexOf("//") > -1) && checkDomain(location.href) !== checkDomain(url)); 3252};
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.