PageSourceSearch

https://kaeri.re.kr/resources/js/common.ccis.js

js kaeri.re.kr collected 2026-09-24 09:01:04 UTC 48,241 bytes, 1,424 lines download raw bytes

1/*-------------------------------------------------
2Common Javascript
3Version : 1.0
4author : mcahn
5create date : 2017. 05. 01.
6create date : 2017. 05. 01.
7-------------------------------------------------*/
8$(function(){
9	/* ▼ CMS 관리자 페이지 Layout 설정  */
10	var windowWidth = $( window ).width();
11	if(windowWidth < 900) {
12		   $("#side, .logo").addClass("active");
13	}else{
14		   $("#side, .logo").removeClass("active");
15	}
16	
17	$(".toggle_nav").on("click", function(){
18		if($("#side, .logo").hasClass("active")) {
19			$("#side, .logo").removeClass("active");
20			setCookie("cookieMenu", "", -1);
21		}else{
22			$("#side, .logo").addClass("active");
23			setCookie("cookieMenu", "active" ,7);
24		}
25	});
26	
27	if(getCookie("cookieMenu") != ""){
28		$("aside").addClass("active");
29		$(".logo").addClass("active");
30	}
31	/* ▲ CMS 관리자 페이지 Layout 설정  */
32	 
33	/* ▼ 페이지 툴팁 활성화  */
34	/*$(".tooltipsy").tooltipsy({
35		offset: [10, 0],
36		css: {
37	        'padding': '10px',
38	        'max-width': '200px',
39	        'color': '#303030',
40	        'background-color': '#ffffff',
41	        'border': '2px solid #4893BA',
42	        '-moz-box-shadow': '0 0 10px rgba(0, 0, 0, .5)',
43	        '-webkit-box-shadow': '0 0 10px rgba(0, 0, 0, .5)',
44	        'box-shadow': '0 0 10px rgba(0, 0, 0, .5)',
45	        'text-shadow': 'none'
46	    }
47	});*/
48	/* ▲  페이지 툴팁 활성화  */
49	
50	// 검색 input 키 이벤트
51	$("#search_keyword").keydown(function(key) {
52		if (key.keyCode == 13) gfnSearch('all');
53	});
54	
55});
56
57$(window).resize(function() {
58   var windowWidth = $( window ).width();
59   if(windowWidth < 900) {
60	   $("#side, .logo").addClass("active");
61   } else {
62	   $("#side, .logo").removeClass("active");
63   }
64});
65
66 /*********************************************************************
67  * 팝업 호출
68  * 
69  * 사용 : gfnOpenWin("url", "name", "style", 100, 200);
70  * 입력 : 호출url, 팝업이름, 스타일지정시, width값, height값
71 **********************************************************************/
72function gfnOpenWin(href,name,strStyle,width,height) {
73	var sleft = (screen.width - width) / 2;
74	var stop = (screen.height - height) / 2;
75
76	var style = "left="+sleft+",top="+stop+",width="+width+",height="+height+","+strStyle;
77	window.open(href,name,style);
78}
79
80 /*********************************************************************
81  * 코드 콤보 조회 함수
82  * 
83  * 사용 : gfnCodeComboList($("#"), "SearchType", "all", "전체", "1", "900D");
84  * 입력 : selectObject, higherCode, 기본값사용시 value, 기본값사용시 text, 선택 할 value, 제외시킬 값 기준+Up/Down(null 처리 가능)
85  **********************************************************************/
86 function gfnCodeComboList(selectObject, strHigh, strValue, strText, strSelect, strRange){
87	 
88	 var condition = null;
89	 var strVal = null;
90	 
91	 if(strRange != null && strRange != "" && typeof strRange != "undefined"){
92		 condition = strRange.substring(strRange.length-1, strRange.length);
93		 strVal = strRange.substring(0, strRange.length-1);
94	 }
95	 
96	 $.ajax({
97		 url: gContextPath+"/listCode",
98		 data: "higherCode="+strHigh,
99		 async: false,
100		 success:function(data, textStatus, jqXHR) {
101			 selectObject.find("option").remove();
102			 
103			 if(strText != "" && strText != null){
104				 selectObject.append($("<option>", {
105					 value:strValue, text: strText
106				 }));
107			 }
108			 
109			 if(data != null) {
110				 $.each(data, function(i, item) {
111					 
112					 // &amp; 기호 치환
113					 if(item.kname.indexOf('&amp;') > 0){
114						 item.kname = item.kname.replace('&amp;', '&');
115					 }
116					 
117					 if(condition == null || condition == ""){
118						 selectObject.append($("<option>", {
119							 value: item.code, text: ConvertSystemSourcetoHtml(item.kname)
120						 }));
121					 } else {
122						 if(condition == 'U'){
123							 if(item.code >= strVal){
124								 selectObject.append($("<option>", {
125									 value: item.code, text: ConvertSystemSourcetoHtml(item.kname)
126								 }));
127							 }
128						 }else{
129							 if(item.code < strVal){
130								 selectObject.append($("<option>", {
131									 value: item.code, text: ConvertSystemSourcetoHtml(item.kname)
132								 }));
133							 }
134							 
135						 }
136					 }
137				 });
138			 }
139			 
140			 if(strSelect != "" && strSelect != null){
141				 selectObject.val(strSelect); 
142			 }
143		 }
144	 });
145 }
146
147 /*********************************************************************
148  * 카테고리 콤보 조회 함수
149  * 
150  * 사용 : gfnCateComboList($("#"), "BOARD00002", "all", "전체", "1");
151  * 입력 : selectObject, boardId, 기본값사용시 value, 기본값사용시 text, 선택 할 value
152  **********************************************************************/
153 function gfnCateComboList(selectObject, strMenuId, strValue, strText, strSelect){
154	 $.ajax({
155		 url: gContextPath+"/listCate",
156		 data: "menuId="+strMenuId,
157		 success:function(data, textStatus, jqXHR) {
158			 selectObject.find("option").remove();
159			 if(strText != "" && strText != null){
160				 selectObject.append($("<option>", {
161					 value:strValue, text: strText
162				 }));
163			 }
164			 
165			 if(data != null) {
166				 $.each(data, function(i, item) {
167					 selectObject.append($("<option>", {
168						 value: item.categoryId, text: ConvertSystemSourcetoHtml(item.categoryName)
169					 }));
170				 });
171			 }
172			 
173			 if(strSelect != "" && strSelect != null){
174				 selectObject.val(strSelect); 
175			 }
176			 selectObject.parent().find("label").text(selectObject.find("option:selected").text());
177		 }
178	 });
179 }
180 
181 /*********************************************************************
182  * 전체선택함수
183  * 
184  * 사용 : gfnCodeComboList($("#"), "seq");
185  * 입력 : selectObject, 선택되게할 Name
186  **********************************************************************/
187function selectAll(selectObject, ckName){
188	 if (selectObject.is(":checked")) { 
189		 $("input[name='"+inputName+"']:checkbox").prop("checked", true);
190	 } else { 
191		 $("input[name='"+inputName+"']:checkbox").prop("checked", false); 
192	 } 
193}
194
195/*********************************************************************
196 * gfnSelectAllCalss 전체선택함수 -- input에 class명으로 체크
197 * 
198 * 사용 : gfnSelectAllCalss($("#"), "calss");
199 * 입력 : selectObject, 선택되게할 Name
200 **********************************************************************/
201function gfnSelectAllCalss(className, bChk){
202	$("."+className).prop("checked", bChk);
203}
204
205/*******************************************************************************
206 * [ Validate ] 숫자만 입력
207 * 
208 * 입력 : 폼 객체 허용 : 0~9 사용 : onkeyup="validateOnlyNumber(this)"
209 ******************************************************************************/
210function validateOnlyNumber(from) {
211	for ( var i = 0; i < from.value.length; i++) {
212		var str = from.value.charCodeAt(i);
213		if (str < 48 || str > 57) {
214			// alert("숫자만 입력하실수 있습니다. ");
215			from.value = from.value.replace(from.value.charAt(i),"");
216			// from.select();
216 //내용선택
217			return false;
218		}
219	}
220	return true;
221}
222
223/*******************************************************************************
224 * fnStrSplit 문자 자르는 함수
225 * 
226 * 사용 : fnStrSplit("1###2", "###");
227 * 입력 : str, 자를 문자열
228 ******************************************************************************/
229function fnStrSplit(str, strSplit) {
230	var s = str;
231	var arrayString;
232	
233	arrayString = s.split(strSplit);
234	
235	return arrayString;
236}
237
238/*******************************************************************************
239 * 선택된 체크박스에 패턴추가 함수
240 * 
241 * 사용 : gfnRtSelectCheck(chkName, pattern);
242 * 입력 : 체크박스 이름, 선택값 뒤 추가될 패턴
243 ******************************************************************************/
244function gfnRtSelectCheck(chkName, pattern){
245	var patternLen = pattern.length;
246	var result="";
247	var isCount = 0;
248	
249	$('input:checkbox[name="'+chkName+'"]').each(function(){
250	    if(this.checked){
251	    	isCount ++;
252	        result = result + this.value + pattern;
253	    }else{
254	        result = result + pattern;
255	    }
256	});
257	
258	return result.substring(0, result.length-patternLen);
259}
260
261/*******************************************************************************
262 * 선택된 오브젝트에 리플 수정 폼 생성
263 * 
264 * 사용 : gfnReplyUpdate(replyId, linkId)
265 * 입력 : 리플 Id, 글 linkId
266 ******************************************************************************/
267function gfnReplyUpdate(replyId, linkId){
268	var txt = $('li[value='+replyId+'] > p').html();
269	txt = replaceAll(txt, "<br>", "\n");
270	
271	$('li[value='+replyId+'] > p').remove();
272	$('li[value='+replyId+']').append('<textarea id="editArea" style="width:100%; height: 56px; min-width: 643px;">');
273	$('li[value='+replyId+'] > #editArea').html(txt);
274	
275	//저장 버튼 추가 할 시
276	$('li[value='+replyId+']').append('<button type="button" onclick="javascript:gfnReplyUpdateAct('+replyId+','+linkId+')">');
277	$('li[value='+replyId+'] > button').text("저장");
278	
279	/*var script = "javascript:gfnReplyUpdateAct("+replyId+","+linkId+")";
280	$('li[value='+replyId+'] > div > .btn > button[value=modify]').attr('onclick', script);*/
281}
282
283/*********************************************************************
284 * 프린트 div 영역 지정 출력
285 * 
286**********************************************************************/
287var win=null;
288function printIt()  {
289	win = window.open('','','width=1024,height=900');
290	self.focus();
291	win.document.open();
292	win.document.write('<'+'html'+'><'+'head'+'><'+'style'+'>');
293	win.document.write('body, td { font-size: 10pt;}');
294	win.document.write('body, th { font-size: 10pt;}');
295	win.document.write('<'+'/'+'style'+'><link rel="stylesheet" type="text/css" href="'+gContextPath+'/resources/css/arti/form.css" /><link rel="stylesheet" type="text/css" href="'+gContextPath+'/resources/css/arti/print.css" /><'+'/'+'head'+'><'+'body'+'>');
296	win.document.write($("#contentArea").html());
297	win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>');
298	win.document.close();
299	win.print();
300	win.close();
301}
302
303/*********************************************************************
304 * 프린트 div content 영역 출력
305 * 
306**********************************************************************/
307function printContent(contextPath, strSiteKey)  {
308	var $divContent = $('#content').clone();
309	var menuId = $('#menuId').val();
310	var step = $('#step').val();
311	
312	win = window.open('','','width=1024,height=900');
313	self.focus();
314	win.document.open();
315	win.document.write('<'+'html'+'><'+'head'+'><'+'style type="text/css" media="print" '+'>');
316	win.document.write('body, td { font-size: 10pt;}');
317	win.document.write('body, th { font-size: 10pt;}');
318	win.document.write('.content-footer { display:none; }');
319	win.document.write('@media print { .content-footer { display:none; } }');
320	win.document.write('@page{ size:auto; margin:8mm;} ');
321	win.document.write('<'+'/'+'style'+'>');
322	win.document.write('<link rel="stylesheet" type="text/css" href="'+contextPath+'/resources/css/'+strSiteKey+'/basic.css" />');
323	win.document.write('<'+'/'+'head'+'><'+'body id="print"'+'>');
324	win.document.write($divContent.html());
325	win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>');
326	win.document.close();
327	
328	setTimeout(function () { 
329		win.print();
330		win.close();
331	} ,1000);
332}
333
334//쿠키값 설정
335function setCookie(name, value, expiredays){
336	var today = new Date();
337	today.setDate( today.getDate() + expiredays );
338	document.cookie = name + "=" + escape(value) + "; path="+gContextPath+"; expires=" + today.toGMTString() + ";";
339}
340
341function setCookieWithSamePath(name, value, expiredays){
342	var today = new Date();
343	today.setDate( today.getDate() + expiredays );
344	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + today.toGMTString() + ";";
345}
346
347//쿠키값 가져오기 
348function getCookie(key){
349	var cook = document.cookie + ";";
350	var idx = cook.indexOf(key,0);
351	var val = "";
352	
353	if(idx!=-1)
354	{
355		cook = cook.substring(idx,cook.length);
356		begin = cook.indexOf("=",0) + 1;
357		end = cook.indexOf(";",begin);
358		
359		//key 값과 cookie의 key 값이 일치 할 경우에만 
360		if(key == cook.substring(0,begin-1)){
361			val = unescape(cook.substring(begin,end));			
362		}
363	}
364	
365	return val;
366}
367
368function replaceAll(sValue, param1, param2) {
369	return sValue.split(param1).join(param2);
370}
371
372/*******************************************************************************
373 * 선택된 게시글(메뉴) 스크랩하기
374 * 
375 * 사용 : gfnMyScrapInsert(menuid, linkId)
376 * 입력 : 현재메뉴 menuid, 현재 글 linkId
377 ******************************************************************************/
378//스크랩중복체크 후 인서트
379function gfnMyScrapInsert(menuid,linkid){
380	if(menuid.length < 9 ){
381		
382		alert("스크랩할 수 없습니다.");
383		return;
384	}
385	
386	$.ajax({               
387 		url: gContextPath+"/mps/mypage/check",
388 		data: {'menuId' : menuid, 'schText' : linkid},
389 		success:function(rtn) {
390
391 	 		fnScrapInsert(menuid,linkid,rtn); 
392 		}
393 	});
394}
395
396//마이스크랩등록
397function fnScrapInsert(menuid,linkid,rtn){
398	if(rtn>0){
399		alert("이미 스크랩되어 있습니다.");
400		return false;
401	}else{
402		if(confirm("해당 게시물(메뉴)를 스크랩 하시겠습니까?")) {
403
404			$.ajax({               
405			url: gContextPath+"/mps/mypage/insert",
406 			data: {'menuId' : menuid, 'schText' : linkid},
407 				success:function(val) {
408 					alert("해당 게시물(메뉴)이 스크랩되었습니다.");
409 				}
410			});
411		}else{
412			alert("취소되었습니다.");
413		}
414	}
415}
416
417/********************************************************************************************************
418 * gfnCodeRadioList 코드 라디오버튼 조회함수
419 * 
420 * 사용 : gfnCodeRadioList($("#"), "interest", "answerWay", "", "", "01");
421 * 입력 : 추가될 위치 selectObject, higherCode, 라디오버튼 이름, 기본값 사용시 value, 기본값 사용시 text, 선택 할 value
422 *******************************************************************************************************/
423function gfnCodeRadioList(selectObject, strHigh, objName, strValue, strText, strSelect){
424    $.ajax({
425        url: gContextPath+"/listCode",
426        data: "higherCode="+strHigh,
427        async: false,
428        success:function(data, textStatus, jqXHR) {
429        	
430        	selectObject.find("input").remove();
431        	selectObject.find("label").remove();
432        	
433        	if(data != null) {
434	        	$.each(data, function(i, item) {
435					$("<input type='radio' id='"+objName+i+"' name='"+objName+"' value='"+item.code+"' />").appendTo(selectObject);
436					$("<label for='"+objName+i+"'>"+item.kname+"</label>").appendTo(selectObject);
437	        	});
438        	}
439        	
440        	if(strSelect != "" && strSelect != null){
441        		$('input[name='+objName+']').each(function(){
442        			if($(this).val() == strSelect){
443        				$(this).attr('checked', 'checked');
444        			}
445        		});
446        	}
447        }
448    });
449}
450
451function padDigit(num){
452	if(num < 10){
453		return "0"+num;
454	}else{
455		return num;
456	}
457}
458
459function gfnAjaxError(){
460	alert("경로가 정확하지 않거나 오류가 발생하였습니다.");
461	return; 
462}
463
464//메일보내기
465function gfnToMail(rtnLoction, KNAME, url){
466	var pop_title = "mail_pop";
467	window.open("", pop_title,'width=870px,height=610px,scrollbars=yes,status=no');
468
469	var frmData = document.frmData;
470	frmData.menuName.value=rtnLoction;
471	frmData.KName.value=KNAME;
472	frmData.linkUrl.value=url;
473	frmData.target = pop_title;
474	frmData.action = "/mps/footerMail";
475	frmData.submit();
476}
477
478//트위터보내기
479function gfnToTwitter(strUrl){
480	strUrl =  "http://www.plani.co.kr"+strUrl;
481	var shareUrl = "http://twitter.com/share?url=" + encodeURIComponent(strUrl);
482	window.open(shareUrl, 'share_twitter', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');
483}	
484
485
486/**************************************************************************************************************
487 * 이용약관 전체선택 공통
488 * 
489 * 사용 : gfnOpenNewsLetter()
490 * 입력 : 
491 **************************************************************************************************************/
492function gfnAllPolicyCheck(){
493	var choicePolicyChk = $("input:checkbox[name='allcheck']").is(":checked");
494	
495	if(choicePolicyChk){
496		$(".agree1").prop("checked", true);
497		$(".agree2").prop("checked", true);
498	}else{
499		$(".agree1").removeAttr('checked');
500		$(".agree2").removeAttr('checked');
501	}	
502}
503
504/**************************************************************************************************************
505 * 이용약관 전체선택 공통
506 * 
507 * 사용 : gfnNotAgreeCheck()
508 * 입력 : 
509 **************************************************************************************************************/
510function gfnNotAgreeCheck()
511{
512	$("#allcheck").removeAttr('checked');
513}
514
515/**************************************************************************************************************
516 * 날짜 공통함수
517 * 
518 * 사용 : 
519 * 입력 : 
520 **************************************************************************************************************/
521function gfnIsHoliday(yyyy, mm, dd){
522	//검사년도
523	var yyyymmdd = yyyy+""+mm+""+dd;
524	//var yyyy = "";
525	var holidays = new Array();
526	var holidaysName = new Array();
527	var holidayName = "";
528	// 음력 공휴일 양력으로 바꾸어서 입력
529	
530	// 양력 공휴일 일력
531	holidays[0] = yyyy+"0101"; //양력설날
532	holidays[1] = yyyy+"0301"; //삼일절
533	//holidays[2] = yyyy+"0405"; //식목일
534	holidays[2] = yyyy+"0505"; //어린이날
535	holidays[3] = yyyy+"0606"; //현충일
536	holidays[4] = yyyy+"0815"; //광복절
537	holidays[5] = yyyy+"1003"; //개천절
538	holidays[6] = yyyy+"1009"; //한글날
539	holidays[7] = yyyy+"1225"; //성탄절
540	
541	var tmp01 = lunerCalenderToSolarCalenger(yyyy+"0101");
542	var tmp02 = lunerCalenderToSolarCalenger(yyyy+"0815");
543
544	holidays[8] = Number(tmp01) -1;  //음력설 첫쨋날
545	holidays[9] = tmp01; 	 //음력설 둘쨋날
546	holidays[10] =Number(tmp01) +1; //음력설 셋쨋날
547	holidays[11] = Number(tmp02) -1; //음력추석 첫쨋날
548	holidays[12] = tmp02; 	 //음력추석 둘쨋날
549	holidays[13] = Number(tmp02) +1; //음력추석 셋쨋날
550	holidays[14] = lunerCalenderToSolarCalenger(yyyy+"0408"); //석가탄신일
551	
552	holidaysName[0] = "신정";
553	holidaysName[1] = "삼일절";
554	//holidaysName[2] = "식목일";
555	holidaysName[2] = "어린이날";
556	holidaysName[3] = "현충일";
557	holidaysName[4] = "광복절";
558	holidaysName[5] = "개천절";
559	holidaysName[6] = "한글날";
560	holidaysName[7] = "성탄절";
561	holidaysName[8] = "설날 첫쨋날";
562	holidaysName[9] = "설날 둘쨋날";
563	holidaysName[10] = "설날 셋쨋날";
564	holidaysName[11] = "추석 첫쨋날";
565	holidaysName[12] = "추석 둘쨋날";
566	holidaysName[13] = "추석 셋쨋날";
567	holidaysName[14] = "석가탄신일";
568	
569	for(var i=0; i<holidays.length; i++){
570		if(holidays[i] == yyyymmdd){
571			holidayName = holidaysName[i];
572			//return true;
573		}
574	}
575	return holidayName;
576}
577
578function get_year(src) {
579	 if ((src < 1841) || (src > 2043 )) {
580	  alert('연도 범위는 1841 ~ 2043 까지입니다.');
581	  return;
582	 } else {
583	  return src;
584	 }
585	}
586
587	/**
588	 * 달이 12보다 크거나 1보다 작은지 검사한다.
589	 * 날짜가 잘못된 경우에는 경고창 후 멈춘다.
590	 *
591	 * @param int
592	 * @return int
593	 */
594	function get_month(src) {
595	 if ((src < 1) || (src > 12 )) {
596	  alert('월 범위는 1 ~ 12 까지입니다.');
597	  return;
598	 } else {
599	  return src;
600	 }
601	}
602
603	/**
604	 * 날짜가 1일보다 크고 src보다 작은 경우는 날짜를 반환한다.
605	 * 날짜가 잘못된 경우에는 경고창 후 멈춘다.
606	 *
607	 * @param int
608	 * @param int
609	 * @return int
610	 */
611	function get_day(src,day) {
612	 if ((src < 1) || (src > day )) {
613	  alert('일 범위가 틀립니다.');
614	  return;
615	 } else {
616	  return src;
617	 }
618	}
619	
620/**
621 * 음력을 양력으로 바꾸어서 반환한다.
622 *
623 * @param string
624 * return string
625 */
626function lunerCalenderToSolarCalenger (input_day) {
627 var kk = [[1, 2, 4, 1, 1, 2, 1, 2, 1, 2, 2, 1],   /* 1841 */
628     [2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1],
629     [2, 2, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1],
630     [2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2],
631     [1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1],
632     [2, 1, 2, 1, 5, 2, 1, 2, 2, 1, 2, 1],
633     [2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
634     [1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1],
635     [2, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 2],
636     [2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2],
637     [2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 5, 2],   /* 1851 */
638     [2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2],
639     [2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2],
640     [1, 2, 1, 2, 1, 2, 5, 2, 1, 2, 1, 2],
641     [1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1],
642     [2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
643     [1, 2, 1, 1, 5, 2, 1, 2, 1, 2, 2, 2],
644     [1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2],
645     [2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2],
646     [2, 1, 6, 1, 1, 2, 1, 1, 2, 1, 2, 2],
647     [1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2],   /* 1861 */
648     [2, 1, 2, 1, 2, 2, 1, 2, 2, 3, 1, 2],
649     [1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2],
650     [1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1],
651     [2, 1, 1, 2, 4, 1, 2, 2, 1, 2, 2, 1],
652     [2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 2],
653     [1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2],
654     [1, 2, 2, 3, 2, 1, 1, 2, 1, 2, 2, 1],
655     [2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1],
656     [2, 2, 2, 1, 2, 1, 2, 1, 1, 5, 2, 1],
657     [2, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1, 2],   /* 1871 */
658     [1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2],
659     [1, 1, 2, 1, 2, 4, 2, 1, 2, 2, 1, 2],
660     [1, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1],
661     [2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1],
662     [2, 2, 1, 1, 5, 1, 2, 1, 2, 2, 1, 2],
663     [2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2],
664     [2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1],
665     [2, 2, 4, 2, 1, 2, 1, 1, 2, 1, 2, 1],
666     [2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2],
667     [1, 2, 1, 2, 1, 2, 5, 2, 2, 1, 2, 1],   /* 1881 */
668     [1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2],
669     [1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2],
670     [2, 1, 1, 2, 3, 2, 1, 2, 2, 1, 2, 2],
671     [2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2],
672     [2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2],
673     [2, 2, 1, 5, 2, 1, 1, 2, 1, 2, 1, 2],
674     [2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1],
675     [2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2],
676     [1, 5, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2],
677     [1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2],   /* 1891 */
678     [1, 1, 2, 1, 1, 5, 2, 2, 1, 2, 2, 2],
679     [1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2],
680     [1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2],
681     [2, 1, 2, 1, 5, 1, 2, 1, 2, 1, 2, 1],
682     [2, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2],
683     [1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1],
684     [2, 1, 5, 2, 2, 1, 2, 1, 2, 1, 2, 1],
685     [2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2],
686     [1, 2, 1, 1, 2, 1, 2, 5, 2, 2, 1, 2],
687     [1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1],   /* 1901 */
688     [2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2],
689     [1, 2, 1, 2, 3, 2, 1, 1, 2, 2, 1, 2],
690     [2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1],
691     [2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2],
692     [1, 2, 2, 4, 1, 2, 1, 2, 1, 2, 1, 2],
693     [1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1],
694     [2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2],
695     [1, 5, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
696     [1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1],
697     [2, 1, 2, 1, 1, 5, 1, 2, 2, 1, 2, 2],   /* 1911 */
698     [2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2],
699     [2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2],
700     [2, 2, 1, 2, 5, 1, 2, 1, 2, 1, 1, 2],
701     [2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2],
702     [1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1],
703     [2, 3, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1],
704     [2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
705     [1, 2, 1, 1, 2, 1, 5, 2, 2, 1, 2, 2],
706     [1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2],
707     [2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2],   /* 1921 */
708     [2, 1, 2, 2, 3, 2, 1, 1, 2, 1, 2, 2],
709     [1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2],
710     [2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1],
711     [2, 1, 2, 5, 2, 1, 2, 2, 1, 2, 1, 2],
712     [1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1],
713     [2, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2],
714     [1, 5, 1, 2, 1, 1, 2, 2, 1, 2, 2, 2],
715     [1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2],
716     [1, 2, 2, 1, 1, 5, 1, 2, 1, 2, 2, 1],
717     [2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1],   /* 1931 */
718     [2, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2],
719     [1, 2, 2, 1, 6, 1, 2, 1, 2, 1, 1, 2],
720     [1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2],
721     [1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1],
722     [2, 1, 4, 1, 2, 1, 2, 1, 2, 2, 2, 1],
723     [2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1],
724     [2, 2, 1, 1, 2, 1, 4, 1, 2, 2, 1, 2],
725     [2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2],
726     [2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1],
727     [2, 2, 1, 2, 2, 4, 1, 1, 2, 1, 2, 1],   /* 1941 */
728     [2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2],
729     [1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2],
730     [1, 1, 2, 4, 1, 2, 1, 2, 2, 1, 2, 2],
731     [1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2],
732     [2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2],
733     [2, 5, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2],
734     [2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2],
735     [2, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2],
736     [2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1],
737     [2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2],   /* 1951 */
738     [1, 2, 1, 2, 4, 2, 1, 2, 1, 2, 1, 2],
739     [1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2],
740     [1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2],
741     [2, 1, 4, 1, 1, 2, 1, 2, 1, 2, 2, 2],
742     [1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2],
743     [2, 1, 2, 1, 2, 1, 1, 5, 2, 1, 2, 2],
744     [1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2],
745     [1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1],
746     [2, 1, 2, 1, 2, 5, 2, 1, 2, 1, 2, 1],
747     [2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2],   /* 1961 */
748     [1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1],
749     [2, 1, 2, 3, 2, 1, 2, 1, 2, 2, 2, 1],
750     [2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2],
751     [1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1],
752     [2, 2, 5, 2, 1, 1, 2, 1, 1, 2, 2, 1],
753     [2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2],
754     [1, 2, 2, 1, 2, 1, 5, 2, 1, 2, 1, 2],
755     [1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1],
756     [2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2],
757     [1, 2, 1, 1, 5, 2, 1, 2, 2, 2, 1, 2],   /* 1971 */
758     [1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1],
759     [2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1],
760     [2, 2, 1, 5, 1, 2, 1, 1, 2, 2, 1, 2],
761     [2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2],
762     [2, 2, 1, 2, 1, 2, 1, 5, 2, 1, 1, 2],
763     [2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1],
764     [2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1],
765     [2, 1, 1, 2, 1, 6, 1, 2, 2, 1, 2, 1],
766     [2, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2],
767     [1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2],   /* 1981 */
768     [2, 1, 2, 3, 2, 1, 1, 2, 2, 1, 2, 2],
769     [2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2],
770     [2, 1, 2, 2, 1, 1, 2, 1, 1, 5, 2, 2],
771     [1, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2],
772     [1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1],
773     [2, 1, 2, 2, 1, 5, 2, 2, 1, 2, 1, 2],
774     [1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1],
775     [2, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2],
776     [1, 2, 1, 1, 5, 1, 2, 1, 2, 2, 2, 2],
777     [1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2],   /* 1991 */
778     [1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2],
779     [1, 2, 5, 2, 1, 2, 1, 1, 2, 1, 2, 1],
780     [2, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2],
781     [1, 2, 2, 1, 2, 2, 1, 5, 2, 1, 1, 2],
782     [1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2],
783     [1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1],
784     [2, 1, 1, 2, 3, 2, 2, 1, 2, 2, 2, 1],
785     [2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1],
786     [2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1],
787     [2, 2, 2, 3, 2, 1, 1, 2, 1, 2, 1, 2],   /* 2001 */
788     [2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1],
789     [2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2],
790     [1, 5, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2],
791     [1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2],
792     [1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 2, 2],
793     [1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2],
794     [2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2],
795     [2, 2, 1, 1, 5, 1, 2, 1, 2, 1, 2, 2],
796     [2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2],
797     [2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1],   /* 2011 */
798     [2, 1, 6, 2, 1, 2, 1, 1, 2, 1, 2, 1],
799     [2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2],
800     [1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 1, 2],
801     [1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2],
802     [1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2],
803     [2, 1, 1, 2, 3, 2, 1, 2, 1, 2, 2, 2],
804     [1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2],
805     [2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2],
806     [2, 1, 2, 5, 2, 1, 1, 2, 1, 2, 1, 2],
807     [1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1],   /* 2021 */
808     [2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2],
809     [1, 5, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2],
810     [1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1],
811     [2, 1, 2, 1, 1, 5, 2, 1, 2, 2, 2, 1],
812     [2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2],
813     [1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2],
814     [1, 2, 2, 1, 5, 1, 2, 1, 1, 2, 2, 1],
815     [2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2],
816     [1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1],
817     [2, 1, 5, 2, 1, 2, 2, 1, 2, 1, 2, 1],   /* 2031 */
818     [2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2],
819     [1, 2, 1, 1, 2, 1, 5, 2, 2, 2, 1, 2],
820     [1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1],
821     [2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2],
822     [2, 2, 1, 2, 1, 4, 1, 1, 2, 1, 2, 2],
823     [2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2],
824     [2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1],
825     [2, 2, 1, 2, 5, 2, 1, 2, 1, 2, 1, 1],
826     [2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 1],
827     [2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2],   /* 2041 */
828     [1, 5, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2],
829     [1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2]];
830
831 var gan = new Array("甲","乙","丙","丁","戊","己","庚","辛","壬","癸");
832 var jee = new Array("子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥");
833 var ddi = new Array("쥐","소","범","토끼","용","뱀","말","양","원숭이","닭","개","돼지");
834 var week = new Array("일","월","화","수","목","금","토");
835
836 var md = new Array(31,0,31,30,31,30,31,31,30,31,30,31);
837
838 var year =input_day.substring(0,4);
839 var month =input_day.substring(4,6);
840 var day =input_day.substring(6,8);
841
842 // 음력에서 양력으로 변환
843 var lyear, lmonth, lday, leapyes;
844 var syear, smonth, sday;
845 var mm, y1, y2, m1;
846 var i, j, k1, k2, leap, w;
847 var td, y;
848 lyear = get_year(year);        // 년도 check
849 lmonth = get_month(month);     // 월 check
850
851 y1 = lyear - 1841;
852 m1 = lmonth - 1;
853 leapyes = 0;
854 if (kk[y1][m1] > 2)  {
855     /*if (document.frmTest.yoon[0].checked) {
856     leapyes = 1;
857     switch (kk[y1][m1]) {
858        case 3:
859        case 5:
860          mm = 29;
861          break;
862        case 4:
863        case 6:
864          mm = 30;
865          break;
866      }
867     } else {*/
868     switch (kk[y1][m1]) {
869       case 1:
870       case 3:
871       case 4:
872         mm = 29;
873         break;
874       case 2:
875       case 5:
876       case 6:
877         mm = 30;
878         break;
879     } // end of switch
880    /*}*/ // end of if
881 } // end of if
882
883   lday = get_day(day, mm);
884
885   td = 0;
886   for (i=0; i<y1; i++) {
887   for (j=0; j<12; j++) {
888      switch (kk[i][j]) {
889        case 1:
890          td = td + 29;
891          break;
892        case 2:
893          td = td + 30;
894          break;
895        case 3:
896          td = td + 58;    // 29+29
897          break;
898        case 4:
899          td = td + 59;    // 29+30
900          break;
901        case 5:
902          td = td + 59;    // 30+29
903          break;
904        case 6:
905          td = td + 60;    // 30+30
906          break;
907        } // end of switch
908   } // end of for
909 } // end of for
910
911 for (j=0; j<m1; j++) {
912  switch (kk[y1][j]) {
913    case 1:
914      td = td + 29;
915      break;
916    case 2:
917      td = td + 30;
918      break;
919    case 3:
920      td = td + 58;    // 29+29
921      break;
922    case 4:
923      td = td + 59;    // 29+30
924      break;
925    case 5:
926      td = td + 59;    // 30+29
927      break;
928    case 6:
929      td = td + 60;    // 30+30
930      break;
931  } // end of switch
932  } // end of for
933
934  if (leapyes == 1) {
935  switch(kk[y1][m1]) {
936    case 3:
937    case 4:
938      td = td + 29;
939      break;
940    case 5:
941    case 6:
942      td = td + 30;
943      break;
944   } // end of switch
945  } // end of switch
946
947  td =  td + parseFloat(lday) + 22;
948  // td : 1841 년 1 월 1 일 부터 원하는 날짜까지의 전체 날수의 합
949  y1 = 1840;
950  do {
951  y1 = y1 +1;
952  if  ((y1 % 400 == 0) || ((y1 % 100 != 0) && (y1 % 4 == 0))) {
953    y2 = 366;
954  }
955  else {
956    y2 = 365;
957  }
958  if (td <= y2) {
959    break;
960  }
961  else {
962    td = td- y2;
963  }
964  } while(1); // end do-While
965 
966 syear = y1;
967 md[1] = parseInt(y2) -337;
968 m1 = 0;
969 do {
970 m1= m1 + 1;
971 if (td <= md[m1-1]) {
972  break;
973 }
974 else {
975  td = td - md[m1-1];
976 }
977 } while(1); // end of do-While
978
979 smonth = parseInt(m1);
980 sday = parseInt(td);
981
982 // 월이 한자리인경우에는 앞에 0을 붙혀서 반환
983 if ( smonth < 10 ) {
984  smonth = "0" + smonth;
985 }
986 // 일이 한자리인경우에는 앞에 0을 붙혀서 반환
987 if ( sday < 10 ) {
988  sday = "0" + sday;
989 }
990
991 return new String( syear + smonth + sday );
992}
993
994//날짜 포맷변환  00000000 => 0000-00-00
995function gfnDateYYYYMMDDFormat(object){
996	
997	var num, year, month, day;
998	
999	var input = "#"+object;
1000	
1001	num = $(input).val();
1002	
1003	if(num.length == 0){
1004		return;
1005	}
1006	
1007	while(num.search("-") != -1){
1008		
1009		num = num.replace("-","");
1010	}
1011	
1012	if(isNaN(num)){
1013		alert("숫자로만 작성하셔야 합니다.");
1014		$(input).focus();
1015		return;
1016	}
1017    
1018	if(num != 0 && num.length == 8){
1019		
1020		year = num.substring(0,4);
1021		month = num.substring(4,6);
1022		day = num.substring(6);
1023		
1024		if(isValidDay(year,month,day)==false){
1025			
1026			num = "";
1027			alert("유효하지 않는 날짜입니다. 다시 한번 확인하시고 입력해주세요.");
1028			$(input).val(num);
1029			$(input).focus();
1030			return;
1031		}
1032		
1033		num = year+"-"+month+"-"+day;
1034		
1035	}else{
1036		num = "";
1037		alert("날짜 입력형식 오류입니다. 다시 한번 확인하시고 입력해 주세요");
1038		$(input).val(num);
1039		$(input).focus();
1040		return;
1041	}
1042	
1043	$(input).val(num);
1044} 
1045
1046//유효한 날짜인지 체크
1047function isValidDay(yyyy, mm, dd){
1048	
1049	var m = parseInt(mm,10) -1;
1050	var d = parseInt(dd,10);
1051	var end = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
1052	
1053	if((yyyy % 4 == 0 && yyyy % 100 != 0) || yyyy % 400 == 0){
1054		
1055		end[1]=29;
1056	}
1057	
1058	return(d >=1 && d <= end[m]);
1059}
1060
1061
1062/*********************************************************************
1063 * 로그인  호출
1064 * 
1065 * 사용 : gfnOpenLogin();
1066 * 입력 : 
1067**********************************************************************/
1068function gfnOpenLogin() 
1069{
1070	
1071	//$(".login_layerPopup").show();
1072	$(".login_layerPopup").css("display","none");
1073	$(".login_layerPopup").fadeIn('slow');
1074}
1075
1076/*********************************************************************
1077 * 유해어 체크
1078 * 
1079 * 사용 : gfnTabooWordCheck();
1080 * 입력 : 
1081**********************************************************************/
1082function gfnTabooWordCheck(objs) 
1083{
1084	var chkCnt = 0;
1085	var chkKNameArray = new Array();
1086	var kNameArray = new Array();
1087	var kNameArray = new Array();
1088	
1089	$.each(objs.split('§§'), function(index, obj){
1090		$.ajax({
1091			url: gContextPath+"/tabooWord",
1092			async: false,
1093			cache: false,
1094			success:function(data, textStatus, jqXHR) {
1095				if(data != null){
1096					$.each(data, function(j){
1097						if($("#"+obj).val() != undefined){
1098							if($("#"+obj).val().indexOf(data[j].KNAME) > -1){
1099								chkCnt += 1;
1100								chkKNameArray.push(data[j].KNAME);
1101							}
1102						}
1103					});
1104				}
1105			}
1106		});
1107	});
1108	
1109	$.each(chkKNameArray, function(i, el){
1110		if($.inArray(el, kNameArray) == -1) kNameArray.push(el);
1111	});
1112		
1113	
1114	return [chkCnt+"건의 유해어가 검출되었습니다.\n"+kNameArray, chkCnt];
1115}
1116
1117function zooms(nowZoom) {
1118	var docbody = document.body;
1119	header.style.zoom = nowZoom;// IE
1120	body.style.zoom = nowZoom;// IE
1121	footer.style.zoom = nowZoom;  // IE
1122	docbody.style.webkitTransform = 'scale('+nowZoom+')';  // Webkit(chrome)
1123	docbody.style.webkitTransformOrigin = '0 0';
1124	docbody.style.mozTransform = 'scale('+nowZoom+')';  // Mozilla(firefox)
1125	docbody.style.mozTransformOrigin = '0 0';
1126	docbody.style.oTransform = 'scale('+nowZoom+')';  // Opera
1127	docbody.style.oTransformOrigin = '0 0';
1128}
1129
1130/*********************************************************************
1131 * 에디터 설정
1132 * 
1133**********************************************************************/
1134function gfnInitEditor(objId, objPosition){
1135	// 다음에디터 설정
1136	$.ajax({
1137        url : gContextPath + "/resources/component/daumeditor-7.4.27/editor.html",
1138        success : function(data){
1139        	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");
1140        	data = data.replace(/images\/icon\/editor\/loading2.png/g, gContextPath + "/resources/component/daumeditor-7.4.27/images/icon/editor/loading2.png");
1141        	data = data.replace(/images\/icon\/editor\/pn_preview.gif/g, gContextPath + "/resources/component/daumeditor-7.4.27/images/icon/editor/pn_preview.gif");
1142			
1143        	$("#editor_frame").html(data);
1144            var config = {
1145            		txHost: '', /* 런타임 시 리소스들을 로딩할 때 필요한 부분으로, 경로가 변경되면 이 부분 수정이 필요. ex) http://xxx.xxx.com */
1146            		txPath: '', /* 런타임 시 리소스들을 로딩할 때 필요한 부분으로, 경로가 변경되면 이 부분 수정이 필요. ex) /xxx/xxx/ */
1147            		txService: 'sample', /* 수정필요없음. */
1148            		txProject: 'sample', /* 수정필요없음. 프로젝트가 여러개일 경우만 수정한다. */
1149            		initializedId: "", /* 대부분의 경우에 빈문자열 */
1150            		wrapper: "tx_trex_container", /* 에디터를 둘러싸고 있는 레이어 이름(에디터 컨테이너) */
1151            		form: 'tx_editor_form'+"", /* 등록하기 위한 Form 이름 */
1152            		txIconPath: gContextPath + "/resources/component/daumeditor-7.4.27/images/icon/editor/", /*에디터에 사용되는 이미지 디렉터리, 필요에 따라 수정한다. */
1153            		txDecoPath: gContextPath + "/resources/component/daumeditor-7.4.27/images/deco/contents/", /*본문에 사용되는 이미지 디렉터리, 서비스에서 사용할 때는 완성된 컨텐츠로 배포되기 위해 절대경로로 수정한다. */
1154            		canvas: {
1155                        exitEditor:{
1156                            /*
1157                            desc:'빠져 나오시려면 shift+b를 누르세요.',
1158                            hotKey: {
1159                                shiftKey:true,
1160                                keyCode:66
1161                            },
1162                            nextElement: document.getElementsByTagName('button')[0]
1163                            */
1164                        },
1165            			styles: {
1166            				color: "#123456", /* 기본 글자색 */
1167            				fontFamily: "굴림", /* 기본 글자체 */
1168            				fontSize: "9pt", /* 기본 글자크기 */
1169            				backgroundColor: "#fff", /*기본 배경색 */
1170            				lineHeight: "1.5", /*기본 줄간격 */
1171            				padding: "10px" /* 위지윅 영역의 여백 */
1172            			},
1173            			showGuideArea: false
1174            		},
1175            		events: {
1176            			preventUnload: false
1177            		},
1178            		sidebar: {
1179            			attachbox: {
1180            				show: true,
1181            				confirmForDeleteAll: true
1182            			},
1183            			capacity: {
1184            				available : 1024 * 1024 * 10, /* 첨부 용량 제한 */
1185            				maximum: 1024 * 1024 * 10     /* 첨부 용량 제한 */
1186            			}
1187            		},
1188            		size: {
1189            			//contentWidth: 670 /* 지정된 본문영역의 넓이가 있을 경우에 설정 */
1190            		}
1191            	};
1192
1193            	EditorJSLoader.ready(function(Editor) {
1194            		var editor = new Editor(config);
1195            		Editor.getCanvas().setCanvasSize({height:250});
1196
1197            		if(objPosition == 'self'){
1198            			Editor.modify({
1199                            "content":  document.getElementById(objId) /* 내용 문자열, 주어진 필드(textarea) 엘리먼트 */
1200                        });
1201            		}else{
1202            			Editor.modify({
1203            				"content": opener.document.getElementById(objId) /* 내용 문자열, 주어진 필드(textarea) 엘리먼트 */
1204            			});
1205            		}
1206            		
1207            	});
1208    	}
1209	});
1210}
1211
1212/*********************************************************************
1213 * 파일업로드 확장자 체크
1214 * 
1215**********************************************************************/
1216function gfnCheckFext(objs, type){
1217	 
1218 	var retval = true;
1219 	var ext = "";
1220 	
1221 	objs.each(function(){
1222 		var fpath = $(this).val();
1223 		if(fpath.length > 0)
1224 		{
1225 			ext = fpath.substr(fpath.lastIndexOf(".") + 1, fpath.length);
1226 			ext = ext.toLowerCase();
1227 			
1228 			if(type == "IMG")
1229 			{
1230 				var allows = "jpg|png|bmp|gif";
1231 				if(allows.indexOf(ext) < 0)
1232 				{
1233 					alert("허용되지 않는 파일이거나 목적에 맞지 않는 파일입니다.\n이미지 파일을 등록해주십시오.\n현재 파일 종류 : " + ext);
1234 					retval = false;
1235 					return false;
1236 				}
1237 			}
1238 			else if(type == "DOC")
1239 			{
1240 				var allows = "doc|docx|xls|xlsx|ppt|pptx|pdf|hwp|txt";
1241 				if(allows.indexOf(ext) < 0)
1242 				{
1243 					alert("허용되지 않는 파일이거나 목적에 맞지 않는 파일입니다/.\n문서 파일을 등록해주십시오.\n현재 파일 종류 : " + ext);
1244 					retval = false;
1245 					return false;
1246 				}
1247 			}
1248 			else if(type == "GNR")
1249 			{
1250 				var allows = "jpg|png|bmp|gif|doc|docx|xls|xlsx|ppt|pptx|pdf|hwp|txt|zip";
1251 				if(allows.indexOf(ext) < 0)
1252 				{
1253 					alert("허용되지 않는 파일이거나 목적에 맞지 않는 파일입니다.\n파일 종류 : " + ext);
1254 					retval = false;
1255 					return false;
1256 				}
1257 			}
1258 		}
1259 	});
1260 	
1261 	return retval;
1262}
1263
1264/*********************************************************************
1265 * 특수문자변화코드
1266 * 
1267**********************************************************************/
1268function ConvertSystemSourcetoHtml(str){
1269	str = str.replace(/&lt;/g,"<");
1270	str = str.replace(/&gt;/g,">");
1271	str = str.replace(/&quot;/g,"\"");
1272	str = str.replace(/&#39;/g,"\'");
1273	str = str.replace(/&apos;/g,"\'");
1274	return str;
1275}
1276
1277function gfnCountryAdd(obj){
1278	var nodeLeng = $("#tdCountry").children('select').length;
1279	var continentName = "continent"+(nodeLeng/2);
1280	var countryName = "country"+(nodeLeng/2);
1281	
1282	obj.before('<select id="'+continentName+'" name="'+continentName+'" class="selContinent"><option value="">대륙 선택</option></select> '
1283             + '<select id="'+countryName+'" name="'+countryName+'" class="selCountry"><option value="">국가 선택</option></select> ');
1284	
1285	gfnCodeComboList($("#"+continentName), "country", "", "대륙 선택", "", ""); // 대륙 코드조회
1286	
1287}
1288
1289function gfnFileTagAdd(obj){
1290	obj.after('<input type="file" id="file_upload" name="file_upload" class="input_mid"/> '
1291			+ '<input type="button" value="파일삭제" class="btn btn-black" onClick="javascript:gfnFileTagDel($(this));" />');
1292}
1293
1294function gfnFileTagDel(obj){
1295	obj.prev().remove();
1296	obj.remove();
1297}
1298
1299function gfnFileDynamicDownload(linkId, menuId){
1300    $.ajax({
1301        url: gContextPath+"/board/fileListJson",
1302        async:false,
1303        data: {linkId : linkId, menuId : menuId },
1304        success:function(data, textStatus, jqXHR) {
1305            if(data != null) {
1306                $.each(data, function(i, item) {
1307                	if("jpg;jpeg;gif;png;bmp".indexOf(item.FILEEXTENSION.toLowerCase()) <= -1){
1308                		location.href = gContextPath+"/fileDownload?titleId="+item.TITLEID+"&fileId="+item.FILEID+"&fileDownType=C&paramMenuId="+menuId;
1309                		return false;
1310                	}
1311                });
1312            }
1313        }
1314    });  
1315}
1316
1317//파일뷰어(게시판파일:상세보기용)
1318function gfnFileBrdViewer(titleId, fileId){
1319	window.open(gContextPath+"/fileViewSn?titleId="+titleId+"&fileId="+fileId);
1320	return false;
1321}
1322
1323// 파일뷰어(게시판파일:목록용)
1324function gfnFileDynamicBrdViewer(linkId, menuId){
1325	$.ajax({
1326		url: gContextPath+"/board/fileListJson",
1327		async:false,
1328		data: {linkId : linkId, menuId : menuId },
1329		success:function(data, textStatus, jqXHR) {
1330			if(data != null) {
1331				$.each(data, function(i, item) {
1332					if("jpg;jpeg;gif;png;bmp".indexOf(item.FILEEXTENSION.toLowerCase()) <= -1){
1333						window.open(gContextPath+"/fileViewSn?titleId="+item.TITLEID+"&fileId="+item.FILEID);
1334						return false;
1335					}
1336				});
1337			}
1338		}
1339	});  
1340}
1341
1342// 파일뷰어(기능파일)
1343function gfnFileDynamicFncViewer(oFileNm, sFileNm, menuId, fileGubun){
1344	window.open(gContextPath+"/fileViewSn?fileGubun="+fileGubun+"&menuId="+menuId+"&userFileName="+encodeURIComponent(oFileNm)+"&systemFileName="+sFileNm);
1345	return false; 
1346}
1347
1348//검색버튼 클릭시
1349function gfnSearch(gubun){
1350	if($.trim($('#search_keyword').val()) == ""){
1351		alert("검색어를 입력해 주세요...");
1352		$("#search_keyword").val("");
1353		$("#search_keyword").focus();
1354		return false;
1355	}
1356	
1357    var li_str_len     = $.trim($('#search_keyword').val()).length; // 이벤트가 일어난 컨트롤의 value 값 길이
1358	if(li_str_len < 2){
1359		alert("두 글자이상 입력바랍니다.");
1360
1361		$("#search_keyword").val("");
1362		$("#search_keyword").focus();
1363		return false;
1364	}
1365	
1366	// 검색어 쿠키생성
1367	var name = "";
1368	var addHistory = true;
1369	var cookieLength = 30;
1370
1371	var search_keyword = $('#search_keyword').val();
1372	search_keyword = replaceAll(search_keyword,"<", "");
1373	search_keyword = replaceAll(search_keyword,">", "");
1374	search_keyword = replaceAll(search_keyword,"&", "");
1375	search_keyword = replaceAll(search_keyword,"\"", "");
1376	search_keyword = replaceAll(search_keyword,"\r", "");
1377	search_keyword = replaceAll(search_keyword,"\n", "");
1378	search_keyword = replaceAll(search_keyword,"\'","");
1379	search_keyword = replaceAll(search_keyword,"%00","");
1380
1381	for(var i=1; i <=cookieLength; i++){
1382		if(getCookie("searchKeywordCookie"+padDigit(i)) == search_keyword ){
1383			addHistory = false;
1384		}
1385	}
1386
1387	if(addHistory){
1388		// 검색어 쿠키를 항상 30개로 채워놓는다. 그래야 최근 것부터 01,02,... 순으로 채워넣을 수 있음.
1389		if(document.cookie.indexOf("searchKeywordCookie")<0){
1390			for(var i=1; i<=cookieLength; i++){
1391				setCookieWithSamePath("searchKeywordCookie"+padDigit(i), "null", 30);
1392			}
1393		}
1394
1395		if(name == ""){
1396			// 항상 1을 남기고 한칸씩  뒤로 밈.
1397			for(var i=cookieLength; i>1; i--){
1398				setCookieWithSamePath("searchKeywordCookie"+padDigit(i), getCookie("searchKeywordCookie"+padDigit(i-1)), 30);
1399			}
1400			setCookieWithSamePath("searchKeywordCookie"+padDigit(i), getCookie("searchKeywordCookie"+padDigit(i)), -1);
1401			name = "searchKeywordCookie"+padDigit(i);
1402		}
1403		setCookieWithSamePath(name, search_keyword, 30);
1404	}
1405	
1406	document.aiSearchForm.aiSearchWord.value = search_keyword;
1407	//document.aiSearchForm.aiSearchKey.value = "${empty USER.userId ? 'guest' : USER.userId }";
1408	document.aiSearchForm.action = "/aiVorySearch";
1409	document.aiSearchForm.submit();
1410	
1411}
1412
1413function safeUrl(url){
1414	var allows = ["www.facebook.com", "twitter.com"];
1415	var isAllowed = allows.some(function(domain) {
1416        return url.includes(domain);
1417    });
1418	
1419    if (isAllowed) {
1420        window.open(url);
1421    } else {
1422        alert("비정상적인 접근 입니다.");
1423    }
1424}

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.