PageSourceSearch

https://nmhc.go.kr/js/global.js

js nmhc.go.kr collected 2026-10-02 20:02:17 UTC 36,699 bytes, 1,360 lines download raw bytes

1// jquery.anchor.js
2$(document).ready(function(){$(function(){$('.anchorLink').on('click', function(){$('html, body').animate({scrollTop:0},'fast');return false;});});});
3
4// 화면 확대 축소
5var zoomRate = 10;
6var curRate = 100;
7var minRate = 100;
8var maxRate = 200;
9
10function zoomInOut(value) {
11	if (((value == "plus")&&(curRate >= maxRate))||((value == "minus") && (curRate <= minRate))) {
12	    return;
13	} 
14	if (value == "plus") {
15		curRate = parseInt(curRate) + parseInt(zoomRate);
16	} else if (value == "minus") {
17		curRate = parseInt(curRate) - parseInt(zoomRate);
18	} else {
19		curRate = 100;
20	}
21	document.body.style.zoom = curRate + '%';	
22	try
23	{
24		var obj = document.getElementById('flash_visual').getElementsByTagName('object')[0];
25
26		if (curRate==100)
27		{
28			obj.style.display	= 'block';
29		}
30		else
31		{
32			obj.style.display	= 'none';
33		}
34	}
35	catch (e)
36	{ console.log(""); 
37	}
38}
39
40// 프린트
41function printAreaAction(){
42	window.onbeforeprint = beforePrint;
43	window.onafterprint  = afterPrint;
44	window.print();
45}
46// 프린트할 내용
47var initBody;
48function beforePrint(){
49	initBody = document.body.innerHTML;
50	document.body.innerHTML = contents.innerHTML;
51}
52function afterPrint(){
53	document.body.innerHTML = initBody;
54}
55
56// 즐겨찾기
57function bookmarkSite(title, url){
58	try{
59		window.external.AddFavorite(url, title);
60	}catch (e) {
61		alert("Ctrl+D 키를 눌러서 북마크를 추가할 수 있습니다.");
62	}
63}
64
65//서브메뉴 보기
66var sMenu_launch = "";
67function detailSubMenu(name)
68{
69	try{
70		submenu = document.getElementById(name).style;
71		if(sMenu_launch != submenu)
72		{
73			if(sMenu_launch != "")
74			{
75				sMenu_launch.display = "none";
76			}
77			submenu.display = "block";
78			sMenu_launch = submenu;
79			$(".question > a").addClass('open');
80			$(".question > a").removeClass('close');
81		}
82		else
83		{
84			submenu.display = "none";
85			$(".question > a").addClass('close');
86			$(".question > a").removeClass('open');
87			sMenu_launch = "";
88		}
89	}catch (e) { console.log(""); }
90}
91
92// 팝업창 openWin(파일경로, 타겟, 넓이, 높이, 스크롤바여부, );
93function openWin (url, target, width, height, scrollbars, pos, resize)
94{   
95	var uri		= url.replace(/(&amp;)/gi, "&");
96	var xy_pos	= "";
97	
98	if (pos)
99	{
100		xy_pos  = ",left=" + (Math.round(screen.width/2) - Math.round(width/2));
101		xy_pos += ",top="  + (Math.round(screen.height/3) - Math.round(height/3));
102	}
103
104	var remote	= window.open(uri, target, "width=" + width
105				+ ",height=" + height 
106				+ ",scrollbars=" + scrollbars 
107				+ ",resizable=" + resize
108				+ xy_pos
109				+ ",toolbar=no,location=no"
110				+ ",directories=no,menubar=no,status=yes");
111	
112	remote.focus();
113	return remote;
114}
115
116
117/* Initialize Top Menu */
118function initTopMenu(select1, select2)
119{
120	var focus	= false;
121	var root	= document.getElementById('head_menu');
122	var delay	= 3000;
123	var menu	= new Array();
124	var item	= new Array();
125
126	var src2menu	= new Array();
127	var src2item	= new Array();
128
129	var getSrc	= function (src)
130	{
131		var file	= src.split('/');
132		var name	= file[(file.length-1)].split('.');
133			name	= src.replace(file[(file.length-1)], name[0] + '_on.' + name[1]);
134
135		return {on:name, off:src};
136	};
137
138	for (var i=0; i<root.childNodes.length; i++)
139	{
140		if (root.childNodes[i].nodeName!='LI') { continue; }
141
142		for (var j=0; j<root.childNodes[i].childNodes.length; j++)
143		{
144			if (root.childNodes[i].childNodes[j].nodeType!=1) { continue; }
145			if (root.childNodes[i].childNodes[j].nodeName=='A')
146			{
147				menu.push(root.childNodes[i].childNodes[j]);
148				src2menu.push(getSrc(root.childNodes[i].childNodes[j].getElementsByTagName('img')[0].src));
149
150				var sub_menu	= root.childNodes[i].getElementsByTagName('ul')[0];
151				var src_item	= new Array();
152
153				if (sub_menu)
154				{
155					sub_menu.style.display	= 'block';
156					var offset	= 0;
157
158					for (var k in sub_menu.childNodes)
159					{
160						if (sub_menu.childNodes[k].nodeName=='LI')
161						{
162							offset	+= 	parseInt(sub_menu.childNodes[k].offsetWidth, 10);
163							src_item.push(getSrc(sub_menu.childNodes[k].getElementsByTagName('img')[0].src));
164						}
165					}
166					
167					sub_menu.style.width	= offset + "px";
168					sub_menu.style.display	= "none";
169
170					for (var l in sub_menu.childNodes)
171					{
172						if (typeof(sub_menu.childNodes[l])=='object' && sub_menu.childNodes[l].nodeType==3 && sub_menu.childNodes[l].nodeName=='#text')
173						{
174							sub_menu.removeChild(sub_menu.childNodes[l]);
175						}
176					}
177
178					item.push(sub_menu);
179				}
180				else
181				{
182					item.push('');
183				}
184
185				src2item.push(src_item);
186			}
187		}
188	}				
189
190	var getIndex	= function (obj, self)
191	{
192		for (var i in obj) { if (obj[i]==self) { return i; } }
193	}
194	
195	for (var i in menu)
196	{
197		menu[i].onfocus	= menu[i].onmouseover = function ()
198		{
199			root.className	= 'head-menu';
200			focus	= true;
201
202			var index	= getIndex(menu, this);
203			this.getElementsByTagName('img')[0].setAttribute('src', src2menu[index].on);
204			this.className	= 'on';
205
206			for (var i in item)
207			{
208				if (item[i].nodeName!='UL') { continue; }
209
210				if (i==index)
211				{
212					root.className	= 'head-menu-on';
213					item[i].style.display	= 'block';
214				}
215				else
216				{
217					item[i].style.display	= 'none';
218				}
219			}
220		};
221	}
222
223	for (var i in item)
224	{
225		if (item[i].nodeName!='UL') { continue; }
226
227		var item_a	= item[i].getElementsByTagName('a');
228
229		for (var j in item_a)
230		{
231			item_a[j].i	= i;
232
233			item_a[j].onmouseover	= item_a[j].onfocus	= function ()
234			{
235				root.className	= 'head-menu-on';
236				focus	= true;
237
238
239				var j	= this.i;
240
241				if (item[j].nodeName=='UL')
242				{
243					for (var k in item[j].childNodes)
244					{
245						if (!item[j].childNodes[k]) { continue; }
246						if (item[j].childNodes[k].nodeName!='LI') { continue; }
247						
248						if (item[j].childNodes[k]==this.parentNode)
249						{
250							menu[j].getElementsByTagName('img')[0].setAttribute('src', src2menu[j].on);
251							menu[j].className	= 'on';
252							item[j].childNodes[k].getElementsByTagName('img')[0].setAttribute('src', src2item[j][k].on);
253						}
254						else
255						{
256							item[j].childNodes[k].getElementsByTagName('img')[0].setAttribute('src', src2item[j][k].off);
257						}
258					}
259				}
260			};
261		}
262	}
263
264
265	// selected
266	var selected	= function ()
267	{
268		var s1	= parseInt((select1-1), 10);
269		var s2	= parseInt((select2-1), 10);
270
271		for (var i in menu)
272		{
273			if (i==s1)
274			{
275				root.className	= 'head-menu-on';
276				menu[i].getElementsByTagName('img')[0].setAttribute('src', src2menu[i].on);
277				menu[i].className	= 'on';
278				
279				focus	= true;
280
281				if (item[i])
282				{
283					item[i].style.display	= 'block';
284
285					for (var j in item[i].childNodes)
286					{
287						if (!item[i].childNodes[j]) { continue; }
288						if (item[i].childNodes[j].nodeName!='LI') { continue; }
289
290						if (j==s2)
291						{
292							item[i].childNodes[j].getElementsByTagName('img')[0].setAttribute('src', src2item[i][j].on);
293						}
294						else
295						{
296							item[i].childNodes[j].getElementsByTagName('img')[0].setAttribute('src', src2item[i][j].off);
297						}
298					}
299				}
300			}
301			else
302			{
303				menu[i].getElementsByTagName('img')[0].setAttribute('src', src2menu[i].off);
304				menu[i].className	= '';
305			}
306		}
307	};
308
309	selected();
310
311	var a = root.getElementsByTagName("a");
312	
313	for (var i in a)
314	{
315		a[i].onmouseout	= a[i].onblur	= function ()
316		{
317			for (var i in menu)
318			{
319				menu[i].getElementsByTagName('img')[0].setAttribute('src', src2menu[i].off);
320				menu[i].className	= '';
321
322				if (item[i])
323				{
324					for (var j in item[i].childNodes)
325					{
326						if (!item[i].childNodes[j]) {continue;} 
327						if (item[i].childNodes[j].nodeName=='LI')
328						{
329							item[i].childNodes[j].getElementsByTagName('img')[0].setAttribute('src', src2item[i][j].off);
330						}
331					}
332				}
333				
334			}
335			
336			focus	= false;
337
338			setTimeout(function()
339			{
340				if (focus==false)
341				{
342					for (var i in item)
343					{
344						if (item[i].nodeName!='UL') { continue; }
345						item[i].style.display	= 'none';
346					}
347
348					root.className	= 'head-menu';
349
350					selected();
351				}
352			}
353			, delay);
354		}
355	}
356}
357
358// 1차메뉴 활성화
359function initNavigation(seq) {		
360	var nav = document.getElementById("head_menu");
361	var allB = nav.getElementsByTagName("a");
362	for(var k = 0; k < allB.length; k++) {
363		var str = allB.item(k) + "";
364		if(str.substr(str.length-10,2) == seq){
365			allB.item(k).className = "active";
366			return false;
367		}
368	}
369}
370
371// 1차메뉴 select 활성화
372function init1DepthComboMenu(seq) {
373	var nav = document.getElementById("head_menu_depth1");
374	var allB = nav.getElementsByTagName("a");
375	for(var k = 0; k < allB.length; k++) {
376		var str = allB.item(k) + "";
377		if(str.substr(str.length-10,2) == seq){
378			allB.item(k).parentNode.className = "active";
379			return false;
380		}
381	}
382}
383
384// 2차메뉴 select 활성화
385function init2DepthComboMenu(seq) {
386	var nav = document.getElementById("head_menu_depth2");
387	var allB = nav.getElementsByTagName("a");
388	for(var k = 0; k < allB.length; k++) {
389		var str = allB.item(k) + "";
390		if(str.substr(str.length-10,4) == seq){
391			allB.item(k).parentNode.className = "active";
392			return false;
393		}
394	}
395}
396
397// 3차메뉴 select 활성화
398function init3DepthComboMenu(seq) {
399	var nav = document.getElementById("head_menu_depth3");
400	var allB = nav.getElementsByTagName("a");
401	for(var k = 0; k < allB.length; k++) {
402		var str = allB.item(k) + "";
403		if(str.substr(str.length-10,6) == seq){
404			allB.item(k).parentNode.className = "active";
405			return false;
406		}
407	}
408}
409
410// 4차메뉴 select 활성화
411function init4DepthComboMenu(seq) {
412	var nav = document.getElementById("head_menu_depth4");
413	var allB = nav.getElementsByTagName("a");
414	for(var k = 0; k < allB.length; k++) {
415		var str = allB.item(k) + "";
416		if(str.substr(str.length-10,8) == seq){
417			allB.item(k).parentNode.className = "active";
418			return false;
419		}
420	}
421}
422
423// 5차메뉴 select 활성화
424function init5DepthComboMenu(seq) {
425	var nav = document.getElementById("head_menu_depth5");
426	var allB = nav.getElementsByTagName("a");
427	for(var k = 0; k < allB.length; k++) {
428		var str = allB.item(k) + "";
429		if(str.substr(str.length-10,10) == seq){
430			allB.item(k).parentNode.className = "active";
431			return false;
432		}
433	}
434}
435
436// 모바일 1차메뉴 활성화
437function initNavigationMbl(seq) {		
438	var nav = document.getElementById("head_menu_all");
439	var allB = nav.getElementsByTagName("a");
440	for(var k = 0; k < allB.length; k++) {
441		var str = allB.item(k) + "";
442		if(str.substr(str.length-10,2) == seq){
443			allB.item(k).className = "active";
444			$("div.submenu"+seq).attr("style","display:block");
445			return false;
446		}
447	}
448}
449
450// 메뉴 네비게이션
451function initNavigation2(seq, seq2) {		
452	var nav = document.getElementById("head_menu");
453	nav.menu = new Array();
454	nav.current = null;
455	nav.menuseq = 0;
456	var navLen = nav.childNodes.length;
457	var menuImg;
458	
459	var allA = nav.getElementsByTagName("a");
460	for(var k = 0; k < allA.length; k++) {
461		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
462			nav.isOver = true;
463		}
464		allA.item(k).onmouseout = allA.item(k).onblur = function () {
465			nav.isOver = false;
466			setTimeout(function () {
467				if (nav.isOver == false) {
468					if (nav.menu[seq]) {
469						nav.menu[seq].onmouseover();
470					} else if(nav.current) {
471						menuImg = nav.current.childNodes.item(0);
472						menuImg.src = menuImg.src.replace("_on.png", ".png");
473						if (nav.current.submenu) {
474							nav.current.submenu.style.display = "none";
475						}
476						nav.current = null;
477					}
478				}
479			}, 3000);
480		}
481	}
482	
483	var allB = nav.getElementsByTagName("a");
484	for(var k = 0; k < allB.length; k++) {
485		var str = allB.item(k) + "";
486		if(str.substr(str.length-12,4) == seq2){
487			allB.item(k).className = "active";
488		}
489	}
490
491	for (var i = 0; i < navLen; i++) {
492		var navItem = nav.childNodes.item(i);
493		if (navItem.tagName != "LI") {
494			continue;
495		}
496		var navAnchor = navItem.getElementsByTagName("a").item(0);
497		navAnchor.submenu = navItem.getElementsByTagName("ul").item(0);
498	
499		navAnchor.onmouseover = navAnchor.onfocus = function () {
500			if (nav.current) {
501				menuImg = nav.current.childNodes.item(0);
502				menuImg.src = menuImg.src.replace("_on.gif", ".gif");
503				if (nav.current.submenu) {
504					nav.current.submenu.style.display = "none";
505				}
506				nav.current = null;
507			}
508			if (nav.current != this) {
509				menuImg = this.childNodes.item(0);
510				menuImg.src = menuImg.src.replace(".gif", "_on.gif");
511				if (this.submenu) {
512					this.submenu.style.display = "block";
513				}
514				nav.current = this;
515			}
516			nav.isOver = true;
517		}
518		nav.menuseq++;
519		nav.menu[nav.menuseq] = navAnchor;
520	}
521	if (nav.menu[seq]) {
522		nav.menu[seq].onmouseover();
523	}
524}
525
526/* Initialize Left Menu - li */
527function initLeftMenuLI(select1, select2)
528{	
529	var nav = document.getElementById("left_menu_top");
530	nav.menu = new Array();
531	nav.current = null;
532	nav.menuseq = 0;
533	var navLen = nav.childNodes.length;
534	var menuImg;
535	
536	var allB = nav.getElementsByTagName("li");
537	for(var k = 0; k < allB.length; k++) {
538		var str = allB.item(k).id + "";
539		if(str.substr(str.length-10,6) == select2){
540			allB.item(k).className += " active";
541			try{ allB.item(k).childNodes.item(0).childNodes.item(0).src = allB.item(k).childNodes.item(0).childNodes.item(0).src.replace(".gif", "_on.gif"); }catch (e) { console.log(""); }
542		}
543	}
544	
545	var allAA = nav.getElementsByTagName("ul");
546	for(var k = 0; k < allAA.length; k++) {
547		var str = allAA.item(k).className + "";
548		if(str.substr(2,4) == select1){
549			allAA.item(k).style.display = "block";
550		}
551	}
552
553	var allA = nav.getElementsByTagName("li");
554	for(var k = 0; k < allA.length; k++) {
555		var str = allA.item(k).id + "";
556		if(str.substr(str.length-10,4) == select1){
557			allA.item(k).className += " active";
558			try{ allB.item(k).childNodes.item(0).childNodes.item(0).src = allB.item(k).childNodes.item(0).childNodes.item(0).src.replace(".gif", "_on.gif"); }catch (e) { console.log(""); }
559			return;
560		}
561	}
562}
563
564/* Initialize Left Menu - a */
565function initLeftMenu(select1, select2)
566{	
567	var nav = document.getElementById("left_menu_top");
568	nav.menu = new Array();
569	nav.current = null;
570	nav.menuseq = 0;
571	var navLen = nav.childNodes.length;
572	var menuImg;
573
574	var allAA = nav.getElementsByTagName("ul");
575	for(var k = 0; k < allAA.length; k++) {
576		var str = allAA.item(k).className + "";
577		if(str.substr(0,4) == select1){
578			allAA.item(k).style.display = "block";
579		}
580	}
581
582	var allB = nav.getElementsByTagName("a");
583	for(var k = 0; k < allB.length; k++) {
584		var str = allB.item(k) + "";
585		if(str.substr(str.length-10,6) == select2){
586			allB.item(k).className = "active";
587		}
588	}
589
590	var allA = nav.getElementsByTagName("a");
591	for(var k = 0; k < allA.length; k++) {
592		var str = allA.item(k) + "";
593		if(str.substr(str.length-10,4) == select1){
594			allA.item(k).className = "active";
595			return;
596		}
597	}
598}
599
600/* 3Depth Left Menu */
601function init3DepthMenu(select1)
602{	
603	var nav = document.getElementById("depth3_menu_div");
604	nav.menu = new Array();
605	nav.current = null;
606	nav.menuseq = 0;
607	var navLen = nav.childNodes.length;
608	var menuImg;
609	
610	var allA = nav.getElementsByTagName("li");
611	for(var k = 0; k < allA.length; k++) {
612		var str = allA.item(k).id + "";
613		if(str.substr(str.length-10,6) == select1){
614			allA.item(k).className = "active";
615			return;
616		}
617	}
618}
619
620/* 4Depth Left Menu */
621function init4DepthMenu(select1)
622{	
623	var nav = document.getElementById("depth4_menu_div");
624	nav.menu = new Array();
625	nav.current = null;
626	nav.menuseq = 0;
627	var navLen = nav.childNodes.length;
628	var menuImg;
629	
630	var allA = nav.getElementsByTagName("li");
631	for(var k = 0; k < allA.length; k++) {
632		var str = allA.item(k).id + "";
633		if(str.substr(str.length-10,8) == select1){
634			allA.item(k).className = "active";
635			return;
636		}
637	}
638}
639
640/* 5Depth Left Menu */
641function init5DepthMenu(select1)
642{	
643	var nav = document.getElementById("depth5_menu_div");
644	nav.menu = new Array();
645	nav.current = null;
646	nav.menuseq = 0;
647	var navLen = nav.childNodes.length;
648	var menuImg;
649	
650	var allA = nav.getElementsByTagName("li");
651	for(var k = 0; k < allA.length; k++) {
652		var str = allA.item(k).id + "";
653		if(str.substr(str.length-10,10) == select1){
654			allA.item(k).className = "active";
655			return;
656		}
657	}
658}
659
660// 이미지 오버
661function initImgOver(as_ID) {
662	var rollNav = document.getElementById(as_ID);	
663	var rollLan = rollNav.childNodes.length;	
664	var rollItem;	
665	var rollAnchor;
666	var rollImg;	
667	
668	for (var i=0; i < rollLan; i++) {
669		rollItem = rollNav.childNodes.item(i);
670		if (rollItem.tagName != "LI") {
671			continue;
672		}
673		rollAnchor = rollItem.getElementsByTagName("a").item(0);
674		if (rollAnchor.className != "over") {		
675			rollAnchor.onmouseover = rollAnchor.onfocus = function () {
676				if (rollNav.current) {
677					rollImg = rollNav.current.childNodes.item(0);
678					rollImg.src = rollImg.src.replace("_on.gif", ".gif");
679					rollNav.current = null;				
680				}
681				if ((rollNav.current == null) || (rollNav.current != this)) {
682					rollImg = this.childNodes.item(0);
683					rollImg.src = rollImg.src.replace(".gif", "_on.gif");
684					rollNav.current = this;
685				}
686				rollNav.isOver = true;			
687			}
688			rollAnchor.onmouseout = rollAnchor.onblur = function () {
689				if (rollNav.current) {
690					rollImg = rollNav.current.childNodes.item(0);
691					rollImg.src = rollImg.src.replace("_on.gif", ".gif");
692					rollNav.current = null;				
693				}
694			}
695		}
696	}	
697}
698
699function getCookie(name)
700{
701	var nameOfCookie = name + "=";
702	var x = 0;
703	while ( x <= document.cookie.length )
704	{
705		var y = ( x + nameOfCookie.length );
706		if ( document.cookie.substring(x,y) == nameOfCookie )
707		{
708			if( (endOfCookie = document.cookie.indexOf(";", y)) == -1 )
709				endOfCookie = document.cookie.length;
710			return unescape(document.cookie.substring(y, endOfCookie)); 
711		}
712		x = document.cookie.indexOf( " ", x ) + 1;
713		if ( x == 0 )
714			break;
715	}
716	return "";		
717}
718
719// 레이어 팝업 열기
720function openLayer(arg)
721{
722	var pop = document.getElementById(arg);
723	pop.style.display = "block";
724}
725
726// 레이어 팝업 닫기
727function closeLayer(arg)
728{
729	var pop = document.getElementById(arg);
730	pop.style.display = "none";
731}
732
733// iframe 세로풀
734function frameResize(obj){
735	var obj_document = obj.contentWindow.document;
736	if(obj_document.height){
737		obj.style.height = obj_document.height+"px";
738	}else{
739		obj.style.height = obj_document.body.scrollHeight+"px";
740	}
741}
742
743// 메인 최근게시물 탭
744function initBoardArticle (container_id)
745{
746	var container	= document.getElementById(container_id);
747	var h3			= container.getElementsByTagName("h3");
748
749	for (var i=0; i<h3.length; i++)
750	{
751		if (h3.item(i).id=="article_setting")
752		{
753			h3.item(i).id			= "js_" + h3.item(i).id;
754
755			var set	= h3.item(i).getElementsByTagName("a").item(0);
756				set.container	= h3;
757				set.targetElement	= document.getElementById(h3.item(i).getElementsByTagName("a").item(0).href.split("#")[1]);
758				set.targetElement.style.position	= "absolute";
759				set.targetElement.style.display		= "none";
760				set.targetElement.style.padding	= "0";
761				set.onclick	= function ()
762				{
763					this.targetElement.style.display	= "block";
764					return false;
765				}
766
767				continue;
768		}
769
770		h3.item(i).className	= "js_" + h3.item(i).className;
771		h3.item(i).id			= "js_" + h3.item(i).id;
772
773		var article	= h3.item(i).getElementsByTagName("a").item(0);
774			article.container		= h3;
775			article.targetElement	= document.getElementById(h3.item(i).getElementsByTagName("a").item(0).href.split("#")[1]);
776			article.targetElement.style.display	= "none";
777			article.onclick	= article.onfocus	= function ()
778			{
779				var current	= this.container.current;
780
781				if (current!=this)
782				{
783					if (current)
784					{
785						current.targetElement.style.display	= "none";
786						current.className	= "";
787					}
788
789					this.targetElement.style.display	= "block";
790					this.className	= "menu_on";
791					this.container.current	= this;
792				}
793				return false;
794
795			};
796			
797			article.className	= "";
798
799			if (!article.container.first) { article.container.first	= article;}
800	}
801	
802	h3.first.onclick();
803}
804
805// 메인 최근게시물 탭
806function initBoardArticle_onoff (container_id)
807{
808	var container	= document.getElementById(container_id);
809	var h3			= container.getElementsByTagName("h4");
810
811	for (var i=0; i<h3.length; i++)
812	{
813		if (h3.item(i).id=="article_setting")
814		{
815			h3.item(i).id			= "js_" + h3.item(i).id;
816
817			var set	= h3.item(i).getElementsByTagName("a").item(0);
818				set.container	= h3;
819				set.targetElement	= document.getElementById(h3.item(i).getElementsByTagName("a").item(0).href.split("#")[1]);
820				set.targetElement.style.position	= "absolute";
821				set.targetElement.style.display		= "none";
822				set.targetElement.style.padding	= "0";
823				set.onclick	= function ()
824				{
825					this.targetElement.style.display	= "block";
826					return false;
827				}
828
829				continue;
830		}
831
832		h3.item(i).className	= "js_" + h3.item(i).className;
833		h3.item(i).id			= "js_" + h3.item(i).id;
834
835		var article	= h3.item(i).getElementsByTagName("a").item(0);
836		article.container		= h3;
837		article.targetElement	= document.getElementById(h3.item(i).getElementsByTagName("a").item(0).href.split("#")[1]);
838		article.targetElement.style.display	= "none";
839		article.onclick	= article.onfocus	= function ()
840		{
841			var current	= this.container.current;
842			if (current!=this)
843			{
844				if (current)
845				{
846					current.targetElement.style.display	= "none";
847					current.className	= "";
848					//current.getElementsByTagName("img").item(0).src = (current.getElementsByTagName("img").item(0).src).replace("_on.gif", ".gif");
849				}
850
851				this.targetElement.style.display	= "block";
852				this.className	= "active";
853				this.container.current	= this;
854				//this.getElementsByTagName("img").item(0).src = (this.getElementsByTagName("img").item(0).src).replace(".gif", "_on.gif");
855			}
856			return false;
857
858		};
859		
860		article.className	= "";
861
862		if (!article.container.first) { article.container.first	= article;}
863	}
864	
865	h3.first.onclick();
866}
867
868// 메인 최근게시물 탭
869function initBoardArticle_over (container_id)
870{
871	var container	= document.getElementById(container_id);
872	var h3			= container.getElementsByTagName("h3");
873
874	for (var i=0; i<h3.length; i++)
875	{
876		if (h3.item(i).id=="article_setting")
877		{
878			h3.item(i).id			= "js_" + h3.item(i).id;
879
880			var set	= h3.item(i).getElementsByTagName("a").item(0);
881				set.container	= h3;
882				set.targetElement	= document.getElementById(h3.item(i).getElementsByTagName("a").item(0).href.split("#")[1]);
883				set.targetElement.style.position	= "absolute";
884				set.targetElement.style.display		= "none";
885				set.targetElement.style.padding	= "0";
886				set.onmouseover	= function ()
887				{
888					this.targetElement.style.display	= "block";
889					return false;
890				}
891
892				continue;
893		}
894
895		h3.item(i).className	= "js_" + h3.item(i).className;
896		h3.item(i).id			= "js_" + h3.item(i).id;
897
898		var article	= h3.item(i).getElementsByTagName("a").item(0);
899			article.container		= h3;
900			article.targetElement	= document.getElementById(h3.item(i).getElementsByTagName("a").item(0).href.split("#")[1]);
901			article.targetElement.style.display	= "none";
902			article.onmouseover	= article.onfocus	= function ()
903			{
904				var current	= this.container.current;
905
906				if (current!=this)
907				{
908					if (current)
909					{
910						current.targetElement.style.display	= "none";
911						current.className	= "";
912					}
913
914					this.targetElement.style.display	= "block";
915					this.className	= "menu_on";
916					this.container.current	= this;
917				}
918				return false;
919
920			};
921			
922			article.className	= "";
923
924			if (!article.container.first) { article.container.first	= article;}
925	}
926	
927	h3.first.onmouseover();
928}
929
930// 입력창 글자제한
931function insertMax(arg, id, obj, spanID, val) {
932	if(arg.value.length > obj){
933		document.getElementById(id).value = val.substr(0,obj);
934	}
935    document.getElementById(spanID).innerHTML = arg.value.length;
936}
937
938function copyURI(arg) {
939	if(arg == "") {
940		alert("복사될 URL 주소가 없습니다.");
941		return;
942	}
943	var IE = (window.clipboardData) ? true : false;
944	if(IE) {
945		window.clipboardData.setData("Text", arg);
946		alert("URL 주소가 복사되었습니다.");
947	} else {
948		prompt("현재페이지의 URL 주소입니다.\nCtrl+C를 눌러 클립보드에 복사하세요.", arg);
949	}
950}
951
952function fncScrap(arg, arg2){
953	var returnURL = "";
954	if(confirm("마이페이지 > 나의 스크랩에 저장되었습니다.\n지금 확인하시겠습니까?")){
955		returnURL = encodeURIComponent("http://www.gwangju.go.kr/ease/menu.es?S=a1&M=120500000000");
956	}
957	location.href = arg + encodeURIComponent(arg2) + "&returnURL=" + returnURL;
958}
959
960function fncScrapDelete(arg){
961	if(confirm("스크랩 목록을 삭제 하시겠습니까?")){
962		location.href = arg;
963	}
964}
965
966function urlMove(arg){
967	var str = document.getElementById(arg).value;
968	if(str == "" | str == "#"){
969		alert("선택된 항목이 없습니다.");
970		return false;
971	}else{
972		return true;
973	}
974}
975
976/**
977* 게시판 SNS 공통 펑션
978* @param site_nm : 사이트명
979* @param title : 글제목
980* @param url : 링크
981* @return
982*/
983function snsApi(sns)
984{
985	var fm = document.snsForm;
986	fm.url.value = document.location.href;
987	fm.target = "_blank";
988	fm.action = "/api/sns.es?sns="+sns;
989	fm.submit();
990}
991function twitter(site_nm, title, url){
992	var str = site_nm + " | " + title + " " + url;
993	var sitelink = "http://twitter.com/home?status=" + encodeURIComponent(str);
994	window.open(sitelink);
995}
996function me2day(site_nm, title, url){
997	var str = site_nm + " | " + title + " " + url;
998	var sitelink = "http://me2day.net/posts/new?new_post[body]=" + encodeURIComponent(str);
999	window.open(sitelink);
1000}
1001function facebook(site_nm, title, url){
1002	var str = site_nm + " | " + title;
1003	var sitelink = "http://facebook.com/sharer.php?u=" + encodeURIComponent(url) + "&t=" + encodeURIComponent(str);
1004	window.open(sitelink);
1005}
1006
1007
1008var xhr = null;
1009function getXMLHttpRequest() {
1010    if (window.ActiveXObject) {
1011        try {
1012            return new ActiveXObject("Msxml2.XMLHTTP");//IE 상위 버젼
1013        } catch (e1) {
1014            try {
1015                return new ActiveXObject("Microsoft.XMLHTTP");//IE 하위 버젼
1016            } catch (e2) {
1017                return null;
1018            }
1019        }
1020    } else if (window.XMLHttpRequest) {
1021        return new XMLHttpRequest();//IE 이외의 브라우저(FireFox 등)
1022    } else {
1023        return null;
1024    }
1025}// XMLHttpRequest 객체 얻기
1026 
1027function requestHello(e,URL) {
1028	var ex_obj = document.getElementById("message");
1029    if(!e) e = window.Event;
1030    //param = f.name.value;
1031    //URL = URL + "?name=" + encodeURIComponent(param);//한글 처리
1032    xhr = getXMLHttpRequest();//XMLHttpRequest 객체 얻기
1033    xhr.onreadystatechange = responseHello;//콜백 함수  등록
1034    xhr.open("GET", URL, true);//연결
1035    xhr.send(null);//전송
1036}// 서버에 요청
1037 
1038function responseHello() {
1039    if (xhr.readyState == 4) {//완료
1040        if (xhr.status == 200) {//오류없이 OK
1041            var str = xhr.responseText;//서버에서 보낸 내용 받기
1042            document.getElementById("message").innerHTML = str;//보여주기 
1043        } else {
1044            alert("Fail : " + xhr.status);
1045        }
1046    }
1047}// 응답
1048
1049function displayTab(coId,num,curr) {
1050	for(var i=0;i<=num;i++){
1051		var obj = document.getElementById(coId+i);
1052		if(obj){ obj.style.display = "none"; }
1053	}
1054	var obj = document.getElementById(coId+curr);
1055	if(obj){ obj.style.display = "block"; }
1056}
1057
1058//IE 인지를 반환(IE 라면 true 아니면 false)
1059function is_IE() {
1060	if (navigator.appName.charAt(0) == "M")
1061		return true ;
1062	else
1063		return false ;
1064}
1065
1066
1067
1068var regExp = /^[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*\.[a-zA-Z]{2,3}$/i;
1069// 확인 버튼 선택시 상세목록 조회
1070function emailSubmit(){
1071	if(document.emailInsForm.email.value == ""){
1072		alert("이메일 주소가 정확하지 않습니다.");
1073		document.emailInsForm.email.focus();
1074	}else if( !regExp.test(document.emailInsForm.email.value) ){
1075		alert("올바른 이메일 형식이 아닙니다.");
1076		document.emailInsForm.email.focus();
1077	}else{
1078		if(confirm("뉴스레터를 신청하시겠습니까?")){
1079			$.post("/mail.es",
1080			{
1081				act : "insMailer",
1082				email : document.emailInsForm.email.value
1083			},
1084			function(data,status){
1085				$("#emailMessage").html(data);
1086			});
1087		}
1088	}
1089}
1090
1091//코멘트 글자수 최대수 제한
1092function insertContentsMax(spanID, max, formNm) {
1093	if(formNm.value.length > max){
1094		alert("제한 글자수 "+max+"자를 초과하였습니다.");
1095		formNm.value = formNm.value.substr(0,max);
1096	}
1097	document.getElementById(spanID).innerHTML = formNm.value.length;
1098	/*
1099	var word = formNm.value.replace(/(^\s*)|(\s*$)/g,"");
1100	if(word.length > max){
1101		formNm.value = formNm.value.substr(0,max);
1102	}
1103	document.getElementById(spanID).innerHTML = word.length;
1104	*/
1105}
1106
1107//글자 폰트 사이즈만 조절 하는 함수
1108defsize = 0.83;
1109var fSize=14;
1110//window.onload = onInit;
1111
1112function onInit(){
1113    var font = getCookieValue("font");
1114    var fontSize = getCookieValue("fontSize");
1115    if(font != ""){
1116        scaleFontType(font);
1117    }
1118    if(fontSize != ""){
1119        fontSize = Number(fontSize) - fSize;
1120        scaleFont(fontSize);
1121    }
1122}
1123
1124///////////////////////////////////////////////////////////////////////
1125function getCookieValue(cookieName){
1126    var cookieValue = null;
1127    if(document.cookie.length > 0){
1128        var offset = document.cookie.indexOf(cookieName +"=");
1129        if(offset != -1) {
1130            offset += cookieName.length;
1131            end = document.cookie.indexOf(";", offset);
1132            if (end == -1)    end = document.cookie.length;
1133            cookieValue = unescape(document.cookie.substring(offset+1, end));
1134        }
1135    }
1136        
1137    if(cookieValue == null)
1138        return "";
1139        
1140    return cookieValue;
1141}
1142
1143var expireDate = new Date();
1144function setCookieValue(cookieName,cookieValue){
1145    expireDate.setMonth(expireDate.getMonth()+6);    
1146    document.cookie = cookieName + "=" + escape(cookieValue) + "; expires=" + expireDate.toGMTString();    
1147}
1148
1149
1150function scaleFont(n){
1151    fSize = fSize + n;
1152    if(fSize < 10)return;
1153    var valueCheck = document.getElementById("wrap");
1154    if(valueCheck !=null){
1155     var objTXT = document.getElementById("wrap")
1156     var objTd = document.getElementById("wrap").getElementsByTagName( "td" );// <td>, <TD>의 내용을 모두 읽어옴
1157     var objDiv = document.getElementById("wrap").getElementsByTagName( "div" );
1158     var objSpan = document.getElementById("wrap").getElementsByTagName( "span" );
1159     var objA = document.getElementById("wrap").getElementsByTagName( "a" );
1160     var objs = document.getElementById("wrap").getElementsByTagName( "p" );
1161     var objli = document.getElementById("wrap").getElementsByTagName( "li" );
1162     objTXT.style.fontSize = fSize + "px";
1163     for( i=0; i < objDiv.length; i++ )    objDiv[i].style.fontSize = fSize + "px";
1164     for( i=0; i < objTd.length; i++ )    objTd[i].style.fontSize = fSize + "px";
1165     for( i=0; i < objSpan.length; i++ )    objSpan[i].style.fontSize = fSize + "px";
1166     for( i=0; i < objA.length; i++ )    objA[i].style.fontSize = fSize + "px";
1167     for( i=0; i < objs.length; i++ )    objs[i].style.fontSize = fSize + "px";
1168     for( i=0; i < objli.length; i++ )    objli[i].style.fontSize = fSize + "px";
1169     setCookieValue("fontSize",fSize);
1170    }
1171}
1172
1173function scaleFontType(str){
1174    var valueCheck = document.getElementById("wrap");
1175    if(valueCheck !=null){
1176     var objTd = document.getElementById("wrap").getElementsByTagName( "td" );// <td>, <TD>의 내용을 모두 읽어옴
1177     var objDiv = document.getElementById("wrap").getElementsByTagName( "div" );
1178     var objSpan = document.getElementById("wrap").getElementsByTagName( "span" );
1179     var objA = document.getElementById("wrap").getElementsByTagName( "a" );
1180     var objs = document.getElementById("wrap").getElementsByTagName( "p" );
1181     var objli = document.getElementById("wrap").getElementsByTagName( "li" );
1182     for( i=0; i < objDiv.length; i++ )    objDiv[i].style.fontFamily = str;
1183     for( i=0; i < objTd.length; i++ )    objTd[i].style.fontFamily = str;
1184     for( i=0; i < objSpan.length; i++ )    objSpan[i].style.fontFamily = str;
1185     for( i=0; i < objA.length; i++ )    objA[i].style.fontFamily = str;
1186     for( i=0; i < objs.length; i++ )    objs[i].style.fontFamily = str;
1187     for( i=0; i < objli.length; i++ )    objli[i].style.fontFamily = str;
1188     setCookieValue("font",str);
1189     }  
1190}
1191
1192var nowZoom = 100;
1193function zoomIn() {
1194	try{
1195		if(/Firefox/.test(navigator.userAgent)) {
1196			alert("이 브라우저에서는 기능을 지원하지 않습니다. \nCtrl키 + 마우스 휠을 이용하여 확대 축소하실수 있습니다.");
1197		} else {
1198			nowZoom = nowZoom - 10;
1199			if(nowZoom <= 70) nowZoom = 70;
1200			zooms();
1201		}
1202	}catch (e) {
1203		alert("이 브라우저에서는 기능을 지원하지 않습니다.");
1204	}
1205}
1206
1207function zoomOut() {
1208	try{
1209		if(/Firefox/.test(navigator.userAgent)) {
1210			alert("이 브라우저에서는 기능을 지원하지 않습니다. \nCtrl키 + 마우스 휠을 이용하여 확대 축소하실수 있습니다.");
1211		} else {
1212			nowZoom = nowZoom + 20;
1213			if(nowZoom >= 500) nowZoom = 500;
1214			zooms();
1215		}
1216	}catch (e) {
1217		alert("이 브라우저에서는 기능을 지원하지 않습니다.");
1218	}
1219}
1220
1221function zoomReset(){
1222	nowZoom = 100; 
1223	zooms();
1224}
1225
1226function zooms(){
1227	try{
1228		document.body.style.zoom = nowZoom + '%';
1229		if(nowZoom==70){
1230			alert ("30%축소 되었습니다. 더 이상 축소할 수 없습니다.");
1231		}
1232
1233		if(nowZoom==500){
1234			alert ("500%확대 되었습니다. 더 이상 확대할 수 없습니다.");
1235		}
1236	}catch (e) {
1237		alert("이 브라우저에서는 기능을 지원하지 않습니다.");
1238	}
1239	
1240}
1241
1242// 
1243var lastPoint = "";
1244function goPoint02(point) {
1245	if(document.getElementById(point).style.display != "none"){
1246		document.getElementById(point).style.display = "none";
1247	} else {
1248		try	{
1249		document.getElementById(lastPoint).style.display = "none";
1250			} catch(e) { console.log(""); }
1251		document.getElementById(point).style.display = "block";
1252			lastPoint = point;			
1253		}
1254}
1255
1256// 클릭시 arg 슬라이딩
1257function slideToggleView(arg){
1258	$(arg).slideToggle("fast");
1259}
1260
1261
1262
1263//Tab Content
1264function initTabMenu(tabContainerID) {
1265	var tabContainer = document.getElementById(tabContainerID);
1266	var tabAnchor = tabContainer.getElementsByTagName("a");
1267	var i = 0;
1268
1269	for(i=0; i<tabAnchor.length; i++) {
1270		if (tabAnchor.item(i).className == "tab")
1271			thismenu = tabAnchor.item(i);
1272		else
1273			continue;
1274
1275		thismenu.container = tabContainer;
1276		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
1277		thismenu.targetEl.style.display = "none";
1278		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
1279		if (thismenu.imgEl) {
1280			thismenu.onfocus = function () {
1281				//this.onfocus();
1282			}
1283		}
1284		thismenu.onclick = tabMenuOver;
1285		
1286		if (!thismenu.container.first)
1287			thismenu.container.first = thismenu;
1288	}
1289	tabContainer.first.onclick();
1290}
1291function tabMenuOver() {
1292	currentmenu = this.container.current;
1293	if (currentmenu != this) {
1294		if (currentmenu) {
1295			currentmenu.targetEl.style.display = "none";
1296			if (currentmenu.imgEl) {
1297				currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
1298				currentmenu.className = currentmenu.className.replace(" selectd", "");
1299			} else {
1300				currentmenu.className = currentmenu.className.replace(" selectd", "");
1301			}
1302		}
1303
1304		this.targetEl.style.display = "block";
1305		if (this.imgEl) {
1306			this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
1307			this.className += " selectd";
1308		} else {
1309			this.className += " selectd";
1310		}
1311		this.container.current = this;
1312	}
1313	return false;
1314}
1315
1316
1317//BMI 체크 프로그램
1318function bmiCheck(){
1319	document.getElementById("bmi01").innerHTML = "-";
1320	document.getElementById("bmi02").innerHTML = "-";
1321
1322	var result01 = "";
1323	var result02 = "";
1324	var ja = 2;
1325	result02 = document.getElementById("bmiWeight").value / (document.getElementById("bmiHeight").value/100 * document.getElementById("bmiHeight").value/100);
1326	result02 = result02.toFixed(1);
1327	if(result02 < 18.5){ result01 = "저체중";
1328	}else if(result02 >= 18.5 && result02 <= 22.9){ result01 = "정상체중";
1329	}else if(result02 >= 23 && result02 <= 24.9){ result01 = "과체중";
1330	}else if(result02 >= 25 && result02 <= 29.9){ result01 = "비만 I";
1331	}else if(result02 >= 30 && result02 <= 39.9){ result01 = "비만 II";
1332	}else if(result02 >= 40){ result01 = "심각한 비만 III";
1333	}
1334	
1335	document.getElementById("bmi01").innerHTML = result01;
1336	document.getElementById("bmi02").innerHTML = result02;
1337	
1338	//게시판 레이어창
1339	function boardPopLayer(divId, url){
1340		document.getElementById(divId).style.display = "block";
1341		$.post(url,
1342		function(data,status){
1343			$("#"+divId).html(data);
1344		});
1345	}
1346}
1347
1348// 메일선택시
1349function fnc_mailChange(arg, arg2){
1350	var sel_f = document.getElementById(arg2);
1351	if(arg == ""){
1352		sel_f.readOnly = false;
1353		sel_f.focus();
1354		sel_f.display = "block";
1355	}else{
1356		sel_f.readOnly = true;
1357		sel_f.display = "none";
1358	}
1359	sel_f.value = arg;
1360}

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.