1(function(window, $){ 2 3 var document = window.document; 4 var _scrollLength = 200; 5 var _stageW; 6 var _stageH; 7 var _host = (("https:" == location.protocol) ? "https://" : "http://") + location.hostname + "/"; 8 var _timer = null; 9 10 FONTPLUS.async(); 11 12 13 /*---------------------------- 14 DOMããªã¼å®äº 15 ----------------------------*/ 16 $(document).ready(function(){ 17 //-----[ç°å¢ãã§ãã¯] 18 _isOS = checkOS(); 19 _isDevice = checkDevice(); 20 _isBrowser = checkBrowser(); 21 _browserLang = getBrowserLanguage(); 22 23 //-----[åæå] 24 onResize(); 25 initPage(); 26 showUnderLine(); 27 28 $('#pjax').velocity({ opacity: 1 },{ duration: 350, delay: 50, easing: 'easeInOutCubic' }); 29 30 //-----[pjax] 31 $.pjax({ 32 area: [ '#pjax' ], 33 load: { head: 'base, meta, link', css: true, script: false }, 34 cache: { click: true, submit: true, popstate: true, get: true, post: false }, 35 wait: 150 36 }); 37 38 $(document).on('pjax:fetch', function (){ 39 $('#pjax').stop().velocity('stop'); 40 $('#pjax').velocity({opacity:0, translateX:20}, {duration:150, easing:"linear", delay:0, complete: function(){ 41 $('#wrapper').addClass('off'); 42 }}); 43 $('#menu-gnav .underline').velocity({'width':0, 'left':$('#menu-gnav .underline').width()+40}, 150, 'easeOutCubic'); 44 45 if(_isDevice == "sp"){ 46 if($('#white').css('display') != 'none'){ 47 showMenu(false); 48 } 49 } 50 51 if($('#home_page').length){ 52 pauseVideo(); 53 $('#youtube').velocity('fadeOut', 130, 'easeOutSine'); 54 } 55 }); 56 57 $(document).on('pjax:render', function(){ 58 $('#pjax').stop().velocity('stop'); 59 $.Velocity.hook($('#pjax'), "translateX", "-20px"); 60 $.Velocity.hook($('#pjax'), "opacity", 0); 61 $('#wrapper').removeClass('off'); 62 $('#pjax').velocity({opacity:1, translateX:0}, {duration:350, easing:"easeInOutCubic", delay:50, complete:function(e){ 63 //$(this).removeAttr('style'); 64 $('#pjax').addClass('off'); 65 }}); 66 67 initPage(); 68 showUnderLine(); 69 70 if(typeof ga !== 'undefined'){ 71 ga('send', 'pageview'); 72 } 73 }); 74 75 //-----[ã¹ã¯ãã¼ã«ããã] 76 $('#scrolltop').on("click", function (){ 77 $('body,html').animate({scrollTop: 0}, 500, "easeOutQuart"); 78 return false; 79 }); 80 81 //-----[ã¹ããã¡ãã¥ã¼] 82 if(_isDevice == "sp"){ 83 $('#menu').on({ 84 'touchend':function(){ 85 if($('#white').css('display') == 'none'){ 86 showMenu(true); 87 }else{ 88 showMenu(false); 89 } 90 } 91 }); 92 93 $('#white').on({ 94 'touchend':function(){ 95 showMenu(false); 96 } 97 }); 98 }else{ 99 $('.snav:not(#menu-snav-1) li a').on({ 100 'mouseenter':function(){ 101 if(_isOS == "win"){ 102 if(_isBrowser == "firefox"){ 103 $(this).css({backgroundPosition: '5px 1px'}).stop().animate({backgroundPosition: '0px 1px'}, 300, "easeOutCubic"); 104 }else{ 105 $(this).css({backgroundPosition: '5px 0px'}).stop().animate({backgroundPosition: '0px 0px'}, 300, "easeOutCubic"); 106 } 107 }else{ 108 $(this).css({backgroundPosition: '5px -1px'}).stop().animate({backgroundPosition: '0px -1px'}, 300, "easeOutCubic"); 109 } 110 } 111 }); 112 } 113 114 if(checkDevice() == "pc" || checkDevice() == "tablet"){ 115 var tag = document.createElement('script'); 116 tag.src = "https://www.youtube.com/iframe_api"; 117 var firstScriptTag = document.getElementsByTagName('script')[0]; 118 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 119 } 120 121 // 122 var language = (window.navigator.languages && window.navigator.languages[0]) || 123 window.navigator.language || 124 window.navigator.userLanguage || 125 window.navigator.browserLanguage; 126 127 if(language != "ja"){ 128 $('#menu-item-46 a').attr("href", "/people/english/"); 129 } 130 131 onResize(); 132 }); 133 134 135 /*---------------------------- 136 ã¢ã³ãã¼ã©ã¤ã³ã®ã¢ã¼ã·ã§ã³è¡¨ç¤º 137 ----------------------------*/ 138 function showUnderLine(){ 139 $('#menu-gnav .underline').velocity({'width':'100%', 'left':0}, {duration:150, easing:'easeOutCubic', delay:100}); 140 141 if($('#menu-item-45 .current_nav').length){ 142 $('#menu-jnav .underline').velocity({'width':'100%', 'left':0}, {duration:150, easing:'easeOutCubic', delay:700}); 143 $('#menu-jnav_sub .underline').velocity({'width':'100%', 'left':0}, {duration:150, easing:'easeOutCubic', delay:700}); 144 } 145 146 $.Velocity.hook($('#heading .title_type'), "translateX", "-40px"); 147 $('#heading .title_type').velocity({translateX:0}, {duration:550, easing:"easeOutCubic", delay:100}); 148 149 $.Velocity.hook($('#heading .title_en'), "translateX", "-55px"); 150 $('#heading .title_en').velocity({translateX:0}, {duration:550, easing:"easeOutCubic", delay:170}); 151 152 $.Velocity.hook($('#heading .title_ja'), "translateX", "-40px"); 153 $('#heading .title_ja').velocity({translateX:0}, {duration:550, easing:"easeOutCubic", delay:100}); 154 } 155 156 /*---------------------------- 157 ã¹ããã¡ãã¥ã¼ã®éé 158 ----------------------------*/ 159 function showMenu(flg){ 160 var current_scrollY; 161 162 if(flg == true){ 163 //-----[ã¹ã¯ãã¼ã«åºå®]
164 $(window).on('touchmove.noScroll', function(e){ 165 e.preventDefault(); 166 }); 167 168 //-----[ã¹ã¯ãã¼ã«åºå®] ver.2 169// current_scrollY = $( window ).scrollTop(); 170// 171// $('#wrapper').css({ 172// position: 'fixed', 173// width: '100%', 174// top: -1 * current_scrollY 175// }); 176 177 $('#white').velocity('stop').velocity("fadeIn", { duration: 450, easing: "easeOutCubic" }); 178 $('#menu_container').css({'display':'block'}); 179 $('#menu_container').velocity({translateX:0}, { duration: 400, easing: "easeOutCubic", delay:150 }); 180 $('#gnav_container').velocity({translateY:_stageH}, 0).velocity({translateY:0}, { duration: 550, easing: "easeOutCubic", delay:170 }); 181 $('#menu_container .snav_container').velocity({translateY:_stageH}, 0).velocity({translateY:0}, { duration: 750, easing: "easeOutCubic", delay:220 }); 182 }else{ 183 //-----[ã¹ã¯ãã¼ã«åºå®ã®è§£é¤] 184 $(window).off('.noScroll'); 185 186// $('#wrapper').attr({ style: '' }); 187// $('html, body').prop({ scrollTop: current_scrollY }); 188 189 $('#menu_container').velocity({translateX:-$('#menu_container').outerWidth(true)-50}, { duration: 620, easing: "easeOutCubic", display:'none' }); 190 $('#white').velocity('stop').velocity("fadeOut", { duration: 620, easing: "easeOutCubic" }); 191 } 192 } 193 194 /*---------------------------- 195 表示è¨èªã®åãæ¿ãï¼CSSæ¹å¼ï¼ 196 ----------------------------*/ 197 function activateLanguage(lang){ 198 if(lang == 'ja'){ 199 $('#ja').addClass("active"); 200 $('#en').removeClass("active"); 201 $('#cn').removeClass("active"); 202 $('.cn').css({display:"none"}); 203 $('.en').css({display:"none"}); 204 $('.ja').css({display:"block"}); 205 localStorage.setItem('lang', 'ja'); 206 } 207 else if(lang == 'en'){ 208 $('#en').addClass("active"); 209 $('#ja').removeClass("active"); 210 $('#cn').removeClass("active"); 211 $('.ja').css({display:"none"}); 212 $('.cn').css({display:"none"}); 213 $('.en').css({display:"block"}); 214 localStorage.setItem('lang', 'en'); 215 } 216 else if(lang == 'cn'){ 217 $('#cn').addClass("active"); 218 $('#ja').removeClass("active"); 219 $('#en').removeClass("active"); 220 $('.ja').css({display:"none"}); 221 $('.en').css({display:"none"}); 222 $('.cn').css({display:"block"}); 223 localStorage.setItem('lang', 'cn'); 224 } 225 if(lang == 'ja') { 226 $('#menu-item-45 a').attr('href', '/recruit/'); 227 $('#menu-item-46 a').attr('href', '/people/'); 228 } 229 else if(lang == 'en') { 230 $('#menu-item-45 a').attr('href', '/recruit/english/'); 231 $('#menu-item-46 a').attr('href', '/people/english/'); 232 } 233 else if(lang == 'cn') { 234 $('#menu-item-45 a').attr('href', '/recruit/english/'); 235 $('#menu-item-46 a').attr('href', '/people/chinese/'); 236 } 237 } 238 239 /*---------------------------- 240 åãã¼ã¸ã®åæå 241 ----------------------------*/ 242 function initPage(){ 243 onResize(); 244 $(window).lazyLoadXT(); 245// window.scrollTo(0, 1); 246 FONTPLUS.start(); 247 248 //-----[ã°ãã¼ãã«ããã®ã¢ã¯ãã£ãå] 249 activateNavi(); 250 251 //-----[ç¢å°ãã¿ã³ã®ã¢ãã³ã·ã§ã³] 252 if(_isDevice != 'sp'){ 253 $('.back1').on({ 254 'mouseenter':function(){ 255 if(_isOS == "win"){ 256 $(this).css({backgroundPosition: '5px 2px'}).stop().animate({backgroundPosition: '0px 2px'}, 300, "easeOutCubic"); 257 }else{ 258 $(this).css({backgroundPosition: '5px 1px'}).stop().animate({backgroundPosition: '0px 1px'}, 300, "easeOutCubic"); 259 } 260 } 261 }); 262 $('.back1').velocity('fadeIn', {duration:750, easing:'easeInOutCubic', delay:600}); 263 264 $('.back2').on({ 265 'mouseenter':function(){ 266 if(_isOS == "win"){ 267 $(this).css({backgroundPosition: '5px 2px'}).stop().animate({backgroundPosition: '0px 2px'}, 300, "easeOutCubic"); 268 }else{ 269 $(this).css({backgroundPosition: '5px 1px'}).stop().animate({backgroundPosition: '0px 1px'}, 300, "easeOutCubic"); 270 } 271 } 272 }); 273 274 $('.back3').on({ 275 'mouseenter':function(){ 276 if(_isOS == "win"){ 277 $(this).css({backgroundPosition: '92% 9px'}).stop().animate({backgroundPosition: '100% 9px'}, 300, "easeOutCubic"); 278 }else{ 279 $(this).css({backgroundPosition: '92% 9px'}).stop().animate({backgroundPosition: '100% 9px'}, 300, "easeOutCubic"); 280 } 281 } 282 }); 283 } 284 285 //-----[ã¹ã ã¼ãºã¹ã¯ãã¼ã«] 286 $('.smooth_scroll').on("click", function(){ 287 var href = $(this).attr("href"), 288 target = $(href === "#" || href === "" ? 'html' : href); 289 target.velocity("scroll", { duration: 1250, easing: "easeInOutCubic", offset:-38 }); 290 return false;
291 }); 292 293 //-----[è¨èªåãæ¿ã] 294 var lang = localStorage.getItem('lang') 295 if(lang) { 296 activateLanguage(lang); 297 } 298 299 //-----[HomePageè¨å®] 300 if($('#home_page').length){ 301 $('header, footer').velocity('fadeOut', 0, "easeOutCubic"); 302 if(_isDevice === 'sp'){ 303 $('#slides').css({display:'block'}); 304 var time = 5000; 305 if($('#slides .slides-container img').length == 1){ 306 time = 0; 307 } 308 $('#slides').superslides({ 309 animation: 'fade', 310 animation_speed: 1000, 311 animation_easing: 'easeInOutCubic', 312 pagination: true, 313 play: time 314 }); 315 }else if(_isDevice === 'tablet'){ 316 $('#slides_tablet').css({display:'block'}); 317 var time = 5000; 318 if($('#slides_tablet .slides-container img').length == 1){ 319 time = 0; 320 } 321 $('#slides_tablet').superslides({ 322 animation: 'fade', 323 animation_speed: 1000, 324 animation_easing: 'easeInOutCubic', 325 pagination: true, 326 play: time 327 }); 328 }else{ 329 $('#youtube').velocity('fadeIn', {duration:200, easing:"easeOutSine", delay:200}); 330 startVideo(); 331 332 $('#menu-snav-1 li a').on({ 333 'mouseenter':function(){ 334 if(_isOS == "win"){ 335 if(_isBrowser == "firefox"){ 336 $(this).css({backgroundPosition: '5px 2px'}).stop().animate({backgroundPosition: '0px 2px'}, 300, "easeOutCubic"); 337 }else{ 338 $(this).css({backgroundPosition: '5px 1px'}).stop().animate({backgroundPosition: '0px 1px'}, 300, "easeOutCubic"); 339 } 340 }else{ 341 $(this).css({backgroundPosition: '5px 0px'}).stop().animate({backgroundPosition: '0px 0px'}, 300, "easeOutCubic"); 342 } 343 } 344 }); 345 } 346 } 347 else { 348 if($('header').css("display") == 'none'){ 349 $('header, footer').velocity('fadeIn', 350, "easeOutCubic"); 350 } 351 352 if(checkDevice() == "pc"){ 353 pauseVideo(); 354 $('#youtube').css({'opacity':0, 'display':'none'}); 355 } 356 } 357 358 //-----[åãã¼ã¸ã®åæå] 359 if($('#company_page').length){ 360 $('#slides').superslides({ 361 animation: 'fade', 362 animation_speed: 1000, 363 animation_easing: 'easeInOutCubic', 364 inherit_width_from: '.slides-area', 365 inherit_height_from: '.slides-area', 366 pagination: true, 367 play: 5000 368 }); 369 370 $('#en').on({ 371 'click': function(){ activateLanguage('en'); } 372 }); 373 $('#ja').on({ 374 'click': function(){ activateLanguage('ja'); } 375 }); 376 $('#cn').on({ 377 'click': function(){ activateLanguage('cn'); } 378 }); 379 if(!lang) { 380 if(_browserLang == "ja"){ activateLanguage('ja') } 381 else if(_browserLang == "cn"){ activateLanguage('cn') } 382 else{ activateLanguage('en') } 383 } 384 }else if($('#history_page').length){ 385 $('#en').on({ 386 'click': function(){ activateLanguage('en'); } 387 }); 388 $('#ja').on({ 389 'click': function(){ activateLanguage('ja'); } 390 }); 391 $('#cn').on({ 392 'click': function(){ activateLanguage('cn'); } 393 }); 394 if(!lang) { 395 if(_browserLang == "ja"){ activateLanguage('ja') } 396 else if(_browserLang == "cn"){ activateLanguage('cn') } 397 else{ activateLanguage('en') } 398 } 399 $('.history_slide').superslides({ 400 animation: 'fade', 401 animation_speed: 200, 402 animation_easing: 'easeOutCubic', 403 inherit_width_from: '.inner', 404 inherit_height_from: '.inner', 405 pagination: true, 406 play: 0, 407 }); 408 409 }else if($('#message_page').length){ 410 $('#en').on({ 411 'click': function(){ activateLanguage('en'); } 412 }); 413 $('#ja').on({ 414 'click': function(){ activateLanguage('ja'); } 415 }); 416 $('#cn').on({ 417 'click': function(){ activateLanguage('cn'); } 418 }); 419 if(!lang) { 420 if(_browserLang == "ja"){ activateLanguage('ja') } 421 else if(_browserLang == "cn"){ activateLanguage('cn') } 422 else{ activateLanguage('en') } 423 } 424 $('#message_president img').velocity({translateX:-30}, 0).velocity({translateX:0}, {duration:750, easing:"easeOutCubic", delay:270}); 425 426 ytiframe_ja = 'player_ja'; 427 targetWindow_ja = document.getElementById(ytiframe_ja).contentWindow; 428 429 ytiframe_en = 'player_en'; 430 targetWindow_en = document.getElementById(ytiframe_en).contentWindow; 431 432 }else if($('#products_page').length){ 433 434 $(".thumb_list li").each(function(index, el){ 435 $(el).find('.black').width(232).velocity({width:0, translateX:230}, {duration:450, easing:"easeOutCubic", delay:780 + 250 * index}); 436 }); 437 438 $('#en').on({ 439 'click': function(){ activateLanguage('en'); } 440 }); 441 $('#ja').on({ 442 'click': function(){ activateLanguage('ja'); } 443 }); 444 $('#cn').on({ 445 'click': function(){ activateLanguage('cn'); } 446 }); 447 if(!lang) { 448 if(_browserLang == "ja"){ activateLanguage('ja') } 449 else if(_browserLang == "cn"){ activateLanguage('cn') } 450 else{ activateLanguage('en') } 451 } 452 }else if($('#jobs_single').length){ 453 if(_isDevice != 'sp'){ 454/* 455 var num = $('#jobs_list > li').length; 456 if(num == 1){ 457 $('#jobs_container').height(220); 458 }else if(num == 2){ 459 $('#jobs_container').height(410); 460 }else if(num == 3){ 461 $('#jobs_container').height(645); 462 }else if(num >= 4){ 463 $('#jobs_container').jScrollPane({animateScroll:true}); 464 } 465*/ 466 } 467 $('#disabilities_button').on({ 468 'click':function(){ 469 $(this).velocity('fadeOut', 0, "easeOutCubic"); 470 $('#disabilities_container').css({'margin-bottom':0}).velocity({'height':$('.disabilities_details').outerHeight(true)}, 450, "easeOutCubic"); 471 } 472 }); 473 }else if($('#recruit_page').length){ 474 $('#slides').superslides({ 475 animation: 'fade', 476 animation_speed: 1000, 477 animation_easing: 'easeInOutCubic', 478 inherit_width_from: '.slides-area', 479 inherit_height_from: '.slides-area', 480 pagination: false, 481 play: 5000 482 }); 483 }else if($('#people_page').length){ 484 let lang; 485 if($('.people_page_ja').length) { 486 activateLanguage('ja'); 487 } 488 else if($('.people_page_en').length) { 489 activateLanguage('en'); 490 } 491 else if($('.people_page_cn').length) { 492 activateLanguage('cn'); 493 } 494 /* 495 lang = localStorage.getItem('lang'); 496 if(lang) { 497 if($('.people_page_ja').length && lang != 'ja' 498 || $('.people_page_en').length && lang != 'en' 499 || $('.people_page_cn').length && lang != 'cn') { 500 if(lang == 'ja') { 501 window.location.href = '/people/'; 502 } 503 else if(lang == 'en') { 504 window.location.href = '/people/english/'; 505 } 506 else if(lang == 'cn') { 507 window.location.href = '/people/chinese/'; 508 } 509 } 510 } 511 */ 512 if(_isDevice == 'pc' || _isDevice == 'tablet'){ 513 $('#people .thumb_list a').on({ 514 'mouseenter':function(){ 515 $(this).find('.black2').velocity('stop').velocity({'opacity':0}, 180, "easeOutCubic"); 516 $(this).find('img').velocity('stop').velocity({'scaleX':1.035, 'scaleY':1.035}, 420, "easeOutCubic"); 517 }, 518 'mouseleave':function(){ 519 $(this).find('.black2').velocity('stop').velocity({'opacity':1}, 380, "easeInOutCubic"); 520 $(this).find('img').velocity('stop').velocity({'scaleX':1, 'scaleY':1}, 380, "easeInOutCubic"); 521 } 522 }); 523 } 524 }else if($('#people_single').length){ 525 if(_isDevice == 'pc' || _isDevice == 'tablet'){ 526 $('#people .thumb_list a').on({ 527 'mouseenter':function(){ 528 $(this).find('.black2').velocity('stop').velocity({'opacity':0}, 180, "easeOutCubic"); 529 $(this).find('img').velocity('stop').velocity({'scaleX':1.035, 'scaleY':1.035}, 420, "easeOutCubic"); 530 }, 531 'mouseleave':function(){ 532 $(this).find('.black2').velocity('stop').velocity({'opacity':1}, 380, "easeInOutCubic"); 533 $(this).find('img').velocity('stop').velocity({'scaleX':1, 'scaleY':1}, 380, "easeInOutCubic"); 534 } 535 }); 536 } 537 }else if($('#publications_page').length){ 538 $('#en').on({ 539 'click': function(){ activateLanguage('en'); } 540 }); 541 $('#ja').on({ 542 'click': function(){ activateLanguage('ja'); } 543 }); 544 $('#cn').on({ 545 'click': function(){ activateLanguage('cn'); } 546 }); 547 if(!lang) { 548 if(_browserLang == "ja"){ activateLanguage('ja') } 549 else if(_browserLang == "cn"){ activateLanguage('cn') } 550 else{ activateLanguage('en') } 551 } 552 553 }else if($('#publication_detail_page').length){ 554 $('#slides').superslides({ 555 animation: 'fade', 556 animation_speed: 1000, 557 animation_easing: 'easeInOutCubic', 558 inherit_width_from: '.slides-area', 559 inherit_height_from: '.slides-area', 560 pagination: false, 561 play: 5000 562 }); 563 $('#slides').superslides('stop'); 564 565 }else if($('#locations_single').length){ 566 $('#en').on({ 567 'click': function(){ activateLanguage('en'); } 568 }); 569 $('#ja').on({ 570 'click': function(){ activateLanguage('ja'); } 571 }); 572 $('#cn').on({ 573 'click': function(){ activateLanguage('cn'); } 574 }); 575 if(!lang) { 576 if(_browserLang == "ja"){ activateLanguage('ja') } 577 else if(_browserLang == "cn"){ activateLanguage('cn') } 578 else{ activateLanguage('en') } 579 } 580 581 $('#slides').superslides({ 582 animation: 'fade', 583 animation_speed: 1000, 584 animation_easing: 'easeInOutCubic', 585 inherit_width_from: '.slides-area', 586 inherit_height_from: '.slides-area', 587 pagination: false, 588 play: 0, 589 }).on('animated.slides', function(){ 590 var current_index = $(this).superslides('current'); 591 $('.slides-pagination-custom a').removeClass('current'); 592 $('.slides-pagination-custom a').eq(current_index).addClass('current'); 593 }); 594 595 if(_isDevice == 'pc' || _isDevice == 'tablet'){ 596 $('#people .thumb_list a').on({ 597 'mouseenter':function(){ 598 $(this).find('.black2').velocity('stop').velocity({'opacity':0}, 180, "easeOutCubic"); 599 $(this).find('img').velocity('stop').velocity({'scaleX':1.035, 'scaleY':1.035}, 420, "easeOutCubic"); 600 }, 601 'mouseleave':function(){ 602 $(this).find('.black2').velocity('stop').velocity({'opacity':1}, 380, "easeInOutCubic"); 603 $(this).find('img').velocity('stop').velocity({'scaleX':1, 'scaleY':1}, 380, "easeInOutCubic"); 604 } 605 }); 606 } 607 608 $('.slides-pagination-custom a').on({ 609 'click': function(){ 610 $('.slides-pagination-custom a').removeClass('current'); 611 $(this).addClass('current'); 612 $('#slides').superslides('animate', $(this).index()); 613 return false;
614 } 615 }); 616 617 if(_isDevice != 'sp'){ 618/* 619 var num = $('#jobs_list > li').length; 620 if(num == 1){ 621 $('#jobs_container').height(220); 622 }else if(num == 2){ 623 $('#jobs_container').height(410); 624 }else if(num == 3){ 625 $('#jobs_container').height(645); 626 }else if(num >= 4){ 627 $('#jobs_container').jScrollPane({animateScroll:true}); 628 } 629*/ 630 } 631 } 632 633 if($('#error_page').length){ 634 _timer = setTimeout(function(){ 635 location.href = _host; 636 }, 5000); 637 }else{ 638 clearTimeout(_timer); 639 } 640 641 onResize(); 642 } 643 644 645 /*---------------------------- 646 ããã²ã¼ã·ã§ã³ã®ã¢ã¯ãã£ãå 647 ----------------------------*/ 648 function activateNavi(){ 649 if($('#company_page').length){ 650 if(!$('#menu-item-44 > a').hasClass('current_nav')){ 651 $('#menu-item-44 > a').append('<span class="underline"></span>'); 652 } 653 $('#menu-item-44 > a').addClass("current_nav"); 654 }else{ 655 $('#menu-item-44 > a').removeClass("current_nav").find('.underline').remove(); 656 } 657 658 if($('#message_page').length){ 659 if(!$('#menu-item-43 > a').hasClass('current_nav')){ 660 $('#menu-item-43 > a').append('<span class="underline"></span>'); 661 } 662 $('#menu-item-43 > a').addClass("current_nav"); 663 }else{ 664 $('#menu-item-43 > a').removeClass("current_nav").find('.underline').remove(); 665 } 666 667 if($('#history_page').length){ 668 if(!$('#menu-item-1986 > a').hasClass('current_nav')){ 669 $('#menu-item-1986 > a').append('<span class="underline"></span>'); 670 } 671 $('#menu-item-1986 > a').addClass("current_nav"); 672 }else{ 673 $('#menu-item-1986 > a').removeClass("current_nav").find('.underline').remove(); 674 } 675 676 if($('#products_page').length){ 677 if(!$('#menu-item-67 > a').hasClass('current_nav')){ 678 $('#menu-item-67 > a').append('<span class="underline"></span>'); 679 } 680 $('#menu-item-67 > a').addClass("current_nav"); 681 }else{ 682 $('#menu-item-67 > a').removeClass("current_nav").find('.underline').remove(); 683 } 684 685 if($('#publications_page').length){ 686 if(!$('#menu-item-1756 > a').hasClass('current_nav')){ 687 $('#menu-item-1756 > a').append('<span class="underline"></span>'); 688 } 689 $('#menu-item-1756 > a').addClass("current_nav"); 690 }else{ 691 $('#menu-item-1756 > a').removeClass("current_nav").find('.underline').remove(); 692 } 693 694 if($('#recruit_page').length || $('#jobs_page').length || $('#jobs_single').length || $('#locations_page').length || $('#locations_single').length || $('#income_page').length){ 695 if(!$('#menu-item-45 > a').hasClass('current_nav')){ 696 $('#menu-item-45 > a').append('<span class="underline"></span>'); 697 } 698 $('#menu-item-45 > a').addClass("current_nav"); 699 }else{ 700 $('#menu-item-45 > a').removeClass("current_nav").find('.underline').remove(); 701 } 702 703 if($('#people_page').length || $('#people_single').length){ 704 if(!$('#menu-item-46 > a').hasClass('current_nav')){ 705 $('#menu-item-46 > a').append('<span class="underline"></span>'); 706 } 707 $('#menu-item-46 > a').addClass("current_nav"); 708 }else{ 709 $('#menu-item-46 > a').removeClass("current_nav").find('.underline').remove(); 710 } 711 712 713 if($('#recruit_page').length){ 714 if(!$('#menu-item-189').hasClass('current_nav')){ 715 $('#menu-item-189').append('<span class="underline"></span>'); 716 } 717 $('#menu-item-189').addClass("current_page_item"); 718 }else{ 719 $('#menu-item-189').removeClass("current_page_item").find('.underline').remove(); 720 } 721 722 if($('#jobs_page.class').length){ 723 if(!$('#menu-item-1991').hasClass('current_nav')){ 724 $('#menu-item-1991').append('<span class="underline"></span>'); 725 } 726 $('#menu-item-1991').addClass("current_page_item"); 727 }else{ 728 $('#menu-item-1991').removeClass("current_page_item").find('.underline').remove(); 729 } 730 731 if($('#jobs_page.jobs').length || $('#jobs_single').length){ 732 if(!$('#menu-item-193').hasClass('current_nav')){ 733 $('#menu-item-193').append('<span class="underline"></span>'); 734 } 735 $('#menu-item-193').addClass("current_page_item"); 736 }else{ 737 $('#menu-item-193').removeClass("current_page_item").find('.underline').remove(); 738 } 739 740 if($('#locations_page').length || $('#locations_single').length){ 741 if(!$('#menu-item-1992').hasClass('current_nav')){ 742 $('#menu-item-1992').append('<span class="underline"></span>'); 743 } 744 $('#menu-item-1992').addClass("current_page_item"); 745 }else{ 746 $('#menu-item-1992').removeClass("current_page_item").find('.underline').remove(); 747 } 748 749 if($('#income_page').length){ 750 if(!$('#menu-item-1993').hasClass('current_nav')){ 751 $('#menu-item-1993').append('<span class="underline"></span>'); 752 } 753 $('#menu-item-1993').addClass("current_page_item"); 754 }else{ 755 $('#menu-item-1993').removeClass("current_page_item").find('.underline').remove(); 756 } 757 758 if($('#jobs_page.part-time').length || $('#jobs_single.part-time').length){ 759 if(!$('#menu-item-490').hasClass('current_nav')){ 760 $('#menu-item-490').append('<span class="underline"></span>'); 761 } 762 $('#menu-item-193').removeClass("current_page_item"); 763 $('#menu-item-490').addClass("current_page_item"); 764 }else{ 765 $('#menu-item-490').removeClass("current_page_item").find('.underline').remove(); 766 } 767 768 if($('#jobs_page.internship').length || $('#jobs_single.internship').length){ 769 if(!$('menu-item-1997').hasClass('current_nav')){ 770 $('#menu-item-1997').append('<span class="underline"></span>'); 771 } 772 $('#menu-item-193').removeClass("current_page_item"); 773 $('#menu-item-1997').addClass("current_page_item"); 774 }else{ 775 $('#menu-item-1997').removeClass("current_page_item").find('.underline').remove(); 776 } 777 778 if($('#jobs_page.english').length || $('#jobs_single.english').length){ 779 if(!$('#menu-item-965').hasClass('current_nav')){ 780 $('#menu-item-965').append('<span class="underline"></span>'); 781 } 782 $('#menu-item-193').removeClass("current_page_item"); 783 $('#menu-item-965').addClass("current_page_item"); 784 }else{ 785 $('#menu-item-965').removeClass("current_page_item").find('.underline').remove(); 786 } 787 788 if($('#jobs_page.chinese').length || $('#jobs_single.chinese').length){ 789 if(!$('#menu-item-2319').hasClass('current_nav')){ 790 $('#menu-item-2319').append('<span class="underline"></span>'); 791 } 792 $('#menu-item-193').removeClass("current_page_item"); 793 $('#menu-item-2319').addClass("current_page_item"); 794 }else{ 795 $('#menu-item-2319').removeClass("current_page_item").find('.underline').remove(); 796 } 797 798 if($('.people_page_ja').length) { 799 $('#menu-item-968').addClass("current_nav"); 800 } 801 else if($('.people_page_en').length) { 802 $('#menu-item-969').addClass("current_nav"); 803 } 804 else if($('.people_page_cn').length) { 805 $('#menu-item-2329').addClass("current_nav"); 806 } 807 } 808 809 810 /*---------------------------- 811 ã¹ã¯ãã¼ã« 812 ----------------------------*/ 813 $(window).on('scroll', function(){ 814 onScroll(); 815 }); 816 817 function onScroll(){ 818 var top; 819 if(_ua.match(/MSIE/) || _ua.match(/Trident/) || _ua.match(/Firefox/)){ 820 top = $('html').scrollTop(); 821 }else{ 822 top = $('body').scrollTop(); 823 } 824 825 if(top > _scrollLength){ 826 if($('#scrolltop').css("opacity") === 0){ 827 $('#scrolltop').stop().animate({opacity:1}, 300, "easeOutSine"); 828 } 829 }else{ 830 if($('#scrolltop').css("opacity") === 1){ 831 $('#scrolltop').stop().animate({opacity:0}
831, 200, "easeOutSine"); 832 } 833 } 834 } 835 836 837 /*---------------------------- 838 ãªãµã¤ãº 839 ----------------------------*/ 840 $(window).on('resize', function(){ 841 onResize(); 842 }); 843 function onResize(){ 844 if(_isDevice == "sp"){ 845 _stageW = window.innerWidth; 846 _stageH = window.innerHeight; 847 }else{ 848 _stageW = $(window).width(); 849 _stageH = $(window).height(); 850 } 851 852 if(_isDevice == 'sp'){ 853// $('#menu_container').velocity({translateX:-_stageW}, 0); 854 } 855 856 if($('#home_page').length){ 857 if(_isDevice != 'sp'){ 858 var mt = _stageH - 470; 859 $('#home_menu').css({'margin-top':mt - 100}); 860 861 var ratio = getRatio(_stageW, _stageH, 960, 540); 862 $('#player').width(960 * ratio); 863 $('#player').height(540 * ratio); 864 $('#player').css({ 865 'margin-top':-parseInt($('#player').height() / 2), 866 'margin-left':-parseInt($('#player').width() / 2) 867 }); 868 }else{ 869 var pt = _stageH - $('#home_menu').height(); 870 $('#home_menu').css({'padding-top': pt - 20}); 871 } 872 } 873 874 if($('#jobs_single').length){ 875 if(_isDevice != 'sp'){ 876 var targetH1 = $('#heading').height(); 877 var targetH2 = $('#lnav_container').height(); 878 if(targetH1 > targetH2){ 879 $('#lnav_container').css({'top':parseInt((targetH1 - targetH2) / 2)}); 880 } 881 } 882 } 883 } 884}(this, jQuery)); 885 886 887var _ua = navigator.userAgent; 888var _isOS = ""; 889var _isDevice = ""; 890var _isBrowser = ""; 891 892 893/*---------------------------- 894 縦横æ¯ã®æ¯çè¨ç® 895----------------------------*/ 896function getRatio(stageW, stageH, originalW, originalH){ 897 if(stageH / stageW < originalH / originalW) return stageW / originalW; 898 else return stageH / originalH; 899} 900 901 902/*---------------------------- 903 ããã¤ã¹å¤å® 904----------------------------*/ 905function checkDevice(){ 906 var ret = ""; 907 if((_ua.indexOf('Android') > 0 && _ua.indexOf('Mobile') == -1) || _ua.indexOf('A1_07') > 0 || _ua.indexOf('SC-01C') > 0 || _ua.indexOf('iPad') > 0){ 908 if(_ua.indexOf('iPad') != -1){ 909 $('body').addClass('ipad'); 910 } 911 $('body').addClass('pc tablet'); 912 ret = "tablet"; 913 }else if((_ua.indexOf('iPhone') > 0 && _ua.indexOf('iPad') == -1) || _ua.indexOf('iPod') > 0 || (_ua.indexOf('Android') > 0 && _ua.indexOf('Mobile') > 0)){ 914 if(_ua.indexOf('iPod') != -1){ 915 $('body').addClass('ipod'); 916 }else if(_ua.indexOf('iPhone') != -1){ 917 $('body').addClass('iphone'); 918 } 919 $('body').addClass('sp'); 920 ret = "sp"; 921 }else{ 922 $('body').addClass('pc'); 923 ret = "pc"; 924 } 925 return ret; 926} 927 928 929/*---------------------------- 930 OSå¤å® 931----------------------------*/ 932function checkOS(){ 933 var ret = ""; 934 if(_ua.indexOf("Win") != -1){ 935 $('body').addClass('win'); 936 ret = "win"; 937 }else if(_ua.indexOf("Mac") != -1){ 938 $('body').addClass('mac'); 939 ret = "mac"; 940 941 //-----[OSãã¼ã¸ã§ã³] 942 var _osVersionSplit = _ua.match(/\(.+?\)/)[0].replace("(", "").replace(")", ""); 943 var version; 944 if(_ua.match(/Firefox/)){ 945 _osVersion = _osVersionSplit.split("; ")[1].split(" "); 946 version = parseFloat(_osVersion[_osVersion.length - 1]); 947 }else{ 948 _osVersion = _osVersionSplit.split(" "); 949 version = parseFloat(_osVersion[_osVersion.length - 1].replace(/_/g, ".")); 950 } 951 if(version < 10.8) $('body').addClass('not_mountainlion'); 952 }else if(_ua.indexOf('Android') != -1){ 953 $('body').addClass('android'); 954 ret = "android"; 955 }else if((_ua.indexOf('iPhone') > 0 && _ua.indexOf('iPad') == -1) || _ua.indexOf('iPod') > 0){ 956 $('body').addClass('ios'); 957 ret = "ios"; 958 } 959 return ret; 960} 961 962 963/*---------------------------- 964 ãã©ã¦ã¶å¤å® 965----------------------------*/ 966function checkBrowser(){ 967 var ret = ""; 968 if(_ua.match(/Edge/)){ 969 $('body').addClass("edge"); 970 ret = "edge"; 971 }else if(_ua.match(/Chrome/)){ 972 $('body').addClass("chrome"); 973 ret = "chrome"; 974 }else if(_ua.match(/MSIE/)){ 975 $('body').addClass("ie"); 976 var appVersion = window.navigator.appVersion; 977 if(appVersion.indexOf("MSIE 6.") != -1){ 978 $('body').addClass("ie6"); 979 ret = "ie6"; 980 }else if(appVersion.indexOf("MSIE 7.") != -1){ 981 $('body').addClass("ie7"); 982 ret = "ie7"; 983 }else if(appVersion.indexOf("MSIE 8.") != -1){ 984 $('body').addClass("ie8"); 985 ret = "ie8"; 986 }else if(appVersion.indexOf("MSIE 9.") != -1){ 987 $('body').addClass("ie9"); 988 ret = "ie9"; 989 }else if(appVersion.indexOf("MSIE 10.") != -1){ 990 $('body').addClass("ie10"); 991 ret = "ie10"; 992 } 993 }else if(_ua.match(/Trident/)){ 994 $('body').addClass("ie"); 995 $('body').addClass("ie11"); 996 ret = "ie11"; 997 }else if(_ua.match(/Firefox/)){ 998 $('body').addClass("firefox"); 999 ret = "firefox"; 1000 }else if(_ua.match(/Safari/)){ 1001 if(_ua.match(/crios/i)){ 1002 $('body').addClass("chrome"); 1003 ret = "chrome"; 1004 }else{ 1005 $('body').addClass("safari"); 1006 ret = "safari"; 1007 } 1008 }else if(_ua.match(/Opera/)){ 1009 $('body').addClass("opera"); 1010 ret = "opera"; 1011 } 1012 return ret; 1013} 1014 1015 1016/*---------------------------- 1017 ãã©ã¦ã¶è¨èª 1018----------------------------*/ 1019function getBrowserLanguage(){ 1020 try{ 1021 // chrome 1022 if(_ua.indexOf( 'chrome' ) != -1){ 1023 return(navigator.languages[0] || navigator.browserLanguage || navigator.language || navigator.userLanguage).substr(0,2); 1024 } 1025 // ããä»¥å¤ 1026 else{ 1027 return(navigator.browserLanguage || navigator.language || navigator.userLanguage).substr(0,2); 1028 } 1029 } 1030 catch(e){ 1031 return undefined; 1032 } 1033} 1034 1035/* 1036 var player_ja; 1037 var player_en; 1038 function onYouTubeIframeAPIReady(){ 1039 console.log('test'); 1040 player_ja = new YT.Player('player_ja', { 1041 height: '427', 1042 width: '760', 1043 videoId: '_3vF1RgeMG4', 1044 playerVars: { 1045 start: 1, 1046 rel: 0, 1047 modestbranding: 1 1048 }, 1049 events: { 1050 'onStateChange': onPlayerStateChange 1051 } 1052 }); 1053 player_en = new YT.Player('player_en', { 1054 height: '427', 1055 width: '760', 1056 videoId: '_3vF1RgeMG4', 1057 playerVars: { 1058 start: 1, 1059 rel: 0, 1060 modestbranding: 1 1061 }, 1062 events: { 1063 'onStateChange': onPlayerStateChange 1064 } 1065 }); 1066 } 1067 var seekSec = 0; 1068 var done = false;
1069 function seekTo (sec){ 1070 seekSec = sec; 1071 player_ja.seekTo(sec, true); 1072 } 1073 var seekSec_en = 0; 1074 var done_en = false; 1075 function seekTo_en (sec){ 1076 seekSec_en = sec; 1077 player_en.seekTo(sec, true); 1078 } 1079 function onPlayerStateChange(event){ 1080 console.log(); 1081 if(event.data == 1 && !done && event.target.g.id == 'player_ja'){ 1082 player_ja.seekTo(seekSec, true); 1083 done = true; 1084 } 1085 if(event.data == 1 && !done_en && event.target.g.id == 'player_en'){ 1086 player_en.seekTo(seekSec_en, true); 1087 done_en = true; 1088 } 1089 } 1090*/ 1091 1092/*---------------------------- 1093 YouTubeå¶å¾¡ 1094----------------------------*/ 1095 1096const ag2ytControl_ja = function(action,arg=null){ 1097 console.log('test2:',targetWindow_ja); 1098 targetWindow_ja.postMessage('{"event":"command", "func":"'+action+'", "args":'+arg+'}', '*'); 1099}; 1100var seekTo_ja = (sec) => { 1101 ag2ytControl_ja('seekTo',`[${sec},true]`); 1102// ag2ytControl_ja('playVideo', '[]'); 1103}; 1104const ag2ytControl_en = function(action,arg=null){ 1105 targetWindow_en.postMessage('{"event":"command", "func":"'+action+'", "args":'+arg+'}', '*'); 1106}; 1107var seekTo_en = (sec) => { 1108 ag2ytControl_en('seekTo',`[${sec},true]`); 1109// ag2ytControl_en('playVideo', '[]'); 1110}; 1111 1112var _player = null; 1113 1114if(checkDevice() == "pc"){ 1115 function onYouTubeIframeAPIReady(){ 1116 _player = new YT.Player('player', { 1117 width: '960', 1118 height: '540', 1119 videoId: videos[0].id, 1120 playerVars: { 1121 'controls': 0, 1122 'suggestedQuality': 'hd720', 1123 'autohide': 1, 1124 'autoplay': 1, 1125 'showinfo': 0, 1126 'loop': 1, 1127 'start': videos[0].start, 1128 'end': videos[0].end, 1129 'enablejsapi': 1, 1130 'wmode': 'transparent' 1131 }, 1132 events: { 1133 'onReady': onPlayerReady, 1134 'onStateChange': onPlayerStateChange 1135 } 1136 }); 1137 } 1138 1139 function onPlayerReady(event){ 1140 _player.mute(); 1141 1142 if($('#home_page').length){ 1143 _player.playVideo(); 1144 _player.mute(); 1145 _player.setVolume(0); 1146 }else{ 1147 pauseVideo(); 1148 } 1149 } 1150 1151 var done = false; 1152 function onPlayerStateChange(event){ 1153 if(event.data == YT.PlayerState.ENDED && !done){ 1154 videos.push(videos[0]); 1155 videos.shift(); 1156 1157 _player.loadVideoById({ 1158 'videoId': videos[0].id, 1159 'startSeconds': videos[0].start, 1160 'endSeconds': videos[0].end, 1161 'suggestedQuality': 'hd720' 1162 }); 1163 } 1164 } 1165 1166 function startVideo(){ 1167 if(_player != null){ 1168 _player.playVideo(); 1169 _player.mute(); 1170 _player.setVolume(0); 1171 } 1172 } 1173 1174 function pauseVideo(){ 1175 if(_player != null){ 1176 _player.pauseVideo(); 1177 } 1178 } 1179} 1180 1181/* 1182window.onload = function(){ 1183 const hash = location.hash; 1184 if(hash){ 1185 let ostTop = Math.floor($(hash).offset().top); 1186 console.log(ostTop, $(hash).offset().top); 1187 $(window).scrollTop(ostTop); 1188 } 1189} 1190*/ 1191 1192 1193/*---------------------------- 1194 æ²¿é© 1195----------------------------*/ 1196let scrollTop; 1197let startX, diffX; 1198let window_width, slide_nav_width; 1199 1200function modal_close(){ 1201 $('.history_modal.active .history_slide, .history_modal.active .txt').velocity({ opacity: 0 },{ duration: 150, delay: 0, easing: 'easeOutCubic', complete: function(){ 1202 $('body').removeClass('noscroll'); 1203 $(window).scrollTop(scrollTop); 1204 $('.modal').scrollTop(0); 1205 }}); 1206 $('.history_modal.active').velocity({ opacity: 0 },{ display: 'none', duration: 250, delay: 0, easing: 'linear', complete: function(){ 1207 $('.history_modal.active').removeClass('active'); 1208 }}); 1209}; 1210 1211$(document).on('click', '.history_modal_close', function(){ 1212 modal_close(); 1213}); 1214 1215$(document).on('click', '.history_modal_btn', function(){ 1216 $(this).parent().parent().find('.history_modal').addClass('active'); 1217 $.Velocity.hook($('.history_modal.active .history_slide, .history_modal.active .txt'), 'opacity', 0); 1218 1219 $('.history_modal.active').velocity({ opacity: 0 },{ display: 'block', duration: 0, delay: 0, complete: function(){ 1220 slide_nav_width = $('.history_modal.active .slides-pagination').width(); 1221 window_width = $(window).width(); 1222 if(window_width <= 767){ 1223 slide_nav_width = slide_nav_width / 2 + 20; 1224 $('.history_modal.active .slides-navigation a.prev').css('margin-right', slide_nav_width+'px'); 1225 $('.history_modal.active .slides-navigation a.next').css('margin-right', '-'+slide_nav_width+'px'); 1226 }else{ 1227 $('.history_modal.active .slides-navigation a.prev').css('right', slide_nav_width+'px'); 1228 }; 1229 }}); 1230 1231 $('.history_modal.active').velocity({ opacity: 1 },{ display: 'block', duration: 400, delay: 0, easing: 'easeOutCubic' }); 1232 $('.history_modal.active .history_slide, .history_modal.active .txt').velocity({ opacity: 1 },{ duration: 450, delay: 100, easing: 'easeOutCubic' }); 1233 scrollTop = $(window).scrollTop(); 1234 $('body').addClass('noscroll').css('top', (-scrollTop) + 'px'); 1235 1236 // swipe 1237 $(".history_modal.active .history_slide .inner img").bind("touchstart touchmove touchend", touchHandler); 1238 function touchHandler(e){ 1239 e.preventDefault(); 1240 let touch = e.originalEvent.touches[0]; 1241 if(e.type == "touchstart"){ 1242 startX = touch.pageX; 1243 console.log('startX:'+startX); 1244 }else if(e.type == "touchmove"){ 1245 diffX = touch.pageX - startX; 1246 console.log('diffX:'+diffX); 1247 }else if(e.type == "touchend"){ 1248 if(diffX > 0){ //left 1249 $('.history_modal.active .history_slide').superslides('animate', 'prev'); 1250 }else{ //righ 1251 $('.history_modal.active .history_slide').superslides('animate', 'next'); 1252 }; 1253 }; 1254 }; 1255});
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.