!function( e, $ ) { e.common = e.common || {}, common.loding = function( e ) { function t() { this.param = a, this.init() } var a = $.extend( !0, { $load: $( "#loading-bg" ), isLoad: !1, isLoadOff: !1, perOneImage: null, percentage: null, rest: null, thisNum: 0, percent: 0, timerId: null, tweenTimerId: null, stars: null, imgLength: $( "body" ).find( "img" ).length, callback: function() { } }, e ), o = t.prototype; return o.init = function() { var e = this; a.isLoad = !0, o.controller() }, o.controller = function( e ) { var t = this; $( "body" ).css( { height: "auto" } ), a.$load.css( { opacity: 0, visibility: "hidden" } ), a.callback() }, o.tweenTimer = function( e ) { var t = this; clearTimeout( a.tweenTimerId ), a.tweenTimerId = setTimeout( function() { a.$load.find( ".obj" ).find( e ), o.tweenController( e ) }, 100 ) }, o.setTimer = function( e ) { var t = this; a.percent < a.thisNum && a.percent++, (100 == a.percent || a.isLoadOff) && (clearInterval( a.timerId ), a.isLoad = !1, setTimeout( function() { $.cookie( "access", $( "body" ).addClass( "access" ) ), clearTimeout( a.tweenTimerId ), o.loadAnime() }, 500 )) }, o.imageLoad = function() { var e = this, t = 0; $( "body" ).imagesLoaded().progress( function() { t++, a.thisNum = Math.floor( t / a.imgLength * 100 ) } ) }, o.loadAnime = function() { var e = this; $.sequence( function() { return a.$load.velocity( { opacity: "0", visibility: "hidden" }, 300, "easeInOutQuart" ) }, function() { $( "body" ).css( { height: "auto" } ), a.$load.css( { opacity: "", visibility: "" } ), a.callback() } ) }, new t }, common.pageChange = function( e ) { function t() { this.param = a, this.init() } var a = $.extend( !0, { $trigger: 'a:not([href^="#"]):not([target])', $load: $( "#loading-bg" ), $header: $( ".global-header" ), state: null, data: null, callback: function() { }, isHistory: !1, ease: "easeOutExpo", duration: 100, isLoadStart: !1, isLoadEnd: !1, flag: !1, timer: null }, e ), o = t.prototype; return o.init = function() { var e = this; o.event() }, o.event = function() { var e = this; $.pjax.defaults.timeout = 5e3, $( document ).on( "click", a.$trigger, function() { var e = location.pathname; if( "/" != location.pathname ) { var t = location.pathname, e = t.substring( 0, t.lastIndexOf( "/" ) ) + "/"; e.replace( location.host, "" ) } if( $( this ).attr( "href" ) === e && !$( "#page" ).hasClass( "page-404" ) )return !1; var a = $( this ).attr( "href" ); return -1 === a.indexOf( "/contact/" ) && -1 === a.indexOf( "/careers/" ) && -1 === a.indexOf( "/about/corporate-document/" ) ? (o.controller( $( this ).attr( "href" ) ), !1) : void 0 } ), $( document ).on( "pjax:popstate", function( e ) { $( ".global-nav__layer" ).css( { height: 0, opacity: 0 } ), a.callback() } ), $( document ).on( "pjax:start", function() { o.pageChangeStart() } ), $( document ).on( "pjax:end", function( e ) { a.isPjax = !1, AMP.mediaquery.on( "change" ), (new AMP.$.MediaImageChange).start(), $( "#wrap" ).imagesLoaded().always( function() { function e() { a.isLoadStart ? (clearTimeout( e ), o.pageChangeEnd( function() { a.callback() } )) : setTimeout( e, 10 ) } e() } ) } ) }, o.pageChangeStart = function() { var e = this; if( a.flag )return !1; a.flag = !0, $( ".global-header" ).removeClass( "_open" ), $( "body" ).hasClass( "is-trans" ) || $( "body" ).addClass( "is-trans" ), a.$load.css( { visibility: "visible" } ), a.$load.stop( !0, !1 ).velocity( { opacity: 1 }, { duration: a.duration, easing: a.ease, queue: !1 } ), $( "#content,.global-footer,.global-nav__lower" ).stop( !0, !1 ).velocity( { opacity: 0 }, { duration: a.duration, easing: a.ease, complete: function() { a.isLoadStart = !0, a.flag = !1 }, queue: !1 } ) }, o.pageChangeEnd = function( e ) { var t = this; a.$load.stop( !0, !1 ).velocity( { opacity: 0 }, { duration: a.duration, easing: a.ease, queue: !1 } ), $( "#content,.global-footer.global-nav__lower" ).stop( !0, !1 ).velocity( { opacity: 1 }, { duration: a.duration, easing: a.ease, complete: function() { a.$load.css( { visibility: "hidden" } ), a.isLoadStart = !1, e() }, queue: !1 } ) }, o.controller = function( e ) { var t = this; a.isPjax = !0, $.pjax( { url: e, container: "#wrap", fragment: "#wrap", timeout: 3e4, data: { _pjax: !1 }, load: { script: !1 } } ) }, new t }, common.headerTween = function( e, t ) { function a() { this.param = o, this.init() } var o = $.extend( !0, { $target: e, $triggerPos: e.height() / 2, $body: $( "body" ), scTop: $( window ).scrollTop(), isFixed: !1 }, t ), n = a.prototype; return n.init = function() { var e = this; n.set(), n.control() }, n.set = function() { var e = this; $( window ).scroll( function() { o.scTop = $( window ).scrollTop(), n.control() } ), $( window ).resize( function() { o.$triggerPos = o.$target.height(), o.scTop = $( window ).scrollTop() } ) }, n.control = function() { var e = this; o.scTop >= o.$triggerPos && !o.isFixed ? (o.isFixed = !0, n.onTween()) : o.scTop < o.$triggerPos && o.isFixed && !o.$target.hasClass( "_open" ) && (n.offTween(), o.isFixed = !1) }, n.onTween = function() { var e = this; o.$body.addClass( "_nav-fixed" ), o.$target.addClass( "_fixed" ) }, n.offTween = function() { var e = this; o.$body.removeClass( "_nav-fixed" ), o.$target.removeClass( "_fixed" ) }, new a }, common.spNavTween = function( e, t ) { function a() { this.param = o, this.init() } var o = $.extend( !0, { $header: $( ".global-header" ), $target: $( ".global-header__nav" ), $trigger: $( ".global-header__btn-nav a" ), $lowerItem: $( ".global-nav__item--has-lower" ), $lowerTrigger: $( ".global-nav__item--has-lower" ).find( ".global-nav__btn-lower a" ), $lowerCont: $( ".global-nav__lower" ), $body: $( "body" ), isOpen: !1, isPC: !1, isTweenLower: !1, duration: 400, pos: $( window ).scrollTop(), easing: "easeInOutExpo", activeClass: "_open", scTop: $( window ).scrollTop() }, t ), n = a.prototype; return n.init = function() { var e = this; n.set(), n.reset() }, n.reset = function() { var e = this; o.$body.removeClass( "_nav-open" ), o.$body.css( { top: 0, height: "auto" } ), "sp" == AMP.mediaquery.mediaStyle && (o.$header.removeClass( "_open-lower" ), o.$header.removeClass( o.activeClass ), o.$target.css( { display: "none" } ), o.$lowerItem.find( ".global-nav__lower" ).css( { display: "none", height: "auto", opacity: 1 } ), o.$lowerItem.removeClass( o.activeClass )) }, n.set = function() { var e = this; o.$trigger.off( "click" ), o.$lowerTrigger.off( "click" ), o.$trigger.click( function() { return "pc" != AMP.mediaquery.mediaStyle && (n.control(), !1) } ), o.$lowerTrigger.click( function() { if( "pc" == AMP.mediaquery.mediaStyle )return !1; var e = $( this ).closest( ".global-nav__item" ); return !o.isTweenLower && (e.hasClass( o.activeClass ) ? n.lowerTween( !1, e ) : n.lowerTween( !0, e ), !1) } ), $( window ).resize( function( e ) { n.resize() } ) }, n.control = function() { var e = this; o.isOpen ? o.isOpen && (n.offTween( o.$target ), n.lowerTween( !1, o.$lowerItem )) : (o.isOpen = !0, n.onTween( o.$target )) }, n.resize = function() { var e = this; "sp" == AMP.mediaquery.mediaStyle && o.isPC ? (o.$header.removeClass( "_open-lower" ), o.$body.removeClass( "_nav-open" ), o.$target.css( { display: "none" } ), o.$lowerItem.find( ".global-nav__lower" ).css( { display: "none", height: "auto", opacity: 1 } ), o.$lowerItem.removeClass( o.activeClass ), o.isPC = !1) : "pc" != AMP.mediaquery.mediaStyle || o.isPC || (o.isPC = !0, o.$body.removeClass( "_nav-open" ), o.$body.css( { top: 0, height: "auto" } ), o.$header.removeClass( o.activeClass ), o.$header.removeClass( "_open-lower" ), o.$target.css( { display: "block", height: "auto", opacity: 1 } ), o.$lowerItem.removeClass( o.activeClass ), o.$lowerItem.find( ".global-nav__lower" ).css( { display: "block", height: "0", opacity: 0 } ), o.isOpen = !1, o.isTweenLower = !1) }, n.onTween = function() { var e = this; o.scTop = $( window ).scrollTop(), o.pos = $( window ).scrollTop(), o.$header.addClass( o.activeClass ), o.$body.css( { top: -1 * o.pos } ), o.$body.addClass( "_nav-open" ); var t = o.$target.outerHeight(); o.$target.css( { height: "0" } ), o.$target.velocity( { opacity: 1, height: t }, { duration: o.duration, easing: o.easing, complete: function() { var e = o.$header.find( ".global-header__inline" ).outerHeight(), t = o.$target.outerHeight() }, display: "block" } ) }, n.offTween = function() { var e = this; o.$body.removeClass( "_nav-open" ).css( { top: 0 } ), window.scrollTo( 0, o.pos ), o.$target.velocity( { opacity: 0, height: 0 }, { duration: o.duration / 2, easing: o.easing, complete: function() { o.$header.removeClass( o.activeClass ), o.$target.css( { display: "none", height: "auto" } ), o.isOpen = !1 } } ) }, n.lowerTween = function( e, t ) { var a = this; if( e ) { o.isTweenLower = !0, o.$header.hasClass( "_open-lower" ) || o.$header.addClass( "_open-lower" ), t.addClass( o.activeClass ), o.$target.css( { height: "auto" } ), t.find( ".global-nav__lower" ).css( { display: "block", height: "auto" } ); var n = t.find( ".global-nav__lower" ).outerHeight(); t.find( ".global-nav__lower" ).css( { height: "0" } ), t.find( ".global-nav__lower" ).velocity( { opacity: 1, height: n }, { duration: o.duration / 2, easing: o.easing, complete: function() { var e = o.$header.find( ".global-header__inline" ).outerHeight(), t = o.$target.outerHeight(); o.isTweenLower = !1 } } ) } else o.isTweenLower = !0, t.removeClass( o.activeClass ), t.find( ".global-nav__lower" ).velocity( { opacity: 0, height: 0 }, { duration: o.duration / 2, easing: o.easing, complete: function() { t.find( ".global-nav__lower" ).css( { display: "none", height: "auto" } ); var e = o.$lowerItem.hasClass( o.activeClass ); o.$header.hasClass( "_open-lower" ) && !e && o.$header.removeClass( "_open-lower" ), o.isTweenLower = !1 } } ) }, new a }, common.pcNavTweeen = function( e ) { var t = { $body: $( "body" ), $wrap: e, $header: $( ".global-header" ), $gnav: $( ".global-nav__item" ), $thisItem: $( ".global-nav__item" ), $bg: $( ".global-nav__layer" ), duration: 150, ease: "easeInOutQuad", targetOffset: $( ".global-header" ).height() + 300, thisNav: e, isOpen: !1, isBgOpen: !1, navHeight: 0, timer: null, closeTimer: null }, a = function() { this.param = t, this.init() }, o = a.prototype; return o.init = function() { var e = this; $.sequence( function() { return $( ".global-nav__lower" ).stop(), $( ".global-nav__lower" ).css( { height: 0 } ), $( ".global-nav__layer" ).css( { height: 0, opacity: 0 } ), t.$header.removeClass( "_hover" ), t.$gnav.removeClass( "_open" ), t.$gnav.off( "hover" ) }, function() { o.event() } ) }, o.event = function() { var e = this, a = !1; $( ".global-nav__item" ).hover( function() { t.$header.addClass( "_hover" ) }, function() { t.$header.removeClass( "_hover" ) } ), t.$gnav.hover( function() { if( "sp" == AMP.mediaquery.mediaStyle )return !1; if( 0 != $( this ).find( ".global-nav__lower" ).length ) { t.isOpen = !0; var e = $( this ); $( this ).hasClass( "_open" ) || (t.$thisItem = $( this ), o.open( e )), t.isBgOpen || o.bgOpenTween() } else o.bgCloseTween() }, function() { if( "sp" == AMP.mediaquery.mediaStyle )return !1; var e = $( this ); $( this ).hasClass( "_open" ) && (t.$header.removeClass( "_hover" ), o.close( e ), t.isOpen = !1) } ), $( ".global-nav__list" ).hover( function() { if( "sp" == AMP.mediaquery.mediaStyle )return !1; t.isOpen && o.bgOpenTween() }, function() { o.bgCloseTween() } ) }, o.resize = function() { var e = this; AMP.mediaquery.mediaStyle }, o.bgOpenTween = function() { var e = this; t.$bg.stop( !0, !1 ).velocity( { opacity: 1, height: t.navHeight }, { duration: t.duration, easing: t.ease, complete: function() { t.isBgOpen = !0 }, queue: !1 } ) }, o.bgCloseTween = function() { var e = this; t.$bg.stop( !0, !1 ).velocity( { opacity: 0, height: 0 }, { duration: t.duration, easing: t.ease, complete: function() { t.isBgOpen = !1 }, queue: !1 } ) }, o.open = function( e ) { var a = this, o = e.find( ".global-nav__lower" ); t.$header.addClass( "_open-lower" ), e.addClass( "_open" ), t.navHeight = o.find( ".nav-inner" ).outerHeight(), o.css( { height: o.find( ".nav-inner" ).outerHeight() } ), o.stop( !0, !1 ).velocity( { opacity: 1 }, { duration: t.duration, easing: t.ease, complete: function() { o.css( { height: "auto" } ), t.$gnav.not( e ).find( ".global-nav__lower" ).css( { opacity: 0 } ) }, queue: !1 } ), t.$bg.stop( !0, !1 ).velocity( { height: o.find( ".nav-inner" ).outerHeight() }, { duration: t.duration, easing: t.ease, complete: function() { }, queue: !1 } ) }, o.close = function( e ) { var a = this, o = e.find( ".global-nav__lower" ); o.stop( !0, !1 ).velocity( { opacity: 0 }, { duration: t.duration, easing: t.ease, complete: function() { t.$header.removeClass( "_open-lower" ), o.css( { height: 0 } ), e.removeClass( "_open" ), t.isOpen = !1 }, queue: !1 } ) }, new a }, common.gaScrollCount = function( e ) { function t() { this.param = a, this.init() } var a = $.extend( !0, { scPoints: [], percentage: [], count: 0, pageH: $( document ).height(), sc: $( window ).scrollTop(), wH: $( window ).height() }, e ), o = t.prototype; return o.init = function() { var e = this; o.percentageSet(), o.posSet(), o.event() }, o.percentageSet = function() { var e = this, t = $( ".p-contact" ).offset().top + $( ".p-contact" ).outerHeight(), o = $( "body" ).height(), n = t / (o / 100); a.percentage = [ n ], a.sc = $( window ).scrollTop(), $.each( a.percentage, function( e ) { var t = .01 * a.percentage[ e ]; a.scPoints[ e ] = { offsetTop: a.pageH * t, action: "scroll-cv-area", category: _thisPath, flag: !0 } } ) }, o.posSet = function() { var e = this; a.sc = $( window ).scrollTop(), a.wH = $( window ).height(), $.each( a.percentage, function( e ) { var t = a.scPoints[ e ].offsetTop; a.sc + a.wH >= t && (a.scPoints[ e ].flag = !1, a.count = a.count + 1) } ) }, o.event = function() { var e = this, t = null; $( window ).on( "scroll", function() { clearTimeout( t ), t = setTimeout( function() { var e = a.pageH / 100; a.sc = $( window ).scrollTop(), a.wH = $( window ).height(), a.count < a.percentage.length && o.tween() }, 100 ) } ) }, o.tween = function() { var e = this, t = a.scPoints[ a.count ].offsetTop, n = a.scPoints[ a.count ].flag; a.sc + a.wH >= t && n && (o.pushTween( a.scPoints[ a.count ] ), a.count = a.count + 1, n = !1) }, o.pushTween = function( e ) { var t = this, a = e.action, o = e.category, n = "null"; gtag( "event", a, { event_category: o, event_label: "null" } ) }, new t }, common.compFunc = function() { function e() { gtag( "config", ua, { page_title: document.title, page_location: globalHost, page_path: _thisPath } ), 0 != $( ".p-contact" ).length && common.gaScrollCount() } function t( e ) { e.closest( ".global-nav__item" ).find( ".global-nav__lower ul" ).find( "li" ).each( function() { var e = $( this ).find( "a" ).attr( "href" ); (e = e.replace( globalHost, "" )) == _thisPath && $( this ).addClass( "_current-sp" ) } ) } function a() { $( ".art-case__kv" ).find( ".video-wrap #video" ).remove() } function o() { var e = $( ".art-case__kv" ).find( ".video-wrap" ), t = e.find( "#video" ), a = e.height(), o = t.height(), o = Math.floor( $( window ).width() / 16 * 9, 1 ); if( a > o ) { var n = a - o, i = n / 9 * 16; t.css( { width: "calc(100% + " + i + "px)", "margin-left": -i / 2 + "px" } ) } else { t.css( { width: "", "margin-left": "" } ); var s; s = e.hasClass( "video-tp" ) ? 0 : e.hasClass( "video-bt" ) ? o - a : (o - a) / 2, t.css( { transform: "translateY(" + -s + "px)" } ) } } var n = location.href; _thisPath = n.replace( globalHost, "" ); var i = new common.headerTween( $( ".global-header" ) ), s = new common.spNavTween, r = new common.pcNavTweeen( $( ".global-header" ) ); gtag ? e() : $( window ).on( "gtagLoad", function() { e() } ); var l = location.search, c = location.hash; 0 != l && (_thisPath = _thisPath.replace( l, "" )), 0 != c && (_thisPath = _thisPath.replace( c, "" )), $( ".c-sub-nav" ).find( "li" ).each( function( e ) { $( this ).find( "a" ).attr( "href" ) == _thisPath && $( this ).addClass( "active" ) } ); var d = _thisPath.split( "/" ); if( $( ".global-header__nav" ).find( ".global-nav__item > a" ).each( function( e ) { var a = $( this ).attr( "href" ); a = a.split( "/" ), a[ 1 ] === d[ 1 ] && ($( this ).closest( ".global-nav__item" ).addClass( "_current" ), $( this ).closest( ".global-nav__item" ).addClass( "_current-sp" ), 4 === d.length && ($( this ).closest( ".global-nav__item" ).removeClass( "_current-sp" ), t( $( this ) ))) } ), 0 != $( ".p-bt-cv ul" ).length ) { var h = AMP.$.FlatHeight.get( $( ".p-bt-cv ul" ).find( "li a" ), 1 ); AMP.mediaquery.on( "change", function( e ) { "sp" === e.mediaStyle ? h.setSplit( 1 ) : h.setSplit( 2 ) } ).trigger( "change" ) } if( common.util.bracket(), 0 != $( "#googleMap" ).length && index.googleMap(), 0 != $( ".page-index" ).length && (index.mv(), $( ".global-header" ).addClass( "_load" ), $( ".mv" ).addClass( "_load" ), $( ".p-case-list-index" ).addClass( "_load" )), 0 != $( ".p-case-list-index" ).length && common.util.casesHover( $( ".p-case-list-index" ) ), 0 != $( ".sec-instagram" ).length && index.getInstagramPhoto(), 0 != $( ".wpcf7" ).length && common.util.form7ErrorFunc(), 0 != $( ".mw_wp_form" ).length ) { common.util.formErrorFunc(); $( ".mw_wp_form" ).hasClass( "mw_wp_form_complete" ) && 0 != $( ".p-bt-cv" ).length && $( ".p-bt-cv" ).addClass( "comp" ) } if( 0 != $( ".slider" ).length ) { if( !g )var g = new index.Slider( $( ".slider" ), { liquid: !0, cloneCallback: function() { new AMP.$.MediaImageChange( $( ".slider" ).find( "img[data-media-img]" ) ).start() } } ); g._init() } if( 0 != $( ".art-case__share" ).length ) { var u = document.title, p = $( ".art-case__share" ).find( ".tw" ).find( "a" ), v = p.attr( "href" ), f = v.replace( "&text=", "&text=" + u ); p.attr( "href", f ) } if( 0 != $( ".page-case-detail" ).find( "video.case-video" ).length ) { var m = $( ".page-case-detail" ).find( ".movie-wrap" ), w = $( "html" ).hasClass( "dev-pc" ) ? "sp" : "pc"; m.find( "." + w ).remove() } if( 0 != $( ".page-case-detail" ).find( "#video" ).length ) { var _ = $( "html" ).hasClass( "dev-pc" ) ? "pc" : "sp"; if( "pc" === _ ) { var b; $( window ).resize( function() { clearTimeout( b ), b = setTimeout( o(), 400 ) } ), o() } "sp" === _ && a() } $( ".u-sc-in" ).length && common.util.scrollInAnime( $( ".u-sc-in" ) ) }, jQuery( function( $ ) { common.loding(), AMP.mediaquery.on( "change" ), (new AMP.$.MediaImageChange).start(), AMP.$.rollover.on( $( ".all-rover img" ) ), $( "body" ).imagesLoaded().always( function() { common.compFunc() } ), common.pageChange( { callback: function() { common.compFunc() } } ) } ) }( this, jQuery );