PageSourceSearch

http://www.samsungsds.com/module_src/js/common_module.js?queryString=20260602094608

js samsungsds.com collected 2026-10-01 10:15:48 UTC 64,641 bytes, 1,876 lines download raw bytes

1/** common_module */
2document.querySelector("html").setAttribute(
3    "data-country",
4    window.location.pathname.split("/")[1]
5);
6
7var pluginObject = {};
8var globalObject = {};
9var eventObject = {};
10var pluginReference = {};
11var fo = {
12    addPlugin : function(fn, selector){
13        !pluginObject[fn.name] ? pluginObject[fn.name] = fn : null;
14    },
15    addGlobal : function(object, name){
16        if(typeof object === 'object'){
17            !globalObject[name] ? globalObject[name] = object : null;
18        }
19    },
20    addEvent : function(object, name){
21        if(typeof object === 'object'){
22            $.extend(eventObject, object);
23        }
24    }
25}
26
27var customModule = {
28    readyModule: [
29        { selector: ".M01_A", plugin: "M01_A" },
30        { selector: ".M01_B", plugin: "M01_B" },
31        { selector: ".M01_C", plugin: "M01_C" },
32        { selector: ".M01_D", plugin: "M01_D" },
33        { selector: ".M04_B", plugin: "M04_B" },
34        { selector: ".M04_D", plugin: "M04_D" },
35        { selector: ".M04_E", plugin: "M04_E" },
36        { selector: ".M05_A", plugin: "M05_A" },
37        { selector: ".M06_A", plugin: "M06_A" },
38        { selector: ".M06_B", plugin: "M06_B" },
39        { selector: ".M06_C", plugin: "M06_C" },
40        { selector: ".M07_A", plugin: "M07_A" },
41        { selector: ".M09_A", plugin: "M09_A" },
42        { selector: ".M09_B", plugin: "M09_B" },
43        { selector: ".M11_A", plugin: "M11_A" },
44        { selector: ".M21_A", plugin: "M21_A" },
45        { selector: ".M21_B", plugin: "M21_B" },
46        { selector: ".M22_A", plugin: "M22_A" },
47        { selector: ".M26_A", plugin: "M26_A" },
48        { selector: ".M22_A .txt_ty", plugin: "M21_B" }, // 예외 케이스: 이미 개발 전달된 내용이라 바꿀 수 없음
49    ],
50    loadModule: [
51        // { selector: ".M01_A", plugin: "M01_A" },
52        { selector: ".M26_B", plugin: "M26_B" },
53    ]
54};
55
56$(document).ready(function(){
57    var country = $("html").attr("data-country") || "en";
58    if(country === "us" || country === "eu" || country === "in" || country === "vn" || country === "la" || country === "ap"){
59        changeOnclickStr();
60        changeAnchorTarget();
61    }
62
63    $('[data-fn]').each(function(i, el){
64        var fnName = $(this).data('fn');
65        if(!$(this).data("plugin")){
66            if(pluginObject.hasOwnProperty(fnName)){
67                $(this).data("plugin", new pluginObject[fnName]($(el)));
68            }
69        }
70    })
71
72    if(!customModule.readyModule.length) return;
73
74    customModule.readyModule.map(function(module){
75        $(module.selector).each(function(i, el){
76            var fnName = module.plugin;
77            if(!$(this).data("plugin")){
78                if(pluginObject.hasOwnProperty(fnName)){
79                    $(this).data("plugin", new pluginObject[fnName]($(el)));
80                }
81            }
82        });
83    });
84    /* 210510 | 접근성 | 리소스 모바일일때 title 추가 */
85    function setResourceTitle(){
86        var lang = $("html").attr("lang") || "en";
87        const offering = $('.filterContainer #resource_tab .btn').eq(0);
88        const content = $('.filterContainer #resource_tab .btn').eq(1);
89        const title = {
90            ko: ["오퍼링 선택하기", "콘텐츠 유형 선택하기"],
91            en: ["Choose an offerings", "Choose a content types"],
92			zh: ["Choose an offerings", "Choose a content types"],
93            pt: ["Choose an offerings", "Choose a content types"],
94        };
95        offering.attr("title", `${title[lang][0]} - ${langSet[lang].layerPop.layerOpen}`);
96        content.attr("title", `${title[lang][1]} - ${langSet[lang].layerPop.layerOpen}`);
97    }
98    function removeResourceTitle(){
99        var lang = $("html").attr("lang") || "en";
100        $('.filterContainer #resource_tab .btn').attr("title", "");
101    }
102    
103    if($(window).innerWidth() < 1024){
104        setResourceTitle();
105    }else{
106        removeResourceTitle();
107    }
108
109     // window resize
110    $(window).on('resize',function(){
111        if($(window).innerWidth() < 1024){
112            setResourceTitle();
113        }else{
114            removeResourceTitle();
115        }
116    });
117    /* //210510 | 접근성 | 리소스 모바일일때 title 추가 */	
118
119	/* 202403 웹접근 작업 */
120    var headSkip = $('#skip_navi'),
121        headSkip_li = headSkip.find('li');
122
123    if(headSkip_li.find('button').length){
124        headSkip_li.find('button').contents().unwrap().wrap( '<a href="#container"></a>' )
125    }
126    /* //202403 웹접근 작업 */
127
128	/* drop & dwon 버튼 공통 */
129    /**
130        * slideToggle 형태가 아닌 형태일 경우 여기서 수정 
131    */
132    var $dropDown_btn = $('.dropDown');
133    $dropDown_btn.on('click', function(e){
134        e.preventDefault();
135        $(this).next().stop().slideToggle();
136        $(this).toggleClass('on');
137
138		 if (!$(this).hasClass('on')) {
139            $(this).attr({ 'aria-expanded': false });
140        } else {
141            $(this).attr({ 'aria-expanded': true });
142        }
143    });
144    /* //drop & dwon 버튼 공통 */
145
146    var $slideMenu = $('.custom_tab>ul')
147    var $slideMenuBtn = $('.custom_tab .only_mb')
148    $slideMenuBtn.on('click', function(e){
149        e.preventDefault();
150        $(this).toggleClass('show');
151        $slideMenu.toggleClass('show');
152    })
153    
154    checkCommonList();
155});
156
157$(window).load(function(){
158    var country = $("html").attr("data-country") || "en";
159    if(country === "us" || country === "eu" || country === "in" || country === "vn" || country === "la" || country === "ap"){
160        changeOnclickStr();
161        changeAnchorTarget();
162    }
163
164    $('[data-load-fn]').each(function(i, el){
165        var fnName = $(this).data('loadFn');
166        if(!$(this).data("plugin")){
167            if(pluginObject.hasOwnProperty(fnName)){
168                $(this).data("plugin", new pluginObject[fnName]($(el)));
169            }
170        }
171    })
172
173    if(!customModule.loadModule.length) return;
174    customModule.loadModule.map(function(module){
175        $(module.selector).each(function(i, el){
176            var fnName = module.plugin;
177            if(!$(this).data("plugin")){
178                if(pluginObject.hasOwnProperty(fnName)){
179                    $(this).data("plugin", new pluginObject[fnName]($(el)));
180                }
181            }
182        });
183    });
184
185    /* 210412 | 웹접근성 | 동영상 대체텍스트 추가 */
186    if($(".img .btn_vod, .is_showPopup").length){
187        var lang = $("html").attr("lang") || "en";
188        var country = $("html").attr("data-country") || "en";
189
190        $(".img .btn_vod, .is_showPopup").each(function(){
191            var $btnMovieDataTxt = $(this).parent().next().find("a:first").text();
192            var $MakeblindTxt = "<span class='blind'>" + $btnMovieDataTxt +" "+ langSet[lang].video.play + "</span>"; 
193
194            //20220411 접근성 대응
195            if($(this).data("src")==undefined){
196                $(this).attr("title", langSet[lang].layerPop.layerOpen);
197            }else{
198                if($(this).data("watch")!=undefined && $(this).data("watch") == "y"){
199                    $(this).attr("title", langSet[lang].layerPop.VideoOpen);
200                }else{
201                    $(this).attr("title", langSet[lang]["openWindow"]);
202                }
203            }
204            
205            /* 210419 | 예외처리 case 추가, 210428 | btn_m 예외 추가 */
206            if(!$(this).is(".btn_arrow, .btn_m, .btn_btm .btn")){
207                $(this).find(".blind").remove();
208                $(this).append($MakeblindTxt);
209            }
210            /* //210419 | 예외처리 case 추가 */
211        });
212    }
213
214    if($('.is_NewWinVideo').length){
215        var lang = $("html").attr("lang") || "en";
216        var country = $("html").attr("data-country") || "en";   
217        $(".is_NewWinVideo").each(function(){
218            $(this).attr("title", langSet[lang]["openWindow"]);
219        });
220    }
221    /* //210412 | 웹접근성 | 동영상 대체텍스트 추가 */
222
223    /* 210412 | 웹접근성 | 공유 아이콘 팝업 열림 텍스트 추가 */
224    if($(".md_btn_share").length){
225        var lang = $("html").attr("lang") || "en";
226        var $mdBtnShare = $(".md_btn_share");        
227        $mdBtnShare.attr("title", langSet[lang].layerPop.layerOpen);           
228    }
229    /* //210412 | 웹접근성 | 공유 아이콘 팝업 열림 텍스트 추가 */
230
231    /* 210714 : img mask add */    
232    $(".md_link").on("focus mouseover", function(){
233        var mask_over = $(this).find(".mask_over");
234        
235        if(!$(mask_over).length) {return;}
236        $(this).addClass("on");
237    });
238
239    $(".md_link").on("focusout mouseleave", function(){
240        var mask_over = $(this).find(".mask_over");
241        
242        if(!$(mask_over).length) {return;}
243        $(this).removeClass("on");
244    });
245    /* //210714 : img mask add */
246
247    function checkCube (){
248        var _cubeEl = $('.M01_E_cont.cube');
249        var _cubeBan = $(".M01_E_cont.cube .md_visual");
250        var _cubeTabHeight = $(".cube_tab").outerHeight();
251        var _originHeight = $(window).height() - $(".M00_A").height();
252        var _replaceHeight = _originHeight - _cubeTabHeight;
253
254        if(!_cubeEl.length) return;        
255        _cubeBan.css("height", _replaceHeight);
256    }
257    checkCube ();
258
259    $(window).on("resize", function(){
260        checkCube ();
261    });   
262});
263  
264
265/* Timer Constructor */
266function Timer(func, delay) {
267    this.handle = 0;
268    this.func = func;
269    this.delay = delay;
270}
271Timer.prototype.start = function(newDelay) {
272    if (typeof newDelay !== "undefined") {
273        this.delay = newDelay;
274    }
275    this.stop();
276    this.handle = setTimeout(this.func, this.delay);
277    return this;
278};
279Timer.prototype.stop = function(newDelay) {
280    if (this.handle) {
281        clearTimeout(this.handle);
282        this.handle = 0;
283    }
284    return this;
285};
286
287/* String Function */
288String.prototype.dashToCamel = function(){
289    return this.replace(/(\-[a-z])/g, function($1){return $1.toUpperCase().replace('-','');});
290};
291
292String.prototype.camelToDash = function(){
293    return this.replace(/([A-Z])/g, function($1){return "-"+$1.toLowerCase();});
294};
295
296String.prototype.camelToUnderscore = function(){
297    return this.replace(/([A-Z])/g, function($1){return "_"+$1.toLowerCase();});
298};
299
300/* XML Parsing, XML selector */
301function OBJtoXML(obj) {
302    var xml = '';
303    for (var prop in obj) {
304        xml += obj[prop] instanceof Array ? '' : "<" + prop + ">";
305        if (obj[prop] instanceof Array) {
306            for (var array in obj[prop]) {
307                xml += "<" + prop + ">";
308                xml += OBJtoXML(new Object(obj[prop][array]));
309                xml += "</" + prop + ">";
310            }
311        } else if (typeof obj[prop] == "object") {
312            xml += OBJtoXML(new Object(obj[prop]));
313        } else {
314            xml += obj[prop];
315        }
316        xml += obj[prop] instanceof Array ? '' : "</" + prop + ">";
317    }
318    var xml = xml.replace(/<\/?[0-9]{1,}>/g, '');
319    return xml
320}
321
322function getChildByNodeName(node, nodeName){
323    var children = node.childNodes;
324    if(children.length){
325        for(var i=0; i<children.length; i++){
326            if(children[i].nodeName == nodeName){
327                return children[i];
328            }
329        }
330        return false;
331    }else{
332        return false;
333    }
334}
335  
336/* mobile check */
337function isMobileDevice(){
338return isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false;    
339}
340
341/* checkEnvironment */
342function checkEnvironment() {
343    const elem = $("html");
344    const userAgent = navigator.userAgent;
345    const mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
346    const ios = /iPhone|iPad|iPod/i;
347    const aos = /Android/i;
348
349    elem.removeAttr("data-device").removeAttr("data-os");
350
351    ( mobile.test(userAgent) ) ? elem.attr("data-device","mobile") : elem.attr("data-device","pc");
352    ( ios.test(userAgent) ) ? elem.attr("data-os", "ios") : null;
353    ( aos.test(userAgent) ) ? elem.attr("data-os", "aos") : null;
354}
355checkEnvironment();
356window.onload = ()=>{
357    checkEnvironment();
358    window.addEventListener("resize", checkEnvironment);
359}
360  
361/* url check (onclick) */
362function changeOnclickStr() { 
363    var lang = $("html").attr("lang") || "en";
364    var selector = document.querySelectorAll("*[onclick]");
365    var reg = new RegExp("(window\.location\.href='\/en\/)(.*)(.html')","gi");
366
367    for (var index = 0; index < selector.length; index++) {
368        var element = selector[index];
369        var onclickStr = element.getAttribute("onclick");
370        
371        // 정규식 통과하지않으면 다음 for 문으로 넘어감
372        if(onclickStr.match(reg) === null){
373            continue;
374        }
375        // Example
376        // asis : outbound('/en/ai/ai.html','');window.location.href='/en/ai/ai.html'
377        // tobe : outbound('/en/ai/ai.html','');window.open('/en/ai/ai.html', '_blank')
378        var changeStr = onclickStr.replace(reg, function(match, p1, p2, p3) {
379            return "window.open('/en/"+ p2 +"', '_blank');";
380        });
381        
382        // 기존 이벤트 삭제
383        element.onclick = null;
384        // 신규 이벤트 추가
385        element.setAttribute("onclick", changeStr);
386        // title="new window"
387        element.setAttribute("title", langSet[lang]["openWindow"]);
388    }
389}
390
391/* url check (href) */
392function changeAnchorTarget(){
393    var lang = $("html").attr("lang") || "en";
394    var selector = document.querySelectorAll("*[href]");
395
396    for (var index = 0; index < selector.length; index++) {
397        var element = selector[index];
398        var hrefStr = element.getAttribute("href");
399        
400        // href 가 "/en/" 으로 시작하지않으면 다음 for 문으로 넘어감
401        if(hrefStr.indexOf("/en/") !== 0){
402            continue;
403        }
404
405        // target="_blank"
406        element.setAttribute("target", "_blank");
407        // title="new window"
408        element.setAttribute("title", langSet[lang]["openWindow"]);
409    }
410}
411
412/* tab_swiper */
413function tabSwiper(el) {
414    _proto = tabSwiper.prototype;
415    this.$el = el;
416    this.data = this.$el.data();
417    this.addEventFlag = false;
418    this.slide;
419    this.$container = this.$el.hasClass("swiper-container") ? this.$el : this.$el.find(".swiper-container");
420    this.$wrapper = this.$container.find(".swiper-wrapper");
421    this.$items = this.$container.find(".swiper-slide");
422    this.$prevBtn = this.$container.find(".btn_prev");
423    this.$nextBtn = this.$container.find(".btn_next");
424    this.key = Math.floor(this.$el.offset().top); //210510 | 접근성 | tabswiper focus
425
426    var _this = this; // tab_swiper
427    var deviceType; // "PC", "TABLET", "MOBILE" // 2023-04 접근성 수정
428
429    _proto.init = function(){
430        // Swiper bug { slidesPerView: "auto" }
431        // Get an array of wrong numbers: slidesGrid / slidesSizesGrid / snapGrid
432        // document ready(X), window load(O)
433        // Set Swiper
434        if(this.$el.hasClass("gnb_rolling")){
435            setSwiperGnb(this);
436        }else{
437            setSwiper(this);
438        }
439        // Add Event
440        if(!this.addEventFlag){
441            this.addEvent();
442        }
443    }
444
445    // Add Event
446    _proto.addEvent = function(){
447        // Device type check
448        deviceType = checkDeviceType(); // 2023-04 접근성 수정
449        _this.slide.on("reachEnd", function(thisSwiper) {
450            var thisSwiper= this;
451            if (deviceType.toLowerCase() === 'pc') return;
452            if (!_this.$el.hasClass('category_swiper')) {
453                return;
454            }
455
456            _this.$el
457                .filter('.category_swiper')
458                .find('.swiper-slide')
459                .attr({ tabindex: -1, 'aria-hidden': true })
460                .find('a, button')
461                .attr({ tabindex: -1, 'aria-hidden': true });
462
463            setTimeout(function () {
464                let _eqValue = _this.$el.filter('.category_swiper').find('.swiper-slide-visible').length - 1;
465
466                _this.$el
467                    .filter('.category_swiper')
468                    .find('.swiper-slide')
469                    .filter('.swiper-slide-visible')
470                    .removeAttr('tabindex aria-hidden')
471                    .find('a, button')
472                    .removeAttr('tabindex aria-hidden');
473
474                _this.$el
475                    .filter('.category_swiper')
476                    .find('.swiper-slide')
477                    .filter('.swiper-slide-visible')
478                    .eq(_eqValue)
479                    .attr({ tabindex: -1, 'aria-hidden': true })
480                    .find('a, button')
481                    .attr({ tabindex: -1, 'aria-hidden': true });
482
483                if (_this.$items.eq(_this.$items.length - 1).hasClass('swiper-slide-visible')) {
484                    _this.$items
485                        .eq(_this.$items.length - 1)
486                        .removeAttr('tabindex aria-hidden')
487                        .find('a, button')
488                        .removeAttr('tabindex aria-hidden');
489                }
490            }, 1);
491        });
492
493        /* 2023-04 접근성 수정 시작 */
494        _this.slide.on('sliderMove', function () {
495            setControlStyle(_this, _this.slide);
496            if (deviceType.toLowerCase() === 'pc') return;
497            if (!_this.$el.hasClass('category_swiper')) {
498                return;
499            }
500            _this.$el
501                .filter('.category_swiper')
502                .find('.swiper-slide')
503                .attr({ tabindex: -1, 'aria-hidden': true })
504                .find('a, button')
505                .attr({ tabindex: -1, 'aria-hidden': true });
506
507            setTimeout(function () {
508                let _eqValue = _this.$el.filter('.category_swiper').find('.swiper-slide-visible').length - 1;
509
510                _this.$el
511                    .filter('.category_swiper')
512                    .find('.swiper-slide')
513                    .filter('.swiper-slide-visible')
514                    .removeAttr('tabindex aria-hidden')
515                    .find('a, button')
516                    .removeAttr('tabindex aria-hidden');
517
518                _this.$el
519                    .filter('.category_swiper')
520                    .find('.swiper-slide')
521                    .filter('.swiper-slide-visible')
522                    .eq(_eqValue)
523                    .attr({ tabindex: -1, 'aria-hidden': true })
524                    .find('a, button')
525                    .attr({ tabindex: -1, 'aria-hidden': true });
526
527                if (_this.$items.eq(_this.$items.length - 1).hasClass('swiper-slide-visible')) {
528                    _this.$items
529                        .eq(_this.$items.length - 1)
530                        .removeAttr('tabindex aria-hidden')
531                        .find('a, button')
532                        .removeAttr('tabindex aria-hidden');
533                }
534            }, 1);
535        });
536
537        // prev button click
538        _this.$prevBtn.on('click', function () {
539            _this.slide.slidePrev();
540            setControlStyle(_this, _this.slide);
541        });
542
543        // next button click
544        _this.$nextBtn.on('click', function () {
545            _this.slide.slideNext();
546            setControlStyle(_this, _this.slide);
547        });
548
549        // window resize
550        $(window).on("resize", function(){
551            if(_this.$el.hasClass("gnb_rolling")){
552                setGnbRolling(_this, _this.slide);
553            }else{
554                setSlideStyle(_this, _this.slide);
555            }
556            var currentDeviceType = checkDeviceType();
557
558            if (deviceType !== currentDeviceType) {
559                deviceType = currentDeviceType;
560                if (deviceType.toLowerCase() === 'pc') {
561                    _this.$el
562                    .filter('.category_swiper')
563                    .find('.swiper-slide')
564                    .removeAttr('tabindex aria-hidden')
565                    .find('a, button')
566                    .removeAttr('tabindex aria-hidden');
567                };
568            }
569        });
570    }
571
572    // Set Swiper
573    function setSwiper(_plugin){
574        _plugin.slide = new Swiper(_plugin.$container, {
575            a11y: true,
576            loop : false,
577            centeredSlides: false,
578            slidesPerView: "auto",
579            freeMode: true,
580            watchSlidesVisibility :true,
581            keyboardControl: true,
582            slidesOffsetBefore: 0,
583            slidesOffsetAfter: 0,
584            /* S: Tab메뉴 시 슬라이더 오류: 불러올 때마ë
584‹¤ 새로 고침 해 주는 역할 2022.10.18 Add */
585            observer: true,
586            observeParents: true,
587            /* E: 2022.10.18 Add */
588            on: {
589                init : function () {
590                    setSlideStyle(_this, this);
591                    setControlStyle(_this, this);
592                },
593            },
594        });
595    }
596
597    // Set Swiper
598    function setSwiperGnb(_plugin){
599        _plugin.slide = new Swiper(_plugin.$container, {
600            a11y: true,
601            loop : false,
602            centeredSlides: false,
603            slidesPerView: "auto",
604            freeMode: true,
605            watchSlidesVisibility :true,
606            keyboardControl: true,
607            slidesOffsetBefore: 0,
608            slidesOffsetAfter: 0,
609            observer: true, 
610            observeParents: true,
611            on: {
612                init : function () {
613                    setSlideStyle(_this, this);
614                    setControlStyle(_this, this);
615                },
616            },
617        });
618    }
619                                        
620    //Offering Gnb Rolling
621    function setGnbRolling(_plugin, swiper){
622        var slideWidth = 0;
623        swiper.slidesSizesGrid.map(function(width){
624            slideWidth += 246;
625        });
626        if(slideWidth <= swiper.size){
627            // fixed wrapper
628            _plugin.$prevBtn.not("[disabled]") && _plugin.$prevBtn.removeAttr("disabled", "disabled").removeClass("disabled");
629            _plugin.$nextBtn.not("[disabled]") && _plugin.$nextBtn.removeAttr("disabled", "disabled").removeClass("disabled");
630        }
631    }
632
633    // slide, prev button, next button style
634    function setSlideStyle(_plugin, swiper){
635        var slideWidth = 0;
636        swiper.slidesSizesGrid.map(function(width){
637            slideWidth += width;
638        })
639        if(slideWidth <= swiper.size){
640            // fixed wrapper
641            _plugin.$wrapper.not(".isFixed") && _plugin.$wrapper.addClass("isFixed").css("transform", "translate3d(0px, 0px, 0px);");
642            // button disabled
643            _plugin.$prevBtn.not("[disabled]") && _plugin.$prevBtn.addClass("disabled");
644            _plugin.$nextBtn.not("[disabled]") && _plugin.$nextBtn.addClass("disabled");
645        }else{
646            // fixed wrapper
647            _plugin.$wrapper.is(".isFixed") && _plugin.$wrapper.removeClass("isFixed").css("transform", "translate3d(0px, 0px, 0px);");
648            // button disabled
649            _plugin.$prevBtn.is("[disabled]") && _plugin.$prevBtn.removeAttr("disabled").removeClass("disabled");
650            _plugin.$nextBtn.is("[disabled]") && _plugin.$nextBtn.removeAttr("disabled").removeClass("disabled");
651        }
652    }
653
654    // prev button, next button style
655    function setControlStyle(_plugin, swiper){
656        // prev button
657        if(swiper.translate >= 0){
658            _plugin.$prevBtn.addClass("disabled");
659        }else{
660            _plugin.$prevBtn.removeAttr("disabled").removeClass("disabled");
661        }
662
663        // next button
664        if(swiper.isEnd){
665            _plugin.$nextBtn.addClass("disabled");
666        }else{
667            _plugin.$nextBtn.removeAttr("disabled").removeClass("disabled");
668        }
669    }
670
671    function checkDeviceType() {
672        if (window.innerWidth > 1023) {
673            return 'PC';
674        } else if (window.innerWidth > 600) {
675            return 'TABLET';
676        } else {
677            return 'MOBILE';
678        }
679    }
680    this.init();
681}
682
683fo.addPlugin(tabSwiper);
684
685/* imgLiquid */
686$(document).ready(function(){
687    var option = {
688        fill:true,
689        horizontalAlign:"center",
690        verticalAlign:"center"
691    };
692    $('.module_ty').find('.img .img_p, .img .img_m').imgLiquid(option);
693    $('.visual_img').find('.img_p, .img_m').imgLiquid(option);
694    $('.board_ty').find('.img .img_p').imgLiquid(option);
695
696    /* 210406 | 웹접근성 | 이미지 대체텍스트 추가 */
697    var lang = $("html").attr("lang") || "en";
698    var parentClass = $('.module_ty, .visual_img, .board_ty');
699    var parentClass2 = $('.vision_carousel');  /* 210525 |지속가능경영 | case 추가 */
700
701    if(!parentClass.length) return;
702
703    parentClass.find('.md_link .img_p, .md_link .img_m').each(function(e){
704        var $this = $(this);
705        var imgAlt = $this.find('img').attr("alt");
706        var thisTit = $this.closest('.item, .li').find('.txt a').first().text();
707        var thisTarget = $this.closest('.md_link');
708
709        $this.find('img').attr("aria-hidden","true");
710        
711        if(thisTarget.attr('target') == "_blank" && !thisTarget.attr('title')){
712            thisTarget.attr('title', langSet[lang]["openWindow"]);
713        };
714        if(!$this.hasClass('img_m')){ //PC를 기준으로 alt값 출력 | alt값 없을시 md_tit값 출력
715            if(imgAlt){
716                thisTarget.append('<div class="blind">'+ imgAlt +'</div>');
717            }else{
718                thisTarget.append('<div class="blind">'+ thisTit +'</div>');
719            };
720        }
721    });
722    /* //210406 | 웹접근성 | 이미지 대체텍스트 추가 */
723
724    /* 210525 |지속가능경영 | case 추가 */
725    if(!parentClass2.length) return;
726
727    parentClass2.find('.img_p').each(function(e){
728        var $this = $(this);
729        var imgAlt = $this.find('img').attr("alt");
730        var thisTarget = $this.closest('.visual_img');
731
732        $this.find('img').attr("aria-hidden","true");        
733        if(imgAlt){
734            thisTarget.append('<div class="blind">'+ imgAlt +'</div>');
735        }
736    });
737    /* 210525 |지속가능경영 | case 추가 */
738
739    /* 210525 | 탭 클릭시 실행 추가 */
740    $('#tab_sel_list').on("click", function(){
741        if(!$('.module_ty')) { return; }
742        moduleAlign();
743    });
744    /* 210525 | 탭 클릭시 실행 추가 */
745});
746
747$(function(){
748    $(document).ready(function(){
749        moduleAlign();
750    });
751    $(window).resize(function(){
752        setTimeout(() => {
753            moduleAlign();
754        }, 300);
755    });
756});
757  
758function moduleAlign(){
759    if ( $('.module_ty').length < 1 ) return;
760
761    var $module_ty = $('.module_ty');
762    var option = {
763        initial: {
764            tbyRow: true,
765            remove: false
766        },
767        remove: {
768            remove: true
769        }
770    }
771    if (window.innerWidth < 601){
772        $module_ty.each(function() {
773            $(this).find('.md_tit').matchHeight(option.remove);
774            $(this).find('.md_tit02').matchHeight(option.remove);
775            $(this).find('.md_txt').matchHeight(option.remove);
776            $(this).find('.md_txt02').matchHeight(option.remove);
777        });
778    }else{
779        $module_ty.each(function() {
780            $(this).find('.md_tit').matchHeight(option.initial);
781            $(this).find('.md_tit02').matchHeight(option.initial);
782            $(this).find('.md_txt').matchHeight(option.initial);
783            $(this).find('.md_txt02').matchHeight(option.initial);
784        });
785    }
786}
787  
788/** like, share **/
789$(function(){
790    // 참고
791    // 1. $shareBox 여는 부분은 ion_common 또는 html 내부에 존재
792    // 2. 하단 md_pop_share, md_pop_share02, md_pop_share03 사용되는곳 없는것으로 추정됨
793    // 3. $shareBox.on("focusin") setTimeout 사용 이유: $shareBox 포커스 들어오는 시점이 각각 다름
794    var lang = $("html").attr("lang") || "en"; 
795    var $shareBox = $(".md_share_box");
796    var $shareDim = $(".md_share_dimd");   
797    var $shareCloseBtn = $(".md_btn_share_close");
798
799    /* 210412 | 접근성 | 대체텍스트 추가 */     
800    $shareBox.find("a").not($shareCloseBtn).attr("title", langSet[lang]["openWindow"]);    
801    $shareBox.find(".tit").text(langSet[lang].share.shareOpen).toString();
802    $shareCloseBtn.find("span").text(langSet[lang].share.shareClose).toString();   
803    /* //210412 | 접근성 | 대체텍스트 추가 */ 
804
805    var resizeTimer = new Timer(function(){                    
806        // mdShareClose(); 20250328 웹접근 삭제
807    }, 100);
808
809    // share dim
810    $shareDim.click(function(){
811        mdShareClose();
812        return false;
813    });
814
815    // share close
816    $shareCloseBtn.on({
817        "click": function(){
818            console.log("close btn click")
819            mdShareClose();
820            return false;
821        }
822    })
823
824    // 포커스 트랩 구현
825    $shareBox.on("keydown", function (e) {
826        // 웹접근성을 위한 버튼 리스트
827        var $shareBoxBtn = $shareBox.find('a:visible, button:visible');
828        var $share_firstBoxBtn = $shareBoxBtn.first();
829        var $share_lastBoxBtn = $shareBoxBtn.last();
830
831        if (e.keyCode === 9) { // Tab 키
832            if (e.shiftKey) { // Shift + Tab
833                if (document.activeElement === $share_firstBoxBtn[0]) {
834                    e.preventDefault();
835                    $share_lastBoxBtn.focus(); // 마지막 버튼으로 이동
836                }
837            } else { // Tab
838                if (document.activeElement === $share_lastBoxBtn[0]) {
839                    e.preventDefault();
840                    $share_firstBoxBtn.focus(); // 첫 번째 버튼으로 이동
841                }
842            }
843        }
844    });
845
846    $(window).on({
847        "resize" : function (){
848            resizeTimer.start();
849        },
850        "scroll": function(){
851            resizeTimer.start();
852        }
853    });
854});
855
856// 공유 팝업 열릴 때 포커스 설정
857function focusTrapOn(mdShareBTn) {
858    mdShareBTn.find('a:visible, button:visible').first().focus();
859}
860
861let lastActivatedButton = null; // 마지막으로 활성화된 버튼을 저장
862function focusTrapOff() {
863    if (lastActivatedButton) {
864        lastActivatedButton.focus(); // 마지막으로 활성화된 버튼에 포커스 복원
865    }
866}
867
868function md_pop_share(obj){
869    if($(obj).hasClass('on')){
870        $(obj).removeClass('on');
871        $('.md_share_area').removeClass('on').removeClass('off');
872        $('.md_btn_share').removeClass('on');
873    }else{        
874        var offsetPosition = $(obj).offset();
875        var w = ($(window).width() - $('#wrap').width()) * 0.5;
876        var x = offsetPosition.left + 30 - w;
877        var y = offsetPosition.top - 2;
878        var mdShareBTn = $('.md_share_area');
879        $('#md_share_area').addClass('on');
880        $('#md_share_area').css('left', x).css('top', y);
881        $('.md_btn_share').removeClass('on');
882        $(obj).addClass('on');
883
884        // 마지막으로 활성화된 버튼 저장
885        lastActivatedButton = $(obj);
886
887        // 포커스 트랩 활성화
888        focusTrapOn(mdShareBTn);
889    }
890    return false;
891}
892function md_pop_share02(obj){
893    if($(obj).hasClass('on')){
894        $(obj).removeClass('on');
895        $('.md_share_area').removeClass('on').removeClass('off');
896        $('.btn_md_share').removeClass('on');
897    }else{        
898        var offsetPosition = $(obj).offset();
899        var w = ($(window).width() - $('#wrap').width()) * 0.5;
900        var x = $(window).width() - offsetPosition.left + 10 - w;
901        var y = offsetPosition.top - 23;
902        var mdShareBTn = $('.md_share_area');
903        $('#md_share_area').addClass('on');
904        $('#md_share_area').css('right', x).css('top', y);
905        $('.btn_md_share').removeClass('on');
906        $(obj).addClass('on');
907
908        // 마지막으로 활성화된 버튼 저장
909        lastActivatedButton = $(obj);
910
911        // 포커스 트랩 활성화
912        focusTrapOn(mdShareBTn);
913    }
914    return false;
915}
916function md_pop_share03(obj){
917    if($(obj).hasClass('on')){
918        $(obj).removeClass('on');
919        $('.md_share_area').removeClass('on').removeClass('off');
920        $('.btn_md_share').removeClass('on');
921    }else{
922        var offsetPosition = $(obj).offset();
923        var x = offsetPosition.left + 160;
924        var y = offsetPosition.top - 0;
925        var mdShareBTn = $('.md_share_area');
926        $('#md_share_area').addClass('on');
927        $('#md_share_area').css('left', x).css('top', y);
928        $('.btn_md_share').removeClass('on');
929        $(obj).addClass('on');
930
931        // 마지막으로 활성화된 버튼 저장
932        lastActivatedButton = $(obj);
933
934        // 포커스 트랩 활성화
935        focusTrapOn(mdShareBTn);
936    }
937    return false;
938}
939
940function md_pop_share04(obj){
941    if($(obj).hasClass('on')){
942        $(obj).removeClass('on');
943        $('.md_share_area').removeClass('on').removeClass('off');
944    }else{
945        var offsetPosition = $(obj).offset();
946        var btnWidth = $(obj).outerWidth();
947        var btnHeight = $(obj).outerHeight();
948        var popupShare = $('.md_share_area');
949        var popupWidth = popupShare.outerWidth();
950        var parentMargin =  parseInt(popupShare.parent().css("margin-left"));
951		var x = offsetPosition.left + btnWidth - popupWidth - parentMargin;
952		var y = offsetPosition.top + btnHeight + 10;
953        var mdShareBTn = $('.md_share_area');
954        $('#md_share_area').addClass('on');
955        $('#md_share_area').css('left', x).css('top', y);
956        $('.md_btn_share').removeClass('on');
957        $(obj).addClass('on');
958
959        // 마지막으로 활성화된 버튼 저장
960        lastActivatedButton = $(obj);
961
962        // 포커스 트랩 활성화
963        focusTrapOn(mdShareBTn);
964    }
965    return false;
966}
967
968function mdShareClose(){
969    console.log("mdShareClose function")
970    var lang = $("html").attr("lang") || "en";
971    if(!$('.md_share_area').hasClass("on")) return;
972    if( $('.md_share_area').hasClass("off")) return;
973    $('.md_share_area').addClass('off');
974    $(".md_btn_share").find(".blind").text(langSet[lang].share.shareOpen).toString(); 
975    setTimeout(function(){
976        $('.md_btn_share.on').length && $('.md_btn_share.on').removeClass('on');
977        $('.btn_md_share.on').length && $('.btn_md_share.on').removeClass('on');
978        $('.share_btn.on').length && $('.share_btn.on').removeClass('on');
979        $('.add_share.on').length && $('.add_share.on').removeClass('on');
980        $('.post_share.on').length && $('.post_share.on').removeClass('on');
981    }, 0);
982    setTimeout(function(){
983        $('.md_share_area').removeClass('on').removeClass('off');
984    }, 250);
985    focusTrapOff();
986}
987  
988/** 접근성 **/
989$(function(){
990    /** Footer **/
991    var $footer = $("#footer");
992    var $lang = $('.etc_lang, .etc_toggle');
993    var $drop = $('.etc_drop');
994
995    function footerRez(){
996        if(!$lang.hasClass("on")) return;
997        $lang.removeClass('on');
998        $lang.find('.sub_menu').hide();
999    }
1000
1001    var footerRez_resizeTimer = new Timer(function(){
1002        footerRez();
1003    }, 100);
1004
1005    $(document).ready(function(){
1006        // footerEvent();
1007        footerRez();
1008    });
1009    $(window).resize(function(){
1010        footerRez_resizeTimer.start();
1011    });
1012});
1013
1014/* 페이지 내 스크롤 앵커 (btn_anchor) */
1015$(function(){
1016    $('.btn_anchor').click(function(e){
1017        e.preventDefault();
1018        var t = $(this).attr("href");
1019        if ( $(t).length ){
1020            $('html, body').stop().animate({
1021                scrollTop:$(t).offset().top - 50
1022            }, 800, function(){
1023                $(t).get(0).focus({preventScroll:false});
1024                $('html,body').scrollTop($(t).offset().top - 50);
1025            });
1026        }
1027    });
1028});
1029  
1030  
1031/* 상단 띠배너 */
1032function initTailBox(){
1033    if(!$('.tail_wrap').length) return;
1034    var tailResizeTImer = new Timer(function(){
1035        $('.tail_wrap:visible').closest('body').addClass('tail_chk');
1036    },100);
1037
1038    $(window).on('resize', function(){
1039        tailResizeTImer.start();
1040    });
1041
1042    $('.tail_wrap .btn_close').click(function(e){
1043        e.preventDefault();
1044        $('.tail_wrap').hide();
1045        $('body').removeClass('tail_chk');
1046        $('.M01_A_cont').trigger('initHeight');
1047        if (window['GNB']) GNB.setHeightRightContainer();
1048        if ( $('#seelater').is(':checked') ) {
1049            $.cookie('tailboxSeeLater', 'Y', { expires: 1, path: '/' });
1050        }
1051    });
1052    $('.tail_wrap:visible').closest('body').addClass('tail_chk');
1053    //$(window).scrollTop(0);
1054    if (window['GNB']) GNB.setSticky();
1055}
1056
1057/* M15_A | location hash | index class */
1058$(function(){
1059    if(!$(".M15_A").length) return;
1060    var M15_A_array;
1061    $("#container").each(function(){
1062        M15_A_array = $(this).find(".M15_A");
1063    });
1064    M15_A_array.map(function(key, value){
1065        if(!$(value).find(".tab_list .tab_btn").length) return;
1066        var contIdx = key + 1;
1067        $(value).find(".tab_list .tab_btn").each(function(index){
1068            var btnIdx = index + 1;
1069            var classKey = contIdx + "_" + btnIdx;
1070            $(this).addClass("tab_link_"+classKey);
1071        });
1072    });
1073});
1074
1075/* Lang Set *//* 210412 | 웹접근성 | 데이터 추가 */
1076// sample:
1077// var lang = $("html").attr("lang") || "en";
1078// langSet[lang]["slide"]["playStr"]
1079var langSet = {
1080    "ko": {
1081        "countryCode" : "kr",    
1082        "history" : {
1083            "activeStr":"최근방문기록 열기",
1084            "title" : "Visit History",
1085            "desc" : "최근방문한 페이지가 최대 30개 저장됩니다.",
1086            "clearall" : "전체삭제",
1087            "close" : "최근방문기록 닫기",
1088            "emptyHistory" : "방문한 이력이 없습니다."
1089        },
1090        "search" : {
1091            "activeStr":"검색창 열기",
1092            "placeholder" : "검색어를 입력하세요",
1093            "search" : "검색",
1094            "close" : "검색창 닫기",
1095            "clear" : "검색어 삭제"
1096        },
1097        "rnb" : {
1098            "activeStr":"전체메뉴 열기",
1099            "inactiveStr":"전체메뉴 닫기"
1100        },        
1101        "menuState":{
1102            "activeStr":"메뉴열기",
1103            "inactiveStr":"메뉴닫힘"
1104        },        
1105        "words":{
1106            "summary":"개요"
1107        },
1108        "slide":{
1109            "prevStr":"이전",
1110            "nextStr":"다음",
1111            "playStr": "재생",
1112            "pauseStr": "멈춤",
1113            "soundOn": "ON",
1114            "soundOff": "OFF",
1115            "selected": "현재위치"
1116        },
1117        "expanded":{
1118            "trueStr":"숨기기",
1119            "falseStr":"더보기",
1120            "trueStr_M08_B":"자료 숨기기",
1121            "falseStr_M08_B":"자료 더보기"
1122        },       
1123        "share" :{
1124            "share" : "공유하기",
1125            "shareOpen" : "공유하기 열기",
1126            "shareClose" : "공유하기 닫기"
1127        },
1128        "video" :{
1129            "play" : "동영상 보러가기"
1130        },
1131        "layerPop" :{
1132            "layerOpen" : "레이어 팝업 열림",
1133            "layerClose" : "레이어 팝업 닫힘",
1134            "VideoOpen" : "레이어 팝업에서 이 동영상 재생"
1135        },
1136        "calenderDate" :{
1137            "dateStart" : "시작일",
1138            "dateEnd" : "종료일",
1139        },
1140        "seeLater": "오늘 하루 보지 않기",
1141        "openWindow": "새창열림",
1142        "ReadMore": "자세히 보기",
1143        "downLoad": "다운로드"
1144    },
1145    "en":{
1146        "countryCode" : "en",        
1147        "history" : {
1148            "activeStr":"Open History",
1149            "title" : "Visit History",
1150            "desc" : "Up to 30 recently visited pages are logged.",
1151            "clearall" : "Clear All",
1152            "close" : "Close History",
1153            "emptyHistory" : "No Visit history."
1154        },
1155        "search" : {
1156            "activeStr":"Open search",
1157            "placeholder" : "Search",
1158            "search" : "Search",
1159            "close" : "Close Search",
1160            "clear" : "Clear"
1161        },
1162        "rnb" : {
1163            "activeStr":"Open Right Global Navigator",
1164            "inactiveStr":"Close Right Global Navigator"
1165        },
1166        "menuState":{
1167            "activeStr":"Open Menu",
1168            "inactiveStr":"Close Menu"
1169        },       
1170        "words":{
1171            "summary":"Summary"
1172        },
1173        "slide":{
1174            "prevStr":"Prev",
1175            "nextStr":"Next",
1176            "playStr": "Play",
1177            "pauseStr": "Stop",
1178            "soundOn": "ON",
1179            "soundOff": "OFF",
1180            "selected": "selected"
1181        },
1182        "expanded":{
1183            "trueStr":"Close",
1184            "falseStr":"See more",
1185            "trueStr_M08_B":"Close",
1186            "falseStr_M08_B":"See more"
1187        },        
1188        "share" :{
1189            "share" : "share",
1190            "shareOpen" : "Share Open",
1191            "shareClose" : "Share Close"
1192        },
1193        "video" :{
1194            "play" : "Play Video"
1195        },
1196        "layerPop" :{
1197            "layerOpen" : "Layer pop-up open",
1198            "layerClose" : "Layer pop-up Close",
1199            "VideoOpen" : "Play this video on the layer pop-up"
1200        },
1201        "calenderDate" :{
1202            "dateStart" : "START DATE",
1203            "dateEnd" : "END DATE",
1204        },
1205        "seeLater": "Check to not see again",
1206        "openWindow": "new window",
1207        "ReadMore": "Read More",
1208        "downLoad": "download"
1209    },
1210    "zh":{
1211        "countryCode" : "cn",
1212        "history" : {
1213            "activeStr":"打开",
1214            "title" : "Visit History",
1215            "desc" : "最多记录30个最近访问的页面。",
1216            "clearall" : "删除所有",
1217            "close" : "关闭",
1218            "emptyHistory" : "没有访问历史."
1219        },
1220        "search" : {
1221            "activeStr":"打开",
1222            "placeholder" : "搜索",
1223            "search" : "关键词搜索",
1224            "close" : "关闭",
1225            "clear" : "删除"
1226        },
1227        "rnb" : {
1228            "activeStr":"open right global navigator",
1229            "inactiveStr":"close right global navigator"
1230        },
1231        "menuState":{
1232            "activeStr":"打开",
1233            "inactiveStr":"关闭"
1234        },        
1235        "words":{
1236            "summary":"概括"
1237        },
1238        "slide":{
1239            "prevStr":"Prev",
1240            "nextStr":"Next",
1241            "playStr": "Play",
1242            "pauseStr": "Stop",
1243            "soundOn": "ON",
1244            "soundOff": "OFF"
1245        },
1246        "expanded":{
1247            "trueStr":"Close",
1248            "falseStr":"See more",
1249            "trueStr_M08_B":"Close",
1250            "falseStr_M08_B":"See more"
1251        },      
1252        "share" :{
1253            "share" : "share",
1254            "shareOpen" : "Share Open",
1255            "shareClose" : "Share Close"
1256        },
1257        "video" :{
1258            "play" : "Play Video"
1259        },
1260        "layerPop" :{
1261            "layerOpen" : "Layer pop-up open",
1262            "layerClose" : "Layer pop-up Close",
1263            "VideoOpen" : "Play this video on the layer pop-up"
1264        },
1265        "calenderDate" :{
1266            "dateStart" : "起始日期",
1267            "dateEnd" : "结束日期",
1268        },
1269        "seeLater": "Check to not see again",
1270        "openWindow": "new window",
1271        "ReadMore": "Read More",
1272        "downLoad": "download"
1273    },
1274    "pt":{
1275        "countryCode" : "pt",
1276        "history" : {
1277            "activeStr":"história aberta",
1278            "title" : "Visit History",
1279            "desc" : "Até 30 páginas visitadas recentemente são registradas.",
1280            "clearall" : "limpar tudo",
1281            "close" : "história próxima",
1282            "emptyHistory" : "sem histórico de visitas."
1283        },
1284        "search" : {
1285            "activeStr":"busca aberta",
1286            "placeholder" : "buscar",
1287            "search" : "buscar",
1288            "close" : "fechar busca",
1289            "clear" : "limpar"
1290        },
1291        "rnb" : {
1292            "activeStr":"open right global navigator",
1293            "inactiveStr":"close right global navigator"
1294        },
1295        "menuState":{
1296            "activeStr":"open Menu",
1297            "inactiveStr":"close Menu"
1298        },        
1299        "words":{
1300            "summary":"summary"
1301        },
1302        "slide":{
1303            "prevStr":"Prev",
1304            "nextStr":"Next",
1305            "playStr": "Play",
1306            "pauseStr": "Stop",
1307            "soundOn": "ON",
1308            "soundOff": "OFF"
1309        },
1310        "expanded":{
1311            "trueStr":"Close",
1312            "falseStr":"See more",
1313            "trueStr_M08_B":"Close",
1314            "falseStr_M08_B":"See more"
1315        },       
1316        "share" :{
1317            "shareOpen" : "Share Open",
1318            "shareClose" : "Share Close"
1319        },
1320        "video" :{
1321            "play" : "Play Video"
1322        },
1323        "layerPop" :{
1324            "layerOpen" : "Layer pop-up open",
1325            "layerClose" : "Layer pop-up Close",
1326            "VideoOpen" : "Play this video on the layer pop-up"
1327        },
1328        "calenderDate" :{
1329            "dateStart" : "DATA INICIO",
1330            "dateEnd" : "DATA FIM",
1331        },
1332        "seeLater": "Check to not see again",
1333        "openWindow": "Abrir uma nova",
1334        "ReadMore": "Read More",
1335        "downLoad": "download"
1336    }
1337}
1338/* Lang Set *//* 210412 | 웹접근성 | 데이터 추가 */
1339
1340function handleRnbScrollControl(e) {
1341    if ($('body').is('[class *= "rnb-active"]')) {
1342        let $otrOfrngRnb = null;
1343        let $inerOfrngRnb = null;
1344        let $scrlEl = null;
1345
1346        const $rnb = $('.rnb');
1347        const $firstMenuItem = $rnb.find('li');
1348        const $firstMenuItemActive = $firstMenuItem.filter('.on');
1349        // const $secondMenu = $firstMenuItemActive.find('.depth-sub .scroll-wrapper.depth2');
1350        const $secondMenu = $firstMenuItemActive.find('.depth-sub .scroll-wrapper');
1351        const $secondMenuItem = $secondMenu.find('ul.depth2 > li');
1352 
1353        if ($('body').hasClass('rnb-active-second')) {
1354			// 오른쪽 메뉴
1355            if ($firstMenuItemActive.find('.renewal_offering_rnb').length > 0) {
1356				// 신규 스타일 메뉴
1357                $otrOfrngRnb = $firstMenuItemActive.find('.renewal_offering_rnb').outerHeight();
1358                $inerOfrngRnb = $firstMenuItemActive.find('.renewal_offering_rnb .inner_offering_rnb').outerHeight();
1359                $scrlEl = $firstMenuItemActive.find('.renewal_offering_rnb .scroll-element.scroll-y .scroll-bar');
1360            } else {
1361                // 기존 스타일 메뉴
1362                let title_height = $secondMenu.find('.md_tit').length > 0 ? $secondMenu.find('.md_tit').toArray().map((currentValue) => $(currentValue).outerHeight(true)).reduce((accumulator, currentValue) => accumulator + currentValue) : null;
1363                $otrOfrngRnb = $secondMenu.outerHeight();
1364                $inerOfrngRnb = $secondMenuItem.toArray().map((currentValue) => $(currentValue).outerHeight(true)).reduce((accumulator, currentValue) => accumulator + currentValue) + title_height; // 배열의 높이 + (.md_title이 있을경우) 총 합한값
1365                $scrlEl = $secondMenu.find('.scroll-element.scroll-y .scroll-bar');
1366            }
1367        } else {
1368            // 왼쪽 메뉴
1369            $otrOfrngRnb = $rnb.find('.depth-main > .scroll-wrapper > .scroll-content').outerHeight();
1370            $inerOfrngRnb = $rnb.find('.depth-main ul.depth1_ul').outerHeight() * $rnb.find('.depth-main ul.depth1_ul').length;
1371            $scrlEl = $rnb.find('.depth-main > .scroll-wrapper > .scroll-element.scroll-y .scroll-bar');
1372        }
1373 
1374        if (e.originalEvent.wheelDelta > 0 || e.originalEvent.detail < 0) {
1375            if ($scrlEl.css('top') === 'auto' || parseInt($scrlEl.css('top')) <= 0) {
1376                // 플러그인 스크롤바는 더 이상 위로 이동할 수 없는 상태입니다.
1377                e.preventDefault();
1378                return false;
1379            }
1380        } else {
1381            if ($scrlEl.css('top') === 'auto' || parseInt($scrlEl.css('top')) >= $inerOfrngRnb - $otrOfrngRnb - 0) {
1382                // 플러그인 스크롤바는 더 이상 아래로 이동할 수 없는 상태입니다.
1383                e.preventDefault();
1384                return false;
1385            }
1386        }
1387    } else {
1388        e.preventDefault();
1389        return false;
1390    }
1391}
1392
1393$(function () {
1394	// gnb.html이 준비됐을 때 각 영역의 첫 번째 메뉴를 활성화
1395	let _checkElement = setInterval(() => {
1396		let $wrapper = $('.renewal_offering');
1397
1398		if ($wrapper.length) {
1399			clearInterval(_checkElement);
1400			$wrapper.each(function (index, element) {
1401				let $group = $(element).find('[class *= "group_offering"]');
1402				let $depth1 = $group.filter('[data-offering-depth = "1"]').find('.item_offering_depth1');
1403				let $depth2 = $group.filter('[data-offering-depth = "2"]').find('.inner_offering_depth2');
1404                /* 20231030 삭제 */
1405				// $depth1.eq(0).addClass('current');
1406				// $depth2.eq(0).addClass('active');
1407			});
1408		}
1409	}, 40);
1410	
1411	let rnbActive = null;
1412	$(document).on('mouseenter', '.rnb .depth-main .depth1_ul .dep1, .rnb .renewal_offering_rnb, .rnb .depth-sub', function (event) {
1413		if (!rnbActive) rnbActive = /renewal_offering_rnb|depth-sub/.test(event.currentTarget.className) ? 'rnb-active-second' : 'rnb-active';
1414		if ($('.rnb').has(event.currentTarget).length) $('body').addClass(rnbActive);
1415	}).on('mouseleave', '.rnb .depth-main .depth1_ul .dep1, .rnb .renewal_offering_rnb, .rnb .depth-sub', function () {
1416		$('body').removeClass(rnbActive);
1417
1418		rnbActive = null;
1419	});
1420
1421
1422
1423    /** 20240723 메인 스크립트 추가 */
1424    let mainBx = $(".sds-wrap, .sub-wrap");
1425
1426    /** ----------------------- 공통 ----------------------- */
1427    /** common-ani-bx box 컨텐츠 애니메이션 효과 */
1428    function createInShow() {
1429        $(".common-ani-bx").each(function () {
1430            let bx = $(this);
1431            gsap.timeline({
1432                scrollTrigger: {
1433                    trigger: bx,
1434                    start: "150 bottom",
1435                    end: "150 bottom",
1436                    once: true,
1437                    scrub: true,
1438                    onEnter: function () {
1439                        let aniItems = bx.find(".common-ani-item");
1440
1441                        aniItems.each(function ($index) {
1442                            gsap.fromTo($(this),
1443                                {opacity: 0, y: 50},
1444                                {opacity: 1, y: 0, duration: 0.75, ease: Cubic.easeOut, delay: 0.1 * $index}
1445                            )
1446                        });
1447                    }
1448                }
1449            })
1450        })
1451    }
1452
1453    if(mainBx.length) {
1454        createInShow(); //공통 : 텍스트 애니메이션 효과
1455    }
1456    /** //20240723 메인 스크립트 추가 */
1457});
1458
1459function mainSlideDot_countCheck(module, moduleEl){
1460    $(window).on("resize.mainSlideDot_countCheck", function(){
1461        if(moduleEl.find('li').length > 11) {
1462            moduleEl.parent().addClass("dotMax_11")
1463        } else {
1464            moduleEl.parent().removeClass("dotMax_11")
1465            }
1466    });
1467    $(window).trigger('resize.mainSlideDot_countCheck');
1468}
1469
1470const slide = {
1471    setSlideItemAttr ( module, data ) {
1472        const { carousel, slides, activeSlides } = data;
1473
1474        carousel.removeAttr("tabindex");
1475        Array.from(slides).forEach( a => {
1476            $(a).removeAttr("tabindex aria-hidden");
1477            $(a).find('a, button').attr({"tabindex": -1, "aria-hidden": true});
1478        });
1479        Array.from(activeSlides).forEach( a => {
1480            $(a).find('a, button').removeAttr("tabindex aria-hidden");
1481        })
1482    },
1483    setTabSlideAttr ( module, data ) {
1484        const { carousel, type, key, tablist, tablists, tabpanel, tabpanels, activeIdx, clonePanelActiveIdx } = data;
1485        const { setting, orientation } = type;
1486
1487        const activePanelIndex = clonePanelActiveIdx || activeIdx;   // clonePanelActiveIdx 값 여부에 따라 탭 패널의 active index 변경
1488
1489        if( setting ) {
1490            $(tablist).attr({"role": "tablist"});
1491            $(tablist).find("li").attr({"role": "presentation"});
1492
1493            Array.from(tablists).forEach((a, i) => {
1494                $(a).attr({
1495                    "id": `tab_btn_${key}`,
1496                    "role": "tab",
1497                    "aria-controls": `tab_panel_${key}`,
1498                    "aria-selected": false,
1499                    "aria-hidden": true,
1500                    "tabindex": -1,
1501                })
1502            });
1503
1504            Array.from(tabpanels).forEach((a, i) => {
1505                $(a).attr({
1506                    "id": `tab_panel_${key}`,
1507                    "role": "tabpanel",
1508                    "aria-labelledby": `tab_btn_${key}`,
1509                    "aria-hidden": true,
1510                    "tabindex": -1,
1511                });
1512                $(a).find("a, button").attr({"aria-hidden": true, "tabindex" : -1})
1513            });
1514        }
1515
1516        // orientation
1517        $(tablist).attr({"aria-orientation": orientation });
1518        
1519        $(tablists)
1520            .removeClass("active")
1521            .attr({"aria-hidden": true, "tabindex" : -1})
1522            .attr({"aria-selected": false})
1523
1524        $(tablists).eq(activeIdx)
1525            .addClass("active")
1526            .removeAttr("aria-hidden tabindex")
1527            .attr({"aria-selected": true})
1528        
1529        $(tabpanels)
1530            .removeClass("active")
1531            .attr({"aria-hidden": true, "tabindex" : -1})
1532            .find("a, button").attr({"aria-hidden": true, "tabindex" : -1})
1533
1534        $(tabpanels).eq(activePanelIndex)
1535            .addClass("active")
1536            .removeAttr("aria-hidden tabindex")
1537            .find("a, button").removeAttr("aria-hidden tabindex")
1538    },
1539    setPagn ( module, data ) {
1540        const { carousel, slides, activeIdx, element, clone: getClone } = data;
1541        const { st, ed, bar } = element;
1542        let clone = getClone || 0;
1543
1544        let edNum = slides / (clone + 1);
1545        let stNum = activeIdx % edNum + 1;
1546        let barNum = ( 100 / edNum ) * stNum;
1547
1548        st.text(String(stNum).padStart(2, 0));
1549        ed.text(String(edNum).padStart(2, 0));
1550        bar.css("width", `${barNum}%`);
1551    },
1552    setControlAttr ( module, data ) {
1553        const { carousel, option, changeFocus, element } = data;
1554        const { wrap, playBtn, stopBtn } = element;
1555
1556        switch(option){
1557            case "PLAY":
1558                $(wrap).removeClass("on");
1559                $(playBtn).attr({"aria-hidden": true, "tabindex": -1});
1560                $(stopBtn).removeAttr("aria-hidden tabindex")
1561                if(changeFocus) $(stopBtn).focus();
1562                break;
1563            case "STOP":
1564                $(wrap).addClass("on");
1565                $(stopBtn).attr({"aria-hidden": true, "tabindex": -1});
1566                $(playBtn).removeAttr("aria-hidden tabindex")
1567                if(changeFocus) $(playBtn).focus();
1568                break;
1569            default:
1570        }
1571    },
1572    setSelectedPagn ( module, data ) {
1573        const lang = $("html").attr("lang") || "en";
1574        const { carousel, items, activeIdx, element } = data;
1575        const { wrap } = element;
1576
1577        $(items).removeAttr("aria-selected title class").removeClass("selected");
1578        $(items).eq(activeIdx).attr({ "aria-selected": true, "title": langSet[lang].slide.selected }).addClass("selected");
1579    },
1580    setTabDragEvent( module, data ) {
1581        const { element } = data;
1582
1583        const slider = element;
1584        let isDown = false;
1585        let startX;
1586        let scrollLeft;
1587      
1588        slider.addEventListener('mousedown', e => {
1589          isDown = true;
1590          slider.classList.add('drag');
1591          startX = e.pageX - slider.offsetLeft;
1592          scrollLeft = slider.scrollLeft;
1593        });
1594      
1595        slider.addEventListener('mouseleave', () => {
1596          isDown = false;
1597          slider.classList.remove('drag');
1598        });
1599      
1600        slider.addEventListener('mouseup', () => {
1601          isDown = false;
1602          slider.classList.remove('drag');
1603        });
1604      
1605        slider.addEventListener('mousemove', e => {
1606          if (!isDown) return; 
1607          e.preventDefault();
1608          const x = e.pageX - slider.offsetLeft;
1609          const walk = x - startX;
1610          slider.scrollLeft = scrollLeft - walk;
1611        });
1612    },
1613    setTabScroll( module, data ) {
1614        const { tabSlideArea, tab, tabItems, activeIdx } = data;
1615        if(isNaN(activeIdx)) return;
1616
1617        const tabSlideAreaW = tabSlideArea.width();
1618
1619        const a = $(tabItems[activeIdx]);
1620        const li = a.parent();
1621
1622        tab.css({ "position" : "relative" });
1623        li.css({ "position": "initial" });
1624
1625        const aLeft = a.position().left;
1626        const aW = a.innerWidth();
1627
1628        tab.css({ "position" : "" });
1629        li.css({ "position": "" });
1630
1631        const scrollLeft = Math.round(aLeft - (tabSlideAreaW / 2) + (aW / 2) );
1632        tabSlideArea.stop().animate({ scrollLeft: scrollLeft });
1633    }
1634}
1635
1636function mobileSliderCtrl(){
1637
1638    const cmCtrl = document.querySelectorAll('.common-control');
1639    const bodyWidth = document.querySelector('body').clientWidth - 40;
1640    let gapWidth = '';
1641    if(bodyWidth > 768){
1642        gapWidth = 12
1643    } else {
1644        gapWidth = 7 
1645    }
1646     
1647        if(bodyWidth <= 1023){
1648
1649            cmCtrl.forEach(function(el){
1650                const parent = el.parentNode;
1651                const playEl = el.querySelector('.common-play--bx');
1652                const el_li = parent.querySelectorAll('.common-list__control-btns ul li');
1653                const totalMargin = (el_li.length - 1) * gapWidth
1654                const autoBoxw = bodyWidth < 1023 ? (bodyWidth > 600 ? 52 : 43) : 0
1655                const width = (bodyWidth - totalMargin - (playEl ? autoBoxw : 0 )) / el_li.length; 
1656                // const flexBasis = (100 / gapWidth) / el_li.length; 
1657                if(playEl){
1658                    parent.classList.add('auto-ctrl')
1659                }
1660                el_li.forEach(function(li) {
1661                    li.style.cssText = `width: ${width}px;`;
1662                });
1663    
1664            
1665            })
1666        } 
1667}
1668
1669function checkCommonList(_plugin) {
1670    const $listText = $('.list_up');
1671    const $listContainer = $('.list_container');
1672
1673    if ($listText.length === 0 || $listContainer.length === 0) {
1674        if ($listText.length === 0 && $listContainer.length !== 0) {
1675            console.warn('list_t 요소가 없습니다.');
1676        }
1677        if ($listContainer.length === 0 && $listText.length !== 0) {
1678            console.warn('list_container 요소가 없습니다.');
1679        }
1680        return;
1681    }
1682
1683    $listText.each(function(index) {
1684        const $element = $(this);
1685        const text = $element.attr('data-tit') ? $element.attr('data-tit') : $element.text();
1686        const $link = $('<a href="javascript:;" class="auto_list"></a>').text(text);
1687
1688        const classList = $element.attr('class') ? $element.attr('class').split(' ') : [];
1689        
1690        // depth_숫자 형태의 class 필터링 후 적용
1691        const depthClass = classList.filter(cls => /^depth_\d+$/.test(cls)).join(' ');
1692
1693        if (depthClass) {
1694            $link.addClass(depthClass);
1695        }
1696        
1697        $link.on('click', function() {
1698            const $targetElement = $listText.eq(index);
1699
1700            if ($targetElement.length) {
1701                $('html, body').animate({
1702                    scrollTop: $targetElement.offset().top - 80
1703                }, 500);
1704            } else {
1705                console.warn('대상 요소를 찾을 수 없습니다: 인덱스: ' + index);
1706            }
1707        });
1708
1709        $listContainer.append($link);
1710    });
1711}
1712
1713
1714    // --- jQuery Swiper 래퍼 함수 추가 ---
1715(function($){
1716    $.fn.swiperControl = function(action) {
1717        return this.each(function() {
1718        const swiper = $(this).data('swiperInstance');
1719        if (!swiper) {
1720            console.warn('Swiper instance not found on this element.');
1721            return;
1722        }
1723
1724        switch(action) {
1725            case 'slidePrev':
1726            swiper.slidePrev();
1727            break;
1728            case 'slideNext':
1729            swiper.slideNext();
1730            break;
1731            case 'slideTo':
1732            const index = arguments[1];
1733            if (typeof index === 'number') {
1734                swiper.slideTo(index);
1735            } else {
1736                console.warn('slideTo requires an index number as second argument.');
1737            }
1738            break;
1739            default:
1740            console.warn('Unknown swiper action:', action);
1741        }
1742        });
1743    };
1744})(jQuery);
1745    // --- 래퍼 함수 끝 ---
1746
1747// 전역 또는 모듈 스코프 변수로 핸들러 저장
1748let keyboardHandlers = {
1749    swiperKeydown: null,
1750    buttonWrapperKeydown: null,
1751    slideChangeHandler: null,
1752};
1753
1754function setupKeyboardSlideNavigation({
1755    swiperInstance,
1756    $swiperContainer,
1757    $buttonWrapper,
1758    $buttons,
1759    slideSpeed,
1760    onIndexChange
1761}) {
1762    if (!swiperInstance) return;
1763
1764    let flag = false;
1765    let fromBtn = false;
1766
1767    // 1) 슬라이더 영역 키보드 이벤트 (좌우 방향키)
1768    keyboardHandlers.swiperKeydown = function(e) {
1769        flag = false;
1770        fromBtn = false;
1771
1772        if(!swiperInstance.destroyed){
1773            if(e.keyCode === 37){ // 왼쪽키
1774                flag = true;
1775                swiperInstance.slidePrev();
1776            } else if(e.keyCode === 39) { // 오른쪽키
1777                flag = true;
1778                swiperInstance.slideNext();
1779            }
1780        }
1781        if (flag) {
1782            e.preventDefault();
1783            e.stopPropagation();
1784        }
1785    };
1786    $swiperContainer.on("keydown", keyboardHandlers.swiperKeydown);
1787
1788    // 2) 버튼 래퍼 내 키보드 이벤트 (좌우 방향키)
1789    keyboardHandlers.buttonWrapperKeydown = function(e) {
1790        flag = false;
1791        fromBtn = false;
1792
1793        if(!swiperInstance.destroyed){
1794            if(e.keyCode === 37){
1795                flag = true;
1796                fromBtn = true;
1797                swiperInstance.slidePrev();
1798
1799                setTimeout(() => {
1800                    let idx = swiperInstance.realIndex;
1801                    if (typeof onIndexChange === "function") onIndexChange(idx);
1802                    $buttons.eq(idx).focus();
1803                }, slideSpeed + 1);
1804
1805            } else if(e.keyCode === 39) {
1806                flag = true;
1807                fromBtn = true;
1808                swiperInstance.slideNext();
1809
1810                setTimeout(() => {
1811                    let idx = swiperInstance.realIndex;
1812                    if (typeof onIndexChange === "function") onIndexChange(idx);
1813                    $buttons.eq(idx).focus();
1814                }, slideSpeed + 1);
1815            }
1816        }
1817
1818        if (flag) {
1819            e.preventDefault();
1820            e.stopPropagation();
1821        }
1822    };
1823    $buttonWrapper.on("keydown", keyboardHandlers.buttonWrapperKeydown);
1824
1825    // 3) 슬라이드 변경 완료 시점에 포커스 이동 및 tabindex 조정
1826    keyboardHandlers.slideChangeHandler = () => {
1827        setTimeout(() => {
1828            const $slides = $swiperContainer.find('.swiper-slide');
1829            const $activeSlide = $slides.filter('.swiper-slide-active').first();
1830
1831            $slides.each(function () {
1832                const $slide = $(this);
1833                const isActive = $slide.hasClass('swiper-slide-active');
1834                $slide.find('a, button').each(function () {
1835                    this.tabIndex = isActive ? 0 : -1;
1836                });
1837            });
1838
1839            if (!flag || fromBtn) {
1840                flag = false;
1841                fromBtn = false;
1842                return;
1843            }
1844
1845            if ($activeSlide.length) {
1846                const $focusable = $activeSlide.find('a, button').filter(':visible').first();
1847                if ($focusable.length) {
1848                    $focusable.focus();
1849                } else {
1850                    console.warn('key event - 슬라이드에 포커스 가능한 요소 없음');
1851                }
1852            } else {
1853                console.warn('key event - 슬라이드를 찾지 못함');
1854            }
1855
1856            flag = false;
1857            fromBtn = false;
1858        }, 10);
1859    };
1860    swiperInstance.on('slideChangeTransitionEnd', keyboardHandlers.slideChangeHandler);
1861}
1862
1863// 메인 임시 띠배너
1864$(function() {
1865  const $banner = $('.g_ticker_banner');
1866  if (!$banner.length) return; // 메인 페이지가 아니면 실행 종료
1867
1868  $(window).on('scroll', function() {
1869    const isScrollDown = $('body').hasClass('sc_down');
1870    $banner.css('top', isScrollDown ? '0px' : '60px');
1871  });
1872
1873  $('.ticker_close_btn').on('click', function() {
1874    $banner.hide();
1875  });
1876});

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.