PageSourceSearch

https://cfm.kt.com/js/v2/common/kt_search.js

js kt.com collected 2026-09-24 08:26:54 UTC 28,679 bytes, 660 lines download raw bytes

1/* 
2   KT.com version 1.0
3  
4   Copyright ⓒ 2017 kt corp. All rights reserved.
5   
6   This is a proprietary software of kt corp, and you may not use this file except in 
7   compliance with license agreement with kt corp. Any redistribution or use of this 
8   software, with or without modification shall be strictly prohibited without prior written 
9   approval of kt corp, and the copyright notice above does not evidence any actual or 
10   intended publication of such software. 
11*/ 
12
13$j = jQuery.noConflict(), $=$j;
14
15var cfmSearchRecommendResult = {}; //추천검색어
16var cfmSearchAreaHtml = {
17
18    //링크정보 
19    linkInfo: function(mode, type, traget, item){        
20        var linkType = '_self';
21        var titleName = 'KT-개인_공통';
22        var urlInfo = search_URL +'/?c=OLE000000&r=10&ch=USR000';
23        var statInfo = '^KT-개인_공통^GNB^검색레이어^';
24
25        if(kt_common.pageType() == 'shop'){ //Shop
26            statInfo = '^KT-개인_공통^GNB^Shop^검색레이어^';
27            urlInfo = search_URL +'/?c=SHO000000';
28        }
29
30        if(traget != null){
31             traget.on('click', function(){
32                var keyword = '';
33                if(type == 'popular'){
34                    var statInfoType = '인기검색어^';
35                    if(kt_common.pageType() == 'shop' && $j('.kt_popkeyword').hasClass('active')){ //Shop&KT인기검색어
36                        statInfoType += 'KT^';
37                    }else if(kt_common.pageType() != 'shop' && $j('.shop_popkeyword').hasClass('active')){ //닷컴&Shop인기검색어
38                        statInfoType += 'Shop^';
39                    }
40
41                    keyword = $j(this).attr('keyword');
42                    urlInfo = urlInfo +'&q='+ encodeURIComponent(keyword);
43                    statInfo = statInfo + statInfoType + $j(this).find('.num').text() +'위^'+ keyword;
44                }else if(type == 'autowords'){
45                    keyword = $j(this).attr('keyword');
46                    urlInfo = urlInfo +'&q='+ encodeURIComponent(keyword);
47                    statInfo = statInfo + '자동완성^'+ keyword;
48                }else if(type == 'autoconts'){
49                    keyword = $j(this).attr('keyword');
50                    urlInfo = '';
51                    statInfo = statInfo + '이미지^'+ keyword;
52                }else if(type == 'words'){
53                    urlInfo = '';
54                    statInfo = statInfo + '메뉴바로가기^'+ item.MENUNAME;
55                }else if(type == 'special'){
56                    urlInfo = '';
57                    statInfo = statInfo + '기획전^'+ item.TITLE;
58                }else if(type == 'related'){
59                    urlInfo = '';
60                    statInfo = statInfo + '연관상품^'+ item.RELATE_TITLE;
61                }
62
63                kt_common.link(urlInfo, linkType, titleName, statInfo);
64                if(urlInfo != '') return false;
65            });
66        }else{
67            if(type == 'search'){
68                urlInfo = urlInfo +'&q='+ encodeURIComponent(item.keyword);
69                statInfo = statInfo + item.keyword +'^검색버튼';           
70            }else if(type == 'click'){
71                urlInfo = '';
72                statInfo = statInfo + '검색필드';
73            }else if(type == 'clear'){
74                urlInfo = '';
75                statInfo = statInfo + '검색어리셋버튼';
76            }else if(type == 'close'){
77                urlInfo = '';
78                statInfo = statInfo + '닫기버튼';
79            }
80
81            kt_common.link(urlInfo, linkType, titleName, statInfo);
82        }
83    },
84
85    //검색어 하이라이팅
86    replaceKeyword: function(keyword, resultValue){
87        var replaceWord = '';
88        cfmKeyword = keyword.replace(/\s/g,''); // 공백 제거
89
90        for (var i = 0 ; i < cfmKeyword.length ; i ++ ) {
91            var charStr = cfmKeyword.substr(i,1);
92            // 정규식 시작 (
93            if (i === 0) replaceWord = '(';
94            if (cfmSearchAreaHtml.isSpecialChar(charStr)) {
95                // 정규식의 기본 특수문자일경우 일반문자로 치환하기 위해 \ 붙여줌
96                replaceWord += '\\' + charStr + '\\s*';
97            } else {
98                replaceWord += charStr + '\\s*';
99            }
100            // 정규식 끝 )
101            if ( i === cfmKeyword.length-1 ) replaceWord += ')';
102        }
103
104        var regex = new RegExp(replaceWord,'gi');
105        var repText = resultValue.replace(regex, '<em>$1</em>');
106
107        return repText;
108    },
109
110    //특수문자 체크
111    isSpecialChar: function(str){
112        var spChr = ['.','*','+','?','\\','^','$','[',']','(',')','{','}','|'];
113        var rtnVal = false;
114
115        $j(spChr).each(function(k,v){
116            if (str === v) rtnVal = true;
117        });
118
119        return rtnVal;
120    },
121
122    //통합검색-검색어 체크
123    searchWordCheck: function(str){
124        var result = str;
125        /* 검색api(rdi.kt.com) url 검색어 -> 파라미터 검색어로 변경으로 해결-2차
126        if(str != ''){
127            var regEx = new RegExp('[\#\%\;\.\/\?]', 'g'); //오류나는 특수문자 제거
128            result = result.replace(regEx, ''); 
129        }
130        */
131        return result;
132    },
133
134    //통합검색-추천검색어 callback
135    callbackSearchRecommend: function(type, result){
136        try {
137            if(type === 'success'){
138                if(kt_common.isNull(result.data) !== '' && result.data.length > 0){
139                    var resultList = result.data[0].areaSetList[0].areaContsList;
140                    if(kt_common.isNull(resultList) !== '' && resultList.length > 0){
141                        if(resultList.length > 0){
142                            cfmSearchRecommendResult = resultList[0]; // 포커싱될때 재설정을 위해
143
144                            $j('#total-search input[type=text]').attr('placeholder', cfmSearchRecommendResult.subTitle);
145                            $j('#total-search input[type=text]').data('recommend', cfmSearchRecommendResult.title);
146                        }
147                    }
148                }
149            }            
150        } catch (e) {
151            common_log.log('kt_search.js callbackSearchRecommend [' + e.message + ']');
152        }
153    },
154
155    //통합검색-인기검색어 callback
156    callbackSearchPopkeywords: function(type, result, mode){
157        if(mode == undefined) mode = kt_common.pageType();
158
159        $j('.cfmCltabs').find('a').removeClass('active').removeAttr('title');
160
161        if(mode == 'shop'){ //Shop
162            $j('.shop_popkeyword').addClass('active');
163		    $j('.shop_popkeyword').attr('title','선택된 탭');
164        }else{
165            $j('.kt_popkeyword').addClass('active');
166		    $j('.kt_popkeyword').attr('title','선택된 탭');
167        }
168
169        try {
170            if(type === 'success'){
171                $j('#rltmkywd-list').empty(); //초기화
172    
173                if(kt_common.isNull(result.data) !== ''){
174                    if(kt_common.isNull(result.data.response) !== ''){
175                        if(kt_common.isNull(result.data.response.docs) !== '' && result.data.response.docs.length > 0){
176                            var resultList = result.data.response.docs;
177                            $j.each(resultList, function(idx, data){
178                                var quick = $j('<li>'+
179                                '	<a href="#">'+
180                                '		<span class="num">' + data.ranking + '</span>'+
181                                '		<em>' + data.keyword + '</em>'+
182                                '	</a>'+
183                                '</li>');
184    
185                                if(data.rankarrow === 'U'){
186                                    quick.find('a').append('<span class="rankf_U"><span>순위상승</span>' + data.changevlu + '</span>');
187                                } else if(data.rankarrow === 'D'){
188                                    quick.find('a').append('<span class="rankf_D"><span>순위하락</span>' + data.changevlu + '</span>');
189                                } else if(data.rankarrow === 'E'){
190                                    quick.find('a').append('<span class="rankf_E"><span>순위변동없음</span></span>');
191                                } else {
192                                    quick.find('a').append('<span class="rankf_N">NEW</span>');
193                                }
194    
195                                quick.find('a').attr('keyword', data.keyword);
196                                cfmSearchAreaHtml.linkInfo('search', 'popular', quick.find('a'));
197    
198                                $j('#rltmkywd-list').append(quick);
199                            });
200                        }
201                    }
202                }
203            }            
204        } catch (e) {
205            common_log.log('kt_search.js callbackSearchPopkeywords [' + e.message + ']');
206        }
207
208    },
209
210    //통합검색-자동완성 callback
211    callbackSearchAutowords: function(type, result, words){
212        var target = $j('.auto-list');
213
214        try {
215            if(type === 'success'){      
216                target.empty(); //초기화
217    
218                var resultList = result.data.response.docs;
219                if(resultList.length > 0){
220                    $j.each(resultList, function(idx, data){
221                        var resultValue = data.KEYWORD;
222
223                        resultValue = resultValue.replaceAll("&lt;", "<").replaceAll( "&lt;","<").replaceAll("&gt;",">").replaceAll( "&#40;","(").replaceAll("&#41;",")").replaceAll( "&#39;","'"); 
224                        words = words.replaceAll("&lt;", "<").replaceAll( "&lt;","<").replaceAll("&gt;",">").replaceAll( "&#40;","(").replaceAll("&#41;",")").replaceAll( "&#39;","'"); 
225                        
226                        var highlight = '';
227                        if(words.length == 1){
228                            if(resultValue.indexOf(words.toUpperCase()) !== -1){
229                                highlight = resultValue.replace(words.toUpperCase(), '<em>' + words.toUpperCase() + '</em>');
230                            }else{
231                                highlight = resultValue.replace(words, '<em>' + words + '</em>');
232                            }
233                        }else{
234                            highlight = cfmSearchAreaHtml.replaceKeyword(words, resultValue);
235                        }
236    
237                        var auto = $j('<li><a href="#" class="cfmautolink" data-index="'+ idx +'">' + highlight + '</a></li>');
238    
239                        auto.find('a').attr('keyword', resultValue);
240                        cfmSearchAreaHtml.linkInfo('search', 'autowords', auto.find('a'));
241    
242                        target.append(auto);
243                    });				                
244    
245                    //이미지
246                    if(kt_common.pageType() != 'shop'){ //Shop 아닌경우만
247                        target.find('li:first').append('<div class="summary-banner"></div>');
248                        target.find('li a').on('mouseover focus', function(){
249                            var idx = $j(this).data('index');
250                            var data = resultList[idx];
251    
252                            if(kt_common.isNull(data.IMG_URL) !== '' && kt_common.isNull(data.LINK_URL) !== ''){
253                                var html = $j('<a href="'+ data.LINK_URL +'">
253<img src="'+ data.IMG_URL +'" alt="'+ kt_common.removeTag(data.IMG_DESC) +'" onerror="this.src=\'' + cfm_domain + '/images/v2/common/KT_summarybanner_noimg.jpg\'"></a>');
254                                
255                                html.attr('keyword', data.KEYWORD);
256                                cfmSearchAreaHtml.linkInfo('search', 'autoconts', html);
257    
258                                target.find('.summary-banner').html(html);
259                            }else{
260                                target.find('.summary-banner').html('<img src="' + cfm_domain + '/images/v2/common/KT_summarybanner_noimg.jpg" alt="이미지없음">');
261                            }
262                        });
263                        target.find('li:eq(0) a').mouseover();
264                    }
265                } else {
266                    target.append('<li>해당 검색어에 대한 검색결과가 없습니다.</li>');
267                }
268            }            
269        } catch (e) {
270            common_log.log('kt_search.js callbackSearchAutowords [' + e.message + ']');
271        }
272    },
273
274    //통합검색-바로가기 callback
275    callbackSearchwords: function(type, result, words){
276        var target = $j('.quick-menu');
277
278        try {
279            if(type === 'success'){
280                target.empty();
281    
282                var resultList = result.data.response.docs;
283                var searchKeyword = result.data.highlighting;
284                if(resultList.length > 0){
285                    $j.each(resultList, function(idx, data){
286                        var category = '';
287                        var menuPathArr = data.MENUPATH.split('^$^');
288                        var menuDepth = menuPathArr.length / 2;
289                        var menuName = '';
290                        var highlightTxt = searchKeyword[data.DOCID].MENUNAME;
291    
292                        for(var depth = 1; depth <= menuDepth; depth++){
293                            if(category !== ''){
294                                category += ' > ';
295                            }
296                        
297                            menuName = menuPathArr[(depth - 1) * 2];
298                            if(depth === menuDepth){
299                                category += highlightTxt;
300                            } else {
301                                category += menuName;
302                            }
303                        }
304    
305                        var link;
306                        if(kt_common.isNull(data.URL) !== ''){
307                            link = $j('<li><a href="'+ data.URL +'">' + category + '</a></li>');
308    
309                            link.attr('keyword', category);
310                            cfmSearchAreaHtml.linkInfo('search', 'words', link.find('a'), data);
311                        } else {
312                            link = $j('<li>' + category + '</li>');
313                        }
314    
315                        target.append(link);
316                    });                
317                    
318                    target.find('strong').contents().unwrap().wrap('<em></em>');
319                } else {
320                    target.append('<li>해당 검색어에 대한 검색결과가 없습니다.</li>');
321                }
322            }            
323        } catch (e) {
324            common_log.log('kt_search.js callbackSearchwords [' + e.message + ']');
325        }
326    },
327
328    //통합검색-기획전(Shop)-2차
329    callbackSearchSpecial: function(type, result, words){
330        var target = $j('.strategy-lilst');
331
332        try {
333            if(type === 'success'){
334                target.empty(); //초기화
335    
336                var resultList = result.data.response.docs;
337                var searchKeyword = result.data.highlighting;
338    
339                if(resultList.length > 0){
340                    $j.each(resultList, function(idx, data){
341                        var highlightTxt = searchKeyword[data.DOCID].TITLE;
342                        var link;
343    
344                        data.URL = data.LINKURL;
345                        if(kt_common.isNull(data.URL) !== ''){
346                            link = $j('<p class="tit"><a href="'+ data.URL +'">'+ highlightTxt +'</a></p>');
347    
348                            cfmSearchAreaHtml.linkInfo('search', 'special', link.find('a'), data);
349                        } else {
350                            link = $j('<p class="tit">'+ highlightTxt +'</p>');
351                        }
352    
353                        target.append(link);
354                    });
355    
356                    target.find('strong').contents().unwrap().wrap('<em></em>');
357                } else {
358                    target.append('<p class="tit">해당 검색어에 대한 <br>검색결과가 없습니다.</p>');
359                }
360            }            
361        } catch (e) {
362            common_log.log('kt_search.js callbackSearchSpecial [' + e.message + ']');
363        }
364    },
365
366    //통합검색-연관상품(Shop)-2차
367    callbackSearchRelatedProduct: function(type, result, words){
368        var target = $j('.relation-list');
369
370        try {
371            if(type === 'success'){
372                target.empty(); //초기화
373    
374                var resultList = result.data.response.docs;
375    
376                if(resultList.length > 0){
377                    $j.each(resultList, function(idx, data){
378                        var link, info = '';
379    
380                        if(kt_common.isNull(data.THUMBNAIL) !== ''){
381                            info += '<img src="'+ data.THUMBNAIL +'" alt="'+ kt_c
381ommon.removeTag(data.RELATE_TITLE) +'" onerror="this.src=\'' + cfm_domain + '/images/v2/layout/KT_relatedbanner_noimg.png\'">';
382                        }else{
383                            info += '<img src="' + cfm_domain + '/images/v2/layout/KT_relatedbanner_noimg.png" alt="이미지없음">';
384                        }
385    
386                        if(kt_common.isNull(data.RELATE_TITLE) !== ''){
387                            info += '<span class="prd_name">'+ data.RELATE_TITLE +'</span>';
388                        }
389    
390                        if(kt_common.isNull(data.RELATE_PRICE) !== ''){
391                            info += '<span class="prd_price"><span>(월)</span> <strong class="point">'+ kt_common.setComma(data.RELATE_PRICE) +'</strong>원~</span>';
392                        }
393    
394                        data.URL = data.LINKURL;
395                        if(kt_common.isNull(data.URL) !== ''){
396                            link = $j('<li><a href="'+ data.URL +'">'+ info +'</a></li>');
397    
398                            cfmSearchAreaHtml.linkInfo('search', 'related', link.find('a'), data);
399                        } else {
400                            link = $j('<li>'+ info +'</li>');
401                        }
402    
403                        target.append(link);
404                    });
405                } else {
406                    target.append('<li>해당 검색어에 대한 검색결과가 없습니다.</li>');
407                }
408            }            
409        } catch (e) {
410            common_log.log('kt_search.js callbackSearchRelatedProduct [' + e.message + ']');
411        }
412    }
413}
414
415$j(document).ready(function(){
416    if($j('#total-search').length > 0){
417        // 파이어폭스 처리
418        var firefoxTimer;
419        var firefoxXKeyword;
420        var filefoxKeyword;
421        var akcDataExist = 'N';
422        function firefoxClearInter() {
423            clearInterval(firefoxTimer);
424        }
425
426        function firefoxSetInter($input) {
427            firefoxClearInter();
428            var intervalId = setInterval(function(){
429                var filefoxKeyword = $input.val().trim();
430                if (filefoxKeyword !== firefoxXKeyword){
431                    firefoxXKeyword = filefoxKeyword;
432                    callSearch($input);
433                }
434            }, 10);
435            firefoxTimer = intervalId;
436        }
437
438        var agent = navigator.userAgent.toLowerCase();
439        $j('#total-search input[type=text]').on('focus', function(event) {
440            if(agent.indexOf('firefox') !== -1) {
441                firefoxSetInter($j(this));
442                return false;
443            }
444        });
445
446        $j('#total-search input[type=text]').on('click', function(event){
447            cfmSearchAreaHtml.linkInfo('search', 'click', null);
448
449            if($j(this).val().trim() === '') {
450                return false;
451            } else {
452                if(agent.indexOf('firefox') !== -1) {
453                    t = 'click';
454                    firefoxSetInter($j(this));
455                }
456
457                if(akcDataExist === "N") {
458                    callSearch($j(this));
459                    return false;
460                } else {
461                    firefoxClearInter();
462                    return false;
463                }
464            }
465        });
466
467        //통합검색(상단영역)-검색버튼
468        $j('#btn-search').on('click', function(e){
469        	if(!e.detail > 0) {
470                var $searchElement = $j('#total-search #searchInput');
471                $searchElement.length && $searchElement.attr('data-cfm-active', 'form');
472            }
473            kt_api.searchRecommend(); //추천검색어
474            kt_api.searchPopkeywords(); //인기검색어
475
476            // 0922 팝업 z-index 조정 위해 추가함 
477			$j("body").addClass("cfm-nonscroll"); 
478        });
479        
480        //통합검색(검색레이어)-인기검색어탭선택-2차
481        $j('.kt_popkeyword').on('click', function(){
482            $j(this).closest('.cfmCltabs').find('a').removeClass('active').removeAttr('title'); 
483		    $j(this).addClass('active');
484		    $j(this).attr('title','선택된 탭');
485
486            //인기검색어
487            kt_api.searchPopkeywords('cl'); 
488
489            //클릭통계
490            if(kt_common.pageType() == 'shop'){ //Shop
491                KT_trackClicks('KT-개인_공통', '^KT-개인_공통^GNB^Shop^검색레이어^TAB_KT');
492            }else{
493                KT_trackClicks('KT-개인_공통', '^KT-개인_공통^GNB^검색레이어^TAB_KT');
494            }
495
496            return false;
497        });
498        $j('.shop_popkeyword').on('click', function(){
499            $j(this).closest('.cfmCltabs').find('a').removeClass('active').removeAttr('title'); 
500		    $j(this).addClass('active');
501		    $j(this).attr('title','선택된 탭');
502
503            //인기검색어
504            kt_api.searchPopkeywords('shop'); 
505
506            //클릭통계
507            if(kt_common.pageType() == 'shop'){ //Shop
508                KT_trackClicks('KT-개인_공통', '^KT-개인_공통^GNB^Shop^검색레이어^TAB_다이렉트샵');
509            }else{
510                KT_trackClicks('KT-개인_공통', '^KT-개인_공통^GNB^검색레이어^TAB_다이렉트샵');
511            }
512
513            return false;
514        });
515
516        //통합검색(검색레이어)-검색영역(닷컴-자동완성&바로가기, Shop-자동완성&기획전&연관상품)-2차
517        if(kt_common.pageType() == 'shop'){ //Shop
518            $j("#searchWrapAfter").append(''+
519                    '<div class="search_word">'+
520                    '   <strong class="total-search-tit">자동완성</strong>'+
521                    '   <ul class="auto-list"></ul>'+
522                    '</div>'+
523                    '<div class="strategy">'+
524                    '   <strong class="total-search-tit">기획전</strong>'+
525                    '   <ol class="strategy-lilst"></ol>'+
526                    '</div>'+
527                    '<div class="relation">'+
528                    '   <strong class="total-search-tit">연관 상품</strong>'+
529                    '   <ul class="relation-list"></ul>'+
530                    '</div>');
531        }else{
532            $j("#searchWrapAfter").append(''+
533                    '<div class="search_word">'+
534                    '   <strong class="total-search-tit">자동완성</strong>'+
535                    '   <ul class="auto-list"></ul>'+
536                    '</div>'+
537                    '<div class="menu-shortcut">'+
538                    '   <strong class="total-search-tit">메뉴 바로가기</strong>'+
539                    '   <ol class="quick-menu"></ol>'+
540                    '</div>');
541        }
542
543        //통합검색(검색레이어)-검색입력창
544        $j('#total-search .result').hide();
545		$j('#total-search input[type=text]').attr('placeholder', '무엇이 궁금하신가요?');
546		$j('#total-search input[type=text]').attr('maxlength', 30);
547
548        //통합검색(검색레이어)-자동완성 & 바로가기 검색
549        $j('#total-search input[type=text]').val(''); //초기화(뒤로가기)
550        $j('#total-search input[type=text]').on(agent.indexOf('firefox') !== -1 ? 'keypress' : 'keyup', function(event){
551            if (event.keyCode === 0 || event.keyCode === 8) {
552                if(agent.indexOf('firefox') !== -1) {
553                    firefoxSetInter($j(this));
554                    return;
555                }
556            } else if(event.keyCode === 13) {
557            	if($j(this).attr('data-cfm-active') === 'form') {
558                    $j(this).removeAttr('data-cfm-active');
559                    return;
560                }
561                $j('#total-search .tsearch').trigger('click');
562                return false;
563            }
564            callSearch($j(this));
565        });
566
567        //통합검색(검색레이어)-검색어 지우기
568        $j('#total-search .searchInput-btn-clear').on('click', function(){
569            var $form = $j(this).closest('form');
570            $form.length && $form.find('#searchInput').attr('data-cfm-active', 'form');
571            
572            $j(this).hide();
573            $j('#searchWrapBefore').show();
574            $j('#searchWrapAfter').hide();
575            $j('#searchInput').val('').focus();
576
577            $j('.auto-list').find('ul').empty();
578            $j('.quick-menu').find('ul').empty();
579
580            cfmSearchAreaHtml.linkInfo('search', 'clear', null);
581        });
582
583        //통합검색(검색레이어)-검색페이지이동
584        $j('#total-search .tsearch').on('click', function(){
585            var searchWords = $j('#total-search input[type=text]').val();
586            var recommendWords = $j('#total-search input[type=text]').data('recommend');
587
588            var words = '';
589            if(kt_common.isNull(searchWords) !== ''){ //일반검색어
590                words = searchWords;
591            } else { //추천검색어
592                words = kt_common.isNull(recommendWords);
593            }
594
595//            if(words !== ''){
596//            	cfmSearchAreaHtml.linkInfo('search', 'search', null, {keyword:words});
597//            } else {
598//            	alert('검색어를 입력해 주세요.');
599//            	setTimeout(function(){
600//            		$j('#total-search input[type=text]').focus(); //검색어 미입력 알림 후 검색창으로 포커스 보내기
601//            	}, 200);
602//            	return false;
603//            }
604            cfmSearchAreaHtml.linkInfo('search', 'search', null, {keyword:words});
605        });
606        
607        //통합검색(검색레이어)-닫기
608        $j('#total-search .close-search').on('click', function(){
609            cfmSearchAreaHtml.linkInfo('search', 'close', null);
610            // 0922 팝업 z-index 조정 위해 추가함 
611			$j("body").removeClass("cfm-nonscroll"); 
612        });
613
614        function callSearch($input){
615            var words = cfmSearchAreaHtml.searchWordCheck($input.val().trim());
616            if(words !== ''){
617                $j('.searchInput-btn-clear').show();
618                $j('#searchWrapBefore').hide();
619                $j('#searchWrapAfter').show();
620               
621                kt_api.searchAutowords(words); //자동완성
622                
623                //통합검색(검색레이어)-문구변경-2차
624                if(kt_common.pageType() == 'shop'){ //Shop
625                    $j('#searchWrapAfter .menu-shortcut>strong').text('연관 상품');
626                    kt_api.searchRelatedProduct(words); //연관상품
627                    kt_api.searchwords('shop', words); //기획전                    
628                }else{
629                    $j('#searchWrapAfter .menu-shortcut>strong').text('메뉴 바로가기');
630                    kt_api.searchwords('search', words);
631                }
632            }else{
633                $j('.searchInput-btn-clear').hide();
634                $j('#searchWrapBefore').show();
635                $j('#searchWrapAfter').hide();
636
637                $j('.auto-list').find('ul').empty();
638                $j('.quick-menu').find('ul').empty();
639            }
640        }
641        
642        $j('#searchInput').on('focus', function(){
643            if (cfmSearchRecommendResult.subTitle !== undefined) {
644                setTimeout(function(){
645                    $j('#searchInput').attr('placeholder', cfmSearchRecommendResult.subTitle);
646                    $j('#searchInput').data('recommend', cfmSearchRecommendResult.title);
647                }, 200);
648            } else {
649                $j('#searchInput').attr('placeholder', "");
650                $j('#searchInput').data('recommend', "");
651            }
652        });
653           
654        // $j('#searchInput').on('blur', function(){
655        // 	if($j('#searchInput').val()==''){
656        // 		kt_api.searchRecommend();
657        // 	}
658        // });
659    }
660});

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.