<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">// Event UI System
var EUI = window.EUI || (function($){   
    var $win = $(window);
    var $html = $('html, body');

    return {
        init: function(){
            EUI.baseUI();
            EUI.lectOverView();
            EUI.lecTabUI();
        },
        lecTabUI: function(){
            var lecTabUI = $('.evSection .lectureTab')
            if(lecTabUI.length){
                $('.evSection .lectureTab .gubn_list li').click(function() {
                    var lecTabID = $(this).index();
                    
                    // 수정 코드
                    $(this).closest('.gubn_list').find('li.on').removeClass('on');
                    $(this).addClass('on');
                    $(this).closest('.lectureTab').find('.lecCon_wrap &gt; li.on').removeClass('on');
                    $(this).closest('.lectureTab').find('.lecCon_wrap &gt; li').eq(lecTabID).addClass('on');

                    // 기존 코드
                    // $('.evSection .lectureTab .gubn_list li.on').removeClass('on');
                    // $('.evSection .lectureTab .lecCon_wrap &gt; li.on').removeClass('on');
                    // $('.evSection .lectureTab .lecCon_wrap &gt; li').eq(lecTabID).addClass('on');
                });
            }
        },
        lectOverView: function(){
            var evSect = $('.evSection');

            if(evSect.length){
                evSect.each(function(){
                    var $this = $(this);
                    var $findLect = $this.find('.lecture');
                    
                    if($findLect.length){
                        $this.addClass('overview'); 
                    }
                })
            }
        },
        baseUI: function(){
            var tabUI = $('.tab_base');
            var panelUI = $('.panel_base');
            var popupUI = $('.popup-wrap');
            var toggleWarningUI = $('.evtoggleWarning');
            var giftListUI = $('.gift_list_wrap');
            var particleUI = $('.obj_cover .partc_obj');

            if (tabUI.length) {
                tabUI.each(function(){
                    var target = $(this).find('li.on').find('a').attr('href');
                    $(target).show();
                });
                tabUI.find('a').on('click', function(e){
                    e.preventDefault();
                    var disabledTab = $(this).closest('.tab_base').data('disabledTab');
                    var disabledMsg = $(this).closest('.tab_base').data('disabledMsg');
                    if (disabledTab) {
                        var activeIndex = disabledTab.indexOf($(this).closest('li').index() + 1);
                        if (activeIndex &gt; -1) {
                            return alert(disabledMsg[activeIndex]);
                        }
                    }
                    var target = $(this).attr('href');
                    $(this).closest('li').addClass('on');
                    $(this).closest('li').siblings().removeClass('on');
                    $(target).show();
                    $(target).siblings().hide();
                });
            }

            if (panelUI.length) {
                panelUI.each(function(){
                    var $this = $(this);
                    if ($this.hasClass('w_slide')) {
                        setTimeout(function(){
                            $this.children('li, div').hide();
                            $this.children('li, div').eq($this.prev('.tab_base').children('li.on').index()).show();
                            $this.addClass('active');
                        }, 250);
                    }
                });
                
            }

            if (popupUI.length) {
                $('.popup-wrap .btn_close, .popup-dimm').on('click', function(e){
                    e.preventDefault();
                    var $class = $(this).attr('class');
                    if ($class === 'btn_close') { 
                        if ($(this).closest('.popup-wrap').data('dimmclick') !== false) {
                            EUI.closePopup();
                        }
                    } else if ($class === 'popup-dimm') {
                        if ($(this).next('.popup-wrap').data('dimmclick') !== false) {
                            EUI.closePopup();
                        }
                    }
                });
            }

            if (toggleWarningUI.length) {
                toggleWarningUI.each(function(){
                    var $this = $(this);
                    $this.find('.w_tit').on('click', function(){
                        $this.find('.warningList').stop().slideToggle()
                        $this.toggleClass('on');
                    })
                })
            }
            
            if (giftListUI.length) {
                giftListUI.each(function(){
                    var liCount = $(this).children('li').length;
                    if (liCount == 4) {
                        $(this).addClass('col4');
                    }
                    if (liCount % 2 == 0) {
                        $(this).addClass('even');
                    }
                });
            }

            if (particleUI.length) {
                particleUI.each(function(){
                    $(this).closest('.obj_cover').prev().addClass('obj_front');
                })
            }
        },
        followQuick: function(target, offset, type){
            var $evWrap = $('#eventWrap');            
            var $quick = $('.flt_inner');
            var activeQuick = false;

            var position = null;
            if (type === 1 || type === undefined) {
                position = $(target).offset().top;
            }
            if (type === 2) {
                position = $(target).offset().top + offset
            }
            
            
            if (offset !== undefined) {
                $quick.css({
                    opacity: 1,
                    top: offset,
                });
                $win.on('scroll', function(){
                    if (offset &gt;= $win.scrollTop() &amp;&amp; !activeQuick) {
                        activeQuick = true;
                        $quick.stop().css("top", offset);
                    }
                    if (position &lt; $win.scrollTop()) {
                        activeQuick = false;
                        if (type === 2) {
                            $quick.stop().animate({
                                top: $win.scrollTop() - $evWrap.offset().top + 100
                            }, 400);
                        } else {
                            $quick.stop().animate({
                                top: $win.scrollTop() - $evWrap.offset().top + offset + 10
                            }, 400);
                        }
                    }
                });    
            } else {
                $quick.css({
                    opacity: 1,
                    top: position - 150,
                });
                $win.on('scroll', function(){
                    // console.log('scroll 2')

                    position = $(target).offset().top;
                    if (position &gt;= $win.scrollTop() &amp;&amp; !activeQuick) {
                        activeQuick = true;
                        $quick.css("top", position - 150);
                    } 
                    if (position &lt; $win.scrollTop()) {
                        activeQuick = false;
                        $quick.stop().animate({
                            top: $win.scrollTop() - $evWrap.offset().top + 100
                        }, 400);
                    }
                });    
            }
        },
        moveQuick: function(target, top) {
            var calTop = top ? $(target).offset().top + top : $(target).offset().top
            $html.animate({ scrollTop: calTop }, 400);
        },
        slickUI: function(obj) {
            var defaultOption = {
                speed: 200,
                touchThreshold: 100,
                slidesToScroll: 1,
                dots: false,
                arrows: false,
                slidesToShow: obj.num || 1,
                autoplaySpeed: 3000,
                autoplay: true,
                infinite: true,
            };
            var customOption = {};
            
            if (obj.mode === 'vertical') {
                customOption = {
                    vertical: true,
                    verticalSwiping: true,
                    centerMode: true,
                    rows: 0,
                }
            } else if (obj.mode === 'tab') {
                var slideCount = $(obj.target).children('div').length;
                var randomStart = Math.floor(Math.random() * slideCount);
                customOption = {
                    initialSlide: obj.random ? randomStart : obj.initialSlide || 0,
                    autoplay: false,
                    fade: true,
                    dots: true,
                }
            } else if (obj.mode === 'horizon') {
                customOption = {
                    dots: true,
                    arrows: true,
                    autoplay: true,
                }
                var isAuto = obj.auto ? obj.auto : false
                if (obj.type === 2) {
                    customOption = {
                        dots: false,
                        arrows: false,
                        autoplay: isAuto,
                        infinite: false,
                        responsive: [
                            {
                                breakpoint: 768,
                                settings: {
                                    slidesToShow: 2,
                                }
                            }
                        ]
                    }
                }
                if (obj.type === 3) {
                    customOption = {
                        dots: false,
                        arrows: true,
                        autoplay: isAuto,
                        adaptiveHeight: true,
                    }
                }
            }
            var getOption = Object.assign(defaultOption, customOption);
            return $(obj.target).slick(getOption);
        },
        openPopup: function(target, absolute, callback) {
            var $popup = $('.popup-wrap' + target);
            if ($popup.data('width')) {
                $popup.css('width', $popup.data('width') + 'px');
            }
            if (!$popup.hasClass('wide') &amp;&amp; absolute) {
                $popup.addClass('abs');
                $popup.css('top', $win.scrollTop() + ($popup.outerHeight() / 4) - $('#mo_globalMenu').outerHeight());
            }
            $('.popup-wrap' + target).fadeIn();
            $('.popup-wrap' + target).prev('.popup-dimm').fadeIn();
            if (typeof callback === 'function') {
                callback();
            }
        },
        closePopup: function(target, callback) {
            if (target) {
                $('.popup-wrap' + target +', .popup-dimm').hide();
            } else {
                $('.popup-wrap, .popup-dimm').hide();
            }
            if (typeof callback === 'function') {
                callback();
            }
        },
        createYoutubePopup: function(target, code, cookieName, autoplay) {
            var baseUrl = 'https://www.youtube.com/embed/';
            var $iframe = $(target).find('iframe');
            if (autoplay === false) {
                $iframe.attr("src", baseUrl + code + "?autoplay=0");
            } else {
                $iframe.attr("src", baseUrl + code + "?autoplay=1&amp;mute=1");
            }
            $(target).find('button.btn_x').on('click', function(){
                $(target + ', .popup-dimm').hide();
                $iframe.attr("src", baseUrl + code + "?autoplay=0");
            });
            $(target).find('button.btn_today').on('click', function(){
                setCookie(cookieName, "close", 1);
                if ($(target).css("display") == "block") {
                    $(target + ", .popup-dimm").hide();
                    $iframe.attr("src", baseUrl + code + "?autoplay=0");
                }
            });
        },
        toggleAnimation: function(obj) {
            !function toggleOn() {
                setTimeout(function(){
                    $(obj.selector).addClass('on');
                    setTimeout(function(){
                        $(obj.selector).removeClass('on');
                        toggleOn();
                    }, obj.speed);
                }, obj.speed);
            }();
        }
    }
}(jQuery));

