PageSourceSearch

https://hpix.co.kr/ind-script/optimizer_user.php?filename=jY5LDsIw…a9ec35b59a7bbef8d4d3c51&t=1778049176&user=T

js hpix.co.kr collected 2026-10-03 21:26:52 UTC 40,233 bytes, 996 lines download raw bytes

1$(function(){ 
2    if($(".menuCategory > li").length==0){
3         $(".menuCategory").hide();
4    };
5});
6/**
7 * 움직이는 배너 Jquery Plug-in
8 * @author  cafe24
9 */
10
11(function($){
12
13    $.fn.floatBanner = function(options) {
14        options = $.extend({}, $.fn.floatBanner.defaults , options);
15
16        return this.each(function() {
17            var aPosition = $(this).position();
18            var jbOffset = $(this).offset();
19            var node = this;
20
21            $(window).on('scroll', function() {
22                var _top = $(document).scrollTop();
23                _top = (aPosition.top < _top) ? _top : aPosition.top;
24
25                setTimeout(function () {
26                    var newinit = $(document).scrollTop();
27
28                    if ( newinit > jbOffset.top ) {
29                        _top -= jbOffset.top;
30                        var container_height = $("#wrap").height();
31                        var quick_height = $(node).height();
32                        var cul = container_height - quick_height;
33                        if(_top > cul){
34                            _top = cul;
35                        }
36                    } else {
37                        _top = 0;
38                    }
39
40                    $(node).stop().animate({top: _top}, options.animate);
41                }, options.delay);
42            });
43        });
44    };
45
46    $.fn.floatBanner.defaults = {
47        'animate'  : 500,
48        'delay'    : 500
49    };
50
51})(jQuery);
52
53/**
54 * 문서 구동후 시작
55 */
56$(function(){
57    $('#banner:visible, #quick:visible').floatBanner();
58
59    //placeholder
60    $(".ePlaceholder input, .ePlaceholder textarea").each(function(i){
61        var placeholderName = $(this).parents().attr('title');
62        $(this).attr("placeholder", placeholderName);
63    });
64    /* placeholder ie8, ie9 */
65    $.fn.extend({
66        placeholder : function() {
67            //IE 8 버전에는 hasPlaceholderSupport() 값이 false를 리턴
68           if (hasPlaceholderSupport() === true) {
69                return this;
70            }
71            //hasPlaceholderSupport() 값이 false 일 경우 아래 코드를 실행
72            return this.each(function(){
73                var findThis = $(this);
74                var sPlaceholder = findThis.attr('placeholder');
75                if ( ! sPlaceholder) {
76                   return;
77                }
78                findThis.wrap('<label class="ePlaceholder" />');
79                var sDisplayPlaceHolder = $(this).val() ? ' style="display:none;"' : '';
80                findThis.before('<span' + sDisplayPlaceHolder + '>' + sPlaceholder + '</span>');
81                this.onpropertychange = function(e){
82                    e = event || e;
83                    if (e.propertyName == 'value') {
84                        $(this).trigger('focusout');
85                    }
86                };
87                //공통 class
88                var agent = navigator.userAgent.toLowerCase();
89                if (agent.indexOf("msie") != -1) {
90                    $(".ePlaceholder").css({"position":"relative"});
91                    $(".ePlaceholder span").css({"position":"absolute", "padding":"0 4px", "color":"#878787"});
92                    $(".ePlaceholder label").css({"padding":"0"});
93                }
94            });
95        }
96    });
97
98    $(':input[placeholder]').placeholder(); //placeholder() 함수를 호출
99
100    //클릭하면 placeholder 숨김
101    $('body').on('click', '.ePlaceholder span', function(){
102        $(this).hide();
103    });
104
105    //input창 포커스 인 일때 placeholder 숨김
106    $('body').on('focusin', '.ePlaceholder :input', function(){
107        $(this).prev('span').hide();
108    });
109
110    //input창 포커스 아웃 일때 value 가 true 이면 숨김, false 이면 보여짐
111    $('body').on('focusout', '.ePlaceholder :input', function(){
112        if (this.value) {
113            $(this).prev('span').hide();
114        } else {
115            $(this).prev('span').show();
116        }
117    });
118
119    //input에 placeholder가 지원이 되면 true를 안되면 false를 리턴값으로 던져줌
120    function hasPlaceholderSupport() {
121        if ('placeholder' in document.createElement('input')) {
122            return true;
123        } else {
124            return false;
125        }
126    }
127});
128
129/**
130 *  썸네일 이미지 엑박일경우 기본값 설정
131 */
132$(window).on('load', function() {
133    $("img.thumb,img.ThumbImage,img.BigImage").each(function($i,$item){
134        var $img = new Image();
135        $img.onerror = function () {
136            $item.src="//img.echosting.cafe24.com/thumb/img_product_big.gif";
137        }
138        $img.src = this.src;
139    });
140});
141
142/**
143 *  tooltip
144 */
145$('.eTooltip').each(function(i){
146    $(this).find('.btnClose').attr('tabIndex','-1');
147});
148//tooltip input focus
149$('.eTooltip').find('input').on('focus', function() {
150    var targetName = returnTagetName(this);
151    targetName.siblings('.ec-base-tooltip').show();
152});
153$('.eTooltip').find('input').on('focusout', function() {
154    var targetName = returnTagetName(this);
155    targetName.siblings('.ec-base-tooltip').hide();
156});
157function returnTagetName(_this){
158    var ePlacename = $(_this).parent().attr("class");
159    var targetName;
160    if(ePlacename == "ePlaceholder"){ //ePlaceholder 대응
161        targetName = $(_this).parents();
162    }else{
163        targetName = $(_this);
164    }
165    return targetName;
166}
167
168/**
169 *  eTab
170 */
171$("body").on("click", ".eTab a", function(e){
172    // 클릭한 li 에 selected 클래스 추가, 기존 li에 있는 selected 클래스는 삭제.
173    var _li = $(this).parent("li").addClass("selected").siblings().removeClass("selected"),
174    _target = $(this).attr("href"),
175    _siblings = $(_target).attr("class"),
176    _arr = _siblings.split(" "),
177    _classSiblings = "."+_arr[0];
178
179    //클릭한 탭에 해당하는 요소는 활성화, 기존 요소는 비활성화 함.
180    $(_target).show().siblings(_classSiblings).hide();
181
182
183    //preventDefault 는 a 태그 처럼 클릭 이벤트 외에 별도의 브라우저 행동을 막기 위해 사용됨.
184    e.preventDefault();
185});
186
187
188/* Hpix add 2023.11.04 : 검색어 clear  */
189$('.xans-layout-searchheader').find('.btnDelete').on('click ', function(){   
190    $('#keyword').val('').focus();
191});
192
193
194//window popup script
195function winPop(url) {
196    window.open(url, "popup", "width=300,height=300,left=10,top=10,resizable=no,scrollbars=no");
197}
198/**
199 * document.location.href split
200 * return array Param
201 */
202function getQueryString(sKey)
203{
204    var sQueryString = document.location.search.substring(1);
205    var aParam       = {};
206
207    if (sQueryString) {
208        var aFields = sQueryString.split("&");
209        var aField  = [];
210        for (var i=0; i<aFields.length; i++) {
211            aField = aFields[i].split('=');
212            aParam[aField[0]] = aField[1];
213        }
214    }
215
216    aParam.page = aParam.page ? aParam.page : 1;
217    return sKey ? aParam[sKey] : aParam;
218};
219
220$(function(){
221    // tab
222    $.eTab = function(ul){
223        $(ul).find('a').on('click', function(){
224            var _li = $(this).parent('li').addClass('selected').siblings().removeClass('selected'),
225                _target = $(this).attr('href'),
226                _siblings = '.' + $(_target).attr('class');
227            $(_target).show().siblings(_siblings).hide();
228            return false
229        });
230    }
231    if ( window.call_eTab ) {
232        call_eTab();
233    };
234});
235
236$(function(){
237    $('.border-box .content-title').on('click', function(){
238        var box = $(this).parents('.border-box');
239        box.toggleClass('none');
240    });
241
242    $('.table-box thead').on('click', function(){
243        var box = $(this).parents('.table-box');
244        box.toggleClass('active');
245    })
246});
247
248
249$(function() {
250    $('.accordion-list li').on('click', function(e){
251        $(this).toggleClass('active');
252        $(this).find('.content').slideToggle();
253        $('.accordion-list li').not(this).removeClass('active');
254        $('.accordion-list li').not(this).find('.content').slideUp();
255    });
256});
257
258$(function() {
259    $('.toggle-trigger').on('click', function(){
260        var target = $(this).parents('tr');
261        if(target.hasClass('active')){
262            target.removeClass('active');
263        }else{
264            $('table.toggle tr').removeClass('active');
265            target.addClass('active');
266        }
267    });
268});
269
270$(function(){
271    $('.btn-back').on('click', function(){
272        if($('.sidebar.board').length){
273            $(location).attr("href",'/cs/')
274        }else{
275            window.history.back();
276        }
277    })
278});
279
280$(function(){
281    // 실제 장바구니에 담긴 갯수 연동 
282    var product_quantity = 0;
283
284    $('.basket-count').text(product_quantity);
285
286    $.get('/api/basket-data.html', function(res){
287        if($('#default-basket').text() !== 0) {
288            $(res).find('#contents .product-item .product-quantity input').each(function(){
289                product_quantity += Number($(this).val());
290                $('.basket-count').text(product_quantity);
291            })
292        }
293    })
294});
295
296
297
298// 채널톡 사용시 채널톡 스타일 조정 JS @CHUJIHYE
299// $(document).ready(function(){
300//     $(window).on('scroll', function(){
301//         var is_orderFixArea =  $('#orderFixArea').css('display');
302//         var ch_plugin_btn = document.getElementById('ch-plugin').querySelector('div:not(#ch-plugin-script)').shadowRoot.getElementById('ch-shadow-root-wrapper').querySelector('div');
303            
304//         if(is_orderFixArea == 'block' && ch_plugin_btn){
305//             ch_plugin_btn.style.bottom = '80px';
306//             ch_plugin_btn.style.transition = 'all 0.3s';
307//         }else{
308//             ch_plugin_btn.style.bottom = '20px';
309//             ch_plugin_btn.style.transition = 'all 0.3s';
310//         }
311//     })
312// });
313(function($){
314    $.fn.extend({
315        center: function() {
316            this.each(function() {
317                var
318                    $this = $(this),
319                    $w = $(window);
320                $this.css({
321                    position: "absolute",
322                    top: ~~(($w.height() - $this.outerHeight()) / 2) + $w.scrollTop() + "px",
323                    left: ~~(($w.width() - $this.outerWidth()) / 2) + $w.scrollLeft() + "px"
324                });
325            });
326            return this;
327        }
328    });
329    $(function() {
330        var $container = function(){/*
331    <div id="modalContainer">
332        <iframe id="modalContent" scroll="0" scrolling="no" frameBorder="0"></iframe>
333    </div>');
334    */}.toString().slice(14,-3);
335        $('body')
336        .append($('<div id="modalBackpanel"></div>'))
337        .append($($container));
338        function closeModal () {
339            $('#modalContainer').hide();
340            $('#modalBackpanel').hide();
341        }
342        $('#modalBackpanel').on('click',closeModal);
343        zoom = function ($piProductNo, $piCategoryNo, $piDisplayGroup) {
344            var $url = '/product/image_zoom.html?product_no=' + $piProductNo + '&cate_no=' + $piCategoryNo + '&display_group=' + $piDisplayGroup;
345            $('#modalContent').attr('src', $url);
346            $('#modalContent').on("load",function(){
347                $(".header .close",this.contentWindow.document.body).on("click", closeModal);
348            });
349            $('#modalBackpanel').css({width:$("body").width(),height:$("body").height(),opacity:.4}).show();
350            $('#modalContainer').center().show();
351        }
352    });
353})(jQuery);
354// 썸네일 이미지 엑박일경우 기본값 설정
355$(window).on('load', function() {
356
357    $(".thumbnail img, img.thumbImage, img.bigImage").each(function($i,$item){
358        var $img = new Image();
359        $img.onerror = function () {
360            $item.src="//img.echosting.cafe24.com/thumb/img_product_big.gif";
361        }
362        $img.src = this.src;
363    });
364
365});
366
367$(function(){
368    // 토글
369    $('div.eToggle .title').off('click').on('click', function(){
370        var toggle = $(this).parent('.eToggle');
371        if(toggle.hasClass('disable') === false){
372            $(this).parent('.eToggle').toggleClass('selected')
373        }
374    });
375
376    $('dl.eToggle dt').on('click', function(){
377        $(this).toggleClass('selected');
378        $(this).next('dd').toggleClass('selected');
379    });
380
381    //장바구니 페이지 수량폼 Type 변경
382    $('[id^="quantity"]').each(function() {
383        $(this).get(0).type = 'tel';
384    });
385
386    // 모바일에서 공급사 테이블 th 강제조절
387    $('.xans-mall-supplyinfo, .supplyInfo').find('table > colgroup').find('col').eq(0).width(98);
388    $('.xans-mall-supplyinfo, .supplyInfo').find('th, td').css({padding:'13px 10px 12px'});
389
390    /**
391     *  메인카테고리 toggle
392     */
393    $('.xans-product-listmain h2').on('click', function() {
394        var bClosed = !!$(this).data('is_closed');
395        var sUrl;
396        if (bClosed) {
397            sUrl = "//img.echosting.cafe24.com/skin/mobile_ko_KR/layout/bg_title_close.gif";
398        } else {
399            sUrl = "//img.echosting.cafe24.com/skin/mobile_ko_KR/layout/bg_title_open.gif";
400        }
401        $(this).css('background-image', 'url("'+ sUrl +'")');
402        $(this).siblings().toggle();
403        $(this).parent().find('div.ec-base-paginate').toggle();
404        $(this).parent().next('div.xans-product-listmore').toggle();
405        $(this).data('is_closed', !bClosed);
406    });
407
408    /* base header 검색 레이어 */
409    $('#layout .header').find('.search .btnSearch').on('click', function(){
410        var $baseHeader = $('#layout .header');
411        $baseHeader.addClass('open');
412        $('#dimmedSlider').one('click', function(){
413            $baseHeader.removeClass('open');
414        });
415    });
416
417    /**
418     *  상단탑버튼
419     */
420    var globalTopBtnScrollFunc = function() {
421        // 탑버튼 관련변수
422        var $btnTop = $('#btnTop');
423        var $floating_wrap = $('.floating-wrap');
424
425        $(window).on('scroll', function() {
426            try {
427                var iCurScrollPos = $(this).scrollTop();
428
429                if (iCurScrollPos > ($(this).height() / 2)) {
430                    $floating_wrap.addClass('show');
431                    $btnTop.fadeIn('fast');
432                } else {
433                    $floating_wrap.removeClass('show');
434                    $btnTop.fadeOut('fast');
435                }
436            } catch(e) { }
437        });
438
439        $('#btnTop').on('click', function() {
440            $('html, body').animate({scrollTop: 0}, 200);
441        });
442    };
443
444    /**
445     *  구매버튼
446     */
447    var globalBuyBtnScrollFunc = function() {
448
449        var sFixId = $('#orderFixItem').length > 0  ? 'orderFixItem' : 'fixedActionButton',
450            $area = $('#orderFixArea'),
451            $item = $('#' + sFixId + '').not($area);
452
453        $(window).on('scroll', function(){
454            try {
455
456                var iCurrentHeightPos = $(this).scrollTop() + $(this).height(),
457                    iButtonHeightPos = $item.offset().top;
458
459                if($(window).innerWidth() < 641){
460                    if (iCurrentHeightPos > iButtonHeightPos || iButtonHeightPos < $(this).scrollTop() + $item.height()) {
461                        if (iButtonHeightPos < $(this).scrollTop() - $item.height()) {
462                            $area.fadeIn('fast');
463                        } else {
464                            $area.hide();
465                        }
466                    } else {
467                        $area.fadeIn('fast');
468                    }
469                }else{
470                    $area.hide();
471                }
472                    
473            } catch(e) { }
474        });
475    };
476
477    globalTopBtnScrollFunc();
478    globalBuyBtnScrollFunc();
479});
480
481// 공통레이어팝업 오픈
482var globalLayerOpenFunc = function(_this) {
483    this.id = $(_this).data('id');
484    this.param = $(_this).data('param');
485    this.basketType = $('#basket_type').val();
486    this.url = $(_this).data('url');
487    this.layerId = 'ec_temp_mobile_layer';
488    this.layerIframeId = 'ec_temp_mobile_iframe_layer';
489
490    var _this = this;
491
492    function paramSetUrl() {
493        if (this.param) {
494            // if isset param
495        } else {
496            this.url = this.basketType ?  this.url + '?basket_type=' + this.basketType : this.url;
497        }
498    };
499
500    if (this.url) {
501        window.ecScrollTop = $(window).scrollTop();
502        $.ajax({
503            url : this.url,
504            success : function (data) {
505                if (data.indexOf('404 페이지 없음') == -1) {
506                    // 있다면 삭제
507                    try { $(_this).remove(); } catch ( e ) { }
508
509                    var $layer = $('<div>', {
510                        html: $("<iframe>", { src: _this.url, id: _this.layerIframeId, scrolling: 'auto', css: { width: '100%', height: '100%', overflowY: 'auto', border: 0 } } ),
511                        id: _this.layerId,
512                        css : { position: 'absolute', top: 0, left:0, width: '100%', height: $(window).height(), 'z-index': 9999 }
513                    });
514
515                    $('body').append($layer);
516                    $('html, body').css({'overflowY': 'hidden', height: '100%', width: '100%'});
517                    $('#' + this.layerId).show();
518                }
519            }
520        });
521    }
522};
523
524// 공통레이어팝업 닫기
525var globalLayerCloseFunc = function() {
526    this.layerId = 'ec_temp_mobile_layer';
527
528    if (window.parent === window)
529        self.close();
530    else {
531        parent.$('html, body').css({'overflowY': 'auto', height: 'auto', width: '100%'});
532        parent.$('html, body').scrollTop(parent.window.ecScrollTop);
533        parent.$('#' + this.layerId).remove();
534    }
535};
536
537/**
538 * document.location.href split
539 * return array Param
540 */
541var getQueryString = function(sKey)
542{
543    var sQueryString = document.location.search.substring(1);
544    var aParam = {};
545
546    if (sQueryString) {
547        var aFields = sQueryString.split("&");
548        var aField  = [];
549        for (var i=0; i<aFields.length; i++) {
550            aField = aFields[i].split('=');
551            aParam[aField[0]] = aField[1];
552        }
553    }
554
555    aParam.page = aParam.page ? aParam.page : 1;
556    return sKey ? aParam[sKey] : aParam;
557};
558
559// PC버전 바로 가기
560var isPCver = function() {
561    var sUrl = window.location.hostname;
562    var aTemp = sUrl.split(".");
563
564    var pattern = /^(mobile[\-]{2}shop[0-9]+)$/;
565
566    if (aTemp[0] == 'm' || aTemp[0] == 'skin-mobile' || aTemp[0] == 'mobile') {
567        sUrl = sUrl.replace(aTemp[0]+'.', '');
568    } else if (pattern.test(aTemp[0]) === true) {
569        var aExplode = aTemp[0].split('--');
570        aTemp[0] = aExplode[1];
571        sUrl = aTemp.join('.');
572    }
573    window.location.href = '//'+sUrl+'/?is_pcver=T';
574};
575
576/* 도움말 */
577$('body').on('click', '.ec-base-tooltip-area .eTip', function(e){
578    var findArea = $($(this).parents('.ec-base-tooltip-area'));
579    var findTarget = $($(this).siblings('.ec-base-tooltip'));
580    var findTooltip = $('.ec-base-tooltip');
581    $('.ec-base-tooltip-area').removeClass('show');
582    $(this).parents('.ec-base-tooltip-area').first().addClass('show');
583    findTooltip.hide();
584    findTarget.show();
585    e.preventDefault();
586});
587
588$('body').on('click', '.ec-base-tooltip-area .eClose', function(e){
589    var findTarget = $(this).parents('.ec-base-tooltip').first();
590    $('.ec-base-tooltip-area').removeClass('show');
591    findTarget.hide();
592    e.preventDefault();
593});
594
595$('.ec-base-tooltip-area').find('input').on('focusout', function() {
596    var findTarget = $(this).parents('.ec-base-tooltip-area').find('.ec-base-tooltip');
597    $('.ec-base-tooltip-area').removeClass('show');
598    findTarget.hide();
599});
600
601/**
602 * 팝업창에 리사이즈 관련
603 */
604
605function setResizePopup() {
606    if(!$('#popup').length) return;
607
608    var iWrapWidth    = $('#popup').width();
609    var iWrapHeight   = $('#popup').height();
610
611    var iWindowWidth  = $(window).width();
612    var iWindowHeight = $(window).height();
613
614    // window.resizeBy(iWrapWidth - iWindowWidth, iWrapHeight - iWindowHeight);
615}
616
617// setResizePopup();
618
619// 팝업 페이지 로드가 완료된 후에 리사이징 함수를 다시 호출
620$( window ).on('load', function() {
621    var iWindowHeight = $(window).height();
622    window.resizeTo(600, iWindowHeight);
623});
624$(document).ready(function(){
625    $('#product_select_all').on('click', function() {
626        var _status = $(this).data('status');
627
628        $('[id^="basket_chk_id_"]').each(function(){
629            var bChecked = $(this).is(":checked");
630            if (_status == 'off') {
631                if (bChecked === false) $(this).prop('checked', true);
632            } else {
633                $(this).prop('checked', false);
634            }
635        });
636
637        $(this).data('status', _status == 'off' ? 'on' : 'off');
638        fixedLayerPriceSet();
639    });
640
641    // 고정영역에 상품정보 세팅
642    var fixedLayerPriceSet = function() {
643        var iSumPrice = 0;
644        var iCheckPrdCnt = 0;
645        $('[id^="basket_chk_id_"]').each(function(){
646            if ($(this).attr('checked') == true) {
647                var sCheckId = $(this).attr('id');
648                var aTemp = sCheckId.split('_');
649                var iCheckId = aTemp[3];
650                var iProductPrice = aBasketProductData[iCheckId].product_sum_price;
651                iSumPrice = iSumPrice + iProductPrice;
652                iCheckPrdCnt = iCheckPrdCnt + 1;
653            }
654        });
655        if (iCheckPrdCnt > 0) {
656            var sTotalPrice = SHOP_PRICE_FORMAT.toShopPrice(iSumPrice);
657            $('#checked_order_count').html('<strong>' + sprintf(__('%s'),iCheckPrdCnt) + '</strong>' +'개 상품선택').css('padding-bottom','5px');
658            $('#checked_order_price').html('결제예정금액 <strong><em>'+sTotalPrice+'</em></strong>').css('padding-bottom','5px');
659            var sPriceRef = SHOP_PRICE_FORMAT.shopPriceToSubPrice(iSumPrice);
660            if (sPriceRef != '') $('#checked_order_price').find('strong').append(sPriceRef);
661        } else {
662            fixLayerPriceRest();
663        }
664    };
665    // 고정영역 상품합계초기화
666    var fixLayerPriceRest = function() {
667        $('#checked_order_count, #checked_order_price').html('').css('padding-bottom','0');
668    };
669    fixLayerPriceRest();
670    // 장바구니 체크박스 체크시 상품총합계, 체크한 숫자 구하기
671    $('[id^="basket_chk_id_"]').click(function(e) {
672        fixedLayerPriceSet();
673    });
674
675    // 비회원 장바구니 페이지일 경우 마일리지 비노출
676    if($('#login-status').text().indexOf('login') !== -1) $('.page-order .product-info-item .mileage').addClass('displaynone');
677    
678    if($('#login-status').text() == 'login') $('.mileage').addClass('displaynone');
679
680    // 장바구니 퍼센트 계산 @CHU
681    $('.product-cart-item').each(function(){
682        var product_prices = $(this).find('.discount-persent');
683
684        if(product_prices.length > 0 && !product_prices.hasClass('displaynone')){
685            var sale_price = product_prices.find('.sale').text().replace(/,/g, "");
686            var origin_price = product_prices.find('.origin').text().replace(/,/g, "");
687            var product_persent = (sale_price / origin_price) * 100;
688            $(this).find('.persent').text(product_persent+'%');
689        }
690    })
691});
692// 장바구니 선택상품 삭제
693function selBasketDel(id) {
694    $('[id^="'+BASKET_CHK_ID_PREFIX+'"]').attr('checked', false);
695    $('[id="'+id+'"]').attr('checked', true);
696    Basket.deleteBasket();
697}
698
699
700$(function(){
701    if (typeof(EC_SHOP_MULTISHOP_SHIPPING) != "undefined") {
702        var sShippingCountryCode4Cookie = 'shippingCountryCode';
703        var bShippingCountryProc = false;
704
705        // 배송국가 선택 설정이 사용안함이면 숨김
706        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) {
707            $('.xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist').hide();
708            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptioncountry').hide();
709        } else {
710            $('.thumb .xans-layout-multishoplistitem').hide();
711            var aShippingCountryCode = document.cookie.match('(^|;) ?'+sShippingCountryCode4Cookie+'=([^;]*)(;|$)');
712            if (typeof(aShippingCountryCode) != 'undefined' && aS
712hippingCountryCode != null && aShippingCountryCode.length > 2) {
713                var sShippingCountryValue = aShippingCountryCode[2];
714            }
715
716            // query string으로 넘어 온 배송국가 값이 있다면, 그 값을 적용함
717            var aHrefCountryValue = decodeURIComponent(location.href).split("/?country=");
718
719            if (aHrefCountryValue.length == 2) {
720                var sShippingCountryValue = aHrefCountryValue[1];
721            }
722
723            // 메인 페이지에서 국가선택을 안한 경우, 그 외의 페이지에서 셋팅된 값이 안 나오는 현상 처리
724            if (location.href.split("/").length != 4 && $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()) {
725                $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
726
727                if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
728                    $("#f_country").val($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
729                }
730            }
731            if (typeof(sShippingCountryValue) != "undefined" && sShippingCountryValue != "" && sShippingCountryValue != null) {
732                sShippingCountryValue = sShippingCountryValue.split("#")[0];
733                var bShippingCountryProc = true;
734
735                $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
736                $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
737                var expires = new Date();
738                expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
739                document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
740                if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
741                    $("#f_country").val(sShippingCountryValue).change();
742                }
743            }
744        }
745        // 언어선택 설정이 사용안함이면 숨김
746        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingLanguageSelection === false) {
747            $('.xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist').hide();
748            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptionlanguage').hide();
749        } else {
750            $('.thumb .xans-layout-multishoplistitem').hide();
751        }
752
753        // 배송국가 및 언어 설정이 둘 다 사용안함이면 숨김
754        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShipping === false) {
755            $(".xans-layout-multishopshipping").hide();
756            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption').hide();
757        } else if (bShippingCountryProc === false && location.href.split("/").length == 4) { // 배송국가 값을 처리한 적이 없고, 메인화면일 때만 선택 레이어를 띄움
758            var sShippingCountryValue = $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val();
759            $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
760            $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
761            // 배송국가 선택을 사용해야 레이어를 보이게 함
762            if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === true) {
763                $(".xans-layout-multishopshipping").show();
764            }
765        }
766
767        $(".xans-layout-multishopshipping .close").on("click", function() {
768            $(".xans-layout-multishopshipping").hide();
769        });
770
771        $(".xans-layout-multishopshipping .ec-base-button a").on("click", function() {
772            var expires = new Date();
773            expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
774            document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
775
776            // 도메인 문제로 쿠키로 배송국가 설정이 안 되는 경우를 위해 query string으로 배송국가 값
776을 넘김
777            var sQuerySting = (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) ? "" : "/?country="+encodeURIComponent($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
778
779            location.href = '//'+$(".xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist").val()+sQuerySting;
780        });
781        $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a").on("click", function() {
782            $(".xans-layout-multishopshipping").show();
783        });
784    }
785});
786(function() {
787    var aCategory = [];
788    var methods = {
789        aCategory    : [],
790        aSubCategory : {},
791        get: function(callback)
792        {
793            $.ajax({
794                url : '/exec/front/Product/SubCategory',
795                dataType: 'json',
796                success: function(aData) {
797                    // console.log(aData);
798                    if (aData == null || aData == 'undefined') {
799                        methods.checkSub();
800                        return;
801                    }
802                    for (var i=0; i<aData.length; i++)
803                    {
804                        var sParentCateNo = aData[i].parent_cate_no;
805                        var sCateNo = aData[i].cate_no;
806                        if (!methods.aSubCategory[sParentCateNo]) {
807                            methods.aSubCategory[sParentCateNo] = [];
808                        }
809                        if (!aCategory[sCateNo]) {
810                            aCategory[sCateNo] = [];
811                        }
812                        methods.aSubCategory[sParentCateNo].push( aData[i] );
813                        aCategory[sCateNo] = aData[i];
814                    }
815                    // console.log('aCategory',aCategory)
816                    // console.log('methods.aSubCategory',methods.aSubCategory)
817                }
818            }).done(function(){
819                callback();
820            });
821        },
822        checkhasChildren: function(parent){
823            var this_cate = $(parent).attr('data-cate'); 
824            if(methods.aSubCategory[this_cate]!= undefined) {
825                var txt = $(parent).find('a').text();
826                var childs = methods.aSubCategory[this_cate];
827                var $child_wrap = $('<ul class="lnb-list depth-3" data-count ="'+(childs.length)+'"></ul>');
828                
829                childs.forEach(function(child){
830                    var $li_wrap = $('<li class="lnb-item"></li>');
831                    var child_txt;
832                    var list_el = null;
833
834                    if(methods.aSubCategory[child.cate_no]!= undefined) {
835                        child_txt = '<button class="lnb-btn depth-4" type="button" data-cate ="'+child.cate_no+'">'+child.name+'</button>'
836                        list_el = methods.makeDepth4ListNum(child.cate_no);
837                    }else{
838                        child_txt = '<a href="/product/list.html?cate_no='+child.cate_no+'" data-cate ="'+child.cate_no+'">'+child.name+'</a>';
839                    }
840                    $li_wrap.append($(child_txt));
841                    if(list_el != null)$li_wrap.append(list_el);
842                    
843                    $child_wrap.append($li_wrap);
844                });
845
846                $(parent).empty();
847                $(parent).append('<button class="lnb-btn depth-3" type="button" data-cate="'+this_cate+'">'+txt+'</button>')
848                $(parent).append($child_wrap);
849            }else{
850                $(parent).find('a').attr('href','/product/list.html?cate_no='+this_cate);
851            }
852        },
853        // makeDepth4List : function(btnDepth4){
854        //     var depth_4_cate = $(btnDepth4).attr('data-cate');
855        //     var childs = methods.aSubCategory[depth_4_cate];
856        //     var $depth_4_wrap = $('<ul class="lnb-list depth-4" data-count ="'+(childs.length)+'"></ul>');
857
858        //     childs.forEach(function(child){
859        //         var child_txt = '<li class="lnb-item"><a href="/product/list.html?cate_no='+child.cate_no+'" data-cate ="'+child.cate_no+'">'+child.name+'</a></li>';
860        //         $depth_4_wrap.append($(child_txt));
861        //     });
862
863        //     $(btnDepth4).parent().append($depth_4_wrap);
864        // },
865        makeDepth4ListNum : function(cate_no){
866            var depth_4_cate = cate_no;
867            var childs = methods.aSubCategory[depth_4_cate];
868            var $depth_4_wrap = $('<ul class="lnb-list depth-4" data-count ="'+(childs.length)+'"></ul>');
869            var child_txt=''
870
871            childs.forEach(function(child){
872                child_txt = '<li class="lnb-item"><a href="/product/list.html?cate_no='+child.cate_no+'" data-cate ="'+child.cate_no+'">'+child.name+'</a></li>';
873                $depth_4_wrap.append($(child_txt));
874            });
875
876            return $depth_4_wrap ;
877        },
878        // 프로모션 메인 사용 
879        //  makePromotionList:function(){
880       //     var $promotion_wrap = $('.lnb-btn.promotion').parent();
881       //     var promotion_cate = $('.lnb-btn.promotion').attr('data-cate');
882       //     var promotion_child = methods.aSubCategory[promotion_cate];
883            
884       //     var $depth_wrap = $('<ul class="lnb-list depth-2 promotion" data-count ="'+(promotion_child.length)+'"></ul>');
885       //     var child_txt=''
886
887        //    promotion_child.forEach(function(child){
888        //        child_txt = '<li class="lnb-item" data-cate ="'+child.cate_no+'"><a href="/promotion/detail.html?cate_no='+child.cate_no+'">'+child.name+'</a></li>';
889        //        $depth_wrap.append($(child_txt));
890        //    });
891        //    $promotion_wrap.append($depth_wrap);
892       // }
893    };
894    try{
895        $('.xans-layout-category.lnb-list.depth-2').attr('data-count',$('.lnb-item.xans-record-').length);
896        
897        methods.get(function(){
898            $('.lnb-list.shop .lnb-item').each(function(){
899                // 부모의 카테고리 번호를 확인해서 동일한 경우 넣어준다
900                methods.checkhasChildren(this);
901            });
902
903          //  methods.makePromotionList(); 프로모션 메인 사용 
904
905            setTimeout(function(){
906                // 상품 화면을 보고 있다면 헤더에 메뉴를 펼쳐준다.
907                var item_h = $(window).width() > 640 ? 2.2 : 2.3;
908                var extra_margin_top = 1.2;
909                var extra_margin_bottom = 0;
910                var extra_margin = 1.6;
911                
912                if( window.location.pathname.indexOf('product') > -1){
913                    var cate_no = getUrlParameter('cate_no');
914                    var this_el = $(".header a[data-cate='"+cate_no+"']");
915                    var this_el_parent_list = this_el.parent().parent();
916                    var this_count = this_el_parent_list.data('count');
917
918                    this_el.parent().addClass('views');
919                    this_el_parent_list.addClass('views');
920
921                    var is_depth_2 = this_el_parent_list.hasClass('depth-2');
922                    var is_depth_3 = this_el_parent_list.hasClass('depth-3');
923                    var is_depth_4 = this_el_parent_list.hasClass('depth-4');
924
925                    var is_open = this_el_parent_list.hasClass('open');
926                    
927                    this_el_parent_list.addClass('active');
928                    this_el_parent_list.css('height',this_count*item_h + extra_margin_top+'rem');
929                    this_el_parent_list.prev().addClass('active');
930
931                    if(is_depth_4 || is_depth_3){
932                        this_el_parent_list.parents('.lnb-list').each(function(index,element){
933                            var is_list_depth_2 = $(element).hasClass('depth-2');
934                            var is_list_depth_3 = $(element).hasClass('depth-3');
935                            var is_list_depth_4 = $(element).hasClass('depth-4');
936                            var is_list_open = $(element).hasClass('active');
937
938                            var children_count = 0;
939                            if($(element).find('.lnb-list.active').length > 0){
940                                
941                                $(element).find('.lnb-list.active').each(function(index,el_child){
942                                    children_count += $(el_child).data('count');
943                                })
944                                $(element).addClass('open');
945                            }
946                            $(element).addClass('active');
947                            $(element).siblings('.lnb-btn').addClass('active');
948                            
949                            // 마지막 depth가 열렸을 때 extra_margin_top이 더 열린 depth만큼 추가해줌
950                            if(is_depth_4) {
951                                if(!is_open) {
952                                    if(is_list_depth_2) {
953                                        $(element).css('height',((children_count+$(element).data('count'))*item_h + extra_margin_top * 3)+'rem');
954                                    } else {
955                                        $(element).css('height',((children_count+$(element).data('count'))*item_h + extra_margin_top * 2)+'rem');
956                                    }
957                                } else {
958                                    if(is_list_depth_2) {
959                                        $(element).css('height',((children_count+$(element).data('count'))*item_h + extra_margin_top * 2)+'rem');
960                                    } else {
961                                        $(element).css('height',((children_count+$(element).data('count'))*item_h + extra_margin_top)+'rem');
962                                    }
963                                }
964                            } else {
965                                if(!is_open) {
966                                    $(element).css('height',((children_count+$(element).data('count'))*item_h + extra_margin_top * 2)+'rem');
967                                } else {
968                                    $(element).css('height',((children_count+$(element).data('count'))*item_h + extra_margin_top)+'rem');
969                                }
970                            }
971                        })
972                    }                    
973                }
974
975                // 프로모션 상세 화면을 보고 있다면 헤더에 메뉴를 펼쳐준다.
976                if( window.location.pathname.indexOf('promotion') > -1 ){
977                    var cate_no = getUrlParameter('cate_no');
978                    console.log(cate_no);
979                    $(".lnb-list.promotion .lnb-item[data-cate='"+cate_no+"']").addClass('views');
980
981                    $('.lnb-btn.promotion').addClass('active');
982                    $('.lnb-list.promotion').addClass('active views');
983                    $('.lnb-list.promotion').css('height',($('.lnb-list.promotion').data('count')*item_h + extra_margin_top)+'rem');
984                }
985            },200);
986        });
987        // $(document).on('click','.lnb-btn.depth-4',function(){
988        //     methods.makeDepth4List(this);
989        // });
990
991    }catch(e){
992        console.log(e)
993    }
994    
995})();
996

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.