PageSourceSearch

https://klri.re.kr/js/eng/content.js

js klri.re.kr collected 2026-09-24 08:41:39 UTC 13,224 bytes, 545 lines download raw bytes

1/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////
2	
3	Top Menu Function
4
5/////////////////////////////////////////////////////////////////////////////////////////////////////////// */
6function Tmenu_setting(){
7}
8$(document).ready(function(){
9	Tmenu_setting_new();
10});
11function Tmenu_setting_new(codes){
12	var obj = $("#header");
13	var Tmenu = $("#gnb>ul");
14		Tmenu.a = Tmenu.find(" a");
15	//사이트맵 or 좌측메뉴 데이터 바인딩
16	var slide_text = "KLRI";
17
18
19	$('<div id="slide_map"><strong class="slide_map_titles">SiteMenu<span>'+slide_text+'</span></strong><div class="binds"></div></div>').prependTo($("#wrap"));
20	Tmenu.clone(false).appendTo($("#slide_map > .binds"));
21	for(var r=0; r<$("#slide_map > .binds>ul>li").size(); r++){
22		var lis = $("#slide_map > .binds>ul>li").eq(r);
23		lis.addClass("line_"+(r+1));
24		if(lis.find(">ul").size() != 0){
25			lis.addClass("child");
26			for(var i=0; i<lis.find(">ul>li").size(); i++){
27				var lis2 = lis.find(">ul>li").eq(i);
28				if(lis2.find(">ul").size() != 0){
29					lis2.addClass("child");
30				}
31			}
32		}
33	}
34	
35	//하단
36	$('<div class="map_foot"></div>').insertAfter($("#slide_map .binds"));
37	$("#header .btn_link > ul").clone(false).appendTo($("#slide_map .map_foot"));
38	$("#slide_map .map_foot > ul >li:eq(0)").remove();
39	$("#slide_map .map_foot > ul >li:eq(0)>a").text("KLRI korean");
40
41	
42	Tmenu.find(" li").removeAttr("class");
43	
44
45	Tmenu.a.on("mouseover focus",function(){
46		if(!$("body").hasClass("header")) $("body").addClass("header");
47	});
48
49	obj.on("mouseleave",function(){
50		if($("body").hasClass("header")) $("body").removeClass("header");
51	});
52
53	$(".btn_menu_all, #lnb a").focus(function(){
54		if($("body").hasClass("header")) $("body").removeClass("header");
55	});
56
57
58
59	var objm = $("#slide_map .binds");
60		objm.a = objm.find(" a");
61
62	//objm.find(">ul>li>ul>li>ul").remove();//3뎁스제거
63	objm.a.click(function(){
64		if($(this).siblings("ul").size() != 0){
65			if($(this).siblings("ul").is(":hidden")){
66				$(this).siblings("ul").slideDown(200);
67				$(this).addClass("on");
68			} else {
69				$(this).siblings("ul").slideUp(200);
70				$(this).removeClass("on");
71			}
72			return false;
73		} else {
74			return true;
75		}
76	});
77
78}
79
80
81
82/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////
83
84	전체메뉴 클릭시 Function
85
86/////////////////////////////////////////////////////////////////////////////////////////////////////////// */
87$(window).load(function(){
88	menu_all_AC();
89});
90
91function menu_all_AC(){
92	var btn = $(".btn_menu_all");
93	var btn_close = $(".btn_menu_all_close");
94
95	btn.click(function(){
96		if(!$("body").hasClass("pc")){
97			if(!$("body").hasClass("gnb")) $("body").removeClass("search").addClass("gnb");
98			return false;
99		} else {
100			return true;
101		}
102	});
103
104	btn_close.click(function(){
105		if($("body").hasClass("gnb")) $("body").removeClass("gnb");
106		if($("body").hasClass("search")) $("body").removeClass("search");
107		return false;
108	});
109}
110
111/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////
112
113	검색 클릭시 Function
114
115/////////////////////////////////////////////////////////////////////////////////////////////////////////// */
116$(window).load(function(){
117	search_all_AC();
118});
119
120function search_all_AC(){
121	var btn = $(".btn_search");
122	var btn_close = $("#header .search_form .btn_close");
123
124	btn.click(function(){
125		if(!$("body").hasClass("search")) $("body").removeClass("search").removeClass("header").addClass("search");
126		return false;
127	});
128
129	btn_close.click(function(){
130		if($("body").hasClass("search")) $("body").removeClass("search");
131		return false;
132	});
133}
134
135
136/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////
137
138	search 활성화 Function
139
140/////////////////////////////////////////////////////////////////////////////////////////////////////////// */
141$(document).ready(function(){
142	top_search_AC();
143});
144
145function top_search_AC(){
146	var obj = $(".user #header #global .global_box");
147		obj.btn = obj.find(" .btn_search");
148
149	obj.btn.on("click",function(){
150		var hit = $(this).siblings(".search_form");
151
152		if(hit.is(":hidden")){
153			hit.show(200);
154			obj.btn.hide();
155			hit.find(" fieldset > input:text").first().focus();
156		} else {
157			hit.hide(200,function(){
158				obj.btn.show();
159			});
160		}
161		return false;
162	});
163
164	obj.btn.siblings(".search_form").find(" fieldset > input:text").on("blur",function(){
165		obj.btn.siblings(".search_form").hide(200,function(){
166			obj.btn.show();
167		});
168		obj.btn.focus();
169	});
170
171	obj.btn.siblings(".search_form").find(" fieldset > input:text").on("keydown",function(e){
172		if(e.keyCode == 27){
173			obj.btn.siblings("div").hide(200,function(){
174			obj.btn.show();
175		});
176			obj.btn.focus();
177		}
178	});
179	
180}
181
182/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////
183
184	프린트 Function
185
186/////////////////////////////////////////////////////////////////////////////////////////////////////////// */
187$(document).ready(function() {
188	$("a.print").click(function() { //이벤트 발생시킬 버튼 아이디
189		printElem({ 
190			printMode: 'popup',
191			pageTitle:'프린트 미리보기', //팝업 타이틀
192			leaveOpen:false, //인쇄하고도 창을 띄우기(true)/안띄우기(false). Default는 false
193			printBodyOptions : {
194				classNameToAdd : 'user',
195				styleToAdd: 'width:1023px; overflow-x:hidden;'
196			}
197		});
198		return false;
199	});
200});
201
202function printElem(options){	
203	$('#txt').printElement(options); //팝업으로 띄울 영역 Div 아이디
204}
205
206
207
208
209
210
211/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////
212
213	main visual Function
214
215/////////////////////////////////////////////////////////////////////////////////////////////////////////// */
216$(document).ready(function() {
217	if($("#main.user #visual").size() != 0){
218		main_visual_AC();
219	}
220});
221
222function main_visual_AC(){
223	var vi = $("#visual .ibox");
224	vi.ul = vi.find(">ul");
225	vi.li = vi.ul.find(">li");
226	vi.nums = 0;
227	vi.saveTime = "";
228	vi.speeds = 6000;
229
230	if(vi.li.size() < 2){
231		
232		return false;
233	}
234
235	//초기화
236	function fn_move(str){
237		vi.removeClass("step_1 step_2 step_3 step_4 step_5 step_6 step_7 step_8 step_9 step_10").addClass("step_"+str);
238		vi.nums = str;
239		fn_play();
240	}
241	function fn_play(){
242		vi.saveTime = setTimeout(function(){
243			var idx = vi.nums + 1;
244			if(idx > vi.li.size()) idx = 1;
245			fn_move(idx);
246		},vi.speeds);
247	}
248
249	fn_move(1);
250}
251
252
253
254
255
256
257/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////
258
259	main Function
260
261/////////////////////////////////////////////////////////////////////////////////////////////////////////// */
262$(window).load(function() {
263	if($("#main.user").size() != 0){
264		visual_popup_AC(); //메인 비주얼영약 팝업존
265	}
266});
267
268
269function visual_popup_AC(){
270	var obj = $("#visual #pops");
271		obj.moves = obj.find(" .move > ul");
272		obj.li = obj.moves.find(">li");
273
274	if(obj.li.size() < 2){
275		fn_count(1);
276		return false;
277	}
278	$('<div class="controll">\
279		<span class="simbol">\
280		</span>\
281		<a href="#" class="btn_play">재생</a>\
282		<a href="#" class="btn_stop">정지</a>\
283	   </div>').appendTo(obj);
284	for(var i=0; i<obj.li.size(); i++){
285		$('<a href="#">'+(i+1)+'번</a>').prependTo(obj.find(" .controll .simbol"));
286	}
287		obj.btn_play = obj.find(" .controll .btn_play");
288		obj.btn_stop = obj.find(" .controll .btn_stop");
289		obj.btn_simbol = obj.find(" .controll .simbol a");
290		obj.autos = "Y";
291		obj.saveTime = "";
292		obj.speeds = 5000;
293
294	function fn_count(idx){
295		obj.removeAttr("class").addClass("step_"+idx);
296		if(obj.autos == "Y"){
297			obj.btn_play.click();
298		}
299	}
300	fn_count(1);
301
302	function fn_play(){
303		fn_stop();
304		obj.saveTime = setTimeout(function(){
305			var idx = parseInt(obj.attr("class").replace("step_",""))+1;
306			if(idx > obj.li.size()) idx = 1;
307			fn_count(idx);
308		},obj.speeds);
309	}
310	function fn_stop(){
311		clearTimeout(obj.saveTime);
312	}
313
314	obj.btn_simbol.click(function(){
315		var idx = obj.btn_simbol.index($(this)) + 1;
316		fn_count(idx);
317		return false;
318	});
319
320	obj.btn_play.click(function(){
321		obj.autos = "Y";
322		obj.btn_play.hide();
323		obj.btn_stop.show();
324		fn_play();
325		return false;
326	});
327
328	obj.btn_stop.click(function(){
329		obj.autos = "N";
330		obj.btn_stop.hide();
331		obj.btn_play.show();
332		fn_stop();
333		return false;
334	});
335	if(obj.autos == "Y"){
336		obj.btn_play.click();
337	}
338}
339
340/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////
341
342	main visual Function
343
344/////////////////////////////////////////////////////////////////////////////////////////////////////////// */
345$(document).ready(function(){
346	if($(".js_count").size() != 0){
347		count_AC();
348	}
349});
350function count_AC(){
351	var obj = $(".js_count");
352
353	for(var i=0; i<obj.size(); i++){
354		new numberCounter(obj.eq(i), obj.eq(i).text(),20,0);
355	}
356}
357
358
359/* /////////////////////////////////////////////////////////////////////////////////////
360
361	현황판 값표시 childMenuOpe
362
363///////////////////////////////////////////////////////////////////////////////////// */
364function numberCounter(target_frame, target_number, rate, counts, fixs) {
365    this.count = parseInt(counts); this.diff = 0;
366    this.target_count = parseInt(target_number);
367
368    var fix = ""+target_number;
369    
370    if(fixs){
371	    this.target_count_fixed = fix.split(".");
372	    if(this.target_count_fixed.length > 1){
373			this.target_count_fixed = "."+this.target_count_fixed[1].substr(0,2);
374		} else {
375			this.target_count_fixed = ".0";
376		}
377	} else {
378		this.target_count_fixed = "";
379	}
380
381    this.target_frame = target_frame[0];
382    this.timer = null;
383    this.rate = 5;
384    if(rate) this.rate = rate;
385    if(this.target_count < this.count){
386		this.counterM(this.target_count_fixed);
387    } else {
388    	this.counter(this.target_count_fixed);
389    }
390};
391numberCounter.prototype.counter = function(str) {
392    var self = this;
393    this.diff = this.target_count - this.count;
394    
395    if(this.diff > 0) {
396        self.count += Math.ceil(this.diff / this.rate);
397    }
398    
399    this.target_frame.innerHTML = this.formatNumber(this.count)+str;
400    
401    if(this.count < this.target_count) {
402        this.timer = setTimeout(function() { self.counter(str); }, 20);
403    } else {
404        clearTimeout(this.timer);
405    }
406};
407numberCounter.prototype.counterM = function(str) {
408    var self = this;
409    this.diff = this.target_count - this.count;
410    
411    if(this.diff < 0) {
412        self.count += parseInt(Math.floor(this.diff / this.rate));
413    }
414    
415    this.target_frame.innerHTML = this.formatNumber(this.count)+str;
416    
417    if(this.count > this.target_count) {
418        this.timer = setTimeout(function() { self.counterM(str); }, 20);
419    } else {
420        clearTimeout(this.timer);
421    }
422};
423numberCounter.prototype.formatNumber = function(num) {
424    num+= '';
425    x = num.split('.');
426    x1 = x[0];
427    x2 = x.length > 1 ? '.' + x[1] : '';
428    var rgx = /(\d+)(\d{3})/;
429    while (rgx.test(x1)) {
430        x1 = x1.replace(rgx, '$1' + ',' + '$2');
431    }
432    return x1 + x2;
433};
434
435
436/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////
437
438	sub menu select Function
439
440/////////////////////////////////////////////////////////////////////////////////////////////////////////// */
441$(document).ready(function(){
442	if($(".user#sub").size() != 0){
443		js_menu_select_menuset_AC();
444	}
445});
446function js_menu_select_menuset_AC(){
447	var obj = $(".js_menu_select:last");
448
449	obj.clone(false).removeAttr("class").addClass("menu").attr("id","cnb").insertAfter($("#path"));
450	
451	var menu = $(".menu#cnb");
452
453	menu.find(">strong>a").attr("href","#").text("Menu View");
454
455	menu.find(">strong>a").click(function(){
456		if(menu.hasClass("on")) menu.removeClass("on");
457		else menu.addClass("on");
458		return false;
459	});
460}
461
462/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////
463
464	infos_data Function
465
466/////////////////////////////////////////////////////////////////////////////////////////////////////////// */
467$(document).ready(function(){
468	if($(".user#sub").size() != 0){
469		for(var i=0; i<$(".infos_data").size(); i++){
470			infos_data_AC($(".infos_data").eq(i));
471		}
472	}
473});
474function infos_data_AC(str){
475	var obj = str;
476		obj.li = obj.find(">.tabs>ul>li");
477		obj.btn = obj.li.find(">a");
478		obj.box = obj.find(" .views");
479		
480	function fn_play(str){
481		obj.li.removeClass("on").eq(str).addClass("on");
482		obj.box.hide().eq(str).stop().show();
483	}
484	fn_play(0);
485
486	obj.btn.click(function(){
487		var idx = obj.btn.parent().index($(this).parent());
488		fn_play(idx);
489		return false;
490	});
491}
492
493
494
495/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////
496
497	사이트맵 바인딩 Function
498
499/////////////////////////////////////////////////////////////////////////////////////////////////////////// */
500$(document).ready(function(){
501	if($("#con_sitemap").size() != 0){
502		con_sitemap_AC();
503	}
504});
505
506function con_sitemap_AC(){
507	$("#gnb.js_menu>ul").clone(false).appendTo($("#con_sitemap .codein"));
508	var obj = $("#con_sitemap .codein");
509}
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545

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.