PageSourceSearch

https://www.djbea.or.kr/resources/js/common.cms.js

js djbea.or.kr collected 2026-10-05 05:09:01 UTC 64,688 bytes, 1,721 lines download raw bytes

1/*-------------------------------------------------
2Common Javascript
3사용자페이지 및 관리자페이지 공통 js
4Version : 1.0
5author : mcahn
6create date : 2017. 05. 01.
7create date : 2017. 05. 01.
8-------------------------------------------------*/
9
10/*********************************************************************
11 * 팝업 호출
12 *
13 * 사용 : gfnOpenWin("url", "name", "style", 100, 200);
14 * 입력 : 호출url, 팝업이름, 스타일지정시, width값, height값
15 **********************************************************************/
16function gfnOpenWin(href, name, strStyle, width, height) {
17    var sleft = (screen.width - width) / 2;
18    var stop = (screen.height - height) / 2;
19
20    var style = "left=" + sleft + ",top=" + stop + ",width=" + width + ",height=" + height + "," + strStyle;
21    window.open(href, name, style);
22}
23
24/*********************************************************************
25 * 코드 콤보 조회 함수
26 *
27 * 사용 : gfnCodeComboList($("#"), "SearchType", "all", "전체", "1", "900D");
28 * 입력 : selectObject, upCdNm, 기본값사용시 value, 기본값사용시 text, 선택 할 value, 제외시킬 값 기준+Up/Down(null 처리 가능)
29 **********************************************************************/
30function gfnCodeComboList(selectObject, strHigh, strValue, strText, strSelect, strRange) {
31
32    var condition = null;
33    var strVal = null;
34
35    if (strRange != null && strRange != "" && typeof strRange != "undefined") {
36        condition = strRange.substring(strRange.length - 1, strRange.length);
37        strVal = strRange.substring(0, strRange.length - 1);
38    }
39
40    $.ajax({
41        url: gContextPath + "/common/listCode",
42        data: "upCdNm=" + strHigh,
43        async: false,
44        success: function (data, textStatus, jqXHR) {
45            selectObject.find("option").remove();
46
47            if (strText != "" && strText != null) {
48                selectObject.append($("<option>", {
49                    value: strValue, text: strText
50                }));
51            }
52
53            if (data != null) {
54                $.each(data, function (i, item) {
55                    // &amp; 기호 치환
56                    if (item.KORN_CD_NM.indexOf('&amp;') > 0) {
57                        item.KORN_CD_NM = item.KORN_CD_NM.replace('&amp;', '&');
58                    }
59
60                    if (condition == null || condition == "") {
61                        selectObject.append($("<option>", {
62                            value: item.CD_NM, text: ConvertSystemSourcetoHtml(item.KORN_CD_NM)
63                        }));
64                    } else {
65                        if (condition == 'U') {
66                            if (item.CD_NM >= strVal) {
67                                selectObject.append($("<option>", {
68                                    value: item.CD_NM, text: ConvertSystemSourcetoHtml(item.KORN_CD_NM)
69                                }));
70                            }
71                        } else {
72                            if (item.CD_NM < strVal) {
73                                selectObject.append($("<option>", {
74                                    value: item.CD_NM, text: ConvertSystemSourcetoHtml(item.KORN_CD_NM)
75                                }));
76                            }
77
78                        }
79                    }
80                });
81            }
82
83            if (strSelect != "" && strSelect != null) {
84                selectObject.val(strSelect);
85                // 선택된 값이 없을 경우, 가장 첫번째 option 선택
86                if (!selectObject.val()) {
87                    selectObject.find("option:first").prop("selected", true);
88                }
89            }
90        }
91    });
92}
93
94/*********************************************************************
95 * 카테고리 콤보 조회 함수
96 *
97 * 사용 : gfnCateComboList($("#"), "BOARD00002", "all", "전체", "1");
98 * 입력 : selectObject, bbsId, 기본값사용시 value, 기본값사용시 text, 선택 할 value
99 **********************************************************************/
100function gfnCateComboList(selectObject, strBbsId, strValue, strText, strSelect) {
101    $.ajax({
102        url: gContextPath + "/common/listCate",
103        data: "bbsId=" + strBbsId,
104        success: function (data, textStatus, jqXHR) {
105            selectObject.find("option").remove();
106
107            if (strText != "" && strText != null) {
108                selectObject.append($("<option>", {
109                    value: strValue, text: strText
110                }));
111            }
112
113            if (data != null) {
114                $.each(data, function (i, item) {
115                    selectObject.append($("<option>", {
116                        value: item.ctgryNo, text: ConvertSystemSourcetoHtml(item.ctgryNm)
117                    }));
118                });
119            }
120
121            if (strSelect != "" && strSelect != null) {
122                selectObject.val(strSelect);
123            }
124        }
125    });
126}
127
128/*********************************************************************
129 * 전체선택함수
130 *
131 * 사용 : gfnCodeComboList($("#"), "seq");
132 * 입력 : selectObject, 선택되게할 Name
133 **********************************************************************/
134function selectAll(selectObject, ckName) {
135    if (selectObject.is(":checked")) {
136        $("input[name='" + inputName + "']:checkbox").prop("checked", true);
137    } else {
138        $("input[name='" + inputName + "']:checkbox").prop("checked", false);
139    }
140}
141
142/*********************************************************************
143 * gfnSelectAllCalss 전체선택함수 -- input에 class명으로 체크
144 *
145 * 사용 : gfnSelectAllCalss($("#"), "calss");
146 * 입력 : selectObject, 선택되게할 Name
147 **********************************************************************/
148function gfnSelectAllCalss(className, bChk) {
149    $("." + className).prop("checked", bChk);
150}
151
152/********************************************************************************************************
153 * gfnCodeCheckList 코드 체크박스 조회함수
154 *
155 * 사용 : gfnCodeCheckList($("#"), "itrstFldNm", "itrstFldNm", strCheckList);
156 * 입력 : 체크박스가 추가될 위치 selectObject, upCdNm, 체크박스 이름, 체크될 값 배열(null 가능)
157 *******************************************************************************************************/
158function gfnCodeCheckList(selectObject, strHigh, ckName, strCheckList) {
159    $.ajax({
160        url: gContextPath + "/common/listCode",
161        data: "upCdNm=" + strHigh,
162        async: false,
163        success: function (data, textStatus, jqXHR) {
164
165            selectObject.find("input").remove();
166            selectObject.find("label").remove();
167
168            if (data != null) {
169                $.each(data, function (i, item) {
170                    if (strCheckList == null || strCheckList == "") {
171                        $("<input type='checkbox' id='" + ckName + i + "' name='" + ckName + "' value='" + item.CD_NM + "' />").appendTo(selectObject);
172                        $("<label for='" + ckName + i + "'>" + item.KORN_CD_NM + "</label>").appendTo(selectObject);
173
174                    } else {
175                        if (strCheckList[i] == item.CD_NM) {
176                            $("<input type='checkbox' id='" + ckName + i + "' name='" + ckName + "' value='" + item.CD_NM + "' checked='checked' />").appendTo(selectObject);
177                        } else {
178                            $("<input type='checkbox' id='" + ckName + i + "' name='" + ckName + "' value='" + item.CD_NM + "' />").appendTo(selectObject);
179                        }
180                        $("<label for='" + ckName + i + "'>" + item.KORN_CD_NM + "</label>").appendTo(selectObject);
181                    }
182                });
183            }
184        }
185    });
186}
187
188
189/*******************************************************************************
190 * [ Validate ] 숫자만 입력
191 *
192 * 입력 : 폼 객체 허용 : 0~9 사용 : onkeyup="validateOnlyNumber(this)"
193 ******************************************************************************/
194function validateOnlyNumber(from) {
195    for (var i = 0; i < from.value.length; i++) {
196        var str = from.value.charCodeAt(i);
197        if (str < 48 || str > 57) {
198            // alert("숫자만 입력하실수 있습니다. ");
199            from.value = from.value.replace(from.value.charAt(i), "");
200            // from.select();
200 //내용선택
201            return false;
202        }
203    }
204    return true;
205}
206
207/*******************************************************************************
208 * fnStrSplit 문자 자르는 함수
209 *
210 * 사용 : fnStrSplit("1###2", "###");
211 * 입력 : str, 자를 문자열
212 ******************************************************************************/
213function fnStrSplit(str, strSplit) {
214    var s = str;
215    var arrayString;
216
217    arrayString = s.split(strSplit);
218
219    return arrayString;
220}
221
222/*******************************************************************************
223 * 선택된 체크박스에 패턴추가 함수
224 *
225 * 사용 : gfnRtSelectCheck(chkName, pattern);
226 * 입력 : 체크박스 이름, 선택값 뒤 추가될 패턴
227 ******************************************************************************/
228function gfnRtSelectCheck(chkName, pattern) {
229    var patternLen = pattern.length;
230    var result = "";
231    var isCount = 0;
232
233    $('input:checkbox[name="' + chkName + '"]').each(function () {
234        if (this.checked) {
235            isCount++;
236            result = result + this.value + pattern;
237        } else {
238            result = result + pattern;
239        }
240    });
241
242    return result.substring(0, result.length - patternLen);
243}
244
245/* 입력 버튼 클릭시 */
246function gfnReplyInsert(selectObject, regNo, bbsId) {
247    var text = selectObject.val();
248    $('#replyArea').val("");
249    var csrfToken = $('meta[name="_csrf"]').attr('content');
250    var param = {_csrf: csrfToken, regNo: regNo, inCondition: "입력", cmntLqtyCn: text, bbsId: bbsId};
251
252    $.ajax({
253        type: "POST",
254        async: false,
255        url: gContextPath + "/common/replyAct",  // URL 변경
256        data: param,
257        success: function (data, textStatus, jqXHR) {
258            if (data == "NOUSER") {
259                alert("로그인이 필요합니다.");
260                location.reload();
261            } else {
262                gfnReplyList($('#reply'), regNo, bbsId);
263            }
264        }
265    });
266}
267
268/*******************************************************************************
269 * 선택된 오브젝트에 리플 삭제
270 *
271 * 사용 : gfnReplyDelete(cmntSn, regNo, bbsId)
272 * 입력 : 리플 Id, 글 regNo, 현재 게시판 bbsId
273 ******************************************************************************/
274function gfnReplyDelete(cmntSn, regNo, bbsId) {
275    var csrfToken = $('meta[name="_csrf"]').attr('content');
276    var param = {_csrf: csrfToken, cmntSn: cmntSn, inCondition: "삭제", regNo: regNo, bbsId: bbsId};
277    if (confirm("삭제하시겠습니까?")) {
278        $.ajax({
279            type: "POST",
280            async: false,
281            url: gContextPath + "/common/replyAct",
282            data: param,
283            success: function () {
284                $('li[value=' + cmntSn + ']').remove();
285            }
286        });
287    }
288}
289
290/*******************************************************************************
291 * 선택된 오브젝트에 리플 수정 폼 생성
292 *
293 * 사용 : gfnReplyUpdate(cmntSn, regNo, bbsId)
294 * 입력 : 리플 Id, 글 regNo, 현재 게시판 bbsId
295 ******************************************************************************/
296function gfnReplyUpdate(cmntSn, regNo, bbsId) {
297    var txt = $('li[value=' + cmntSn + '] > p').html();
298    txt = replaceAll(txt, "<br>", "\n");
299
300    $('li[value=' + cmntSn + '] > p').remove();
301    $('li[value=' + cmntSn + ']').append('<textarea id="editArea" style="width:100%; height: 56px; min-width: 643px;">');
302    $('li[value=' + cmntSn + '] > #editArea').html(txt);
303
304    //저장 버튼 추가 할 시
305    $('li[value=' + cmntSn + ']').append('<button type="button" onclick="javascript:gfnReplyUpdateAct(' + '\'' + cmntSn + '\'' + ',' + '\'' + regNo + '\'' + ',' + '\'' + bbsId + '\'' + ')">');
306    $('li[value=' + cmntSn + '] > button').text("저장");
307
308    /*var script = "javascript:gfnReplyUpdateAct("+cmntSn+","+regNo+")";
309    $('li[value='+cmntSn+'] > div > .btn > button[value=modify]').attr('onclick', script);*/
310}
311
312/*******************************************************************************
313 * 선택된 오브젝트에 리플 수정 처리
314 *
315 * 사용 : gfnReplyUpdateAct(cmntSn, regNo, bbsId)
316 * 입력 : 리플 Id, 글 regNo, 현재 게시판 bbsId
317 ******************************************************************************/
318function gfnReplyUpdateAct(cmntSn, regNo, bbsId) {
319    var text = $('#editArea').val();
320    var csrfToken = $('meta[name="_csrf"]').attr('content');
321    var param = {_csrf: csrfToken, 'regNo': regNo, 'cmntSn': cmntSn, 'inCondition': "수정", 'cmntLqtyCn': text, 'bbsId': bbsId};
322
323    $.ajax({
324        type: "POST",
325        async: false,
326        url: gContextPath + "/common/replyAct",
327        data: param,
328        success: function (data, textStatus, jqXHR) {
329            if (data == "NOUSER") {
330                alert("로그인이 필요합니다.");
331                location.reload();
332            } else {
333                $('li[value=' + cmntSn + '] > textarea').remove();
334
335                $('li[value=' + cmntSn + ']').last().append('<p>');
336                var str = text;
337                str = replaceAll(str, "\n", "<br />");
338                $('li[value=' + cmntSn + '] > p').last().html(str);
339            }
340
341            gfnReplyList($('#reply'), regNo, bbsId);
342        }
343    });
344
345    /*var script = "javascript:gfnReplyUpdate("+cmntSn+","+regNo+")";
346    $('li[value='+cmntSn+'] > div > .btn > button[value=modify]').attr('onclick', script);*/
347}
348
349/*******************************************************************************
350 * 선택된 오브젝트에 리플 리스트 가져오기
351 *
352 * 사용 : gfnReplyList(selectObject, regNo, bbsId)
353 * 입력 : 추가될 위치, 현재 글 regNo, 현재 게시판 bbsId
354 ******************************************************************************/
355function gfnReplyList(selectObject, regNo, bbsId) {
356    selectObject.empty();
357
358    $.ajax({
359        url: gContextPath + "/common/replyList",
360        data: {regNo: regNo, bbsId: bbsId},
361        success: function (data, textStatus, jqXHR) {
362            if (data != null) {
363                $.each(data, function (i, item) {
364                    selectObject.append('<li value=' + item.cmntSn + '>');
365                    selectObject.find('li').last().append('<div class="cmt_control">');
366                    selectObject.find('.cmt_control').last().append('<strong class="cmt_name">');
367                    selectObject.find('.cmt_name').last().text(item.dmlUserName);
368                    selectObject.find('.cmt_control').last().append('<span class="date">');
369                    selectObject.find('.cmt_control > .date').last().text(item.regDt);
370                    if (item.isMyReply == "Y") {
371                        selectObject.find('.cmt_control').last().append('<span class="btn">');
372                        selectObject.find('.btn').last().append('<button type="button" value="modify" onclick="javascript:gfnReplyUpdate(' + '\'' + item.cmntSn + '\'' + ',' + '\'' + item.regNo + '\'' + ',' + '\'' + bbsId + '\'' + ');">수정</button>');
373                        selectObject.find('.btn').last().append('<button type="button" value="delete" onclick="javascript:gfnReplyDelete(' + '\'' + item.cmntSn + '\'' + ',' + '\'' + item.regNo + '\'' + ',' + '\'' + bbsId + '\'' + ');">삭제</button>');
374                    }
375                    selectObject.find('li').last().append('<p>');
376
377                    var str = item.cmntLqtyCn;
378                    str = replaceAll(str, "\n", "<br />");
379                    selectObject.find('li > p').last().html(str);
380
381                });
382            }
383        }
384    });
385}
386
387/*********************************************************************
388 * 프린트 div 영역 지정 출력
389 *
390 **********************************************************************/
391var win = null;
392
393function printIt(contextPath) {
394    win = window.open('', '', 'width=1024,height=900');
395    self.focus();
396    win.document.open();
397    win.document.write('<' + 'html' + '><' + 'head' + '><' + 'style' + '>');
398    win.document.write('body { margin: 10px!important;}');
399    win.document.write('body, th { font-size: 10pt;}');
400    win.document.write('<' + '/' + 'style' + '>');
401    win.document.write('<link rel="stylesheet" type="text/css" href="' + contextPath + '/resources/css/ips/sub.css" />');
402    win.document.write('<link rel="stylesheet" type="text/css" href="' + contextPath + '/resources/css/ips/print.css" /><' + '/' + 'head' + '><' + 'body' + '>');
403    const el = window.top.document.getElementById('contentArea');
404
405    if (el.tagName.toLowerCase() === 'iframe') {
406        // iframe일 경우
407        const doc = el.contentDocument || el.contentWindow.document;
408        win.document.write(doc.body.innerHTML);
409    } else {
410        // div 또는 기타 요소일 경우
411        win.document.write($("#contentArea").html());
412    }
413    win.document.write('<' + '/' + 'body' + '><' + '/' + 'html' + '>');
414    win.document.close();
415    win.print();
416    win.close();
417}
418
419/*********************************************************************
420 * 프린트 div content 영역 출력
421 *
422 **********************************************************************/
423function printContent(contextPath, strSiteKey) {
424    var $divContent = $('#content').clone();
425    var menuId = $('#menuId').val();
426    var step = $('#step').val();
427
428    win = window.open('', '', 'width=1024,height=900');
429    self.focus();
430    win.document.open();
431    win.document.write('<' + 'html' + '><' + 'head' + '><' + 'style type="text/css" media="print" ' + '>');
432    // win.document.write('body, td { font-size: 10pt;}');
433    // win.document.write('body, th { font-size: 10pt;}');
434    // win.document.write('.content-footer { display:none; }');
435    // win.document.write('@media print { .content-footer { display:none; } }');
436    // win.document.write('@page{ size:auto; margin:8mm;} ');
437    win.document.write('<' + '/' + 'style' + '>');
438    win.document.write('<link rel="stylesheet" type="text/css" href="' + contextPath + '/resources/css/' + strSiteKey + '/print.css" />');
439    win.document.write('<' + '/' + 'head' + '><' + 'body id="print"' + '>');
440    win.document.write($divContent.html());
441    win.document.write('<' + '/' + 'body' + '><' + '/' + 'html' + '>');
442    win.document.close();
443
444    setTimeout(function () {
445        win.print();
446        win.close();
447    }, 1000);
448}
449
450/*
451//쿠키값 설정
452function setCookie(name, value, expiredays) {
453    var today = new Date();
454    today.setDate(today.getDate() + expiredays);
455    document.cookie = name + "=" + escape(value) + "; path=" + gContextPath + "; expires=" + today.toGMTString() + ";";
456}
457
458function setCookieWithSamePath(name, value, expiredays) {
459    var today = new Date();
460    today.setDate(today.getDate() + expiredays);
461    document.cookie = name + "=" + escape(value) + "; path=/; expires=" + today.toGMTString() + ";";
462}
463
464//쿠키값 가져오기 
465function getCookie(key) {
466    var cook = document.cookie + ";";
467    var idx = cook.indexOf(key, 0);
468    var val = "";
469
470    if (idx != -1) {
471        cook = cook.substring(idx, cook.length);
472        begin = cook.indexOf("=", 0) + 1;
473        end = cook.indexOf(";", begin);
474
475        //key 값과 cookie의 key 값이 일치 할 경우에만
476        if (key == cook.substring(0, begin - 1)) {
477            val = unescape(cook.substring(begin, end));
478        }
479    }
480
481    return val;
482}*/
483
484// localStorage 설정
485function setStorage(name, value, expireDays) {
486    if (expireDays === -1) {
487        localStorage.removeItem(name);
488        return;
489    }
490    const data = {
491        value: value,
492        expires: expireDays ? new Date().getTime() + expireDays * 24 * 60 * 60 * 1000 : null
493    };
494    localStorage.setItem(name, JSON.stringify(data));
495}
496
497// localStorage 가져오기
498function getStorage(name) {
499    try {
500        const data = JSON.parse(localStorage.getItem(name));
501        if (!data) return null;
502        if (data.expires && new Date().getTime() > data.expires) {
503            localStorage.removeItem(name);
504            return null;
505        }
506        return data.value;
507    } catch (e) {
508        console.error("getStorage parse error", e);
509        return null;
510    }
511}
512
513
514// 사용자 로그인 폼 아이디 저장 쿠키 가져오기
515function getIdCookie(name) {
516    const cookieString = document.cookie;
517    const cookies = cookieString.split(';');
518    for (const cookie of cookies) {
519        const [key, value] = cookie.split('=').map(item => item.trim());
520        if (key === name) {
521            return decodeURIComponent(value || '');
522        }
523    }
524    return '';
525}
526
527// 사용자 로그인 폼 아이디 저장 쿠키 설정하기
528function setIdCookie(name, value, days) {
529    const date = new Date();
530    date.setDate(date.getDate() + days);
531    const secure = location.protocol === "https:" ? "; Secure" : "";
532    document.cookie = `${name}=${encodeURIComponent(value)}; path=/; expires=${date.toUTCString()}${secure}`;
533}
534
535// 사용자 로그인 폼 아이디 저장 쿠키 삭제하기
536function deleteIdCookie(name) {
537    document.cookie = `${name}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC;`;
538}
539
540
541function replaceAll(sValue, param1, param2) {
542    return sValue.split(param1).join(param2);
543}
544
545/*******************************************************************************
546 * 선택된 게시글(메뉴) 스크랩하기
547 *
548 * 사용 : gfnMyScrapInsert(menuid, regNo)
549 * 입력 : 현재메뉴 menuid, 현재 글 regNo
550 ******************************************************************************/
551//스크랩중복체크 후 인서트
552function gfnMyScrapInsert(menuid, regNo) {
553    if (menuid.length < 9) {
554
555        alert("스크랩할 수 없습니다.");
556        return;
557    }
558
559    $.ajax({
560        url: gContextPath + "/mps/mypage/check",
561        data: {'menuId': menuid, 'schText': regNo},
562        success: function (rtn) {
563
564            fnScrapInsert(menuid, regNo, rtn);
565        }
566    });
567}
568
569//마이스크랩등록
570function fnScrapInsert(menuid, regNo, rtn) {
571    if (rtn > 0) {
572        alert("이미 스크랩되어 있습니다.");
573        return false;
574    } else {
575        if (confirm("해당 게시물(메뉴)를 스크랩 하시겠습니까?")) {
576
577            $.ajax({
578                url: gContextPath + "/mps/mypage/insert",
579                data: {'menuId': menuid, 'schText': regNo},
580                success: function (val) {
581                    alert("해당 게시물(메뉴)이 스크랩되었습니다.");
582                }
583            });
584        } else {
585            alert("취소되었습니다.");
586        }
587    }
588}
589
590/********************************************************************************************************
591 * gfnCodeRadioList 코드 라디오버튼 조회함수
592 *
593 * 사용 : gfnCodeRadioList($("#"), "itrstFldNm", "answerWay", "", "", "01");
594 * 입력 : 추가될 위치 selectObject, upCdNm, 라디오버튼 이름, 기본값 사용시 value, 기본값 사용시 text, 선택 할 value
595 *******************************************************************************************************/
596function gfnCodeRadioList(selectObject, strHigh, objName, strValue, strText, strSelect) {
597    $.ajax({
598        url: gContextPath + "/common/listCode",
599        data: "upCdNm=" + strHigh,
600        async: false,
601        success: function (data, textStatus, jqXHR) {
602
603            selectObject.find("input").remove();
604            selectObject.find("label").remove();
605
606            if (data != null) {
607                $.each(data, function (i, item) {
608                    $("<input type='radio' id='" + objName + i + "' name='" + objName + "' value='" + item.CD_NM + "' />").appendTo(selectObject);
609                    $("<label for='" + objName + i + "'>" + item.KORN_CD_NM + "</label>").appendTo(selectObject);
610                });
611            }
612
613            if (strSelect != "" && strSelect != null) {
614                $('input[name=' + objName + ']').each(function () {
615                    if ($(this).val() == strSelect) {
616                        $(this).attr('checked', 'checked');
617                    }
618                });
619            }
620        }
621    });
622}
623
624function padDigit(num) {
625    if (num < 10) {
626        return "0" + num;
627    } else {
628        return num;
629    }
630}
631
632function gfnAjaxError() {
633    alert("경로가 정확하지 않거나 오류가 발생하였습니다.");
634    return;
635}
636
637//메일보내기
638function gfnToMail(rtnLoction, ttl, url) {
639    var pop_title = "mail_pop";
640    window.open("", pop_title, 'width=870px,height=610px,scrollbars=yes,status=no');
641
642    var frmData = document.frmData;
643    frmData.menuName.value = rtnLoction;
644    frmData.ttl.value = ttl;
645    frmData.urlAddr.value = url;
646    frmData.target = pop_title;
647    frmData.action = "/mps/footerMail";
648    frmData.submit();
649}
650
651//트위터보내기
652function gfnToTwitter(strUrl) {
653    strUrl = "http://www.plani.co.kr" + strUrl;
654    var shareUrl = "http://twitter.com/share?url=" + encodeURIComponent(strUrl);
655    window.open(shareUrl, 'share_twitter', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');
656}
657
658
659/**************************************************************************************************************
660 * 이용약관 전체선택 공통
661 *
662 * 사용 : gfnOpenNewsLetter()
663 * 입력 :
664 **************************************************************************************************************/
665function gfnAllPolicyCheck() {
666    var choicePolicyChk = $("input:checkbox[name='allcheck']").is(":checked");
667
668    if (choicePolicyChk) {
669        $(".agree1").prop("checked", true);
670        $(".agree2").prop("checked", true);
671    } else {
672        $(".agree1").removeAttr('checked');
673        $(".agree2").removeAttr('checked');
674    }
675}
676
677/**************************************************************************************************************
678 * 이용약관 전체선택 공통
679 *
680 * 사용 : gfnNotAgreeCheck()
681 * 입력 :
682 **************************************************************************************************************/
683function gfnNotAgreeCheck() {
684    $("#allcheck").removeAttr('checked');
685}
686
687/**************************************************************************************************************
688 * 날짜 공통함수
689 *
690 * 사용 :
691 * 입력 :
692 **************************************************************************************************************/
693function gfnIsHoliday(yyyy, mm, dd) {
694    //검사년도
695    var yyyymmdd = yyyy + "" + mm + "" + dd;
696    //var yyyy = "";
697    var holidays = new Array();
698    var holidaysName = new Array();
699    var holidayName = "";
700    // 음력 공휴일 양력으로 바꾸어서 입력
701
702    // 양력 공휴일 일력
703    holidays[0] = yyyy + "0101"; //양력설날
704    holidays[1] = yyyy + "0301"; //삼일절
705    //holidays[2] = yyyy+"0405"; //식목일
706    holidays[2] = yyyy + "0505"; //어린이날
707    holidays[3] = yyyy + "0606"; //현충일
708    holidays[4] = yyyy + "0815"; //광복절
709    holidays[5] = yyyy + "1003"; //개천절
710    holidays[6] = yyyy + "1009"; //한글날
711    holidays[7] = yyyy + "1225"; //성탄절
712
713    var tmp01 = lunerCalenderToSolarCalenger(yyyy + "0101");
714    var tmp02 = lunerCalenderToSolarCalenger(yyyy + "0815");
715
716    holidays[8] = Number(tmp01) - 1;  //음력설 첫쨋날
717    holidays[9] = tmp01; 	 //음력설 둘쨋날
718    holidays[10] = Number(tmp01) + 1; //음력설 셋쨋날
719    holidays[11] = Number(tmp02) - 1; //음력추석 첫쨋날
720    holidays[12] = tmp02; 	 //음력추석 둘쨋날
721    holidays[13] = Number(tmp02) + 1; //음력추석 셋쨋날
722    holidays[14] = lunerCalenderToSolarCalenger(yyyy + "0408"); //석가탄신일
723
724    holidaysName[0] = "신정";
725    holidaysName[1] = "삼일절";
726    //holidaysName[2] = "식목일";
727    holidaysName[2] = "어린이날";
728    holidaysName[3] = "현충일";
729    holidaysName[4] = "광복절";
730    holidaysName[5] = "개천절";
731    holidaysName[6] = "한글날";
732    holidaysName[7] = "성탄절";
733    holidaysName[8] = "구정 첫쨋날";
734    holidaysName[9] = "구정 둘쨋날";
735    holidaysName[10] = "구정 셋쨋날";
736    holidaysName[11] = "추석 첫쨋날";
737    holidaysName[12] = "추석 둘쨋날";
738    holidaysName[13] = "추석 셋쨋날";
739    holidaysName[14] = "석가탄신일";
740
741    for (var i = 0; i < holidays.length; i++) {
742        if (holidays[i] == yyyymmdd) {
743            holidayName = holidaysName[i];
744            //return true;
745        }
746    }
747    return holidayName;
748}
749
750function get_year(src) {
751    if ((src < 1841) || (src > 2043)) {
752        alert('연도 범위는 1841 ~ 2043 까지입니다.');
753        return;
754    } else {
755        return src;
756    }
757}
758
759/**
760 * 달이 12보다 크거나 1보다 작은지 검사한다.
761 * 날짜가 잘못된 경우에는 경고창 후 멈춘다.
762 *
763 * @param int
764 * @return int
765 */
766function get_month(src) {
767    if ((src < 1) || (src > 12)) {
768        alert('월 범위는 1 ~ 12 까지입니다.');
769        return;
770    } else {
771        return src;
772    }
773}
774
775/**
776 * 날짜가 1일보다 크고 src보다 작은 경우는 날짜를 반환한다.
777 * 날짜가 잘못된 경우에는 경고창 후 멈춘다.
778 *
779 * @param int
780 * @param int
781 * @return int
782 */
783function get_day(src, day) {
784    if ((src < 1) || (src > day)) {
785        alert('일 범위가 틀립니다.');
786        return;
787    } else {
788        return src;
789    }
790}
791
792/**
793 * 음력을 양력으로 바꾸어서 반환한다.
794 *
795 * @param string
796 * return string
797 */
798function lunerCalenderToSolarCalenger(input_day) {
799    var kk = [[1, 2, 4, 1, 1, 2, 1, 2, 1, 2, 2, 1],   /* 1841 */
800        [2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1],
801        [2, 2, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1],
802        [2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2],
803        [1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1],
804        [2, 1, 2, 1, 5, 2, 1, 2, 2, 1, 2, 1],
805        [2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
806        [1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1],
807        [2, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 2],
808        [2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2],
809        [2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 5, 2],   /* 1851 */
810        [2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2],
811        [2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2],
812        [1, 2, 1, 2, 1, 2, 5, 2, 1, 2, 1, 2],
813        [1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1],
814        [2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
815        [1, 2, 1, 1, 5, 2, 1, 2, 1, 2, 2, 2],
816        [1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2],
817        [2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2],
818        [2, 1, 6, 1, 1, 2, 1, 1, 2, 1, 2, 2],
819        [1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2],   /* 1861 */
820        [2, 1, 2, 1, 2, 2, 1, 2, 2, 3, 1, 2],
821        [1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2],
822        [1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1],
823        [2, 1, 1, 2, 4, 1, 2, 2, 1, 2, 2, 1],
824        [2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 2],
825        [1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2],
826        [1, 2, 2, 3, 2, 1, 1, 2, 1, 2, 2, 1],
827        [2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1],
828        [2, 2, 2, 1, 2, 1, 2, 1, 1, 5, 2, 1],
829        [2, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1, 2],   /* 1871 */
830        [1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2],
831        [1, 1, 2, 1, 2, 4, 2, 1, 2, 2, 1, 2],
832        [1, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1],
833        [2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1],
834        [2, 2, 1, 1, 5, 1, 2, 1, 2, 2, 1, 2],
835        [2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2],
836        [2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1],
837        [2, 2, 4, 2, 1, 2, 1, 1, 2, 1, 2, 1],
838        [2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2],
839        [1, 2, 1, 2, 1, 2, 5, 2, 2, 1, 2, 1],   /* 1881 */
840        [1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2],
841        [1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2],
842        [2, 1, 1, 2, 3, 2, 1, 2, 2, 1, 2, 2],
843        [2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2],
844        [2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2],
845        [2, 2, 1, 5, 2, 1, 1, 2, 1, 2, 1, 2],
846        [2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1],
847        [2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2],
848        [1, 5, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2],
849        [1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2],   /* 1891 */
850        [1, 1, 2, 1, 1, 5, 2, 2, 1, 2, 2, 2],
851        [1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2],
852        [1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2],
853        [2, 1, 2, 1, 5, 1, 2, 1, 2, 1, 2, 1],
854        [2, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2],
855        [1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1],
856        [2, 1, 5, 2, 2, 1, 2, 1, 2, 1, 2, 1],
857        [2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2],
858        [1, 2, 1, 1, 2, 1, 2, 5, 2, 2, 1, 2],
859        [1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1],   /* 1901 */
860        [2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2],
861        [1, 2, 1, 2, 3, 2, 1, 1, 2, 2, 1, 2],
862        [2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1],
863        [2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2],
864        [1, 2, 2, 4, 1, 2, 1, 2, 1, 2, 1, 2],
865        [1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1],
866        [2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2],
867        [1, 5, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
868        [1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1],
869        [2, 1, 2, 1, 1, 5, 1, 2, 2, 1, 2, 2],   /* 1911 */
870        [2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2],
871        [2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2],
872        [2, 2, 1, 2, 5, 1, 2, 1, 2, 1, 1, 2],
873        [2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2],
874        [1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1],
875        [2, 3, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1],
876        [2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
877        [1, 2, 1, 1, 2, 1, 5, 2, 2, 1, 2, 2],
878        [1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2],
879        [2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2],   /* 1921 */
880        [2, 1, 2, 2, 3, 2, 1, 1, 2, 1, 2, 2],
881        [1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2],
882        [2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1],
883        [2, 1, 2, 5, 2, 1, 2, 2, 1, 2, 1, 2],
884        [1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1],
885        [2, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2],
886        [1, 5, 1, 2, 1, 1, 2, 2, 1, 2, 2, 2],
887        [1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2],
888        [1, 2, 2, 1, 1, 5, 1, 2, 1, 2, 2, 1],
889        [2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1],   /* 1931 */
890        [2, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2],
891        [1, 2, 2, 1, 6, 1, 2, 1, 2, 1, 1, 2],
892        [1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2],
893        [1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1],
894        [2, 1, 4, 1, 2, 1, 2, 1, 2, 2, 2, 1],
895        [2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1],
896        [2, 2, 1, 1, 2, 1, 4, 1, 2, 2, 1, 2],
897        [2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2],
898        [2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1],
899        [2, 2, 1, 2, 2, 4, 1, 1, 2, 1, 2, 1],   /* 1941 */
900        [2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2],
901        [1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2],
902        [1, 1, 2, 4, 1, 2, 1, 2, 2, 1, 2, 2],
903        [1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2],
904        [2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2],
905        [2, 5, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2],
906        [2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2],
907        [2, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2],
908        [2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1],
909        [2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2],   /* 1951 */
910        [1, 2, 1, 2, 4, 2, 1, 2, 1, 2, 1, 2],
911        [1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2],
912        [1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2],
913        [2, 1, 4, 1, 1, 2, 1, 2, 1, 2, 2, 2],
914        [1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2],
915        [2, 1, 2, 1, 2, 1, 1, 5, 2, 1, 2, 2],
916        [1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2],
917        [1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1],
918        [2, 1, 2, 1, 2, 5, 2, 1, 2, 1, 2, 1],
919        [2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2],   /* 1961 */
920        [1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1],
921        [2, 1, 2, 3, 2, 1, 2, 1, 2, 2, 2, 1],
922        [2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2],
923        [1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1],
924        [2, 2, 5, 2, 1, 1, 2, 1, 1, 2, 2, 1],
925        [2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2],
926        [1, 2, 2, 1, 2, 1, 5, 2, 1, 2, 1, 2],
927        [1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1],
928        [2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2],
929        [1, 2, 1, 1, 5, 2, 1, 2, 2, 2, 1, 2],   /* 1971 */
930        [1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1],
931        [2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1],
932        [2, 2, 1, 5, 1, 2, 1, 1, 2, 2, 1, 2],
933        [2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2],
934        [2, 2, 1, 2, 1, 2, 1, 5, 2, 1, 1, 2],
935        [2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1],
936        [2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1],
937        [2, 1, 1, 2, 1, 6, 1, 2, 2, 1, 2, 1],
938        [2, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2],
939        [1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2],   /* 1981 */
940        [2, 1, 2, 3, 2, 1, 1, 2, 2, 1, 2, 2],
941        [2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2],
942        [2, 1, 2, 2, 1, 1, 2, 1, 1, 5, 2, 2],
943        [1, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2],
944        [1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1],
945        [2, 1, 2, 2, 1, 5, 2, 2, 1, 2, 1, 2],
946        [1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1],
947        [2, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2],
948        [1, 2, 1, 1, 5, 1, 2, 1, 2, 2, 2, 2],
949        [1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2],   /* 1991 */
950        [1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2],
951        [1, 2, 5, 2, 1, 2, 1, 1, 2, 1, 2, 1],
952        [2, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2],
953        [1, 2, 2, 1, 2, 2, 1, 5, 2, 1, 1, 2],
954        [1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2],
955        [1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1],
956        [2, 1, 1, 2, 3, 2, 2, 1, 2, 2, 2, 1],
957        [2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1],
958        [2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1],
959        [2, 2, 2, 3, 2, 1, 1, 2, 1, 2, 1, 2],   /* 2001 */
960        [2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1],
961        [2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2],
962        [1, 5, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2],
963        [1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2],
964        [1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 2, 2],
965        [1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2],
966        [2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2],
967        [2, 2, 1, 1, 5, 1, 2, 1, 2, 1, 2, 2],
968        [2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2],
969        [2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1],   /* 2011 */
970        [2, 1, 6, 2, 1, 2, 1, 1, 2, 1, 2, 1],
971        [2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2],
972        [1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 1, 2],
973        [1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2],
974        [1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2],
975        [2, 1, 1, 2, 3, 2, 1, 2, 1, 2, 2, 2],
976        [1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2],
977        [2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2],
978        [2, 1, 2, 5, 2, 1, 1, 2, 1, 2, 1, 2],
979        [1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1],   /* 2021 */
980        [2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2],
981        [1, 5, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2],
982        [1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1],
983        [2, 1, 2, 1, 1, 5, 2, 1, 2, 2, 2, 1],
984        [2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2],
985        [1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2],
986        [1, 2, 2, 1, 5, 1, 2, 1, 1, 2, 2, 1],
987        [2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2],
988        [1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1],
989        [2, 1, 5, 2, 1, 2, 2, 1, 2, 1, 2, 1],   /* 2031 */
990        [2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2],
991        [1, 2, 1, 1, 2, 1, 5, 2, 2, 2, 1, 2],
992        [1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1],
993        [2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2],
994        [2, 2, 1, 2, 1, 4, 1, 1, 2, 1, 2, 2],
995        [2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2],
996        [2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1],
997        [2, 2, 1, 2, 5, 2, 1, 2, 1, 2, 1, 1],
998        [2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 1],
999        [2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2],   /* 2041 */
1000        [1, 5, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
1001        [1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2]];
1002
1003    var gan = new Array("甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸");
1004    var jee = new Array("子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥");
1005    var ddi = new Array("쥐", "소", "범", "토끼", "용", "뱀", "말", "양", "원숭이", "닭", "개", "돼지");
1006    var week = new Array("일", "월", "화", "수", "목", "금", "토");
1007
1008    var md = new Array(31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
1009
1010    var year = input_day.substring(0, 4);
1011    var month = input_day.substring(4, 6);
1012    var day = input_day.substring(6, 8);
1013
1014    // 음력에서 양력으로 변환
1015    var lyear, lmonth, lday, leapyes;
1016    var syear, smonth, sday;
1017    var mm, y1, y2, m1;
1018    var i, j, k1, k2, leap, w;
1019    var td, y;
1020    lyear = get_year(year);        // 년도 check
1021    lmonth = get_month(month);     // 월 check
1022
1023    y1 = lyear - 1841;
1024    m1 = lmonth - 1;
1025    leapyes = 0;
1026    if (kk[y1][m1] > 2) {
1027        if (document.frmTest.yoon[0].checked) {
1028            leapyes = 1;
1029            switch (kk[y1][m1]) {
1030                case 3:
1031                case 5:
1032                    mm = 29;
1033                    break;
1034                case 4:
1035                case 6:
1036                    mm = 30;
1037                    break;
1038            }
1039        } else {
1040            switch (kk[y1][m1]) {
1041                case 1:
1042                case 3:
1043                case 4:
1044                    mm = 29;
1045                    break;
1046                case 2:
1047                case 5:
1048                case 6:
1049                    mm = 30;
1050                    break;
1051            } // end of switch
1052        } // end of if
1053    } // end of if
1054
1055    lday = get_day(day, mm);
1056
1057    td = 0;
1058    for (i = 0; i < y1; i++) {
1059        for (j = 0; j < 12; j++) {
1060            switch (kk[i][j]) {
1061                case 1:
1062                    td = td + 29;
1063                    break;
1064                case 2:
1065                    td = td + 30;
1066                    break;
1067                case 3:
1068                    td = td + 58;    // 29+29
1069                    break;
1070                case 4:
1071                    td = td + 59;    // 29+30
1072                    break;
1073                case 5:
1074                    td = td + 59;    // 30+29
1075                    break;
1076                case 6:
1077                    td = td + 60;    // 30+30
1078                    break;
1079            } // end of switch
1080        } // end of for
1081    } // end of for
1082
1083    for (j = 0; j < m1; j++) {
1084        switch (kk[y1][j]) {
1085            case 1:
1086                td = td + 29;
1087                break;
1088            case 2:
1089                td = td + 30;
1090                break;
1091            case 3:
1092                td = td + 58;    // 29+29
1093                break;
1094            case 4:
1095                td = td + 59;    // 29+30
1096                break;
1097            case 5:
1098                td = td + 59;    // 30+29
1099                break;
1100            case 6:
1101                td = td + 60;    // 30+30
1102                break;
1103        } // end of switch
1104    } // end of for
1105
1106    if (leapyes == 1) {
1107        switch (kk[y1][m1]) {
1108            case 3:
1109            case 4:
1110                td = td + 29;
1111                break;
1112            case 5:
1113            case 6:
1114                td = td + 30;
1115                break;
1116        } // end of switch
1117    } // end of switch
1118
1119    td = td + parseFloat(lday) + 22;
1120    // td : 1841 년 1 월 1 일 부터 원하는 날짜까지의 전체 날수의 합
1121    y1 = 1840;
1122    do {
1123        y1 = y1 + 1;
1124        if ((y1 % 400 == 0) || ((y1 % 100 != 0) && (y1 % 4 == 0))) {
1125            y2 = 366;
1126        } else {
1127            y2 = 365;
1128        }
1129        if (td <= y2) {
1130            break;
1131        } else {
1132            td = td - y2;
1133        }
1134    } while (1); // end do-While
1135
1136    syear = y1;
1137    md[1] = parseInt(y2) - 337;
1138    m1 = 0;
1139    do {
1140        m1 = m1 + 1;
1141        if (td <= md[m1 - 1]) {
1142            break;
1143        } else {
1144            td = td - md[m1 - 1];
1145        }
1146    } while (1); // end of do-While
1147
1148    smonth = parseInt(m1);
1149    sday = parseInt(td);
1150
1151    // 월이 한자리인경우에는 앞에 0을 붙혀서 반환
1152    if (smonth < 10) {
1153        smonth = "0" + smonth;
1154    }
1155    // 일이 한자리인경우에는 앞에 0을 붙혀서 반환
1156    if (sday < 10) {
1157        sday = "0" + sday;
1158    }
1159
1160    return new String(syear + smonth + sday);
1161}
1162
1163//날짜 포맷변환  00000000 => 0000-00-00
1164function gfnDateYYYYMMDDFormat(object) {
1165
1166    var num, year, month, day;
1167
1168    var input = "#" + object;
1169
1170    num = $(input).val();
1171
1172    if (num.length == 0) {
1173        return;
1174    }
1175
1176    while (num.search("-") != -1) {
1177
1178        num = num.replace("-", "");
1179    }
1180
1181    if (isNaN(num)) {
1182        alert("숫자로만 작성하셔야 합니다.");
1183        $(input).focus();
1184        return;
1185    }
1186
1187    if (num != 0 && num.length == 8) {
1188
1189        year = num.substring(0, 4);
1190        month = num.substring(4, 6);
1191        day = num.substring(6);
1192
1193        if (isValidDay(year, month, day) == false) {
1194
1195            num = "";
1196            alert("유효하지 않는 날짜입니다. 다시 한번 확인하시고 입력해주세요.");
1197            $(input).val(num);
1198            $(input).focus();
1199            return;
1200        }
1201
1202        num = year + "-" + month + "-" + day;
1203
1204    } else {
1205        num = "";
1206        alert("날짜 입력형식 오류입니다. 다시 한번 확인하시고 입력해 주세요");
1207        $(input).val(num);
1208        $(input).focus();
1209        return;
1210    }
1211
1212    $(input).val(num);
1213}
1214
1215//유효한 날짜인지 체크
1216function isValidDay(yyyy, mm, dd) {
1217
1218    var m = parseInt(mm, 10) - 1;
1219    var d = parseInt(dd, 10);
1220    var end = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
1221
1222    if ((yyyy % 4 == 0 && yyyy % 100 != 0) || yyyy % 400 == 0) {
1223
1224        end[1] = 29;
1225    }
1226
1227    return (d >= 1 && d <= end[m]);
1228}
1229
1230
1231/*********************************************************************
1232 * 로그인  호출
1233 *
1234 * 사용 : gfnOpenLogin();
1235 * 입력 :
1236 **********************************************************************/
1237function gfnOpenLogin() {
1238
1239    //$(".login_layerPopup").show();
1240    $(".login_layerPopup").css("display", "none");
1241    $(".login_layerPopup").fadeIn('slow');
1242}
1243
1244/*********************************************************************
1245 * 정규식 패턴 생성 (공백/특수문자 무시)
1246 * 유해어의 각 문자 사이에 공백/특수문자가 올 수 있도록 패턴 생성
1247 * 예: "유해어" -> "유[공백/특수문자]*해[공백/특수문자]*어"
1248 *
1249 * 사용 : createTabooPattern("유해어");
1250 * 입력 : word - 유해어
1251 * 반환 : RegExp 객체 (대소문자 무시)
1252 **********************************************************************/
1253function createTabooPattern(word) {
1254    if (!word || word.length === 0) return null;
1255
1256    // 각 문자 사이에 0개 이상의 공백/특수문자가 올 수 있도록 패턴 생성
1257    // 특수문자: 공백, 하이픈, 언더스코어, 기타 특수문자 등
1258    var pattern = '';
1259    // 정규식에서 특수문자로 취급되는 문자들
1260    var regexSpecialChars = /[.*+?^${}()|[\]\\]/;
1261
1262    for (var i = 0; i < word.length; i++) {
1263        if (i > 0) {
1264            // 문자 사이에 공백/특수문자 허용 (0개 이상)
1265            // 공백, 하이픈, 언더스코어, @, #, $, %, ^, &, *, (, ), +, =, [, ], {, }, |, \, ;, :, ", ', <, >, ,, ., ?, /, !, ~, `
1266            pattern += '[\\s\\-\\_@#\\$%\\^&\\*\\(\\)\\+=\\[\\]\\{\\}\\|\\\\;:\"\'<>,\\.\\?/!~`]*';
1267        }
1268        // 정규식 특수문자는 이스케이프 처리
1269        var char = word.charAt(i);
1270        if (regexSpecialChars.test(char)) {
1271            pattern += '\\' + char;
1272        } else {
1273            pattern += char;
1274        }
1275    }
1276    return new RegExp(pattern, 'i'); // 대소문자 무시
1277}
1278
1279/*********************************************************************
1280 * 유해어 체크
1281 *
1282 * 사용 : gfnTabooWordCheck();
1283 * 입력 :
1284 **********************************************************************/
1285function gfnTabooWordCheck(objs) {
1286    var chkCnt = 0;
1287    var chkTtlArray = [];
1288    var kNameArray = [];
1289
1290    $.each(objs.split('§§'), function (index, obj) {
1291        $.ajax({
1292            url: gContextPath + "/tabooWord",
1293            async: false,
1294            cache: false,
1295            success: function (data) {
1296                if (data != null) {
1297                    var fieldValue = $("#" + obj).val();
1298                    if (fieldValue !== undefined && fieldValue !== null) {
1299                        $.each(data, function (j) {
1300                            if (data[j].PHWRD_NM) {
1301                                var pattern = createTabooPattern(data[j].PHWRD_NM);
1302                                if (pattern && pattern.test(fieldValue)) {
1303                                    chkCnt += 1;
1304                                    chkTtlArray.push(data[j].PHWRD_NM);
1305                                }
1306                            }
1307                        });
1308                    }
1309                }
1310            }
1311        });
1312    });
1313
1314    $.each(chkTtlArray, function (i, el) {
1315        if ($.inArray(el, kNameArray) == -1) kNameArray.push(el);
1316    });
1317
1318
1319    return [chkCnt + "건의 유해어가 검출되었습니다.\n" + kNameArray, chkCnt];
1320}
1321
1322/*********************************************************************
1323 * 유해어 검증 및 알림 (공통 함수)
1324 * 
1325 * 사용 : if (!gfnValidateTabooWords('ttl§§htmlLqtyCn')) return false;
1326 * 입력 : fieldIds - 검증할 필드 ID들 (예: 'ttl§§htmlLqtyCn' 또는 'htmlLqtyCn')
1327 * 반환 : true (유해어 없음) / false (유해어 검출 시 alert 후 false 반환)
1328 **********************************************************************/
1329function gfnValidateTabooWords(fieldIds) {
1330    /*var tabooResult = gfnTabooWordCheck(fieldIds);
1331    if (tabooResult[1] > 0) {
1332        alert(tabooResult[0]);
1333        return false;
1334    }*/
1335    return true;
1336}
1337
1338function zooms(nowZoom) {
1339    var docbody = document.body;
1340    header.style.zoom = nowZoom;// IE
1341    body.style.zoom = nowZoom;// IE
1342    footer.style.zoom = nowZoom;  // IE
1343    docbody.style.webkitTransform = 'scale(' + nowZoom + ')';  // Webkit(chrome)
1344    docbody.style.webkitTransformOrigin = '0 0';
1345    docbody.style.mozTransform = 'scale(' + nowZoom + ')';  // Mozilla(firefox)
1346    docbody.style.mozTransformOrigin = '0 0';
1347    docbody.style.oTransform = 'scale(' + nowZoom + ')';  // Opera
1348    docbody.style.oTransformOrigin = '0 0';
1349}
1350
1351/*********************************************************************
1352 * 에디터 설정
1353 *
1354 **********************************************************************/
1355function gfnInitEditor(objId, objPosition) {
1356    // 다음에디터 설정
1357    $.ajax({
1358        url: gContextPath + "/resources/component/daumeditor-7.4.27/editor.html",
1359        success: function (data) {
1360            data = data.replace(/images\/icon\/editor\/skin\/01\/btn_drag01.gif/g, gContextPath + "/resources/component/daumeditor-7.4.27/images/icon/editor/skin/01/btn_drag01.gif");
1361            data = data.replace(/images\/icon\/editor\/loading2.png/g, gContextPath + "/resources/component/daumeditor-7.4.27/images/icon/editor/loading2.png");
1362            data = data.replace(/images\/icon\/editor\/pn_preview.gif/g, gContextPath + "/resources/component/daumeditor-7.4.27/images/icon/editor/pn_preview.gif");
1363
1364            $("#editor_frame").html(data);
1365            var config = {
1366                txHost: '', /* 런타임 시 리소스들을 로딩할 때 필요한 부분으로, 경로가 변경되면 이 부분 수정이 필요. ex) http://xxx.xxx.com */
1367                txPath: '', /* 런타임 시 리소스들을 로딩할 때 필요한 부분으로, 경로가 변경되면 이 부분 수정이 필요. ex) /xxx/xxx/ */
1368                txService: 'sample', /* 수정필요없음. */
1369                txProject: 'sample', /* 수정필요없음. 프로젝트가 여러개일 경우만 수정한다. */
1370                initializedId: "", /* 대부분의 경우에 빈문자열 */
1371                wrapper: "tx_trex_container", /* 에디터를 둘러싸고 있는 레이어 이름(에디터 컨테이너) */
1372                form: 'tx_editor_form' + "", /* 등록하기 위한 Form 이름 */
1373                txIconPath: gContextPath + "/resources/component/daumeditor-7.4.27/images/icon/editor/", /*에디터에 사용되는 이미지 디렉터리, 필요에 따라 수정한다. */
1374                txDecoPath: gContextPath + "/resources/component/daumeditor-7.4.27/images/deco/contents/", /*본문에 사용되는 이미지 디렉터리, 서비스에서 사용할 때는 완성된 컨텐츠로 배포되기 위해 절대경로로 수정한다. */
1375                canvas: {
1376                    exitEditor: {
1377                        /*
1378                        desc:'빠져 나오시려면 shift+b를 누르세요.',
1379                        hotKey: {
1380                            shiftKey:true,
1381                            keyCode:66
1382                        },
1383                        nextElement: document.getElementsByTagName('button')[0]
1384                        */
1385                    },
1386                    styles: {
1387                        color: "#123456", /* 기본 글자색 */
1388                        fontFamily: "굴림", /* 기본 글자체 */
1389                        fontSize: "9pt", /* 기본 글자크기 */
1390                        backgroundColor: "#fff", /*기본 배경색 */
1391                        lineHeight: "1.5", /*기본 줄간격 */
1392                        padding: "10px" /* 위지윅 영역의 여백 */
1393                    },
1394                    showGuideArea: false
1395                },
1396                events: {
1397                    preventUnload: false
1398                },
1399                sidebar: {
1400                    attachbox: {
1401                        show: true,
1402                        confirmForDeleteAll: true
1403                    },
1404                    capacity: {
1405                        available: 1024 * 1024 * 10, /* 첨부 용량 제한 */
1406                        maximum: 1024 * 1024 * 10     /* 첨부 용량 제한 */
1407                    }
1408                },
1409                size: {
1410                    //contentWidth: 670 /* 지정된 본문영역의 넓이가 있을 경우에 설정 */
1411                }
1412            };
1413
1414            EditorJSLoader.ready(function (Editor) {
1415                var editor = new Editor(config);
1416                Editor.getCanvas().setCanvasSize({height: 250});
1417
1418                if (objPosition == 'self') {
1419                    Editor.modify({
1420                        "content": document.getElementById(objId) /* 내용 문자열, 주어진 필드(textarea) 엘리먼트 */
1421                    });
1422                } else {
1423                    Editor.modify({
1424                        "content": opener.document.getElementById(objId) /* 내용 문자열, 주어진 필드(textarea) 엘리먼트 */
1425                    });
1426                }
1427
1428            });
1429        }
1430    });
1431}
1432
1433/*********************************************************************
1434 * 파일업로드 확장자 체크
1435 *
1436 **********************************************************************/
1437function gfnCheckFext(objs, type) {
1438
1439    var retval = true;
1440    var ext = "";
1441
1442    objs.each(function () {
1443        var fpath = $(this).val();
1444        if (fpath.length > 0) {
1445            ext = fpath.substr(fpath.lastIndexOf(".") + 1, fpath.length);
1446            ext = ext.toLowerCase();
1447
1448            if (type == "IMG") {
1449                var allows = "jpg|png|bmp|gif";
1450                if (allows.indexOf(ext) < 0) {
1451                    alert("허용되지 않는 파일이거나 목적에 맞지 않는 파일입니다.\n이미지 파일을 등록해주십시오.\n현재 파일 종류 : " + ext);
1452                    retval = false;
1453                    return false;
1454                }
1455            } else if (type == "DOC") {
1456                var allows = "doc|docx|xls|xlsx|ppt|pptx|pdf|hwp|txt";
1457                if (allows.indexOf(ext) < 0) {
1458                    alert("허용되지 않는 파일이거나 목적에 맞지 않는 파일입니다/.\n문서 파일을 등록해주십시오.\n현재 파일 종류 : " + ext);
1459                    retval = false;
1460                    return false;
1461                }
1462            } else if (type == "GNR") {
1463                var allows = "jpg|png|bmp|gif|doc|docx|xls|xlsx|ppt|pptx|pdf|hwp|txt|zip";
1464                if (allows.indexOf(ext) < 0) {
1465                    alert("허용되지 않는 파일이거나 목적에 맞지 않는 파일입니다.\n파일 종류 : " + ext);
1466                    retval = false;
1467                    return false;
1468                }
1469            }
1470        }
1471    });
1472
1473    return retval;
1474}
1475
1476
1477/*********************************************************************
1478 * 파일미리보기
1479 *
1480 **********************************************************************/
1481function gfnFileViewer(url) {
1482    $.ajax({
1483        type: "POST",
1484        async: false,
1485        url: url,
1486        success: function (data) {
1487            window.open(data.INFO, "_balnk", "status=no,toolbar=no,scrollbars=no");
1488        }
1489    });
1490}
1491
1492/*********************************************************************
1493 * 특수문자변화코드
1494 *
1495 **********************************************************************/
1496function ConvertSystemSourcetoHtml(str) {
1497    str = str.replace(/&lt;/g, "<");
1498    str = str.replace(/&gt;/g, ">");
1499    str = str.replace(/&quot;/g, "\"");
1500    str = str.replace(/&#39;/g, "\'");
1501    str = str.replace(/&apos;/g, "\'");
1502    return str;
1503}
1504
1505function gfnNtnNmAdd(obj) {
1506    var nodeLeng = $("#tdNtnNm").children('select').length;
1507    var cntntNmCdNm = "cntntNm" + (nodeLeng / 2);
1508    var ntnNmCdNm = "ntnNm" + (nodeLeng / 2);
1509
1510    obj.before('<select id="' + cntntNmCdNm + '" name="' + cntntNmCdNm + '" class="selContinent"><option value="">대륙 선택</option></select> '
1511        + '<select id="' + ntnNmCdNm + '" name="' + ntnNmCdNm + '" class="selNtnNm"><option value="">국가 선택</option></select> ');
1512
1513    gfnCodeComboList($("#" + cntntNmCdNm), "cntntNm", "", "대륙 선택", "", ""); // 대륙 코드조회
1514
1515}
1516
1517function gfnFileTagAdd(obj) {
1518    obj.after('<input type="file" id="file_upload" name="file_upload" class="input_mid"/> '
1519        + '<input type="button" value="파일삭제" class="btn btn-black" onClick="javascript:gfnFileTagDel($(this));" />');
1520}
1521
1522function gfnFileTagDel(obj) {
1523    obj.prev().remove();
1524    obj.remove();
1525}
1526
1527
1528function gfnDatePicker(selobjs, format) {
1529    selobjs.each(function () {
1530        let pickobj = $(this);
1531        if (pickobj.prop('type') == "text") {
1532            pickobj.datepicker({
1533                monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
1534                dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
1535                showOtherMonths: true,
1536                selectOtherMonths: true,
1537                showButtonPanel: false,
1538                changeYear: true,
1539                changeMonth: true,
1540                prevText: '이전',
1541                nextText: '다음',
1542                dateFormat: (format && format !== '') ? format : 'yy-mm-dd'
1543            });
1544        }
1545    });
1546}
1547
1548$(function () {
1549
1550    // 검색기간 체크
1551    if ($("#schStartDate").val() !== undefined && $("#schEndDate").val() !== undefined) {
1552        $("#schStartDate, #schEndDate").change(function () {
1553            var stdt = $("#schStartDate").val();
1554            var endt = $("#schEndDate").val();
1555
1556            if (stdt !== '' && endt !== '') {
1557                var startDate = new Date(stdt);
1558                var endDate = new Date(endt);
1559
1560                if (startDate >
1560 endDate) {
1561                    alert("검색 종료일이 검색 시작일보다 빠릅니다.\n\n다시 입력하세요.");
1562                    $("#schEndDate").val('');
1563                    $("#schEndDate").focus();
1564                }
1565            }
1566        });
1567    }
1568});
1569
1570// 검색
1571$(function () {
1572    // 검색 버튼 클릭 이벤트 등록
1573    $("#btnHeadGfnSearch, #btnModalGfnSearch, #btnMainGfnSearch, #btnMainGfnSearch2nd").on("click", function () {
1574        var $form = $(this).closest("form");
1575        handleSearch($form);
1576    });
1577
1578    // 검색 인풋에서 엔터 입력 시 해당 버튼 클릭 이벤트 발생
1579    $("#aiHeadSearchWord, #aiModalSearchWord, #aiMainSearchWord, #aiMainSearchWord2nd").on("keydown", function (e) {
1580        if (e.keyCode === 13) {
1581            e.preventDefault();
1582            $(this).closest("form").find("button[type='button']").trigger("click");
1583        }
1584    });
1585
1586    // 공통 검색 처리 함수
1587    function handleSearch($form) {
1588        var $visibleInput = $form.find("input[type='text']:not([name='aiSearchWord'])");
1589        var $hiddenInput = $form.find("input[name='aiSearchWord']");
1590        var keyword = $.trim($visibleInput.val());
1591
1592        if (keyword === "") {
1593            alert("검색어를 입력해 주세요.");
1594            $visibleInput.focus();
1595            return false;
1596        }
1597
1598        if (keyword.length < 2) {
1599            alert("두 글자 이상 입력해 주세요.");
1600            $visibleInput.focus();
1601            return false;
1602        }
1603
1604        $hiddenInput.val(keyword); // hidden input에 입력값 복사
1605        $form.submit();
1606    }
1607});
1608
1609
1610/*********************************************************************
1611 * 카테고리 콤보 조회 함수
1612 *
1613 * 사용 : gfnCateComboList($("#"), "BOARD00002", "all", "전체", "1");
1614 * 입력 : selectObject, bbsId, 기본값사용시 value, 기본값사용시 text, 선택 할 value
1615 **********************************************************************/
1616function gfnVocCateComboList(selectObject, strBbsId, strValue, strText, strSelect) {
1617    $.ajax({
1618        url: gContextPath + "/common/vocListCate",
1619        data: "bbsId=" + strBbsId,
1620        success: function (data, textStatus, jqXHR) {
1621            selectObject.find("option").remove();
1622
1623            if (strText != "" && strText != null) {
1624                selectObject.append($("<option>", {
1625                    value: strValue, text: strText
1626                }));
1627            }
1628
1629            if (data != null) {
1630                $.each(data, function (i, item) {
1631                    selectObject.append($("<option>", {
1632                        value: item.ctgryNo, text: ConvertSystemSourcetoHtml(item.ctgryNm)
1633                    }));
1634                });
1635            }
1636
1637            if (strSelect != "" && strSelect != null) {
1638                selectObject.val(strSelect);
1639            }
1640        }
1641    });
1642}
1643
1644/*********************************************************************
1645 * 아이디 입력 검증 함수
1646 *
1647 * 사용 : onkeyup="validateUserIdSilent(this)"
1648 * 기능 : 아이디에 어긋나는 문자를 자동으로 제거하고 무음으로 처리
1649 **********************************************************************/
1650function validateUserIdSilent(input) {
1651    var userId = input.value.trim();
1652
1653    // 영문과 숫자가 아닌 문자만 제거
1654    var cleanUserId = userId.replace(/[^a-zA-Z0-9]/g, "");
1655
1656    // 입력된 값이 변경되었으면 교체
1657    if (userId !== cleanUserId) {
1658        input.value = cleanUserId;
1659    }
1660
1661    // 길이 제한 (12자 제한)
1662    if (cleanUserId.length > 12) {
1663        input.value = cleanUserId.substring(0, 12);
1664    }
1665
1666    // 중복 확인하기 상태 값
1667    $("#doubleChk").val("N");
1668}
1669
1670/*********************************************************************
1671 * 이메일 입력 검증 함수
1672 *
1673 * 사용 : onkeyup="validateEmailSilent(this)"
1674 * 기능 : 이메일에 어긋나는 문자를 자동으로 제거하고 무음으로 처리
1675 **********************************************************************/
1676function validateEmailSilent(input) {
1677    // 허용할 문자: 영문, 숫자, 하이픈(-), 언더스코어(_), 점(.)
1678    input.value = input.value.replace(/[^a-zA-Z0-9._-]/g, "");
1679}
1680
1681
1682/*********************************************************************
1683 * 비밀번호 검증
1684 *
1685 * 기능 : 입력된 인증번호 유효성 검사 및 인증 완료 처리
1686 **********************************************************************/
1687function checkPass(pwv) {
1688    var alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
1689    var number = "1234567890";
1690    var sChar = "-_=+\|()*&^%$#@!~`?></;,.:'";
1691
1692    var sChar_Count = 0;
1693    var alphaCheck = false;
1694    var numberCheck = false;
1695
1696    var returnBoolean = false;
1697
1698    for (var i = 0; i < pwv.length; i++) {
1699        if (sChar.indexOf(pwv.charAt(i)) != -1) {
1700            sChar_Count++;
1701        }
1702        if (alpha.indexOf(pwv.charAt(i)) != -1) {
1703            alphaCheck = true;
1704        }
1705        if (number.indexOf(pwv.charAt(i)) != -1) {
1706            numberCheck = true;
1707        }
1708    }
1709
1710    if (sChar_Count > 0 && alphaCheck && numberCheck) {
1711        if (pwv.length < 9) {
1712            returnBoolean = false;
1713        } else if (pwv.length > 32) {
1714            returnBoolean = false;
1715        } else {
1716            returnBoolean = true;
1717        }
1718    }
1719
1720    return returnBoolean;
1721}

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.