// Run Script (Event UI System)
$(function(){
    EUI.init();
});

// Add $ Prototype
$.urlParam = function(name){
    var results = new RegExp('[\?&amp;]' + name + '=([^&amp;#]*)').exec(window.location.href);
    if (results == null){
      return null;
    } else {
        return decodeURI(results[1]) || 0;
    }
}

var triggerMoveByHash = function(delay){
    var hash = window.location.hash;
	if (hash &amp;&amp; $(hash).length) {
		setTimeout(function(){
			window.scrollTo(0, $(hash).offset().top)
		}, delay)
	}
}

var initRandomTab = function($tab, $panel) {
    var tlength = $($tab + ' &gt; li').length;
    var tInterval = null;
    var tRandom =  Math.ceil(Math.random() * tlength);
    var tCurrent = tRandom || 1;
    var tFlag = false;

    function activeTab(index) {
        $($tab + ' &gt; li').eq(index - 1).siblings().removeClass('on');
        $($tab + ' &gt; li').eq(index - 1).addClass('on');
        $($($tab + ' &gt; li').eq(index - 1).find('a').attr('href')).show();
        $($($tab + ' &gt; li').eq(index - 1).find('a').attr('href')).siblings().hide();
        $($panel + ' &gt; li').eq(index).css('display', 'none');
    }

    function intervalTab(speed) {
        tInterval = setInterval(function() {
            if (tCurrent &lt; tlength) {
                tCurrent++;
            } else {
                tCurrent = 1;
            }
            activeTab(tCurrent);
        }, speed);
    }

    setTimeout(function() {
        activeTab(tRandom);
    }, 250);

    intervalTab(3000);

    $($tab + ' &gt; li').on('click', function() {
        tFlag = true;
    });
    
    $($panel + ' &gt; li').on('click', function() {
        tFlag = true;
    });

    $($tab + ' &gt; li').on('mouseenter', function() {
        clearInterval(tInterval);
    });

    $($tab + ' &gt; li').on('mouseleave', function() {
        if (!tFlag) {
            intervalTab(3000);
        }
    });

    $($panel + ' &gt; li').on('mouseenter', function() {
        clearInterval(tInterval);
    });

    $($panel + ' &gt; li').on('mouseleave', function() {
        if (!tFlag) {
            intervalTab(3000);
        }
    });
}

