/* 20220425 �덈룄�곗깉李쏀뙘�� */ window.popupWindowCenter = function (url, title, w, h, opts) { var _innerOpts = ''; if (opts !== null && typeof opts === 'object') { for (var p in opts) { if (opts.hasOwnProperty(p)) { _innerOpts += p + '=' + opts[p] + ','; } } } // Fixes dual-screen position, Most browsers, Firefox var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left; var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top; var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; var left = ((width / 2) - (w / 2)) + dualScreenLeft; var top = ((height / 2) - (h / 2)) + dualScreenTop; var newWindow = window.open(url, title, _innerOpts + ' width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); // Puts focus on the newWindow if (newWindow && newWindow.focus) { newWindow.focus(); } }; /* 20221020 gnb �몄뼱 �좏깮 */ (function () { const buttonElements = document.querySelectorAll('[data-language-toggle]'); if (buttonElements.length) { const bodyElement = document.body; const footer = document.querySelector('footer'); //const footerCont = footer.querySelector('.footer__cont'); //const pcLayerSelector = '#selectLangBox'; //const pcLayer = document.querySelector(pcLayerSelector); //const clickedClass = 'lang-clicked'; const moLayerActiveClass = 'sel-active'; const breakPoint = 959; let isClicked = false; window.addEventListener('resize', function () { if (window.innerWidth <= breakPoint) { if (isClicked) { // Mobile �� �� PC �ㅽ��� �쒓굅 bodyElement.classList.remove(clickedClass); isClicked = false; } } else { // PC �� �� Mobile �ㅽ��� �쒓굅 if (bodyElement.classList.contains(moLayerActiveClass)) { bodyElement.classList.remove(moLayerActiveClass); //footerCont.style.display = 'none'; footer.classList.remove('is-active'); } } }); // // 紐⑤컮�� GNB 踰꾪듉 �대┃ �� buttonElements.forEach(function (element) { element.addEventListener('click', function () { if (window.innerWidth <= breakPoint) { // Mobile bodyElement.classList.add(moLayerActiveClass); //footerCont.style.display = 'block'; footer.classList.add('is-active'); if (!bodyElement.classList.contains('scroll-up') || !bodyElement.classList.contains('scroll-down')) { bodyElement.classList.add('scroll-down'); } } }); // pc �덉씠�� �닿린 element.addEventListener('focus', function () { if (window.innerWidth > breakPoint && !isClicked) { bodyElement.classList.add(clickedClass); isClicked = true; } }); // shift tab �� pc �덉씠�� �リ린 element.addEventListener('keydown', function (event) { const keyCode = event.keyCode || event.which; const isShiftTabPressed = event.shiftKey && keyCode === 9; if (isShiftTabPressed && isClicked) { bodyElement.classList.remove(clickedClass); isClicked = false; } }); }); // �몃��곸뿭 �대┃ �� �リ린 document.addEventListener('click', function (event) { if (window.innerWidth > breakPoint && isClicked) { if (event.target.getAttribute('data-language-toggle') !== '' || event.target.closest(pcLayerSelector)) { bodyElement.classList.remove(clickedClass); isClicked = false; } } }); // pc �덉씠�� 留덉�留� �ъ빱�� �꾩썐 �� �リ린 const focusElements = pcLayer.querySelectorAll(['a', 'button', 'tabindex']); const lastFocusElement = focusElements[focusElements.length - 1]; lastFocusElement.addEventListener('keydown', function (event) { const keyCode = event.keyCode || event.which; const isTabPressed = !event.shiftKey && keyCode === 9; if (isTabPressed && isClicked) { bodyElement.classList.remove(clickedClass); isClicked = false; } }); } })();