PageSourceSearch

https://daejeontour.co.kr/js/common.js?ver=2304171

js daejeontour.co.kr collected 2026-10-02 20:45:16 UTC 24,542 bytes, 858 lines download raw bytes

1// 전역 변수
2var errmsg = "";
3var errfld = null;
4
5// 필드 검사
6function check_field(fld, msg)
7{
8    if ((fld.value = trim(fld.value)) == "")
9        error_field(fld, msg);
10    else
11        clear_field(fld);
12    return;
13}
14
15// 필드 오류 표시
16function error_field(fld, msg)
17{
18    if (msg != "")
19        errmsg += msg + "\n";
20    if (!errfld) errfld = fld;
21    fld.style.background = "#BDDEF7";
22}
23
24// 필드를 깨끗하게
25function clear_field(fld)
26{
27    fld.style.background = "#FFFFFF";
28}
29
30function trim(s)
31{
32    var t = "";
33    var from_pos = to_pos = 0;
34
35    for (i=0; i<s.length; i++)
36    {
37        if (s.charAt(i) == ' ')
38            continue;
39        else
40        {
41            from_pos = i;
42            break;
43        }
44    }
45
46    for (i=s.length; i>=0; i--)
47    {
48        if (s.charAt(i-1) == ' ')
49            continue;
50        else
51        {
52            to_pos = i;
53            break;
54        }
55    }
56
57    t = s.substring(from_pos, to_pos);
58    //				alert(from_pos + ',' + to_pos + ',' + t+'.');
59    return t;
60}
61
62function check_password_strength(str)
63{
64    if (str.length < 9 || str.length > 20) {
65        return "비밀번호는 9자 이상 20자 이하로 입력해주세요.";
66    }
67
68    var check = 0;
69    if (/[a-zA-Z]/.test(str)) check++;
70    if (/[0-9]/.test(str)) check++;
71    if (/[\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]/.test(str)) check++;
72
73    if (check < 3) {
74        return "비밀번호는 영문, 숫자, 특수문자를 모두 포함해야 합니다.";
75    }
76
77    if (/(.)\1\1/.test(str)) {
78        return "동일한 문자를 3번 이상 연속해서 사용할 수 없습니다.";
79    }
80
81    return "";
82}
83
84// 자바스크립트로 PHP의 number_format 흉내를 냄
85// 숫자에 , 를 출력
86function number_format(data)
87{
88
89    var tmp = '';
90    var number = '';
91    var cutlen = 3;
92    var comma = ',';
93    var i;
94    
95    data = data + '';
96
97    var sign = data.match(/^[\+\-]/);
98    if(sign) {
99        data = data.replace(/^[\+\-]/, "");
100    }
101
102    len = data.length;
103    mod = (len % cutlen);
104    k = cutlen - mod;
105    for (i=0; i<data.length; i++)
106    {
107        number = number + data.charAt(i);
108
109        if (i < data.length - 1)
110        {
111            k++;
112            if ((k % cutlen) == 0)
113            {
114                number = number + comma;
115                k = 0;
116            }
117        }
118    }
119
120    if(sign != null)
121        number = sign+number;
122
123    return number;
124}
125
126// 새 창
127function popup_window(url, winname, opt)
128{
129    window.open(url, winname, opt);
130}
131
132
133// 폼메일 창
134function popup_formmail(url)
135{
136    opt = 'scrollbars=yes,width=417,height=385,top=10,left=20';
137    popup_window(url, "wformmail", opt);
138}
139
140// , 를 없앤다.
141function no_comma(data)
142{
143    var tmp = '';
144    var comma = ',';
145    var i;
146
147    for (i=0; i<data.length; i++)
148    {
149        if (data.charAt(i) != comma)
150            tmp += data.charAt(i);
151    }
152    return tmp;
153}
154
155// 삭제 검사 확인
156function del(href)
157{
158    if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
159        window.location.href = href;
160    }
161}
162
163// 쿠키 입력
164function set_cookie(name, value, expirehours, domain)
165{
166    var today = new Date();
167    today.setTime(today.getTime() + (60*60*1000*expirehours));
168    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
169    if (domain) {
170        document.cookie += "domain=" + domain + ";";
171    }
172}
173
174// 쿠키 얻음
175function get_cookie(name)
176{
177	var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
178	if (match) return unescape(match[2]);
179	return "";
180}
181
182// 쿠키 지움
183function delete_cookie(name)
184{
185    var today = new Date();
186
187    today.setTime(today.getTime() - 1);
188    var value = get_cookie(name);
189    if(value != "")
190        document.cookie = name + "=" + value + "; path=/; expires=" + today.toGMTString();
191}
192
193var last_id = null;
194function menu(id)
195{
196    if (id != last_id)
197    {
198        if (last_id != null)
199            document.getElementById(last_id).style.display = "none";
200        document.getElementById(id).style.display = "block";
201        last_id = id;
202    }
203    else
204    {
205        document.getElementById(id).style.display = "none";
206        last_id = null;
207    }
208}
209
210function textarea_decrease(id, row)
211{
212    if (document.getElementById(id).rows - row > 0)
213        document.getElementById(id).rows -= row;
214}
215
216function textarea_original(id, row)
217{
218    document.getElementById(id).rows = row;
219}
220
221function textarea_increase(id, row)
222{
223    document.getElementById(id).rows += row;
224}
225
226// 글숫자 검사
227function check_byte(content, target)
228{
229    var i = 0;
230    var cnt = 0;
231    var ch = '';
232    var cont = document.getElementById(content).value;
233
234    for (i=0; i<cont.length; i++) {
235        ch = cont.charAt(i);
236        if (escape(ch).length > 4) {
237            cnt += 2;
238        } else {
239            cnt += 1;
240        }
241    }
242    // 숫자를 출력
243    document.getElementById(target).innerHTML = cnt;
244
245    return cnt;
246}
247
248// 브라우저에서 오브젝트의 왼쪽 좌표
249function get_left_pos(obj)
250{
251    var parentObj = null;
252    var clientObj = obj;
253    //var left = obj.offsetLeft + document.body.clientLeft;
254    var left = obj.offsetLeft;
255
256    while((parentObj=clientObj.offsetParent) != null)
257    {
258        left = left + parentObj.offsetLeft;
259        clientObj = parentObj;
260    }
261
262    return left;
263}
264
265// 브라우저에서 오브젝트의 상단 좌표
266function get_top_pos(obj)
267{
268    var parentObj = null;
269    var clientObj = obj;
270    //var top = obj.offsetTop + document.body.clientTop;
271    var top = obj.offsetTop;
272
273    while((parentObj=clientObj.offsetParent) != null)
274    {
275        top = top + parentObj.offsetTop;
276        clientObj = parentObj;
277    }
278
279    return top;
280}
281
282function flash_movie(src, ids, width, height, wmode)
283{
284    var wh = "";
285    if (parseInt(width) && parseInt(height))
286        wh = " width='"+width+"' height='"+height+"' ";
287    return "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' "+wh+" id="+ids+"><param name=wmode value="+wmode+"><param name=movie value="+src+"><param name=quality value=high><embed src="+src+" quality=high wmode="+wmode+" type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash' "+wh+"></embed></object>";
288}
289
290function obj_movie(src, ids, width, height, autostart)
291{
292    var wh = "";
293    if (parseInt(width) && parseInt(height))
294        wh = " width='"+width+"' height='"+height+"' ";
295    if (!autostart) autostart = false;
296    return "<embed src='"+src+"' "+wh+" autostart='"+autostart+"'></embed>";
297}
298
299function doc_write(cont)
300{
301    document.write(cont);
302}
303
304var win_password_lost = function(href) {
305    window.open(href, "win_password_lost", "left=50, top=50, width=617, height=330, scrollbars=1");
306}
307
308$(document).ready(function(){
309    $("#login_password_lost, #ol_password_lost").click(function(){
310        win_password_lost(this.href);
311        return false;
312    });
313});
314
315/**
316 * 포인트 창
317 **/
318var win_point = function(href) {
319    var new_win = window.open(href, 'win_point', 'left=100,top=100,width=600, height=600, scrollbars=1');
320    new_win.focus();
321}
322
323/**
324 * 쪽지 창
325 **/
326var win_memo = function(href) {
327    var new_win = window.open(href, 'win_memo', 'left=100,top=100,width=620,height=500,scrollbars=1');
328    new_win.focus();
329}
330
331/**
332 * 쪽지 창
333 **/
334var check_goto_new = function(href, event) {
335    if( !(typeof g5_is_mobile != "undefined" && g5_is_mobile) ){
336        if (window.opener && window.opener.document && window.opener.document.getElementById) {
337            event.preventDefault ? event.preventDefault() : (event.returnValue = false);
338            window.open(href);
339            //window.opener.document.location.href = href;
340        }
341    }
342}
343
344/**
345 * 메일 창
346 **/
347var win_email = function(href) {
348    var new_win = window.open(href, 'win_email', 'left=100,top=100,width=600,height=580,scrollbars=1');
349    new_win.focus();
350}
351
352/**
353 * 자기소개 창
354 **/
355var win_profile = function(href) {
356    var new_win = window.open(href, 'win_profile', 'left=100,top=100,width=620,height=510,scrollbars=1');
357    new_win.focus();
358}
359
360/**
361 * 스크랩 창
362 **/
363var win_scrap = function(href) {
364    var new_win = window.open(href, 'win_scrap', 'left=100,top=100,width=600,height=600,scrollbars=1');
365    new_win.focus();
366}
367
368/**
369 * 홈페이지 창
370 **/
371var win_homepage = function(href) {
372    var new_win = window.open(href, 'win_homepage', '');
373    new_win.focus();
374}
375
376/**
377 * 우편번호 창
378 **/
379var win_zip = function(frm_name, frm_zip, frm_addr1, frm_addr2, frm_addr3, frm_jibeon) {
380    if(typeof daum === "undefined"){
381        alert("KAKAO 우편번호 서비스 postcode.v2.js 파일이 로드되지 않았습니다.");
382        return false;
383    }
384
385    // 핀치 줌 현상 제거
386    var vContent = "width=device-width,initial-scale=1.0,minimum-scale=0,maximum-scale=10";
387    $("#meta_viewport").attr("content", vContent + ",user-scalable=no");
388
389    var zip_case = 1;   //0이면 레이어, 1이면 페이지에 끼워 넣기, 2이면 새창
390
391    var complete_fn = function(data){
392        // 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분.
393
394        // 각 주소의 노출 규칙에 따라 주소를 조합한다.
395        // 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다.
396        var fullAddr = ''; // 최종 주소 변수
397        var extraAddr = ''; // 조합형 주소 변수
398
399        // 사용자가 선택한 주소 타입에 따라 해당 주소 값을 가져온다.
400        if (data.userSelectedType === 'R') { // 사용자가 도로명 주소를 선택했을 경우
401            fullAddr = data.roadAddress;
402
403        } else { // 사용자가 지번 주소를 선택했을 경우(J)
404            fullAddr = data.jibunAddress;
405        }
406
407        // 사용자가 선택한 주소가 도로명 타입일때 조합한다.
408        if(data.userSelectedType === 'R'){
409            //법정동명이 있을 경우 추가한다.
410            if(data.bname !== ''){
411                extraAddr += data.bname;
412            }
413            // 건물명이 있을 경우 추가한다.
414            if(data.buildingName !== ''){
415                extraAddr += (extraAddr !== '' ? ', ' + data.buildingName : data.buildingName);
416            }
417            // 조합형주소의 유무에 따라 양쪽에 괄호를 추가하여 최종 주소를 만든다.
418            extraAddr = (extraAddr !== '' ? ' ('+ extraAddr +')' : '');
419        }
420
421        // 우편번호와 주소 정보를 해당 필드에 넣고, 커서를 상세주소 필드로 이동한다.
422        var of = document[frm_name];
423
424        of[frm_zip].value = data.zonecode;
425
426        of[frm_addr1].value = fullAddr;
427        of[frm_addr3].value = extraAddr;
428
429        if(of[frm_jibeon] !== undefined){
430            of[frm_jibeon].value = data.userSelectedType;
431        }
432        
433        setTimeout(function(){
434            $("#meta_viewport").attr("content", vContent);
435            of[frm_addr2].focus();
436        } , 100);
437    };
438
439    switch(zip_case) {
440        case 1 :    //iframe을 이용하여 페이지에 끼워 넣기
441            var daum_pape_id = 'daum_juso_page'+frm_zip,
442                element_wrap = document.getElementById(daum_pape_id),
443                currentScroll = Math.max(document.body.scrollTop, document.documentElement.scrollTop);
444            if (element_wrap == null) {
445                element_wrap = document.createElement("div");
446                element_wrap.setAttribute("id", daum_pape_id);
447                element_wrap.style.cssText = 'display:none;border:1px solid;left:0;width:100%;height:300px;margin:5px 0;position:relative;-webkit-overflow-scrolling:touch;';
448                element_wrap.innerHTML = '<img src="//t1.daumcdn.net/
448postcode/resource/images/close.png" id="btnFoldWrap" style="cursor:pointer;position:absolute;right:0px;top:-21px;z-index:1" class="close_daum_juso" alt="접기 버튼">';
449                jQuery('form[name="'+frm_name+'"]').find('input[name="'+frm_addr1+'"]').before(element_wrap);
450                jQuery("#"+daum_pape_id).off("click", ".close_daum_juso").on("click", ".close_daum_juso", function(e){
451                    e.preventDefault();
452                    $("#meta_viewport").attr("content", vContent);
453                    jQuery(this).parent().hide();
454                });
455            }
456
457            new daum.Postcode({
458                oncomplete: function(data) {
459                    complete_fn(data);
460                    // iframe을 넣은 element를 안보이게 한다.
461                    element_wrap.style.display = 'none';
462                    // 우편번호 찾기 화면이 보이기 이전으로 scroll 위치를 되돌린다.
463                    document.body.scrollTop = currentScroll;
464                },
465                // 우편번호 찾기 화면 크기가 조정되었을때 실행할 코드를 작성하는 부분.
466                // iframe을 넣은 element의 높이값을 조정한다.
467                onresize : function(size) {
468                    element_wrap.style.height = size.height + "px";
469                },
470                maxSuggestItems : g5_is_mobile ? 6 : 10,
471                width : '100%',
472                height : '100%'
473            }).embed(element_wrap);
474
475            // iframe을 넣은 element를 보이게 한다.
476            element_wrap.style.display = 'block';
477            break;
478        case 2 :    //새창으로 띄우기
479            new daum.Postcode({
480                oncomplete: function(data) {
481                    complete_fn(data);
482                }
483            }).open();
484            break;
485        default :   //iframe을 이용하여 레이어 띄우기
486            var rayer_id = 'daum_juso_rayer'+frm_zip,
487                element_layer = document.getElementById(rayer_id);
488            if (element_layer == null) {
489                element_layer = document.createElement("div");
490                element_layer.setAttribute("id", rayer_id);
491                element_layer.style.cssText = 'display:none;border:5px solid;position:fixed;width:300px;height:460px;left:50%;margin-left:-155px;top:50%;margin-top:-235px;overflow:hidden;-webkit-overflow-scrolling:touch;z-index:10000';
492                element_layer.innerHTML = '<img src="//i1.daumcdn.net/localimg/localimages/07/postcode/320/close.png" id="btnCloseLayer" style="cursor:pointer;position:absolute;right:-3px;top:-3px;z-index:1" class="close_daum_juso" alt="닫기 버튼">';
493                document.body.appendChild(element_layer);
494                jQuery("#"+rayer_id).off("click", ".close_daum_juso").on("click", ".close_daum_juso", function(e){
495                    e.preventDefault();
496                    $("#meta_viewport").attr("content", vContent);
497                    jQuery(this).parent().hide();
498                });
499            }
500
501            new daum.Postcode({
502                oncomplete: function(data) {
503                    complete_fn(data);
504                    // iframe을 넣은 element를 안보이게 한다.
505                    element_layer.style.display = 'none';
506                },
507                maxSuggestItems : g5_is_mobile ? 6 : 10,
508                width : '100%',
509                height : '100%'
510            }).embed(element_layer);
511
512            // iframe을 넣은 element를 보이게 한다.
513            element_layer.style.display = 'block';
514    }
515}
516
517/**
518 * 새로운 비밀번호 분실 창 : 101123
519 **/
520win_password_lost = function(href)
521{
522    var new_win = window.open(href, 'win_password_lost', 'width=617, height=330, scrollbars=1');
523    new_win.focus();
524}
525
526/**
527 * 설문조사 결과
528 **/
529var win_poll = function(href) {
530    var new_win = window.open(href, 'win_poll', 'width=616, height=500, scrollbars=1');
531    new_win.focus();
532}
533
534/**
535 * 쿠폰
536 **/
537var win_coupon = function(href) {
538    var new_win = window.open(href, "win_coupon", "left=100,top=100,width=700, height=600, scrollbars=1");
539    new_win.focus();
540}
541
542
543/**
544 * 스크린리더 미사용자를 위한 스크립트 - 지운아빠 2013-04-22
545 * alt 값만 갖는 그래픽 링크에 마우스오버 시 title 값 부여, 마우스아웃 시 title 값 제거
546 **/
547$(function() {
548    $('a img').mouseover(function() {
549        $a_img_title = $(this).attr('alt');
550        $(this).attr('title', $a_img_title);
551    }).mouseout(function() {
552        $(this).attr('title', '');
553    });
554});
555
556/**
557 * 텍스트 리사이즈
558**/
559function font_resize(id, rmv_class, add_class, othis)
560{
561    var $el = $("#"+id);
562
563	if((typeof rmv_class !== "undefined" && rmv_class) || (typeof add_class !== "undefined" && add_class)){
564		$el.removeClass(rmv_class).addClass(add_class);
565
566		set_cookie("ck_font_resize_rmv_class", rmv_class, 1, g5_cookie_domain);
567		set_cookie("ck_font_resize_add_class", add_class, 1, g5_cookie_domain);
568	}
569
570    if(typeof othis !== "undefined"){
571        $(othis).addClass('select').siblings().removeClass('select');
572    }
573}
574
575/**
576 * 댓글 수정 토큰
577**/
578function set_comment_token(f)
579{
580    if(typeof f.token === "undefined")
581        $(f).prepend('<input type="hidden" name="token" value="">');
582
583    $.ajax({
584        url: g5_bbs_url+"/ajax.comment_token.php",
585        type: "GET",
586        dataType: "json",
587        async: false,
588        cache: false,
589        success: function(data, textStatus) {
590            f.token.value = data.token;
591        }
592    });
593}
594
595$(function(){
596    $(".win_point").click(function() {
597        win_point(this.href);
598        return false;
599    });
600
601    $(".win_memo").click(function() {
602        win_memo(this.href);
603        return false;
604    });
605
606    $(".win_email").click(function() {
607        win_email(this.href);
608        return false;
609    });
610
611    $(".win_scrap").click(function() {
612        win_scrap(this.href);
613        return false;
614    });
615
616    $(".win_profile").click(function() {
617        win_profile(this.href);
618        return false;
619    });
620
621    $(".win_homepage").click(function() {
622        win_homepage(this.href);
623        return false;
624    });
625
626    $(".win_password_lost").click(function() {
627        win_password_lost(this.href);
628        return false;
629    });
630
631    /*
632    $(".win_poll").click(function() {
633        win_poll(this.href);
634        return false;
635    });
636    */
637
638    $(".win_coupon").click(function() {
639        win_coupon(this.href);
640        return false;
641    });
642
643    // 사이드뷰
644    var sv_hide = false;
645    $(".sv_member, .sv_guest").click(function() {
646        $(".sv").removeClass("sv_on");
647        $(this).closest(".sv_wrap").find(".sv").addClass("sv_on");
648    });
649
650    $(".sv, .sv_wrap").hover(
651        function() {
652            sv_hide = false;
653        },
654        function() {
655            sv_hide = true;
656        }
657    );
658
659    $(".sv_member, .sv_guest").focusin(function() {
660        sv_hide = false;
661        $(".sv").removeClass("sv_on");
662        $(this).closest(".sv_wrap").find(".sv").addClass("sv_on");
663    });
664
665    $(".sv a").focusin(function() {
666        sv_hide = false;
667    });
668
669    $(".sv a").focusout(function() {
670        sv_hide = true;
671    });
672
673    // 셀렉트 ul
674    var sel_hide = false;
675    $('.sel_btn').click(function() {
676        $('.sel_ul').removeClass('sel_on');
677        $(this).siblings('.sel_ul').addClass('sel_on');
678    });
679
680    $(".sel_wrap").hover(
681        function() {
682            sel_hide = false;
683        },
684        function() {
685            sel_hide = true;
686        }
687    );
688
689    $('.sel_a').focusin(function() {
690        sel_hide = false;
691    });
692
693    $('.sel_a').focusout(function() {
694        sel_hide = true;
695    });
696
697    $(document).click(function() {
698        if(sv_hide) { // 사이드뷰 해제
699            $(".sv").removeClass("sv_on");
700        }
701        if (sel_hide) { // 셀렉트 ul 해제
702            $('.sel_ul').removeClass('sel_on');
703        }
704    });
705
706    $(document).focusin(function() {
707        if(sv_hide) { // 사이드뷰 해제
708            $(".sv").removeClass("sv_on");
709        }
710        if (sel_hide) { // 셀렉트 ul 해제
711            $('.sel_ul').removeClass('sel_on');
712        }
713    });
714
715    $(document).on( "keyup change", "textarea#wr_content[maxlength]", function(){
716        var str = $(this).val();
717        var mx = parseInt($(this).attr("maxlength"));
718        if (str.length > mx) {
719            $(this).val(str.substr(0, mx));
720            return false;
721        }
722    });
723});
724
725function get_write_token(bo_table)
726{
727    var token = "";
728
729    $.ajax({
730        type: "POST",
731        url: g5_bbs_url+"/write_token.php",
732        data: { bo_table: bo_table },
733        cache: false,
734        async: false,
735        dataType: "json",
736        success: function(data) {
737            if(data.error) {
738                alert(data.error);
739                if(data.url)
740                    document.location.href = data.url;
741
742                return false;
743            }
744
745            token = data.token;
746        }
747    });
748
749    return token;
750}
751
752$(function() {
753    $(document).on("click", "form[name=fwrite] input:submit, form[name=fwrite] button:submit, form[name=fwrite] input:image", function() {
754        var f = this.form;
755
756        if (typeof(f.bo_table) == "undefined") {
757            return;
758        }
759
760        var bo_table = f.bo_table.value;
761        var token = get_write_token(bo_table);
762
763        if(!token) {
764            alert("토큰 정보가 올바르지 않습니다.");
765            return false;
766        }
767
768        var $f = $(f);
769
770        if(typeof f.token === "undefined")
771            $f.prepend('<input type="hidden" name="token" value="">');
772
773        $f.find("input[name=token]").val(token);
774
775        return true;
776    });
777});
778
779// 분류 선택 변경
780function listMulti_select(selectBox) {
781	const scaValue = document.getElementById('bo_cate_list')?.value || '';
782	const guValue  = document.getElementById('bo_gu_list')?.value || '';
783
784	const url = new URL(window.location.href);
785	const params = url.searchParams;
786
787	const prevSca = params.get('sca') ?? '';
788	const prevGu  = params.get('gu') ?? '';
789
790	if (scaValue) params.set('sca', scaValue); else params.delete('sca');
791	if (guValue)  params.set('gu',  guValue);  else params.delete('gu');
792
793	const nextSca = params.get('sca') ?? '';
794	const nextGu  = params.get('gu') ?? '';
795
796	if (prevSca === nextSca && prevGu === nextGu) return;
797
798	const query = params.toString();
799	window.location.href = query ? `${url.pathname}?${query}` : url.pathname;
800}
801
802
803// 개별 선택
804const GU_PARAM = 'gu';
805function listMulti(checkbox) {
806    const name = checkbox.getAttribute('name'); // 'sca[]' | 'gu[]'
807    const isCategory = name === 'sca[]';
808    const isGu = name === 'gu[]';
809
810    const allSelector  = `input[name="${name}"][value=""]`;
811    const itemSelector = `input[name="${name}"]:not([value=""])`;
812    const allBox = document.querySelector(allSelector);
813    const itemBoxes = document.querySelectorAll(itemSelector);
814
815    if (checkbox.value === '') {
816        if (checkbox.checked) {
817            itemBoxes.forEach(b => { b.checked = false; });
818        } else {
819            const anyChecked = Array.from(itemBoxes).some(b => b.checked);
820            if (!anyChecked) checkbox.checked = true;
821        }
822    } else {
823        if (allBox && allBox.checked) allBox.checked = false;
824
825        const anyCheckedItems = document.querySelectorAll(`${itemSelector}:checked`).length;
826        if (anyCheckedItems === 0 && allBox) {
827            allBox.checked = true; // 자동 전체 체크
828        }
829    }
830
831    const shouldNavigate = isGu || isCategory;
832    if (!shouldNavigate) return;
833
834    const scaValues = Array.from(document.querySelectorAll('input[name="sca[]"]:checked'))
835        .map(b => b.value).filter(v => v !== '');
836    const guValues = Array.from(document.querySelectorAll('input[name="gu[]"]:checked'))
837        .map(b => b.value).filter(v => v !== '');
838
839    const url = new URL(window.location.href);
840    const params = url.searchParams;
841
842    const prevSca = params.get('sca') ?? '';
843    const prevGu  = params.get(GU_PARAM) ?? '';
844
845    if (scaValues.length > 0) params.set('sca', scaValues.join(','));
846    else params.delete('sca');
847
848    if (guValues.length > 0) params.set(GU_PARAM, guValues.join(','));
849    else params.delete(GU_PARAM);
850
851    const nextSca = params.get('sca') ?? '';
852    const nextGu  = params.get(GU_PARAM) ?? '';
853
854    if (prevSca === nextSca && prevGu === nextGu) return;
855
856    const query = params.toString();
857    window.location.href = query ? `${url.pathname}?${query}` : url.pathname;
858}

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.