var initRandomTabEffect = function($tab, $panel, $autoMove, $firstMove, $clickMove) {
    var tlength = $($tab + ' &gt; li').length;
    var tInterval = null;
    var tRandom =  Math.ceil(Math.random() * tlength);
    var tCurrent = tRandom || 1;
    var tFlag = false;

    function activeTab(index) {
        $($tab + ' &gt; li').eq(index - 1).siblings().removeClass('on');
        $($tab + ' &gt; li').eq(index - 1).addClass('on');
        $($($tab + ' &gt; li').eq(index - 1).find('a').attr('href')).show();
        $($($tab + ' &gt; li').eq(index - 1).find('a').attr('href')).siblings().hide();
        $($panel + ' &gt; li').eq(index).css('display', 'none');
    }

    function intervalTab(speed) {
        tInterval = setInterval(function() {
            if (tCurrent &lt; tlength) {
                tCurrent++;
            } else {
                tCurrent = 1;
            }
            activeTab(tCurrent);
            $autoMove(tCurrent); // initRandomTab에서 바뀐 부분
        }, speed);
    }

    setTimeout(function() {
        activeTab(tRandom);
        if (typeof $firstMove == 'function') {
            $firstMove(tRandom); // initRandomTab에서 바뀐 부분
        }
    }, 250);

    intervalTab(3000);

    $($tab + ' &gt; li').on('click', function() {
        tFlag = true;
        if (typeof $clickMove == 'function') {
            $clickMove($(this).index()); // initRandomTab에서 바뀐 부분
        }
    });
    
    $($panel + ' &gt; li').on('click', function() {
        tFlag = true;
    });

    $($tab + ' &gt; li').on('mouseenter', function() {
        clearInterval(tInterval);
    });

    $($tab + ' &gt; li').on('mouseleave', function() {
        if (!tFlag) {
            intervalTab(3000);
        }
    });

    $($panel + ' &gt; li').on('mouseenter', function() {
        clearInterval(tInterval);
    });

    $($panel + ' &gt; li').on('mouseleave', function() {
        if (!tFlag) {
            intervalTab(3000);
        }
    });
}

