PageSourceSearch

https://dearbyme.co.kr/ind-script/optimizer_user.php?filename=jZBB…14d61a8d52b98028b13a4b6&t=1789622947&user=T

js dearbyme.co.kr collected 2026-10-06 14:04:19 UTC 44,195 bytes, 1,094 lines download raw bytes

1$(function(){
2    $('[id^="replyArea_"]').each(function(e) {
3        $(this).hide();
4    });
5});
6/*================================================================================
7 * @name: bPopup - if you can't get it up, use bPopup
8 * @author: (c)Bjoern Klinggaard (twitter@bklinggaard)
9 * @demo: http://dinbror.dk/bpopup
10 * @version: 0.11.0.min
11 ================================================================================*/
12 (function(c){c.fn.bPopup=function(A,E){function L(){a.contentContainer=c(a.contentContainer||b);switch(a.content){case "iframe":var d=c('<iframe class="b-iframe" '+a.iframeAttr+"></iframe>");d.appendTo(a.contentContainer);t=b.outerHeight(!0);u=b.outerWidth(!0);B();d.attr("src",a.loadUrl);l(a.loadCallback);break;case "image":B();c("<img />").load(function(){l(a.loadCallback);F(c(this))}).attr("src",a.loadUrl).hide().appendTo(a.contentContainer);break;default:B(),c('<div class="b-ajax-wrapper"></div>').load(a.loadUrl,a.loadData,function(d,b,e){l(a.loadCallback,b);F(c(this))}).hide().appendTo(a.contentContainer)}}function B(){a.modal&&c('<div class="b-modal '+e+'"></div>').css({backgroundColor:a.modalColor,position:"fixed",top:0,right:0,bottom:0,left:0,opacity:0,zIndex:a.zIndex+v}).appendTo(a.appendTo).fadeTo(a.speed,a.opacity);C();b.data("bPopup",a).data("id",e).css({left:"slideIn"==a.transition||"slideBack"==a.transition?"slideBack"==a.transition?f.scrollLeft()+w:-1*(x+u):m(!(!a.follow[0]&&n||g)),position:a.positionStyle||"absolute",top:"slideDown"==a.transition||"slideUp"==a.transition?"slideUp"==a.transition?f.scrollTop()+y:z+-1*t:p(!(!a.follow[1]&&q||g)),"z-index":a.zIndex+v+1}).each(function(){a.appending&&c(this).appendTo(a.appendTo)});G(!0)}function r(){a.modal&&c(".b-modal."+b.data("id")).fadeTo(a.speed,0,function(){c(this).remove()});a.scrollBar||c("html").css("overflow","auto");c(".b-modal."+e).unbind("click");f.unbind("keydown."+e);k.unbind("."+e).data("bPopup",0<k.data("bPopup")-1?k.data("bPopup")-1:null);b.undelegate(".bClose, ."+a.closeClass,"click."+e,r).data("bPopup",
12null);clearTimeout(H);G();return!1}function I(d){y=k.height();w=k.width();h=D();if(h.x||h.y)clearTimeout(J),J=setTimeout(function(){C();d=d||a.followSpeed;var e={};h.x&&(e.left=a.follow[0]?m(!0):"auto");h.y&&(e.top=a.follow[1]?p(!0):"auto");b.dequeue().each(function(){g?c(this).css({left:x,top:z}):c(this).animate(e,d,a.followEasing)})},50)}function F(d){var c=d.width(),e=d.height(),f={};a.contentContainer.css({height:e,width:c});e>=b.height()&&(f.height=b.height());c>=b.width()&&(f.width=b.width());t=b.outerHeight(!0);u=b.outerWidth(!0);C();a.contentContainer.css({height:"auto",width:"auto"});f.left=m(!(!a.follow[0]&&n||g));f.top=p(!(!a.follow[1]&&q||g));b.animate(f,250,function(){d.show();h=D()})}function M(){k.data("bPopup",v);b.delegate(".bClose, ."+a.closeClass,"click."+e,r);a.modalClose&&c(".b-modal."+e).css("cursor","pointer").bind("click",r);N||!a.follow[0]&&!a.follow[1]||k.bind("scroll."+e,function(){if(h.x||h.y){var d={};h.x&&(d.left=a.follow[0]?m(!g):"auto");h.y&&(d.top=a.follow[1]?p(!g):"auto");b.dequeue().animate(d,a.followSpeed,a.followEasing)}}).bind("resize."+e,function(){I()});a.escClose&&f.bind("keydown."+e,function(a){27==a.which&&r()})}function G(d){function c(e){b.css({display:"block",opacity:1}).animate(e,a.speed,a.easing,function(){K(d)})}switch(d?a.transition:a.transitionClose||a.transition){case "slideIn":c({left:d?m(!(!a.follow[0]&&n||g)):f.scrollLeft()-(u||b.outerWidth(!0))-200});break;case "slideBack":c({left:d?m(!(!a.follow[0]&&n||g)):f.scrollLeft()+w+200});break;case "slideDown":c({top:d?p(!(!a.follow[1]&&q||g)):f.scrollTop()-(t||b.outerHeight(!0))-200});break;case "slideUp":c({top:d?p(!(!a.follow[1]&&q||g)):f.scrollTop()+y+200});break;default:b.stop().fadeTo(a.speed,d?1:0,function(){K(d)})}}function K(d){d?(M(),l(E),a.autoClose&&(H=setTimeout(r,a.autoClose))):(b.hide(),l(a.onClose),a.loadUrl&&(a.contentContainer.empty(),b.css({height:"auto",width:"auto"})))}function m(a){return a?x+f.scrollLeft():x}function p(a){return a?z+f.scrollTop():z}function l(a,e){c.isFunction(a)&&a.call(b,e)}function C(){z=q?a.position[1]:Math.max(0,(y-b.outerHeight(!0))/2-a.amsl);x=n?a.position[0]:(w-b.outerWidth(!0))/2;h=D()}function D(){return{x:w>b.outerWidth(!0),y:y>b.outerHeight(!0)}}c.isFunction(A)&&(E=A,A=null);var a=c.extend({},c.fn.bPopup.defaults,A);a.scrollBar||c("html").css("overflow","hidden");var b=this,f=c(document),k=c(window),y=k.height(),w=k.width(),N=/OS 6(_\d)+/i.test(navigator.userAgent),v=0,e,h,q,n,g,z,x,t,u,J,H;b.close=function(){r()};b.reposition=function(a){I(a)};return b.each(function(){c(this).data("bPopup")||(l(a.onOpen),v=(k.data("bPopup")||0)+1,e="__b-popup"+v+"__",q="auto"!==a.position[1],n="auto"!==a.position[0],g="fixed"===a.positionStyle,t=b.outerHeight(!0),u=b.outerWidth(!0),a.loadUrl?L():B())})};c.fn.bPopup.defaults={amsl:50,appending:!0,appendTo:"body",autoClose:!1,closeClass:"b-close",content:"ajax",contentContainer:!1,easing:"swing",escClose:!0,follow:[!0,!0],followEasing:"swing",followSpeed:500,iframeAttr:'scrolling="no" frameborder="0"',loadCallback:!1,loadData:!1,loadUrl:!1,modal:!0,modalClose:!0,modalColor:"#000",onClose:!1,onOpen:!1,opacity:.7,position:["auto","auto"],positionStyle:"absolute",scrollBar:!0,speed:250,transition:"fadeIn",transitionClose:!1,zIndex:9997}})(jQuery);
13window.addEventListener('load', function(){
14    handleNav();
15});
16
17function handleNav() {
18    var btnNavs = document.querySelectorAll('.eNavFold');
19    var btnClose = document.querySelector('#aside .btnClose');
20    var dimmed = document.querySelector('#layoutDimmed');
21    var elements = document.getElementsByClassName("test");
22    btnNavs.forEach( function(btnNav) {
23        btnNav.addEventListener('click', function(){
24            document.body.classList.add('expand');
25        });
26    });
27    btnClose.addEventListener('click', function(){
28        document.body.classList.remove('expand');
29    });
30    handleDimmed(dimmed, document.body, 'expand');
31}
32
33function handleDimmed(target, element, className){
34    target.addEventListener('click', function(){
35        element.classList.remove(className);
36    });
37}
38
39
40    // Scroll to top button
41    $('#scroll_up_down a.up').click(function() {
42        $('html, body').animate({ scrollTop: 0 }, 1000);
43        return false;
44    });
45    $('#scroll_up_down a.down').click(function() {
46        $('html, body').animate({ scrollTop: $(document).height() - $(window).height() }, 1000);
47        return false;
48    });
49
50
51
52
53
54
55    // Loop animation
56    function loop() {
57        $('.c_joinpoint').animate({ left: '+=2' }, 200)
58            .animate({ left: '-=2' }, 200)
59            .animate({ left: '+=2' }, 200)
60            .animate({ left: '-=2' }, 200)
61            .animate({ left: -2 }, 1000, function() {
62                loop();
63            });
64    }
65    loop();
66
67
68
69
70
71	/* 검색 팝업   */
72	jQuery(".icon_search").bind('click', function(e) {
73		e.preventDefault();
74		jQuery('#quick_search').bPopup({
75			follow: [true, true],
76			position: ['auto', 'auto'],
77			//closeClass : '.quick_searchClose',
78			modalClose: true,
79			modalColor : '#000',
80			opacity: .9,
81			positionStyle: 'fixed',
82			transition : 'fadeIn'
83		});
84            var input = document.querySelector('#keyword');
85            input.focus();
86            // Set placeholder for input
87            $("input#keyword").attr("placeholder", "Start Searching");        
88	});
89
90
91
92/**
93 * hasClass
94 */
95function hasClass(element, className){
96    return (' ' + element.className + ' ').indexOf(' ' + className+ ' ') > -1;
97};
98
99/**
100 *  toggle
101 */
102function toggleClassAll(element, handler, className){
103    var _handler = document.querySelector(handler);
104    document.querySelectorAll(handler).forEach(function(item){
105        item.addEventListener('click', function(){
106            var _element = item.parentNode;
107            if ( hasClass( _element, className ) ) {
108                _element.classList.remove( className );
109            } else {
110                _element.classList.add( className );
111            }
112        })
113    })
114};
115
116/**
117 *  findElements
118 */
119function findElements(element, findElement){
120    var resultElements = [];
121    document.querySelectorAll(element).forEach(function(item){
122        var findElementList = item.querySelectorAll(findElement);
123        findElementList = Array.prototype.slice.call(findElementList);
124        resultElements = resultElements.concat(findElementList);
125    })
126    return resultElements;
127};
128
129/**
130 *  setAttributeAl
131 */
132function setAttributeAll(elements, name, value){
133    elements.forEach(function(item){
134        item.setAttribute(name, value);
135    })
136};
137
138/**
139 *  tooltip
140 */
141function setTooltipEvent(){
142    var input = findElements('.eTooltip', 'input');
143    input.forEach(function(item){
144        item.addEventListener('focusin', function(event){
145            var targetName = returnTargetName(event.target);
146            targetName.nextElementSibling.style.display = 'block'
147        });
148        item.addEventListener('focusout', function(event){
149            var targetName = returnTargetName(event.target);
150            targetName.nextElementSibling.style.display = 'none'
151        });
152    });
153}
154
155/**
156 *  tooltip input focus
157 */
158function returnTargetName(_this){
159    var ePlacename = _this.parentElement.getAttribute("class");
160    var targetName;
161    if(ePlacename == "ePlaceholder"){ //ePlaceholder supported
162        targetName = _this.parentElement;
163    }else{
164        targetName = _this;
165    }
166    return targetName;
167}
168
169/**
170 * window load
171 */
172window.addEventListener('load', function(){
173    if (document.querySelector('.eTooltip')){
174        setAttributeAll(findElements('.eTooltip', '.btnClose'),'tabIndex','-1');
175        setTooltipEvent();
176    }
177    if (document.querySelector('div.eToggle')){
178        toggleClassAll(false, 'div.eToggle .title', 'selected');
179    }
180});
181
182// 썸네일 이미지 엑박일경우 기본값 설정
183$(window).on('load', function() {
184    $(".thumbnail img, img.thumbImage, img.bigImage").each(function($i,$item){
185        var $img = new Image();
186        $img.onerror = function () {
187            $item.src="//img.echosting.cafe24.com/thumb/img_product_big.gif";
188        }
189        $img.src = this.src;
190    });
191});
192
193$(function(){
194
195
196    $('dl.eToggle dt').on('click', function(){
197        $(this).toggleClass('selected');
198        $(this).next('dd').toggleClass('selected');
199    });
200
201    /*장바구니 페이지 수량폼 Type 변경
202    $('[id^="quantity"]').each(function() {
203        $(this).get(0).type = 'tel';
204    });
205
206    // 모바일에서 공급사 테이블 th 강제조절
207    $('.xans-mall-supplyinfo, .supplyInfo').find('table > colgroup').find('col').eq(0).width(98);
208    $('.xans-mall-supplyinfo, .supplyInfo').find('th, td').css({padding:'13px 10px 12px'});
209
210    /**
211     *  메인카테고리 toggle
212  
213    $('.xans-product-listmain h2').on('click', function() {
214        var bClosed = !!$(this).data('is_closed');
215        var sUrl;
216        if (bClosed) {
217            sUrl = "//img.echosting.cafe24.com/skin/mobile_ko_KR/layout/bg_title_close.gif";
218        } else {
219            sUrl = "//img.echosting.cafe24.com/skin/mobile_ko_KR/layout/bg_title_open.gif";
220        }
221        $(this).css('background-image', 'url("'+ sUrl +'")');
222        $(this).siblings().toggle();
223        $(this).parent().find('div.ec-base-paginate').toggle();
224        $(this).parent().next('div.xans-product-listmore').toggle();
225        $(this).data('is_closed', !bClosed);
226    });
227  */
228    /**
229     *  상단탑버튼
230     */
231    var globalTopBtnScrollFunc = function() {
232        // 탑버튼 관련변수
233        var $btnTop = $('#btnTop');
234
235        $(window).on('scroll', function() {
236            try {
237                var iCurScrollPos = $(this).scrollTop();
238
239                if (iCurScrollPos > ($(this).height() / 2)) {
240                    $btnTop.fadeIn('fast');
241                } else {
242                    $btnTop.fadeOut('fast');
243                }
244            } catch(e) { }
245        });
246    };
247
248    /**
249     *  구매버튼
250     */
251    var globalBuyBtnScrollFunc = function() {
252        // 구매버튼 관련변수
253        var sFixId = $('#orderFixItem').length > 0  ? 'orderFixItem' : 'fixedActionButton',
254            $area = $('#orderFixArea'),
255            $item = $('#' + sFixId + '').not($area);
256
257        $(window).on('scroll', function(){
258            try {
259                 // 구매버튼 관련변수
260                var iCurrentHeightPos = $(this).scrollTop() + $(this).height(),
261                    iButtonHeightPos = $item.offset().top;
262
263                if (iCurrentHeightPos > iButtonHeightPos || iButtonHeightPos < $(this).scrollTop() + $item.height()) {
264                    if (iButtonHeightPos < $(this).scrollTop() - $item.height()) {
265                        $area.fadeIn('fast');
266                    } else {
267                        $area.hide();
268                    }
269                } else {
270                    $area.fadeIn('fast');
271                }
272            } catch(e) { }
273        });
274    };
275
276    globalTopBtnScrollFunc();
277    globalBuyBtnScrollFunc();
278});
279
280// 공통레이어팝업 오픈
281var globalLayerOpenFunc = function(_this) {
282    this.id = $(_this).data('id');
283    this.param = $(_this).data('param');
284    this.basketType = $('#basket_type').val();
285    this.url = $(_this).data('url');
286    this.layerId = 'ec_temp_mobile_layer';
287    this.layerIframeId = 'ec_temp_mobile_iframe_layer';
288
289    var _this = this;
290
291    function paramSetUrl() {
292        if (this.param) {
293            // if isset param
294        } else {
295            this.url = this.basketType ?  this.url + '?basket_type=' + this.basketType : this.url;
296        }
297    };
298
299    if (this.url) {
300        window.ecScrollTop = $(window).scrollTop();
301        $.ajax({
302            url : this.url,
303            success : function (data) {
304                if (data.indexOf('404 페이지 없음') == -1) {
305                    // 있다면 삭제
306                    try { $(_this).remove(); } catch ( e ) { }
307
308                    var $layer = $('<div>', {
309                        html: $("<iframe>", { src: _this.url, id: _this.layerIframeId, scrolling: 'auto', css: { width: '100%', height: '100%', overflowY: 'auto', border: 0 } } ),
310                        id: _this.layerId,
311                        css : { position: 'absolute', top: 0, left:0, width: '100%', height: $(window).height(), 'z-index': 9999 }
312                    });
313
314                    $('body').append($layer);
315                    $('html, body').css({'overflowY': 'hidden', height: '100%', width: '100%'});
316                    $('#' + this.layerId).show();
317                }
318            }
319        });
320    }
321};
322
323// 공통레이어팝업 닫기
324var globalLayerCloseFunc = function() {
325    this.layerId = 'ec_temp_mobile_layer';
326
327    if (window.parent === window)
328        self.close();
329    else {
330        parent.$('html, body').css({'overflowY': 'auto', height: 'auto', width: '100%'});
331        parent.$('html, body').scrollTop(parent.window.ecScrollTop);
332        parent.$('#' + this.layerId).remove();
333    }
334};
335
336/**
337 * document.location.href split
338 * return array Param
339 */
340var getQueryString = function(sKey)
341{
342    var sQueryString = document.location.search.substring(1);
343    var aParam = {};
344
345    if (sQueryString) {
346        var aFields = sQueryString.split("&");
347        var aField  = [];
348        for (var i=0; i<aFields.length; i++) {
349            aField = aFields[i].split('=');
350            aParam[aField[0]] = aField[1];
351        }
352    }
353
354    aParam.page = aParam.page ? aParam.page : 1;
355    return sKey ? aParam[sKey] : aParam;
356};
357
358
359/* 도움말 */
360$('body').on('click', '.ec-base-tooltip-area .eTip', function(e){
361    var findArea = $($(this).parents('.ec-base-tooltip-area'));
362    var findTarget = $($(this).siblings('.ec-base-tooltip'));
363    var findTooltip = $('.ec-base-tooltip');
364    $('.ec-base-tooltip-area').removeClass('show');
365    $(this).parents('.ec-base-tooltip-area').first().addClass('show');
366    findTooltip.hide();
367    findTarget.show();
368    e.preventDefault();
369});
370
371$('body').on('click', '.ec-base-tooltip-area .eClose', function(e){
372    var findTarget = $(this).parents('.ec-base-tooltip').first();
373    $('.ec-base-tooltip-area').removeClass('show');
374    findTarget.hide();
375    e.preventDefault();
376});
377
378$('.ec-base-tooltip-area').find('input').on('focusout', function() {
379    var findTarget = $(this).parents('.ec-base-tooltip-area').find('.ec-base-tooltip');
380    $('.ec-base-tooltip-area').removeClass('show');
381    findTarget.hide();
382});
383
384
385(function(){ var h = {};	var a = {};   var c = {};  
386/*###################################################################################################
387
388	▶ 수정안내
389	아래 각 항목의 " "따옴표 사이에 내용만 수정해주세요. 
390	그 외 다른 코드를 임의로 수정하거나, 엔터키 입력시 오류가 발생될 수 있습니다. 
391
392	▶ 복구안내
393	문제가 발생된 경우 /momoi/info-backup.js 파일에 내용을 복사하여 해당 페이지에 붙여넣기 하면 초기 상태로 복구됩니다.  
394    
395###################################################################################################*/ 
396    
397    
398   
399/*------------------------------------------------------------------------------------------------*/   
400/*  		4.적립금 말풍선 
401/*------------------------------------------------------------------------------------------------*/   
402    
403    // 말풍선 표시여부 설정하기  
404	// 입력값: on (표시함) 
405    // 입력값 : off (표시안함)
406	c.joinpoint = "on";  
407
408    // 말풍선 금액 
409	h.point_text = "+20,000";         
410
411     
412        
413    
414    
415    
416    
417/*------------------------------------------------------------------------------------------------*/  
418/*   		14.콜&뱅킹&교환.반품 정보 (<br> 태그는 줄바꿈 태그입니다.)
419/*------------------------------------------------------------------------------------------------*/  
420    
421    // 콜센터 운영시간 
422	h.cs_on =  "  <p>카카오톡 채널[디어바이미]</p>  </p> MON - FRI 13:00 -  17:00  ";     
423	h.cs_off = " SAT.SUN.HOLIDAY OFF ";     
424    
425    // 전화번호 표시여부 설정 
426	// 입력값: on (표시함) 
427    // 입력값 : off (표시안함)
428	c.call_tel = " on ";          
429
430    
431    
432	// 계좌정보      
433	h.bank_name = "예금주 : 허정연(디어바이미)";         
434	h.bank_info1 = "우리은행 1005-404-938020 ";       
435
436    
437    
438    // 반품&교환 타이틀 
439	h.re_title = " 반품/교환주소 ";      
440    // 반품&교환 주소
441	h.re_info = " 반품주소는 매뉴얼을 참고하여 입력해주세요  ";  // 사용하지 않을 경우 따옴표 사이에 내용만 지워주세요 
442     
443        
444    
445    
446    
447   
448/*------------------------------------------------------------------------------------------------*/  
449/*  		16.SNS 아이콘
450
451/*  		url주소의 경우 따옴표(" ") 사이에 여백이 없도록 넣어주세요.
452/*  		입력값: on (표시함) 
453/*  		입력값 : off (표시안함)
454/*------------------------------------------------------------------------------------------------*/   
455    
456	//  카카오톡 표시여부       
457	c.kakaotalk = "on";       
458	// 카카오톡 주소      
459	a.kakaotalk = "https://pf.kakao.com/_IuhUK";       
460    //  우측 고정형 카카오톡 표시여부
461	c.fix_talk = " on ";      
462                   
463    //  인스타그램 표시여부 
464	c.instagram1 = " on ";            
465    // 인스타그램 주소 
466	a.instagram1 = "https://www.instagram.com/dearbyme_official/";       
467                   
468    //  인스타그램 표시여부 
469	c.instagram2 = " on ";            
470    // 인스타그램 주소 
471	a.instagram2 = "https://www.instagram.com/dear.jungyeon/";     
472                               
473    // 유튜브 표시여부    
474	c.youtube = " on ";     
475    // 유튜브 주소    
476	a.youtube = "https://www.youtube.com/@jungyeonii";              
477            
478    //  페이스북 표시여부 
479	c.facebook = " off ";   
480    // 페이스북 주소 
481	a.facebook = "https://www.facebook.com/";      
482    
483    //  블로그 표시여부  
484	c.nblog = " off ";         
485    // 블로그 주소    
486	a.nblog = "https://www.naver.com/";             
487  
488    // 스마트스토어 표시여부       
489	c.sstore = " off ";     
490    // 스마트스토어 주소        
491	a.sstore = "https://www.naver.com/";  
492    
493    // 네이버톡톡 표시여부        
494	c.talktalk = " off ";    
495    // 네이버톡톡 주소  
496	a.talktalk = "https://www.naver.com/";      
497    //  우측 고정형 네이버톡톡 표시여부
498	c.fix_talktalk = " off "; 
499    
500    
501    
502    
503   
504/*------------------------------------------------------------------------------------------------*/     
505/*  		100.기타 기능
506/*  		입력값: on (표시함) 
507/*  		입력값 : off (표시안함)
508/*------------------------------------------------------------------------------------------------*/        
509
510	// 메인 구매후기 사용여부              
511	c.mainreview = " on ";     
512
513 
514
515    // 상품정보 정렬 
516    // 입력값: left   (왼쪽 정렬)
517    // 입력값: center (가운데 정렬)
518	c.itemalign = " left ";      // 스크롤링 기능에서는 적용되지 않습니다.
519    
520                             
521                                                         
522    // 포인트 배경색 변경 
523    // 색상표 이용방법 :  네이버에서 "색상 팔레트"로 검색 
524    // 위 색상표에서 #으로 시작하는 6자리 코드를 복사해서 아래 배경색상에 붙여넣기해주세요.                                                             
525	pointBg = "#222";  
526    
527    // 포인트 폰트 색상 (기본 화이트 색상)
528	pointColor = "#fff";     
529    
530                             
531                                                         
532    // 왼쪽 카테고리 여백 추가
533    // 매뉴얼에서 "2-1.그 외 메뉴"의 카테고리 번호 확인 방법을 참고해주세요                                                       
534    c.customId = " 104 ";                                                     
535                                                         
536
537
538
539  
540    
541    
542    
543    
544    
545    
546    
547    
548    
549    
550    
551    
552    
553    
554    
555    
556    
557    
558    
559    
560    
561    
562    
563    
564    
565    
566    
567    
568    
569    
570    
571    
572    
573    
574    
575    
576    
577    
578    
579    
580    
581    
582    
583    
584    
585    
586    
587    
588    
589    
590    
591    
592    
593    
594    
595    
596    
597    
598// 아래 내용은 절대 삭제 금지  
599for (var key in c) { $('.c_' + key).addClass(c[key]); };  // class        
600// for (var key in n) { $('.n_' + key).addClass('grid' + n[key]); };  // number + class                                                           
601for (var key in h) { $('.h_' + key).html(h[key]);};  // html
602for (var key in a) { var value = a[key]; $('.a_' + key).attr('href', value); }; // href                                                       
603$(":root").css('--pointbg', pointBg); 
604$(":root").css('--pointtext', pointColor);      
605var categoryId = "cate" + parseInt(c.customId.trim(), 10);
606var elementsWithCustomId = document.querySelectorAll("#" + categoryId);
607
608elementsWithCustomId.forEach(function (element) {
609  element.classList.add("custom-margin");
610});
611 
612}())
613
614var aCategory = [];
615$(document).ready(function(){
616    var methods = {
617        aCategory    : [],
618        aSubCategory : {},
619        get: function() {
620             $.ajax({
621                url : '/exec/front/Product/SubCategory',
622                dataType: 'json',
623                success: function(aData) {
624                    if (aData == null || aData == 'undefined') {
625                        methods.checkSub();
626                        return;
627                    }
628                    for (var i=0; i<aData.length; i++)
629                    {
630                        var sParentCateNo = aData[i].parent_cate_no;
631                        var sCateNo = aData[i].cate_no;
632                        if (!methods.aSubCategory[sParentCateNo]) {
633                            methods.aSubCategory[sParentCateNo] = [];
634                        }
635                        if (!aCategory[sCateNo]) {
636                            aCategory[sCateNo] = [];
637                        }
638                        methods.aSubCategory[sParentCateNo].push( aData[i] );
639                        aCategory[sCateNo] = aData[i];
640                        
641                    }
642                    methods.checkSub();
643//                    
644                    // 대분류에 대한 링크만 생성
645                    $.each(aData, function(idx, item) {
646                        if (methods.aSubCategory[item.cate_no] == undefined) {
647                            var sHref = '/'+item.design_page_url+item.param;
648                            $('#cate'+item.cate_no).find('.cate').attr('href', sHref);
649                        }
650                    });
651                        
652                    
653                }
654            });
655        },
656        getParam: function(sUrl, sKey) {
657            if (typeof sUrl !== 'string') return;
658            var aUrl         = sUrl.split('?');
659            var sQueryString = aUrl[1];
660            var aParam       = {};
661            if (sQueryString) {
662                var aFields = sQueryString.split("&");
663                var aField  = [];
664                for (var i=0; i<aFields.length; i++) {
665                    aField = aFields[i].split('=');
666                    aParam[aField[0]] = aField[1];
667                }
668            }
669            return sKey ? aParam[sKey] : aParam;
670        },
671
672show: function(overNode, iCateNo) {
673    var oParentNode = overNode;
674    var aHtml = [];
675    var sMyCateList = localStorage.getItem("myCateList");
676    if (methods.aSubCategory[iCateNo] != undefined) {
677        aHtml.push('<ul class="slideSubMenu">');
678        $(methods.aSubCategory[iCateNo]).each(function() {
679            var sNextParentNo = this.cate_no;
680            var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : '';
681            if (methods.aSubCategory[sNextParentNo] == undefined) {
682                aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">');
683                var sHref = '/'+this.design_page_url+this.param;
684                aHtml.push('<a href="'+sHref+'" class="cate 1" cate="'+this.param+'"  onclick="subMenuEvent(this);" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>');
685            } else {
686                aHtml.push('<li id="cate'+this.cate_no+'">');
687                var sHref = '#none';
688                aHtml.push('<a href="/' + this.design_page_url + this.param+'" class="view 1">상품보기</a>'); //중분류
689                if (methods.aSubCategory[sNextParentNo] != undefined)  aHtml.push('<a href="'+sHref+'" class="cate 1" cate="'+this.param+'"  onclick="subMenuEvent(this);" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>');
690            }
691
692            if (methods.aSubCategory[sNextParentNo] != undefined) {
693                aHtml.push('<ul class="slideSubMenu-child">');
694                $(methods.aSubCategory[sNextParentNo]).each(function() {
695                    var sNextParentNo2 = this.cate_no;
696                    var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : '';
697                    if (methods.aSubCategory[sNextParentNo2] == undefined) {
698                        aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">');
699                        var sHref = '/'+this.design_page_url+this.param;
700                        aHtml.push('<a href="'+sHref+'" class="cate 2" cate="'+this.param+'"  onclick="subMenuEvent(this);" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>');
701                    } else {
702                        aHtml.push('<li id="cate'+this.cate_no+'">');
703                        var sHref = '#none';
704                        aHtml.push('<a href="/' + this.design_page_url + this.param+'" class="view 2">상품보기</a>');
705                        if (methods.aSubCategory[sNextParentNo] != undefined)  aHtml.push('<a href="/' + this.design_page_url + this.param+'"  onclick="subMenuEvent(this);" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>');
706                    }
707
708                    if (methods.aSubCategory[sNextParentNo2] != undefined) {
709                        aHtml.push('<ul>');
710                        $(methods.aSubCategory[sNextParentNo2]).each(function() {
711                            aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">');
712                            var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : '';
713                            aHtml.push('<a href="'+sHref+'" class="cate 3" cate="'+this.param+'"  onclick="subMenuEvent(this);" data-i18n="LIST.PRD_CATE_NO_'+this.cate_no+'" data-i18n-new>'+this.name+'</a>');
714                            aHtml.push('</li>');
715                        });
716                        aHtml.push('</ul>');
717                    }
718                    aHtml.push('</li>');
719                });
720                aHtml.push('</ul>');
721            }
722            aHtml.push('</li>');
723        });
724        aHtml.push('</ul>');
725    }
726    if($(oParentNode).children('ul').length < 1) {
727        $(oParentNode).append(aHtml.join(''));
728    }
729    if (window.i18nextCafe24) {
730        i18nextCafe24.translate('data-i18n-new');
731    }
732},
733
734        close: function() {
735            //$('.slideSubMenu').remove();
736        },
737        checkSub: function() {
738            $('.cate').each(function(){
739                var sParam = $(this).attr('cate');
740                if (!sParam) return;
741                var iCateNo = Number(methods.getParam(sParam, 'cate_no'));
742                var result = methods.aSubCategory[iCateNo];
743                if (result == undefined) {
744                    if ($(this).closest('#slideProjectList').length) {
745                        var sHref = '/product/project.html'+sParam;
746                    } else {
747                        var sHref = '/product/list.html'+sParam;
748                    }
749
750                    $(this).attr('href', sHref);
751                    //$(this).parent().attr('class', 'noChild');
752                    var currentClasses = $(this).parent().attr('class');
753                    var newClasses = currentClasses.replace(/(?:^|\s)(menu|xans-record-)(?=\S|$)/g, '') + ' noChild';
754                    $(this).parent().attr('class', newClasses);                 
755                }
756            });
757        }
758    };
759
760    methods.get();
761    
762
763    $('#slideCateList > ul > li > a.cate').on('click', function(e) {
764        //e.preventDefault();
765
766        var sParam = $(this).attr('cate');
767        var iCateNo = Number(methods.getParam(sParam, 'cate_no'));
768
769        if (sParam && iCateNo) {
770            $('#aside #slideCateList li').removeClass('selected');
771            methods.close();
772            methods.show(this.parentNode, iCateNo);
773        }
774
775        var $submenu = $(this).next('.slideSubMenu');
776
777        if (!$(this).hasClass('on')) {
778            $('#slideCateList > ul > li > a.cate').removeClass('on');
779            $(this).addClass('on');
780            $('.slideSubMenu').not($submenu).slideUp(200);
781            $submenu.slideDown(200);
782        } else {
783            $(this).removeClass('on');
784            $('.slideSubMenu').slideUp(200);
785        }
786    });
787
788    $(document).on('click', '.slideSubMenu > li > a.cate', function(e) {
789        //e.preventDefault();
790        var $submenuChild = $(this).next('.slideSubMenu-child');
791
792        if (!$(this).hasClass('on')) {
793            $('.slideSubMenu > li > a.cate').removeClass('on');
794            $(this).addClass('on');
795            $('.slideSubMenu-child').not($submenuChild).slideUp(200);
796            $submenuChild.slideDown(200);
797        } else {
798            $(this).removeClass('on');
799            $('.slideSubMenu-child').slideUp(200);
800        }
801    });
802
803
804    $('#aside ul a.cate').on('click', function(e){
805        $(this).parent().find('li').removeClass('selected');
806        $(this).parent().toggleClass('selected');
807        if (!$(this).parent('li').hasClass('noChild')){
808            e.preventDefault();
809        }
810    });
811
812    $('#slideCateList h2').on('click', function() {
813        var oParentId = $(this).parent().attr('id');
814        if (oParentId == 'slideCateList' || oParentId == 'slideMultishopList' || oParentId == 'slideProjectList') {
815            ($(this).attr('class') == 'selected') ? $(this).next().hide() : $(this).next().show();
816        }
817        $(this).toggleClass('selected');
818    });
819
820    $('#slideProjectList .icoCategory').on('click', function() {
821        var target = $(this).parents('#slideProjectList');
822        if(target.find('.categoryList').css("display") == "none"){
823            target.find('.categoryList').show();
824        }else{
825            target.find('.categoryList').hide();
826        }
827        
828        $(this).parents('.title').toggleClass('selected');
829    });
830
831});
832function subMenuEvent(obj) {
833    $(obj).parent().find('li').removeClass('selected');
834    $(obj).parent().toggleClass('selected');
835}
836
837function checkInArray(sBookmarkList, iCateNo) {
838    if (sBookmarkList == null) return false;
839    var aBookmarkList = sBookmarkList.split("|");
840    for (var i = 0; i < aBookmarkList.length; i++) {
841        if (aBookmarkList[i] == iCateNo) {
842            return true;
843        }
844    }
845    return false;
846}
847
848
849
850$(window).scroll(function(){
851    var headerScrollTop = $(document).scrollTop();
852    
853    // #header에 대한 처리
854    handleScroll('#header', headerScrollTop, 0);
855
856    // #snb에 대한 처리
857    handleScroll('#snb', headerScrollTop, 0);
858});
859
860function handleScroll(elementId, scrollPosition, threshold) {
861    var $element = $(elementId);
862
863    if (scrollPosition > threshold) {
864        $element.addClass('fixed');
865    } else {
866        $element.removeClass('fixed');
867    }
868}
869
870
871
872
873$(document).ready(function () {
874  // 카테고리 데이터 저장 객체
875  var categoryData = {};
876
877  // 카테고리 데이터를 가져오는 함수
878  function getCategoryData() {
879    $.ajax({
880      url: '/exec/front/Product/SubCategory',
881      dataType: 'json',
882      success: function (data) {
883        // 카테고리 데이터를 저장
884        $(data).each(function () {
885          if (!categoryData[this.parent_cate_no]) {
886            categoryData[this.parent_cate_no] = [];
887          }
888          categoryData[this.parent_cate_no].push(this);
889        });
890        // 카테고리 메뉴 그리기
891        Category();
892      },
893    });
894  }
895
896  // 카테고리 메뉴를 그리는 함수
897  function Category() {
898    $('#category .menu-dp1 > li > a').each(function () {
899      var hrefParts = $(this).attr('href').split('?cate_no=');
900      var cateNo = hrefParts[1];
901
902      // 해당 카테고리에 데이터가 없으면 스킵
903      if (!categoryData[cateNo]) {
904        return;
905      }
906
907      var html = [];
908      html.push('<ul class="menu-dp2">');
909      for (var i = 0; i < categoryData[cateNo].length; i++) {
910        var category = categoryData[cateNo][i];
911        html.push(
912          '<li><a href="/' + category.design_page_url + category.param + '">' + category.name + '</a></li>'
913        );
914      }
915      html.push('</ul>');
916      $(this).parent('.menu-dp1 > li').append(html.join(''));
917
918      $(this)
919        .siblings('.menu-dp2')
920        .find(' > li > a')
921        .each(function () {
922          var hrefParts = $(this).attr('href').split('?cate_no=');
923          var cateNo = hrefParts[1];
924          if (!categoryData[cateNo]) {
925            return;
926          }
927
928          var html = [];
929          html.push('<ul class="menu-dp3">');
930          for (var i = 0; i < categoryData[cateNo].length; i++) {
931            var category = categoryData[cateNo][i];
932            html.push(
933              '<li><a href="/product/list.html' + category.param + '">' + category.name + '</a></li>'
934            );
935          }
936          html.push('</ul>');
937          $(this).parent('li').append(html.join(''));
938
939          $(this)
940            .siblings('.menu-dp3')
941            .find(' > li > a')
942            .each(function () {
943              var hrefParts = $(this).attr('href').split('?cate_no=');
944              var cateNo = hrefParts[1];
945              if (!categoryData[cateNo]) {
946                return;
947              }
948
949              /*var html = [];
950              html.push('<ul class="menu-dp4">');
951              for (var i = 0; i < categoryData[cateNo].length; i++) {
952                var category = categoryData[cateNo][i];
953                html.push(
954                  '<li><a href="/product/list.html' + category.param + '">' + category.name + '</a></li>'
955                );
956              }
957              html.push('</ul>');
958              $(this).parent('li').append(html.join(''));
959              */
960            });
961        });
962    });
963  }
964
965  // 카테고리 데이터 가져오기 및 메뉴 그리기 실행
966  getCategoryData();
967});
968
969
970
971$('#category .menu-dp1 > li > a').on('click', function(e) {
972    // .leftmenu li 태그에 자식 요소인 클래스 .menu-dp2가 있을 경우에만 클릭 이벤트 실행 방지
973    if ($(this).closest('.leftmenu li').find('.menu-dp2').length > 0) {
974        e.preventDefault();
975    }
976});
977
978var acodian = {
979  click: function(target) {
980    var _self = this,
981      $target = $(target);
982    $target.on('click', function() {
983      var $this = $(this);
984      var $menulist = $this.next('.menu-dp2');
985
986      if ($menulist.css('display') == 'none') {
987        $('.menu-dp2').slideUp(200);
988        _self.onremove($target);
989
990        $this.addClass('on');
991        $menulist.slideDown(200); 
992      } else {
993        $('.menu-dp2').slideUp(200); 
994        _self.onremove($target);
995      }
996    });
997  },
998  onremove: function($target) {
999    $target.removeClass('on');
1000  }
1001};
1002
1003acodian.click('#category .menu-dp1 > li > a, dt');
1004
1005    $('#dropmenu ul li a').filter(function() {
1006        return $(this).find('> span').length > 0;
1007    }).parent('li').addClass('plusmargin');
1008
1009$(function(){
1010    if (typeof(EC_SHOP_MULTISHOP_SHIPPING) != "undefined") {
1011        var sShippingCountryCode4Cookie = 'shippingCountryCode';
1012        var bShippingCountryProc = false;
1013
1014        // 배송국가 선택 설정이 사용안함이면 숨김
1015        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) {
1016            $('.xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist').hide();
1017            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptioncountry').hide();
1018        } else {
1019            $('.thumb .xans-layout-multishoplistitem').hide();
1020            var aShippingCountryCode = document.cookie.match('(^|;) ?'+sShippingCountryCode4Cookie+'=([^;]*)(;|$)');
1021            if (typeof(aShippingCountryCode) != 'undefined' && aS
1021hippingCountryCode != null && aShippingCountryCode.length > 2) {
1022                var sShippingCountryValue = aShippingCountryCode[2];
1023            }
1024
1025            // query string으로 넘어 온 배송국가 값이 있다면, 그 값을 적용함
1026            var aHrefCountryValue = decodeURIComponent(location.href).split("/?country=");
1027
1028            if (aHrefCountryValue.length == 2) {
1029                var sShippingCountryValue = aHrefCountryValue[1];
1030            }
1031
1032            // 메인 페이지에서 국가선택을 안한 경우, 그 외의 페이지에서 셋팅된 값이 안 나오는 현상 처리
1033            if (location.href.split("/").length != 4 && $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val()) {
1034                $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
1035
1036                if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
1037                    $("#f_country").val($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
1038                }
1039            }
1040            if (typeof(sShippingCountryValue) != "undefined" && sShippingCountryValue != "" && sShippingCountryValue != null) {
1041                sShippingCountryValue = sShippingCountryValue.split("#")[0];
1042                var bShippingCountryProc = true;
1043
1044                $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
1045                $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
1046                var expires = new Date();
1047                expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
1048                document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
1049                if ($("#f_country").length > 0 && location.href.indexOf("orderform.html") > -1) {
1050                    $("#f_country").val(sShippingCountryValue).change();
1051                }
1052            }
1053        }
1054        // 언어선택 설정이 사용안함이면 숨김
1055        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingLanguageSelection === false) {
1056            $('.xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist').hide();
1057            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption .xans-layout-multishoplistmultioptionlanguage').hide();
1058        } else {
1059            $('.thumb .xans-layout-multishoplistitem').hide();
1060        }
1061
1062        // 배송국가 및 언어 설정이 둘 다 사용안함이면 숨김
1063        if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShipping === false) {
1064            $(".xans-layout-multishopshipping").hide();
1065            $('.xans-layout-multishoplist .xans-layout-multishoplistmultioption').hide();
1066        } else if (bShippingCountryProc === false && location.href.split("/").length == 4) { // 배송국가 값을 처리한 적이 없고, 메인화면일 때만 선택 레이어를 띄움
1067            var sShippingCountryValue = $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val();
1068            $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val(sShippingCountryValue);
1069            $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a .ship span").text(" : "+$(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist option:selected").text().split("SHIPPING TO : ").join(""));
1070            // 배송국가 선택을 사용해야 레이어를 보이게 함
1071            if (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === true) {
1072                $(".xans-layout-multishopshipping").show();
1073            }
1074        }
1075
1076        $(".xans-layout-multishopshipping .btnClose").on("click", function() {
1077            $(".xans-layout-multishopshipping").hide();
1078        });
1079
1080        $(".xans-layout-multishopshipping .ec-base-button a").on("click", function() {
1081            var expires = new Date();
1082            expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30일간 쿠키 유지
1083            document.cookie = sShippingCountryCode4Cookie+'=' + $(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val() +';path=/'+ ';expires=' + expires.toUTCString();
1084
1085            // 도메인 문제로 쿠키로 배송국가 설정이 안 되는 경우를 위해 query string으로 배송국가 값
1085을 넘김
1086            var sQuerySting = (EC_SHOP_MULTISHOP_SHIPPING.bMultishopShippingCountrySelection === false) ? "" : "/?country="+encodeURIComponent($(".xans-layout-multishopshipping .xans-layout-multishopshippingcountrylist").val());
1087
1088            location.href = '//'+$(".xans-layout-multishopshipping .xans-layout-multishopshippinglanguagelist").val()+sQuerySting;
1089        });
1090        $(".xans-layout-multishoplist .xans-layout-multishoplistmultioption a").on("click", function() {
1091            $(".xans-layout-multishopshipping").show();
1092        });
1093    }
1094});

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.