PageSourceSearch

https://www.fbo.or.kr/js/common/common.js?v=3

js fbo.or.kr collected 2026-10-07 19:41:52 UTC 38,532 bytes, 1,314 lines download raw bytes

1$(document).ready(function () {
2
3    $('#skipNav a').on('click', function () {
4        var aAttr = $(this).attr('href');
5        $(aAttr).attr('tabindex', '0');
6    });
7	
8	/* pc header */
9	var $header = $('.header');
10	var $gnb = $header.find('.gnbWrap>.inner');
11	var $gnbList = $header.find('.depth1');
12	var $btnMobile = $('.btnMobile');
13
14	$gnbList.find('a[href*="gis"]').attr({
15		'target': '_blank',
16		'rel': 'noopener noreferrer'
17	});
18
19	$gnbList.on('mouseenter', function () {
20		if ($btnMobile.is(':hidden')) {
21			$header.addClass('active');
22		}
23	});
24	$header.on('mouseleave', function () {
25		if ($btnMobile.is(':hidden')) {
26			$header.removeClass('active');
27		}
28	});
29	$gnbList.find('>li').on({
30		mouseenter: function () {
31			if ($btnMobile.is(':hidden')) {
32				$(this).addClass('hover');
33				$gnbList.find('>li').not(this).removeClass('hover');
34			}
35		},
36		mouseleave: function () {
37			if ($btnMobile.is(':hidden')) {
38				$gnbList.find('>li').removeClass('hover');
39			}
40		}
41	});
42	$(window).scroll(function () {
43		if ($btnMobile.is(':hidden')) {
44			if ($(this).scrollTop() > 0) {
45				var height = $(window).outerHeight();
46				if (height > 680) {
47					$header.addClass('fix');
48				} else {
49					$header.removeClass('fix');
50				}
51			} else {
52				$header.removeClass('fix');
53			}
54		}
55	});
56	$(window).resize(function () {
57		if ($btnMobile.is(':hidden')) {
58
59		} else {
60			$header.removeClass('fix');
61		}
62	});
63	// focus
64	$header.find('.logo>a, .hdRightItem a').on('focus', function () {
65		if ($btnMobile.is(':hidden')) {
66			$header.removeClass('active');
67		}
68	});
69	$gnbList.find('>li>a').on('focus', function () {
70		if ($btnMobile.is(':hidden')) {
71			$header.addClass('active');
72			$gnbList.find('>li').removeClass('hover');
73			$(this).parent('li').addClass('hover');
74		}
75	});
76	$(document).find(":focusable").focus(function (e) {
77		if ($gnbList.has(e.target).length === 0) {
78			if ($btnMobile.is(':hidden')) {
79				$header.removeClass('active');
80				$gnbList.find('>li').removeClass('hover');
81			}
82		}
83	});
84	
85	/* mobile header */
86    var $headerMobile = $('.headerMobile');
87    var $moGnb = $headerMobile.find('.gnb');
88    var $moGnbList = $headerMobile.find('.depth1');
89	$moGnbList.find('a[href*="gis"]').attr({
90		'target': '_blank',
91		'rel': 'noopener noreferrer'
92	});
93    // 모바일 nav
94    $('.btnMobile').on('click', function () {
95        $('body').addClass('open');
96    });
97    $moGnb.find('.depth1>li>a').on('click', function () {
98        $(this).siblings('.depth2').slideToggle();
99        $(this).parent('li').toggleClass('active');
100        $moGnbList.find('>li>a').not(this).siblings('div').slideUp();
101        $moGnbList.find('>li>a').not(this).parent('li').removeClass('active');
102    });
103    $headerMobile.find('.nav-bg, .gnbClose').on('click', function () {
104        $('body').removeClass('open');
105        $moGnbList.find('.depth2').removeAttr('style');
106    });
107    $(window).resize(function () {
108        if ($headerMobile.is(':hidden')) {
109            $('body').removeClass('open');
110            $moGnbList.find('.depth2').removeAttr('style');
111            $moGnbList.find('>li').removeClass('active');
112        }
113    });
114
115    // 탑버튼
116    $(document).on('click', '.btn-top', function () {
117        $('html, body').animate({
118            scrollTop: 0
119        }, 600);
120
121        return false;
122    });
123
124    // 푸터 관련사이트
125    $(document).on('click', '.btn-familysite', function () {
126        $(this).siblings('.listWrap').slideToggle();
127        $(this).parent('li').toggleClass('open');
128        $(this).parent('li').mouseleave(function () {
129            $(this).find('.listWrap').slideUp();
130            $(this).removeClass('open');
131        });
132    });
133    $('.blog>a, .btn-top').on('focus', function () {
134        if ($headerMobile.is(':hidden')) {
135            $('.familysite').find('.listWrap').slideUp();
136            $('.familysite').find('li').removeClass('open');
137        }
138    });
139    $(document).find(":focusable").focus(function (e) {
140        if ($('.familysite').find('.listWrap').has(e.target).length === 0) {
141            if ($headerMobile.is(':hidden')) {
142                $('.familysite').find('.listWrap').slideUp();
143                $('.familysite').find('li').removeClass('open');
144            }
145        }
146    });
147
148    // 툴팁(도움말)
149    $('.tooltip-icon').on({
150        click: function () {
151            $('.tooltip-icon').not(this).siblings('.tooltip-container').removeClass('active');
152            $(this).siblings('.tooltip-container').toggleClass('active');
153        }
154    });
155    $('.tooltip .tooltip-container .close').on({
156        click: function () {
157            $(this).parent('div').removeClass('active');
158        }
159    });
160
161    //ie 일땐, 경고창 보이도록
162    if ((window.navigator.userAgent).indexOf("MSIE") > -1 || !fnIsNull((window.navigator.userAgent).match(/Trident.*rv\:11\./))) {
163        $(".video-warning>span.input-help-text").addClass("on");
164    }
165
166    /**
167     * textarea 글자수 체크 이벤트 22.06.22
168     * */
169    $(".textareaBox>textarea").keyup(function(e){
170    	var $spanCnt = $(this).next();
171    	if(gfnChkUdf(this.value) != "" && $spanCnt.length > 0 && ($spanCnt.find("span")).length > 0)
172		{
173    		$spanCnt.find("span").text( this.value.length > this.maxLength ? this.maxLength : this.value.length);
174		}//end if
175    });
176    
177    /**
178     * 23.09.15 값 검증 이벤트
179     * */
180    $(".data-validation").on({
181        focusout : function (e){
182        	if(gfnChkUdf(e.target.dataset.validType) != "")
183        	{
184        		if(!gfnCheckDataType(e.target.dataset.validType, e.target.value, e.target))
185        		{
186        			fnMoveFocus(e.target, true, false); 
187        			return gfnValidAlert(e.target.dataset.validType);
188        		}//end if
189        	}//end if
190        }
191    });
192    
193});
194
195$('.form-calendar, .datepicker').datepicker({
196    minDate: '-100y',
197    yearRange: '-100:c+50',
198    showMonthAfterYear: true,
199    changeMonth: true,
200    dayNames: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'],
201    dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
202    changeYear: true,
203    monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
204    monthNames: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
205    nextText: '다음 달',
206    prevText: '이전 달',
207    showButtonPanel: true,
208    closeText: '닫기',
209    dateFormat: 'yy-mm-dd'
210});
211
212// Zoom
213var nowZoom = 100;
214var maxZoom = 140;
215var minZoom = 80;
216
217/**
218 * null, undefined 체크.( + 값이 없을 때, default 값으로 지정할 obj)
219 * 
220 * @param obj(,obj)
221 * @returns boolean or Obj
222 */
223function fnIsNull(poObj, poRtnDefaultVal) {
224    //기본값으로 리턴 받을지에 대한 여부
225    var defaultYn = poRtnDefaultVal == undefined ? false : true;
226
227    if (!defaultYn) {
228        //기본값 return 없을 때
229        return typeof poObj == "undefined" ? true : (poObj == null ? true : false);
230    } else {
231        //기본값 || 기존값 return 해줄 때
232        return typeof poObj == "undefined" ? poRtnDefaultVal : (poObj == null ? poRtnDefaultVal : poObj);
233    }
234}
235
236/**
237 * null && undefined && NaN && Infinity 체크
238 * @description
239 * @param any
240 * @return any 성공 시 원본 파라미터, 실패 시 ""
241 */
242function gfnChkUdf(poTarget){
243	try{
244		return typeof poTarget != "undefined" ? (poTarget == null || (poTarget == "null" || poTarget == "NULL") ? "" : ( typeof poTarget == "number" && (isNaN(poTarget) || !isFinite(poTarget)) ? "0" : poTarget)) : "";
245	}catch(e){
246		return "";
247	}
248};
249
250function zoomIn() {
251    if (nowZoom < maxZoom) {
252        nowZoom += 10; // 25%
253    } else {
254        alert("최대 화면 크기 입니다.\n더 이상 확대하실 수 없습니다");
255        return;
256    }
257    document.body.style.zoom = nowZoom + "%";
258}
259// 화면 줄인다.
260function zoomOut() {
261    if (nowZoom > minZoom) {
262        nowZoom -= 10; // 25%
263    } else {
264        alert("최소 화면 크기 입니다.\n더 이상 축소하실 수 없습니다");
265        return;
266    }
267    document.body.style.zoom = nowZoom + "%";
268}
269
270function zoomDefault() {
271    document.body.style.zoom = 100 + "%";
272}
273
274/**
275 * 공통코드를 select에 넣기
276 * 
277 * @param upperC
278 *            코드종류
279 * @param selector
280 *            코드를 넣을 select 엘리먼트 셀렉터
281 * @param cd
282 *            코드 값. 일치할 경우 selected="selected" 처리목적
283 */
284function gfnCmmCdSelect(upperC, selector, cd) {
285    $.ajax({
286        type: 'POST',
287        url: CTX + '/comm/SelectCommCd.do',
288        data: {
289            upperC: upperC
290        },
291        success: function (data) {
292            $(selector + " > option:gt(0)").remove();
293            $.each(data.rows, function (idx, val) {
294                var selected = "";
295                if (val.cd == cd) {
296                    selected = " selected='selected'";
297                }
298                $(selector).append("<option value='" + val.cd + "'" + selected + ">" + val.cdNm + "</option>");
299            });
300        },
301        error: function (request, status, error) {
302            alert("code:" + request.status + "\n" + "message:" + request.responseText + "\n" + "error:" + error);
303        },
304        dataType: "json",
305        async: true
306    });
307}
308
309/**
310 * 셀렉트박스의 selected="selected" 처리
311 * 
312 * @param selector
313 *            비교대상 select 엘리먼트
314 * @param val
315 *            비교할 값
316 */
317function gfnSetSelect(selector, val) {
318    $(selector + " > option").each(function () {
319        if ($(this).val() == val) {
320            $(this).prop("selected", true);
321        }
322    });
323}
324
325/**
326 * 면적
327 * 
328 * @param str
329 * @returns
330 */
331function toFloat(str) {
332    var tmp = str.value.replace(/[^0-9\.]/g, "");
333    if (tmp == "") {
334        tmp = 0.0;
335    }
336    str.value = addcomma(parseFloat(tmp));
337    return parseFloat(tmp);
338}
339
340/**
341 * 금액
342 * 
343 * @param str
344 * @returns
345 */
346function toInteger(str) {
347    var tmp = str.value.replace(/[^0-9]/g, "");
348    if (tmp == "") {
349        tmp = 0;
350    }
351    str.value = addcomma(parseInt(tmp));
352    return parseInt(tmp);
353}
354
355/**
356 * 숫자 콤마
357 * 
358 * @param str
359 * @returns
360 */
361function addcomma(str) {
362    var clearExp = /[^0-9\.]/g;
363    var regExp = /\B(?=(\d{3})+(?!\d))/g;
364    var clearStr = str.toString().replace(clearExp, '');
365    var splitStr = clearStr.toString().split(".");
366    var amt = "" + parseInt(splitStr[0].toString());
367    return amt.replace(regExp, ',') + (splitStr[1] != undefined ? "." + splitStr[1] : "");
368}
369
370function formatDate(date) {
371    var d = new Date(date),
372        month = '' + (d.getMonth() + 1),
373        day = '' + d.getDate(),
374        year = d.getFullYear();
375
376    if (month.length < 2)
377        month = '0' + month;
378    if (day.length < 2)
379        day = '0' + day;
380
381    return [year, month, day
382	].join('-');
383}
384
385/**
386 * 도로명팝업
387 * 
388 * @param doroIndex
389 */
390function DoroPopup(doroIndex) {
391    var win = window.open(CTX + '/comm/zipno/DoroPopup.do?openerFunc=DoroCallBack&openerParam=' + doroIndex, 'self', 'width=450, height=630, toolbar=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no');
392}
393
394/**
395 * 이메일주소 체크(로직 수정 22.06.23)
396 * 
397 * @param val
398 * @returns
399 */
400function isValidEmail(val) {
401//    var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
402	try{
403		var re = /^([\w\.\_\-])*[a-zA-Z0-9]+([\w\.\_\-])*([a-zA-Z0-9])+([\w\.\_\-])+@((([a-zA-Z0-9]+\.)+[a-zA-Z0-9]{2,8})|(\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}]))$/;
404		return re.test(gfnNonBlank(val));
405	}catch(e){
406		return false;
407	}
408}
409
410function satisfactionFormCheck(form) {
411    if (form.serp.value == "") {
412        alert("평가를 선택해주세요.");
413        return false;
414    }
415    $.ajax({
416        url: CTX + '/comm/PgsvSave.do',
417        data: $("#satisfactionForm").serialize(),
418        success: function (data) {
419            alert(data.resultMsg);
420        },
421        error: function (request, status, error) {
422            alert("code:" + request.status + "\n" + "message:" + request.responseText + "\n" + "error:" + error);
423        },
424        async: true
425    });
426    return false;
427}
428
429
430/**
431 * 해당 타겟위치로 화면 이동 ( + 입력창 활성화 여부 )
432 * 
433 * @param dom Obj or jQuery Obj (,boolean, boolean)
434 * @returns void
435 */
436function fnMoveFocus(poTargetEl, pbIsFocus, pbIsMove) {
437    var $target = poTargetEl instanceof jQuery ? poTargetEl : $(poTargetEl);
438    if(gfnChkUdf(pbIsMove) === "" || String(gfnChkUdf(pbIsMove)) == "true")
439    {
440    	$('html, body').animate({
441    		scrollTop: $target.offset().top - 150
442    	}, 200);
443    }
444    
445    if (String(gfnChkUdf(pbIsFocus)) == "true")
446    {//23.06.05 chrome 브라우저 무한루프 발생가능성 있으므로 수정
447		setTimeout(function(){
448			$target.focus();
449		},10);
450    }//end if 
451}
452
453/**
454 * 현재날짜 yyyyMMdd로 받기
455 * @param date obj
456 * @returns String
457 * */
458var fnNowDate = function (pdDate) {
459    return "" + pdDate.getFullYear() + "" + ((pdDate.getMonth() + 1) >= 10 ? (pdDate.getMonth() + 1) : "0" + (pdDate.getMonth() + 1)) + "" + (pdDate.getDate() >= 10 ? pdDate.getDate() : "0" + pdDate.getDate());
460};
461
462/**
463 * pw검증
464 * @param String pw1, String pw2
465 * @returns String
466 * */
467var fnPwChk = function (psPw, psPw2) {
468
469    //영어 또는 숫자 또는 특수문자만 입력가능함, 길이체크(9~16글자)
470    var regex = /^[A-Za-z0-9+!@#$^*-\=\+]{9,16}$/;
471
472    //영어 대소문자 체크
473    var checkEng = /[a-zA-Z]/g;
474    //숫자 체크
475    var checkNum = /[0-9]/g;
476    //특수문자 체크
477    var checkSpecialChar = /[!@#$^\-\=+*]/g;
478    // ',','.','/' 의 경우 허용문자가 아닌데도 true를 유도하므로 별도로 체크
479    var exceptionChar = /[,./<]/g;
480
481    if (!regex.test(psPw)) {
482        //길이 체크 및 허용문자 체크(입력된 문자가 허용된 문자인지만 체크)
483        alert("비밀번호는 영문/숫자/특수문자(!@#$^*+=-)조합 9~16자리까지 입력 가능합니다.");
484        return false;
485    } else {
486        //필수문자 체크
487        var vsPass = String(psPw);
488        if (fnIsNull(vsPass.match(checkEng)) || vsPass.match(checkEng).length < 1) {
489            alert("비밀번호는 영문/숫자/특수문자(!@#$^*+=-)조합 9~16자리까지 입력 가능합니다.");
490            return false;
491        }
492        if (fnIsNull(vsPass.match(checkNum)) || vsPass.match(checkNum).length < 1) {
493            alert("비밀번호는 영문/숫자/특수문자(!@#$^*+=-)조합 9~16자리까지 입력 가능합니다.");
494            return false;
495        }
496        if (fnIsNull(vsPass.match(checkSpecialChar)) || vsPass.match(checkSpecialChar).length < 1) {
497            alert("비밀번호는 영문/숫자/특수문자(!@#$^*+=-)조합 9~16자리까지 입력 가능합니다.");
498            return false;
499        }
500        if (!fnIsNull(vsPass.match(exceptionChar)) && vsPass.match(exceptionChar).length > 0) {
501            alert("비밀번호는 영문/숫자/특수문자(!@#$^*+=-)조합 9~16자리까지 입력 가능합니다.");
502            return false;
503        }
504    }
505
506    if (psPw != psPw2) {
507        alert("입력하신 비밀번호가 서로 일치하지 않습니다.");
508        return false;
509    }
510
511    return true;
512};
513
514/**
515 * 22.11.10
516 * fnXssSubmit submit 전 검증 function(or boolean) 리턴값 확인
517 * 
518 * @param function or boolean (, funciton args[array])
519 * @return boolean
520 */
521var fnTypeChk = function (a, fnArgs) {
522	
523	if(typeof a == "function")
524	{
525		try{
526			var vbFnRtn = gfnChkUdf(fnArgs) == "" ? a() : a(fnArgs);
527			if(typeof vbFnRtn == "boolean")
528			{//함수 실행 후 return 값 확인
529				return vbFnRtn;
530			}//end if
531		}catch(e){
532			console.error("fnTypeChk error : " + e);
533			return false;
534		}
535	}//end if
536	else if(typeof a == "boolean")
537	{
538		return a;
539	}//end else if
540	else
541	{
542		return false;
543	}//end else
544};
545
546/**
547 * aTag XSS 방지 CSRF 적용된 Form 태그 생성 및 submit
548 * 22.11.10 무조건 submit 까지 이벤트가 실행되는 문제 수정
549 * @param event, thisEl, csrfTokenValue , (, check, method, checkArgs)
550 * @return void
551 */
552var fnXssSubmit = function (event, selfTag, csrfStatus, check, method, checkArgs) {
553    //기본 이벤트 초기화
554    if (!fnIsNull(event))
555    {
556    	event.preventDefault();
557    }//end if
558
559    if (typeof check != "undefined") 
560    {
561        if (typeof check == "boolean") 
562        {
563        	if(!check)
564        	{//false 면 이벤트 중지
565        		return check;
566        	}//end if
567        }//end if
568        else 
569        {
570            //함수 return type : boolean
571            if (!fnTypeChk(check, checkArgs))
572            {
573            	return false;
574            }//end if
575        }//end else
576        fnXssSubmit_final(selfTag, csrfStatus, method);
577    }//end if
578    else
579    {
580    	fnXssSubmit_final(selfTag, csrfStatus, method);
581    }//end else
582};
583
584/**
585 * aTag XSS 방지 CSRF 적용된 Form 태그 생성 및 submit
586 * 22.11.10 무조건 submit 까지 이벤트가 실행되는 문제 수정
587 * @param event, thisEl, csrfTokenValue , (, check, method, checkArgs)
588 * @return void
589 */
590//검증 후 실행 모듈 selfTag, csrfStatus, method
591var fnXssSubmit_final = function(st, csrf, mtd){
592	if (fnIsNull(st) || fnIsNull(st)) 
593    {
594        alert("잘못된 이벤트입니다.");
595        return false;
596    }//end if
597    else
598	{
599    	if (fnIsNull(st.getAttribute("href")) || st.getAttribute("href").indexOf(".do") < 0) 
600    	{//aTag가 아닌경우 전부 return false;
601            return false;
602        }//end if
603    	else
604		{
605    		var voform = document.createElement("form"),
606            voinput = document.createElement("input");
607
608            voinput.type = "hidden";
609            voinput.name = "csrfToken";
610            voinput.value = csrf;
611
612            voform.action = st.getAttribute("href");
613            voform.method = fnIsNull(mtd) ? "post" : mtd; //default : post(권고사항)
614
615            voform.style.display = "none";
616
617            //_blank(새창으로) 일 때
618            if (st.getAttribute("target") == "_blank") 
619            {
620                window.open("about:blank", "newTab");
621                voform.target = "newTab";
622            }//end if
623
624            voform.appendChild(voinput);
625
626            document.body.appendChild(voform);
627            voform.submit();
628		}//end else
629	}//end else
630};
631
632// 레이어 팝업 제어
633var dialogOpen = false,
634    lastFocus, dialog, okbutton, pagebackground;
635var popId;
636
637/**
638 * 모달 팝업 호출 
639 * @param psIdx
640 * 		String 팝업창을 공유하는 경우, idx값을 구분짓기위해 사용
641 * */
642function showDialog(el, disView, pop, e, psIdx) {
643    lastFocus = el || document.activeElement;
644    if (disView !== undefined) {
645        if (pop !== undefined) {
646            toggleDialog('show', disView, pop, e, psIdx);
647        } else {
648            toggleDialog('show', disView, '', e, psIdx);
649        }
650    } else {
651        toggleDialog('show', '', '', e, psIdx);
652    }
653}
654
655function hideDialog(el, pop, e) {
656    if (pop == undefined) {
657        toggleDialog('hide', '', '', e);
658    } else {
659        toggleDialog('hide', '', pop, e);
660    }
661}
662
663function toggleDialog(sh, disView, pop, e, psIdx) {
664    var viewCode = disView;
665    var popId = pop;
666
667    if (gfnChkUdf(popId) == "") {
668        dialog = document.getElementById("layerPop");
669    } else {
670        dialog = document.getElementById(popId);
671        if(gfnChkUdf(dialog) == "")
672        {
673        	dialog = document.querySelectorAll(".cardModal>." + popId)[0];
674        }//end if
675    }
676    
677    //24.10.07 aria-hidden 오류 수정(크롬 브라우저 업데이트로 인해 발생하는 오류)
678    pagebackground = document.querySelectorAll("body>*:not(#attachLayer"+psIdx+"):not(script)");
679    
680//    pagebackground = document.getElementById("wrap");
681//    if(pagebackground == undefined) 
682//    {
683//        pagebackground = document.getElementById("content");
684//    }
685    if (sh == "show") {
686        dialogOpen = true;
687        
688        // show the dialog
689        if("table,block".indexOf(dialog.style.display) < 0 || dialog.style.display == "")
690        {
691        	if (viewCode == '') {
692        		dialog.style.display = 'table';
693        	} else {
694        		dialog.style.display = 'block';
695        	}
696        	// after displaying the dialog, focus an element inside it
697        	// only hide the background *after* you've moved focus out of the content that will be "hidden"
698        	
699        	pagebackground.forEach(function(node){node.setAttribute("aria-hidden","true");});
700        	dialog.removeAttribute("aria-hidden");
701        	dialog.focus();
702        }//end if
703        
704        //23.11.22
705        if(gfnChkUdf(psIdx) != "")
706        {
707        	$(dialog).find(".img")
708        	.css("background", "url('/images/content/card/" + psIdx + ".jpeg')")
709        	.css("background-repeat", "no-repeat")
710        	.css("background-size", "contain");
711        }//end if
712    } else {
713    	
714    	if(gfnChkUdf(e) != "")
715    	{
716    		e.stopPropagation();
717    		e.preventDefault();
718    	}//end if
719    	
720        dialogOpen = false;
721        
722        if(gfnChkUdf(dialog) != "")
723        {
724        	dialog.style.display = 'none';
725        	var chkSrcClear = $(dialog).find("div.img.noneClear").length > 0 ? false : true;
726        	if(chkSrcClear)
727        	{
728        		$(dialog).find("img").attr("src", "");
729        	}//end if
730        }//end if
731        else
732        {//빈값이 들어오는 경우
733        	$(".attachLayer").css("display", "none");
734        }//end else
735        
736        pagebackground.forEach(function(node){node.removeAttribute("aria-hidden");});
737        dialog.setAttribute("aria-hidden", "true");
738        lastFocus.focus();
739    }
740}
741document.addEventListener("focus", function (event) {
742    if (dialogOpen && !dialog.contains(event.target)) {
743        event.stopPropagation();
744        dialog.focus();
745    }
746}, true);
747document.addEventListener("keydown", function (event) {
748    if (dialogOpen && event.keyCode == 27) {
749        toggleDialog('hide');
750    }
751}, true);
752
753// Tab Content 
754function initTabMenu(tabContainerID) {
755    var tabContainer = document.getElementById(tabContainerID);
756    if(tabContainer != null && typeof tabContainer != "undefined"){
757    	
758    	var tabAnchor = tabContainer.getElementsByTagName("a");
759    	var i = 0;
760    	
761    	for (i = 0; i < tabAnchor.length; i++) {
762    		if (tabAnchor.item(i).className == "tab")
763    			var thismenu = tabAnchor.item(i);
764    		else
765    			continue;
766    		
767    		thismenu.container = tabContainer;
768    		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
769    		thismenu.targetEl.style.display = "none";
770    		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
771    		if (thismenu.imgEl) {
772    			thismenu.onfocus = function () {
773    				//this.onfocus();
774    			};
775    		}
776    		thismenu.onclick = tabMenuOver;
777    		
778    		if (!thismenu.container.first)
779    			thismenu.container.first = thismenu;
780    	}
781    	if(tabContainer.first != null && typeof tabContainer.first != "undefined")
782    		tabContainer.first.onclick();
783    }
784}
785
786function tabMenuOver() {
787    var currentmenu = this.container.current;
788    if (currentmenu != this) {
789        if (currentmenu) {
790            currentmenu.targetEl.style.display = "none";
791            if (currentmenu.imgEl) {
792                currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
793                currentmenu.className = currentmenu.className.replace(" on", "");
794            } else {
795                currentmenu.className = currentmenu.className.replace(" on", "");
796            }
797        }
798
799        this.targetEl.style.display = "block";
800        if (this.imgEl) {
801            this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
802            this.className += " on";
803        } else {
804            this.className += " on";
805        }
806        this.container.current = this;
807    }
808    return false;
809}
810
811function gfnFlndInfoApi(event) {
812	event.preventDefault();
813	event.stopPropagation();
814	var vsPnu = prompt();
815	
816    $.ajax({
817        type: 'POST',
818        url: CTX + '/comm/flndInfoCall.do',
819        data: {
820        	rowcnt: vsPnu
821        },
822        success: function (data) {
823        	var result = data.result[0];
824        	alert(result.RESULT_MSG);
825        },
826        error: function (request, status, error) {
827            alert("code:" + request.status + "\n" + "message:" + request.responseText + "\n" + "error:" + error);
828        },
829        dataType: "json",
830        async: true
831    });
832}
833
834/**
835 * 숫자 퍼센트 값 연산
836 * 
837 * @param str
838 * @returns number
839 */
840function fnPercent(psClsf, psTotal, psPercent) {
841	
842	var vsTotal = Number(fnIsNull(psTotal, "0"))//전체값
843		,vsPcnt = Number(fnIsNull(psPercent, "0"))//퍼센트값(%값 또는 특정 수치)
844		,vsClsf = fnIsNull(psClsf, "");
845	
846	if(vsTotal > 0 && vsPcnt > 0)
847	{
848		if(vsClsf == "total")
849		{//전체값의 x퍼센트를 알고싶을 때
850			return (vsTotal * vsPcnt) / 100;
851		}//end if
852		else if(vsClsf == "slice")
853		{//전체값에서 x값이 y퍼센트인지 알고싶을 때
854			return (vsPcnt * 100) / vsTotal;
855		}//end else
856	}//end if
857	
858	//위 조건을 타지 않는 경우 0 반환
859	return 0;
860}
861
862/**
863 * 원단위 절사 금액값 리턴(금액 관련해 원단위 절사가 대부분 발생함)
864 * 
865 * @param str
866 * @returns str
867 * */
868function fnGetPay(psPay){
869	var vnPay = Number(psPay);
870	return addcomma(String(Math.floor(vnPay / 10) * 10));
871}
872
873/**
874 * jquery selector 모바일에서 안될경우, 표준스크립트로 사용
875 * @param str
876 * @returns querySelector
877 * */
878function $s(psSelctor){
879	var vsStr = gfnChkUdf(psSelctor);
880	try
881	{
882		if(vsStr != "")
883		{
884			var vaSelectors = vsStr.split(" ");
885			//마지막 선택자가 #(id 선택자 = 단일) 이 아니면 복수 선택자로 호출
886			if(vaSelectors[vaSelectors.length - 1].indexOf("#") > -1)
887			{
888				return document.querySelector(vsStr);
889			}//end if
890			else
891			{
892				var vaSel = document.querySelectorAll(vsStr);
893				return vaSel.length == 1 ? vaSel[0] : vaSel;
894			}//end else
895		}//end if
896	}
897	catch(e)
898	{
899		return "";
900	}
901}
902
903/**
904 * jquery selector 모바일에서 안될경우, 표준스크립트로 사용
905 * @param str
906 * @param obj
907 * @returns boolean
908 * */
909function gfnSetClassVal(paClassObj, poData){
910	
911	var voData = gfnChkUdf(poData);
912	
913	try
914	{
915		for(var i = 0 ; i < paClassObj.length ; i++)
916		{
917			paClassObj[i].innerText = voData;
918		}//end for
919		return true;
920	}
921	catch(e)
922	{
923		return false;
924	}
925} 
926
927/**
928 * 글자수 체크
929 * @param str
930 * @param byte
931 * @returns boolean
932 * */
933function gfnChkIoByte(psStr, pnByte){
934	try
935	{
936		var fnToUniLeng = function(a){return (a.charCodeAt(0).toString(16)).length;};//유니코드 변환 후 길이 반환
937		
938		var vnMaxByte = gfnChkUdf(pnByte) == "" ? 0 : Number(pnByte);//입출력 최대 바이트
939		var vnTotalByte = 0;//글자의 바이트 수
940		
941		var vsStr = gfnChkUdf(psStr);//체크할 글자
942		var vnStrLength = vsStr.length;//글자 length : 단순 갯수파악용
943		
944		var vsChkChar = "";//앞에서부터 한글자씩 체크
945		
946		var vnIdx = 0;//글자 idx
947		
948		while(vnIdx < vnStrLength)
949		{
950			vsChkChar = vsStr.charAt(vnIdx);
951			
952			if(fnToUniLeng(vsChkChar) >= 4)
953			{
954				vnTotalByte += 2;//한글
955			}//end if
956			else
957			{
958				vnTotalByte += 1;//그외
959			}//end else
960			
961			vnIdx++;
962		}//end while
963		
964		if(vnMaxByte < vnTotalByte)
965		{
966			return false;
967		}//end if
968		else
969		{
970			return true;
971		}//end else
972	}
973	catch(e)
974	{
975		return false;
976	}
977} 
978
979/**
980 * 포털고객정보 기준 입력값 바이트 확인
981 * @param psType
982 * @returns Number
983 * */
984function gfnGetByteInput(psType){
985	
986	var vsType = gfnChkUdf(psType).toUpperCase();
987	var vnRtn = 9999;//잘못 사용했을 경우 에러방지
988	
989	if(vsType != "")
990	{
991		switch(vsType)
992		{
993		case "ID" :
994			vnRtn = 20;
995			break;
996		case "EMAIL" :
997			vnRtn = 100;
998			break;
999		case "NAME" :
1000			vnRtn = 100;
1001			break;
1002		case "ZIPNO" :
1003			vnRtn = 6;
1004			break;
1005		case "ADDR" :
1006			vnRtn = 100;
1007			break;
1008		case "ADDR_DTL" :
1009			vnRtn = 500;
1010			break;
1011		case "TEL" :
1012			vnRtn = 30;
1013			break;
1014		case "TEL_AR" :
1015			vnRtn = 3;
1016			break;
1017		case "TEL_MID" :
1018			vnRtn = 4;
1019			break;
1020		case "TEL_END" :
1021			vnRtn = 4;
1022			break;
1023		case "YEAR" :
1024			vnRtn = 4;
1025			break;
1026		default :
1027			break;
1028		}//end switch
1029	}//end if
1030	
1031	if(vnRtn == 9999)
1032	{
1033		console.log("unmapped byte");
1034	}//end if
1035	
1036	return vnRtn;
1037}
1038
1039
1040//공통메시지
1041function gfnMngAlert(psClsf){
1042	
1043	var vsRtnStr = "";
1044	
1045	if(psClsf == "대표전화")
1046	{
1047		vsRtnStr = "메시지 내용을 1577-7770으로 문의해주시길 바랍니다."; 	
1048	}//end if
1049	else if(psClsf == "매입임차신청")
1050	{
1051		vsRtnStr = "1.아래의 3가지 요건 중 하나도 해당되지 않는 자는 신청이 취소됩니다.\n- 농지소재지 시군구에 거주하는 자\n- 농지소재지 시군구에 인접하는 시군구에 거주하는 자\n- 농지소재지에서 직선거리 30km 이내 거주하는 자";
1052	}//end else if
1053	else if(psClsf == "타작물농지")
1054	{
1055		vsRtnStr = "계약기간 중 벼 이외의 타작물 재배만 가능한 농지입니다.";
1056	}//end else if
1057	
1058	return vsRtnStr;
1059}
1060
1061//23.01.26 공백 제거
1062function gfnNonBlank(psVal){
1063	try{
1064		return (gfnChkUdf(psVal)).replace(/ /g,"");
1065	}catch(e){
1066		return (String(psVal)).replace(/ /g,"");
1067	}
1068}
1069
1070/**
1071 * 23.01.26 ie 체크(11 포함)
1072 * */
1073function gfnIsIe(){
1074	var vsAgent = navigator.userAgent.toLowerCase();
1075	return navigator.appName.toLowerCase() == "netscape" && (vsAgent.indexOf("trident") > -1 || vsAgent.indexOf("msie") > -1) ? true : false;
1076}
1077
1078/**
1079 * string repeat
1080 * 문자열 multiply(곱하기)
1081 * @param String
1082 * 		psStr 반복될 문자
1083 * @param Number
1084 * 		pnCnt 반복 횟수
1085 * @param anything
1086 * 		poArgs 에러 확인하고자 하는 부분과 관련된 param 
1087 * @returns String
1088 * */
1089function gfnStrRept(psStr, pnCnt, poArgs){
1090	try{
1091		return (new Array(pnCnt + 1).join(psStr)).toString();
1092	}catch(e){
1093		console.dir(poArgs);
1094		console.warn(e);
1095	}
1096}
1097
1098/**
1099 * 23.09.14
1100 * 문자열 마스킹 처리
1101 * @param nodeList
1102 * 		pnlMasking 마스킹 처리 대상(className = mask)
1103 * @returns void
1104 * */
1105function gfnSetMasking(pnlMasking){
1106	if(pnlMasking.length > 0)
1107	{
1108		pnlMasking.forEach(function(item){
1109			setTimeout(function(){
1110				if(item.tagName.toLowerCase() == "input")
1111				{
1112					item.value = gfnStrRept("*", Number(item.dataset.maskText), item);
1113				}//end if
1114				else
1115				{
1116					item.innerText = gfnStrRept("*", Number(item.dataset.maskText), item);
1117				}//end  else
1118			});
1119		});
1120	}
1121}
1122
1123/**
1124 * 23.09.15
1125 * 데이터 타입체크
1126 * @param String
1127 * 		psType 데이터 타입
1128 * @param String
1129 * 		psDataVal 정규식 처리 대상 문자열
1130 * @param EleNode(+ option)
1131 * 		poNode 정규식 처리 요청 tag - 별도의 처리가 필요할 경우
1132 * @returns boolean
1133 * */
1134function gfnCheckDataType(psType, psDataVal, poNode) {
1135	/*
1136	 * 정규식은 /정규식/ 의 틀 안에 넣어야 한다 정규식의 시작과 끝은 ^ $ 이다. ex> /^ 정규식 $/ => 정규식 글자 자리에
1137	 * 정규식을 넣는다
1138	 * 
1139	 * --그룹화 추가로 정규식 자리에 () 으로 그룹화된 정규식을 사용할 수도 있다. 그룹화는 ex> /(^ 정규식 $)/ => 정규식
1140	 * 글자 자리에 정규식을 넣는다. ex> /(^\d+$) | (^\D+$)/ => 숫자 이거나 or 숫자가 아니거나
1141	 * 
1142	 * --기본 패턴 [0-9] 숫자 또는 0~9. \d 이렇게도 쓸 수 있어요. [^0-9] 숫자가 아닌것. \D
1143	 * [\t\n\x0B\f\r] 이건공백인데 복잡하네요.. 안써.. 이걸로 쓰세요.. \s [^\s] 공백이 아닌것 또는 \S
1144	 * [a-zA-Z0-9] 문자 또는 \w [^w] 문자가 아닌것 또는 \W
1145	 * 
1146	 * --특수 기호 [] 안에 사용되는 ^은 not의 의미 , 소문자 특수기호 대신 대문자를 사용 ex> [^0-9]는 숫자가 아닌것 =>
1147	 * /D
1148	 * 
1149	 * 특수기호 사용시 '\'붙이기 ex> . => \. 특수기호 예 ex> \d 숫자 [0-9]와 동일 \d{1} 숫자 1자리 인지 확인
1150	 * \d{1,6} 숫자 1~6자리 인지 확인
1151	 * 
1152	 * 
1153	 */
1154	var pattern = "";
1155	var vsTemp = "";
1156	
1157	if(gfnChkUdf(psDataVal) == "")
1158	{//값이 없는경우
1159		console.warn("gfnCheckDataType() notFound value. type =" + psType + " / " +psDataVal);
1160		return true;
1161	}//end if
1162	else
1163	{//값이 있는경우 trim 처리
1164		psDataVal = psDataVal.trim();
1165	}//end else
1166
1167	if ("brn" == psType) { // 사업자번호
1168		// pattern =
1169		// /(^\d{3}-\d{2}-\d{5}$)|(^\d{5}-\d{5}$)|(^\d{3}-\d{7}$)|(^\d{10}$)/;
1170		pattern = /^\d{10}$/;
1171	} else if ("cbn" == psType) { // 법인번호
1172		pattern = /^\d{6}-\d{7}$/;
1173	} else if ("int" == psType) { // 정수
1174		psDataVal = psDataVal.replaceAll(",","");
1175		pattern = /^(\-?)\d+$/;
1176	} else if ("float" == psType) { // 실수
1177		psDataVal = psDataVal.replaceAll(",","");
1178		pattern = /(^(\-?)\d+$)|(^\d+\.\d{1,2}$)/;
1179	} else if ("+-float" == psType) { // 실수(허용범위 확대)
1180		psDataVal = psDataVal.replaceAll(",","");
1181		pattern = /(^(\-?)\d+$)|(^(\-?)\d+\.\d{1,2}$)|(^\d+\.\d{1,2}$)/;
1182	} else if ("float4" == psType) { // 배점
1183		psDataVal = psDataVal.replaceAll(",","");
1184		pattern = /(^\d{0,4}$)|(^\d{0,4}\.\d{0,1}$)/;
1185	} else if ("float6" == psType) { // 이율
1186		psDataVal = psDataVal.replaceAll(",","");
1187		pattern = /(^\d{0,8}$)|(^\d{1,8}\.\d{0,6}$)/;
1188	} else if ("percent" == psType) { // 백퍼센트
1189		psDataVal = psDataVal.replaceAll(",","");
1190		pattern = /(^\d{0,3}$)|(^\d{0,3}\.\d{1,2}$)/;
1191		if (psDataVal > 100) {
1192			return false;
1193		}
1194	} else if ("date" == psType) { // 날짜(yyyymmdd)
1195		return gfndateCheck(psDataVal);
1196	} else if ("year" == psType) { // 연도(yyyy)
1197		pattern = /(^\d{4}$)/;
1198	} else if ("birth" == psType) { // 생년월일(yyyymmdd)
1199		if(psDataVal.replace(/[^0-9]/g,'').length == 8 && gfnChkUdf(poNode) != "")
1200		{
1201			vsTemp = psDataVal.replace(/[^0-9]/g,'');
1202			poNode.value = vsTemp.substr(0,4) + "." + vsTemp.substr(4,2) + "." + vsTemp.substr(6,2);
1203			psDataVal = poNode.value;
1204		}//end if
1205		pattern = /(^\d{4}\.(0[1-9]|1[0-2])\.(0[1-9]|[12][0-9]|3[01])$)/;
1206	} else if ("numtext" == psType) { // 특수문자 제외한 문자
1207		pattern = /^[A-Za-z0-9ㄱ-힣 ]*$/;
1208	} else if ("text" == psType) { // 특수문자,숫자 제외한 문자
1209		pattern = /^[A-Za-zㄱ-힣 ]*$/;
1210	} else if ("acc" == psType) { // 계좌번호
1211		pattern = /^[0-9]([0-9]|-)*[0-9]$/;
1212	} else if ("tel" == psType) { // 전화번호
1213		if(psDataVal == "1577-7770"){
1214			return true;
1215		}else{
1216			pattern = /(^0\d{1,2}-\d{3,4}-\d{4}$)|(^\d{9,11}$)/;
1217		}
1218	} else if ("rrn" == psType) { // 주민등록번호
1219		pattern = /(^\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])-[1-4]\d{6}$)|(^\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])[1-4]\d{6}$)/;
1220	} else if ("rrnf" == psType) { // 주민번호(앞)
1221		/**
1222		 * ^ 						: 문자열 시작
1223		 * \d{2} 					: 정수형 2자리 수
1224		 * (0[1-9]|1[0-2]) 			: ( (십의 자리 : 0, 일의 자리 : 1 ~ 9) 또는 (십의 자리 : 1, 일의 자리 : 0 ~ 2) )
1225		 * (0[1-9]|[12][0-9]|3[01]) : ( (십의 자리 : 0, 일의 자리 : 1 ~ 9) 또는 (십의 자리 : 1 ~ 2, 일의 자리 : 0 ~ 9) 또는 (십의 자리 : 3, 일의 자리 : 0 ~ 1) ) 
1226		 * $						: 문자열 종료(마지막)
1227		 * */
1228		pattern = /(^\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])$)/;
1229	} else if ("rrnr" == psType) { // 주민번호(뒤)
1230		/**
1231		 * ([1-6]\d{6}$) 			: (첫번째 자리 : 1 ~ 6) + 정수형 6자리
1232		 * */
1233		pattern = /([1-6]\d{6}$)|(^\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])[1-4]\d{6}$)/;
1234	} else if ("zcode" == psType) {
1235		pattern = /^\d{3}-?\d{3}$/;
1236	} else if ("yearmon" == psType) { // 년월(yyyymm)
1237		psDataVal = psDataVal.replaceAll(".","");
1238		pattern = /(^\d{4}(0[1-9]|1[0-2])$)/;
1239	} else if ("email" == psType) {
1240		pattern = /(\w+\.)*\w+@(\w+\.)*\w+/;
1241	}  else if ("naturalnum" == psType) {
1242		psDataVal = psDataVal.replaceAll(",","");
1243		pattern = /^\d+$/;
1244	} else if ("none" == psType) {
1245		return true;
1246	} else if (undefined == psType) {
1247		return true;
1248	} else if("arrayText" == psType){ //콤마포함
1249		pattern = /^[A-Za-z0-9ㄱ-힣, ]*$/;
1250	}
1251	if (!pattern.test((psDataVal))) { // 패턴에 문제가 있을 경우 false
1252		return false;
1253	} else { // 정상적일 경우 true
1254		return true;
1255	}
1256}
1257
1258/**
1259 * 23.09.15
1260 * 데이터 타입체크(필요에 따라 추가해서 사용)
1261 * @param String
1262 * 		psType 데이터 타입
1263 * @returns boolean
1264 * */
1265function gfnValidAlert(psType){
1266	if(psType == "birth")
1267	{
1268		alert("생년월일 형식에 맞지 않습니다.(ex.1990.01.01)");
1269		return false;
1270	}
1271	return true;
1272}
1273
1274/**
1275 * 공통 오버레이 로딩
1276 */
1277function showOverlayLoading() {
1278	var $overlayLoading = $("#overlayLoading");
1279
1280	if ($overlayLoading.length > 0) {
1281		$overlayLoading.addClass("is-active");
1282	}
1283}
1284
1285function hideOverlayLoading() {
1286	var $overlayLoading = $("#overlayLoading");
1287
1288	if ($overlayLoading.length > 0) {
1289		$overlayLoading.removeClass("is-active");
1290	}
1291}
1292
1293
1294
1295/**
1296 * 챗봇 팝업 호출 스크립트
1297 * 
1298 */
1299
1300var ctx = '/wiseChatbot';
1301
1302var chatWindow;
1303
1304jQuery(function () {
1305	   jQuery('#chatBotLink').on('click', function () {
1306	      const url = 'https://njbot.ekr.or.kr/wiseChatbot/chatbot.do?testId=9d8ba989-4878-42ad-9546-4def008cab98';
1307	      const njChatBot= window.open(url, 'NjChat', 'top=0, left=0, width=460, height=780');
1308	      return false;
1309	   });
1310
1311	   jQuery('.chatBot .chatBot-tooltip-close').on('click', function () {
1312	      jQuery(this).parent().hide();
1313	   });
1314	});

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.