// 사용예시 : destroySwiperMaker({$name:"슬라이드 이름", $media: "분기점"})
var destroySwiperMaker = function({ $name, $media, $speed = 2000, $perView = 'auto', $scroll = false}) {
    // console.log(typeof $name, typeof $media, typeof $scroll)
    // console.log($name, $media, $scroll)
    var timer = null;
    var windowWidth = $(window).innerWidth();
    var destroySwiper = undefined;

    
    function initdestroySwiper() {
        if($scroll){ //스크롤 사용시
            if (windowWidth &lt; $media &amp;&amp; destroySwiper == undefined) {
                
                destroySwiper = new Swiper(`.${$name} .swiper_common`, {
                    slidesPerView: $perView,	
                    observer : true,
                    observeParents : true,
                    loop: false,
                    scrollbar: {
                        el: `.${$name} .swiper-scrollbar`,
                        draggable: true,
                    },			
                })
            } else if (windowWidth &gt;= $media &amp;&amp; destroySwiper != undefined) {
                destroySwiper.destroy();
                destroySwiper = undefined;
            }
        }else{
            if (windowWidth &lt; $media &amp;&amp; destroySwiper == undefined) {
                destroySwiper = new Swiper(`.${$name} .swiper_common`, {
                    slidesPerView: $perView,	
                    observer : true,
                    observeParents : true,
                    loop: true,
                    autoplay: { 
                        delay: $speed, 
                        disableOnInteraction: false, 
                    },					
                    pagination: {el: `.${$name} .swiper-pagination`,clickable: true,},
                    navigation: {
                        nextEl: `.${$name} .swiper-button-next`,
                        prevEl: `.${$name} .swiper-button-prev`,
                    },
                })
            } else if (windowWidth &gt;= $media &amp;&amp; destroySwiper != undefined) {
                destroySwiper.destroy();   
                destroySwiper = undefined;
            }
        }
    }
    initdestroySwiper();

    $(window).on('resize', function() {
        clearTimeout(timer);
        timer = setTimeout(function() {
            windowWidth = $(window).innerWidth();
            initdestroySwiper();
        }, 100)
    });		
}</pre></body></html>