PageSourceSearch

https://e-crt.org/script/user.js?t=20260925063906

js e-crt.org collected 2026-09-24 21:39:18 UTC 28,484 bytes, 1,051 lines download raw bytes

1var hideMenu = null,
2	hotBnr = null,
3	recentBnr = null,
4	sponBnr = null;
5
6jQuery(function($) {
7
8	var win_w = $(window).width();
9
10	if (win_w > 960) {
11//PC	
12		setting_pc();
13
14	} else {
15//Mobile	
16		setting_mobile();
17	}
18
19	if (hotBnr != null) {
20		hotBnr.destroySlider();
21		hotBnr = null;
22	}
23
24	$("dl.gnbSearch").on("click", "dt a", function(){
25		var sClass = $("dl.gnbSearch dt").attr("class");
26		if (sClass != "view") {
27			$("ul#gnb > li").removeClass("on");
28			$("ul#gnb ul").css('display', 'none');
29
30			$("dl.gnbSearch dt").addClass("view");
31			$("dl.gnbSearch dd").show();
32		} else {
33			$("ul#gnb ul").css('display', '');
34
35			$("dl.gnbSearch dt").removeClass("view");
36			$("dl.gnbSearch dd").hide();
37		}
38	
39		return false
40	});
41
42	if ($("div.articleBrief").length) {
43		$("div#container").addClass("article");
44	}
45
46// 탭메뉴
47	var tabArea = $(".tabArea");
48	
49	if (tabArea.length) {
50		
51		for (var i=0 ; i<tabArea.length ; i++) {
52			var tabMenu = tabArea.eq(i).find("ul.tabMenu > li"),
53				tabCon = tabArea.eq(i).find(".tabCon");
54			
55			//tabMenu.removeClass("on").eq(0).addClass("on");
56			//tabCon.hide().eq(0).show();
57		}
58
59		if ($("div.necEdu").length) 	{
60			tabMenu.removeClass("on");
61			tabCon.hide();
62		}
63		
64		tabArea.on("click", "ul.tabMenu a", function(){
65			var currTabMenu =  $(this).parent().parent().parent().find("ul.tabMenu li"),
66				currTabCon =  $(this).parent().parent().parent().find(".tabCon"),
67				currIdx = $(this).parent().index();
68
69			if ($(this).parent().attr("class") == "on") {
70				currTabMenu.removeClass("on");
71				currTabCon.slideUp();
72			} else {
73				currTabMenu.removeClass("on").eq(currIdx).addClass("on");
74				currTabCon.hide().eq(currIdx).slideDown();
75			}
76		
77
78			return false
79		});
80		
81	}
82
83	var rwTabArea = $(".rwTabArea");
84	if (rwTabArea.length) {
85		var rwTabMenu = rwTabArea.find("ul.rwTabMenu li"),
86			rwTabCon = rwTabArea.find("div.tabCon");
87
88		//rwTabMenu.eq(0).addClass("on");
89		//rwTabCon.hide().eq(0).show();
90
91		rwTabMenu.on("click", "a",  function(){
92			var win_w = $(window).width(),
93				nIdx = $(this).parent().index(),
94				menuTxt = $(this).text();
95
96			rwTabArea.find("dl.rwMenu > dt").removeClass("view");
97			rwTabArea.find("dl.rwMenu > dt").find("i").attr("class",  function(i){
98				var src = $(this).attr("class");
99				return src.replace("-up", "-down");
100			});
101			rwTabArea.find(".toggleCon").slideUp();			
102
103			rwTabArea.find("a.trigger span").text(menuTxt);
104			rwTabMenu.removeClass("on").eq(nIdx).addClass("on");
105			rwTabCon.hide().eq(nIdx).show();
106			
107			
108			return false
109		});
110	}
111
112	$(document).on("click","span.trigger",function() {
113		if($(this)[0].id=="trigger_c") {
114			var _currToggle = $(this).parent().parent().parent(),
115			_currToggleCon = $(this).parent().parent().parent().find("dd#toggleCon_c"),
116			sClass = $(this).attr("class");
117			
118			$(this).parent().find("span#trigger_c").removeClass("view");
119			$(this).parent().parent().find("dd#toggleCon_c").hide();
120		} else {
121			var _currToggle = $(this).parent().parent(),
122			_currToggleCon = $(this).parent().next(),
123			sClass = $(this).attr("class");
124		}
125
126		if (sClass != "trigger view") {
127			$(this).addClass("view");
128			$(this).find("i").attr("class",  function(i){
129				var src = $(this).attr("class");
130				return src.replace("-down", "-up");
131			});
132			_currToggleCon.slideDown();
133		} else {
134			$(this).removeClass("view");
135			$(this).find("i").attr("class",  function(i){
136				var src = $(this).attr("class");
137				return src.replace("-up", "-down");
138			});
139			_currToggleCon.slideUp();
140		}
141
142		return false
143	});
144
145	$(document).on("click","a.trigger",function() {
146
147		if($(this)[0].id=="trigger_a") {
148			var _currToggle = $(this).parent().parent(),
149			_currToggleCon = $(this).parent().parent().find("dd#toggleCon_a"),
150			sClass = $(this).attr("class");
151
152			$(this).parent().find("a#trigger_ga").removeClass("view");
153			$(this).parent().parent().find("dd#toggleCon_ga").hide();
154		} else if($(this)[0].id=="trigger_ga") {
155			var _currToggle = $(this).parent().parent(),
156			_currToggleCon = $(this).parent().parent().find("dd#toggleCon_ga"),
157			sClass = $(this).attr("class");
158			
159			$(this).parent().find("a#trigger_a").removeClass("view");
160			$(this).parent().parent().find("dd#toggleCon_a").hide();
161		} else {
162			var _currToggle = $(this).parent().parent(),
163			_currToggleCon = $(this).parent().next(),
164			sClass = $(this).attr("class");
165		}
166
167		if (sClass != "trigger view") {
168			$(this).addClass("view");
169			$(this).find("i").attr("class",  function(i){
170				var src = $(this).attr("class");
171				return src.replace("-down", "-up");
172			});
173			_currToggleCon.slideDown();
174		} else {
175			$(this).removeClass("view");
176			$(this).find("i").attr("class",  function(i){
177				var src = $(this).attr("class");
178				return src.replace("-up", "-down");
179			});
180			_currToggleCon.slideUp();
181		}
182
183		return false
184	});
185
186	//filter	
187	$(document).on("click","a#filter_category_more",function() {
188		
189		if($("#filter_category_layer").css("display") == "none"){
190			$('#filter_category_layer').show();
191		} else {
192			$('#filter_category_layer').hide();
193		}
194
195		return false
196	});
197
198	$(document).on("click","a#filter_topic_more",function() {
199		
200		if($("#filter_topic_layer").css("display") == "none"){
201			$('#filter_topic_layer').show();
202		} else {
203			$('#filter_topic_layer').hide();
204		}
205
206		return false
207	});
208
209	$(document).on("click","a#filter_keyword_more",function() {
210		
211		if($("#filter_keyword_layer").css("display") == "none"){
212			$('#filter_keyword_layer').show();
213		} else {
214			$('#filter_keyword_layer').hide();
215		}
216
217		return false
218	});
219
220	$(document).on("click","a#filter_author_more",function() {
221		
222		if($("#filter_author_layer").css("display") == "none"){
223			$('#filter_author_layer').show();
224		} else {
225			$('#filter_author_layer').hide();
226		}
227
228		return false
229	});
230
231	$(document).on("click","a#filter_year_more",function() {
232		
233		if($("#filter_year_layer").css("display") == "none"){
234			$('#filter_year_layer').show();
235		} else {
236			$('#filter_year_layer').hide();
237		}
238
239		return false
240	});
241
242	$(document).on("click","a#filter_fund_more",function() {
243		
244		if($("#filter_fund_layer").css("display") == "none"){
245			$('#filter_fund_layer').show();
246		} else {
247			$('#filter_fund_layer').hide();
248		}
249
250		return false
251	});
252
253	$('ul > li > input:checkbox').on("click", function(){		
254		var this_name = $(this)[0].name;
255		var this_value = $(this)[0].value;
256		var this_checked = $(this)[0].checked;
257
258		$('ul > li > input:checkbox').each(function() {
259			if($(this)[0].name == this_name && $(this)[0].value == this_value) { 
260				$(this)[0].checked = this_checked;
261			}
262		});
263	});
264
265	$('ul[name="filter"] > li > input:checkbox').on("click", function(){	
266		$('#page')[0].value = "1";
267		$('#filter_form')[0].submit();
268	});
269
270	//filer layer
271	$(document).on("click","input#filter_layer_submit",function() {
272		$('#page')[0].value = "1";
273		$('#filter_form')[0].submit();
274	});
275
276	$(document).on("click","a#filter_layer_close",function() {
277		$('.layerPopup').each(function() {
278			$(this).hide();
279		});
280	});	
281
282	//기타
283	$(document).on("click","span[name='funded_link']",function() {
284		var this_value = $(this)[0].innerText;
285
286		$("ul > li > input:checkbox[name='p_filter_fund[]']").each(function() {
287			if($(this)[0].value == this_value) { 
288				$(this)[0].checked = true;
289			}
290		});
291
292		$('#page')[0].value = "1";
293		$('#filter_form')[0].submit();
294	});
295	
296	$("dl.popupCite").on("click", " .close a", function(){
297		$("dl.popupCite").hide();
298		$(".div_dc_back").hide();
299		return false
300	});
301
302
303	$("dl.popupCite").on("click", " .close_ic a", function(){
304		$(".div_dc_back").hide();
305		return false
306	});
307
308		
309	$(".div_dc").on("click", "a", function(){
310		$(".div_dc_back").hide();
311		return false
312	});
313
314
315	$('form[name="cited_btn"] a.btnPoint_down').on("click", function(){
316		var cited_popup = $(this).closest("li");
317		if(cited_popup.find(".div_dc_back").css("display")=="none") {
318
319			cited_popup.find(".div_dc_back").show();
320			cited_popup.find(".popupCite select").trigger("change");
321			cited_popup.find(".div_dc_back select").trigger("change");
322		} else {
323				cited_popup.find(".popupCite").hide();
324				cited_popup.find(".div_dc_back").hide();
325		}
326		return false
327	});
328
329
330
331
332	$(".cited_view").on("click", "a", function(){
333		var cited_popup = $(this).closest("li");
334		if(cited_popup.find(".popupCite").css("display")=="none") {
335			cited_popup.find(".popupCite").show();
336			cited_popup.find(".popupCite select").trigger("change");
337		} else cited_popup.find(".popupCite").hide();
338		return false
339	});
340
341	if ($('form[name="cited_btn"]').length) {
342
343		$('form[name="cited_btn"] select').change( function(){
344			type = $(this).val();
345			number = $(this).parent().find('input:hidden[name="number"]').val();
346			text = $(this).closest("dd").find('.popupCon')[0];
347
348			$.ajax({
349				type: 'POST',
350				data: {type:type, number:number},
351				url: '../journal/ajax_cited_text.php',
352				success: function(result) {
353					text.innerHTML = result;
354				}
355			});
356		});
357
358		$('form[name="cited_btn"] a.btnPoint').on("click", function(){
359			text = $(this).closest("dd").find('.popupCon')[0].innerText;
360			$('#clip_target').val(text);
361			$('#clip_target').select();
362			
363			document.execCommand('copy');
364			alert('Citation successfully copied.');
365		});
366
367	
368
369		$('form[name="cited_btn"] a.btnDef').on("click", function(){
370			type = $(this).val();
371			number = $(this).parent().find('input:hidden[name="number"]').val();
372			text = $(this).closest("dd").find('.popupCon')[0];
373
374			$.ajax({
375				type: 'POST',
376				data: {type:type, number:number},
377				url: '../journal/ajax_cited_text.php',
378				success: function(result) {
379					text.innerHTML = result;
380				}
381			});
382		});
383	}
384});
385
386window.addEventListener('load', function()
387{
388	main_resize();	
389});
390
391
392function main_resize() {
393	var win_w = $(window).width();
394    var main_hot = $("div.mainArticle > div.hot");
395	var max_heignt = 0;
396	var max_heignt_resize_ck = false;
397
398	if (main_hot.length) {
399
400		max_heignt = main_hot[0].clientHeight;
401
402		$("div.hot li.slick-slide").each(function() {
403			if(max_heignt < $(this)[0].clientHeight) {
404				max_heignt = $(this)[0].clientHeight;
405				max_heignt_resize_ck = true;
406			}
407		});
408		
409		$("div.mainArticle > div.hot").css({"height":max_heignt});
410		if(win_w + 16 > 960) {
411
412			$max_height=  (main_hot[0].clientHeight / 3) - 15;
413			if (win_w + 16 > 1360) $max_height= (main_hot[0].clientHeight / 2) - 7.5;
414
415			$("div.mainArticle > ul.articleList > li > a").each(function() {
416				if($max_height < $(this)[0].clientHeight) {
417					$max_height = $(this)[0].clientHeight;	
418				}
419			});
420
421			$("div.mainArticle > ul.articleList > li > a").css({"height":$max_height});
422
423			if (win_w + 16 > 1360) {
424				if(main_hot[0].clientHeight < ($max_height * 2) + 15) {
425					$("div.mainArticle > div.hot").css({"height":($max_height * 2) + 15});
426				}
427			} else {
428				if(main_hot[0].clientHeight < ($max_height * 3) + 30) {
429					$("div.mainArticle > div.hot").css({"height":($max_height * 3) + 30});
430				}
431			}
432		}	
433	}
434}
435
436// 윈도우 창 size 변경시
437$(window).resize(function(){
438
439	var win_w = $(window).width();
440	if (win_w > 960) {
441		//PC	
442		setting_pc();
443		main_resize();
444	} else {
445		//Mobile	
446		setting_mobile();
447	}
448
449	if (hotBnr != null) {
450		hotBnr.destroySlider();
451		hotBnr = null;
452	}
453
454});
455
456//페이지새로고침
457function f_page_reload(){
458	location.href = location.href;
459}	
460
461//필터 초기화
462function f_filter_reset(){
463
464	history.replaceState({}, null, location.pathname);// GET 파라미터가 있는 경우 파라미터 삭제
465
466	$("ul > li > input:checkbox[name='p_filter_topic[]']").each(function() {
467		$(this)[0].checked = false;
468	});
469
470	$("ul > li > input:checkbox[name='p_filter_category[]']").each(function() {
471		$(this)[0].checked = false;
472	});
473	
474	$("ul > li > input:checkbox[name='p_filter_keyword[]']").each(function() {
475		$(this)[0].checked = false;
476	});
477
478	$("ul > li > input:checkbox[name='p_filter_author[]']").each(function() {
479		$(this)[0].checked = false;
480	});
481
482	$("ul > li > input:checkbox[name='p_filter_year[]']").each(function() {
483		$(this)[0].checked = false;
484	});
485
486	$("ul > li > input:checkbox[name='p_filter_fund[]']").each(function() {
487		$(this)[0].checked = false;
488	});
489
490	$('#filter_form')[0].submit();
491	
492}	
493
494
495//페이지 선택
496function page_search(page){
497	$('#page')[0].value = page;
498	$('#filter_form')[0].submit();
499}	
500
501//Mobile
502function setting_mobile() {
503	$("div.wrapper, div#headerWrap, ul#gnb ul, ul.articleList li").removeAttr("style");
504	$("div.mainArticle div.hot, ul.articleList a").removeAttr("style");
505	$("ul#gnb > li").removeClass("on");
506	$("ul#gnb > li, ul#gnb > li > a").off();
507	//$("dl.gnbSearch dt").removeClass("view");
508	//$("dl.gnbSearch dd").hide();
509
510
511	setTimeout(function(){
512		var win_h = $(window).height(),
513			header_h = $("div#headerWrap").outerHeight(),
514			footer_h = $("div#footerWrap").outerHeight(),
515			con_minH = win_h - header_h - footer_h;
516
517		$("div#container").css({"min-height":con_minH})
518
519	}, 300);
520
521
522	$("ul#gnb > li > a").on("click", function(){
523		var sClass = $(this).parent().attr("class");
524		if (sClass == "on") {
525			$(this).parent().removeClass("on");
526			$(this).parent().find("ul").slideUp();
527		} else {
528			//$("dl.gnbSearch dt").removeClass("view");
529			//$("dl.gnbSearch dd").hide();
530
531			$("ul#gnb > li").removeClass("on");
532			$("ul#gnb ul").hide();
533
534			$(this).parent().addClass("on");
535			$(this).parent().find("ul").slideDown();
536		}
537		return false
538	});
539
540
541	if ($("div.lnbWrap").length) {
542
543		$("div.lnbWrap dt").removeClass();
544		$("div.lnbWrap dl, div.lnbWrap dd").removeAttr("style");
545
546		$("div.lnbWrap dt a").on("click", function(){
547			var sClass = $(this).parent().attr("class"),
548				currCon = $(this).parent().next();
549
550			if (sClass == "view") {
551				$(this).parent().removeClass("view");
552				currCon.slideUp();
553			} else {
554				$(this).parent().addClass("view");
555				currCon.slideDown();
556			}
557			return false
558		});
559
560
561		$("body:not(div.lnbWrap)").on("click", function(){
562			$("div.lnbWrap dt").removeClass("view");
563			$("div.lnbWrap dd").hide();
564		});
565
566	}
567
568
569	if (recentBnr != null) {
570		recentBnr.destroySlider();
571		$("div.recent ul, div.recent li").removeAttr("style");
572		recentBnr = null;
573	}
574
575	if (sponBnr != null) {
576		sponBnr.destroySlider();
577		$("div.bnrzone ul, div.bnrzone li").removeAttr("style");
578		sponBnr = null;
579	}
580}
581
582
583
584//PC 
585function setting_pc() {
586	$("body").removeClass("overHidden");
587	$("div.wrapper, ul.headerMenu, div.contents, .toggleCon, ul.subMenu, dl.rwMenu dd, dl.rwMenu li, dl.toggleArea_rw > dd").removeAttr("style");
588	$("div.mainArticle div.hot, ul.articleList a").removeAttr("style");
589	$("ul#gnb > li").removeClass("on");
590	$("ul#gnb > li, ul#gnb > li > a").off();
591	//$("dl.gnbSearch dt").removeClass("view");
592	//$("dl.gnbSearch dd").hide();
593
594	/*
595	setTimeout(function(){
596		for (var i=0; i<$("ul#gnb > li").length ; i++) {
597			var re_poLeft = $("ul#gnb > li > a").eq(i).position().left;
598			$("ul#gnb > li").eq(i).find("ul").css({
599				"left":re_poLeft
600			});
601		}
602	}, 300);
603	*/
604
605	if ($("ul.articleList a").length) {
606		for (var i=0; i<$("ul.articleList a").length; i++) {
607			//var re_paddingB = $("ul.articleList a").eq(i).find("span.type").outerHeight() + 40;
608			var re_paddingB = $("ul.articleList a").eq(i).find("span.type").outerHeight();
609			$("ul.articleList a").eq(i).css({
610				"padding-bottom":re_paddingB
611			});
612		}
613	}
614	/*
615	$("ul#gnb > li").on("mouseenter", function(){
616		if (hideMenu != null) {
617			clearTimeout(hideMenu);
618		}
619		//$("dl.gnbSearch dt").removeClass("view");
620		//$("dl.gnbSearch > dd").hide();
621
622		$("ul#gnb > li").removeClass("on");
623		$("ul#gnb ul").hide();
624
625		
626		$(this).addClass("on");
627		if ($(this).find("ul").length) {
628			$(this).find("ul").show();
629		}
630
631	});
632
633	$("ul#gnb ul").on("mouseenter", function(){
634		if (hideMenu != null) {
635			clearTimeout(hideMenu);
636		}
637	});
638
639	$("ul#gnb").on("mouseleave", function(){
640		hideMenu = setTimeout(function(){
641			$("ul#gnb > li").removeClass("on");
642			$("ul#gnb ul").hide();
643		}, 500);
644	});
645	*/
646
647	if (recentBnr != null) {
648		recentBnr.destroySlider();
649		$("div.recent ul, div.recent li").removeAttr("style");
650		recentBnr = null;
651	}
652
653	if (sponBnr != null) {
654		sponBnr.destroySlider();
655		$("div.bnrzone ul, div.bnrzone li").removeAttr("style");
656		sponBnr = null;
657	}
658
659//반응형 메뉴
660	$(document).ready(function () {
661		main_menu_fixed();
662	});
663
664	if ($("dl.rwMenu").length) {
665
666		var sClass = $("dl.rwMenu ul").attr("class");
667		if (sClass == null) 	{
668			var reW = 100 / $("dl.rwMenu li").length;
669			$("dl.rwMenu li").css({
670				"width" : reW + "%"
671			});
672		}
673	}
674
675	if ($("div.articleBrief").length) {
676		menu_fixed();
677
678		 $("ul.con_menu a").click(function(event){
679			event.preventDefault();
680
681			var move_h = $(this.hash).offset().top - 123,
682				nIdx = $(this).parent().index();
683
684			if ($(".fixedArea").length) {
685				//move_h = move_h;
686			}
687			$('html,body').animate({scrollTop:move_h}, 500);
688
689			$("ul.conMenu li").removeClass("on").eq(nIdx).addClass("on");
690		});
691
692		$(window).on('scroll', function() {
693			var inView = false;
694
695			$('.link-target').each(function(index, element) {
696				var preBasicH = 0;
697				var basicH = $(element).offset().top - 100;
698				if (index > 0) {
699					preElement = $('.link-target').eq(index - 1);
700					preBasicH = preElement.offset().top - 100;
701				} else {
702					preElement = $(element);
703				}
704
705				var preBasicH = preElement.offset().top - 220;
706				var basicH = $(element).offset().top - 220;
707				var scrollTop = $(window).scrollTop();
708
709				if(basicH > scrollTop && scrollTop >= preBasicH) {
710					inView = true;
711					var sID = preElement.attr('id');
712					$('ul.con_menu a').removeClass('on');
713					var selectedElement = $('ul.con_menu a[href=#'+ sID +']');
714					selectedElement.addClass('on');
715
716					var ulTop = $('ul.con_menu').offset().top;
717					var elementTop = selectedElement.offset().top;
718					if(elementTop < ulTop) {
719						$('ul.con_menu').scrollTop($('ul.con_menu').scrollTop() - (ulTop - elementTop));
720					}
721
722					var ulBottom = $('ul.con_menu').offset().top + $('ul.con_menu').outerHeight();
723					var elementBottom = selectedElement.offset().top + selectedElement.outerHeight();
724					if(elementBottom > ulBottom) {
725						$('ul.con_menu').scrollTop($('ul.con_menu').scrollTop() + (elementBottom - ulBottom));
726					}
727					return false;
728				}
729
730				var scrollValue = $(window).scrollTop(),
731				basic_h = $("div#headerWrap").outerHeight() + $("div.titArea").outerHeight() + $("div.articleBrief").outerHeight();
732
733				//console.log('Scroll Value: ', scrollValue);
734				//console.log('Basic Height: ', basic_h);
735
736				if (index === ($('.link-target').length - 1) && scrollValue > basic_h) {
737					inView = true;
738					var sID = $(element).attr('id');
739					$('ul.con_menu a').removeClass('on');
740					var selectedElement = $('ul.con_menu a[href=#'+ sID +']');
741					selectedElement.addClass('on');
742
743					var ulTop = $('ul.con_menu').offset().top;
744					var elementTop = selectedElement.offset().top;
745					if(elementTop < ulTop) {
746						$('ul.con_menu').scrollTop($('ul.con_menu').scrollTop() - (ulTop - elementTop));
747					}
748
749					var ulBottom = $('ul.con_menu').offset().top + $('ul.con_menu').outerHeight();
750					var elementBottom = selectedElement.offset().top + selectedElement.outerHeight();
751					if(elementBottom > ulBottom) {
752						$('ul.con_menu').scrollTop($('ul.con_menu').scrollTop() + (elementBottom - ulBottom));
753					}
754				}
755			});
756
757			if (!inView) {
758				$('ul.con_menu a').removeClass('on');
759			}
760		});
761	}
762}
763
764function main_menu_fixed() {
765	$(window).scroll(function() {
766		var scrollValue = $(window).scrollTop(),
767		basic_h = $("div#headerWrap").outerHeight()-57;
768		if (scrollValue > basic_h) {
769			$("div.header__container").addClass("fixed");
770			$("dl.gnbSearch").addClass("fixed");
771			$(".article_paging").addClass("fixed");
772			$(".top_btn").addClass("fixed");
773		} else {
774			$("div.header__container").removeClass("fixed");
775			$("dl.gnbSearch").removeClass("fixed");
776			$(".article_paging").removeClass("fixed");
777			$(".top_btn").removeClass("fixed");
778		}
779	});
780}
781
782    $(document).ready(function(){
783        $('.top_btn').on('click', function(){
784            $('html, body').animate({scrollTop: '0'}, 500);
785        })
786    })
787    $(window).scroll(function() {
788        var scroll = $(window).scrollTop();
789        //console.log(scroll);
790        if (scroll >= 500) {
791            //console.log('a');
792            $(".top_btn").addClass("on");
793        } else {
794            //console.log('a');
795            $(".top_btn").removeClass("on");
796        }
797    });
798
799function menu_fixed() {
800	$(window).scroll(function() {
801		var scrollValue = $(window).scrollTop(),
802		basic_h = $("div#headerWrap").outerHeight() + $("div.titArea").outerHeight() + $("div.articleBrief").outerHeight();
803		if (scrollValue > basic_h) {
804			$("div.articleMenu").addClass("fixed")
805		} else {
806			$("div.articleMenu").removeClass("fixed")
807		}
808	});
809
810	$(window).scroll(function() {
811		var menuPosition = ($(window).scrollTop() + $("ul.conMenu").height());
812		var containerHeight = ($('#container').height() + 113);
813		var bottomLimit = 109 - (menuPosition - containerHeight);
814
815		if(menuPosition > containerHeight) {
816			$("ul.conMenu").css("top", bottomLimit + 'px');
817		} else if (bottomLimit != 109) {
818			$("ul.conMenu").css("top", "");
819		}
820	});
821}
822
823function journal_download(type, sid, filename) {
824	var increase_column;
825
826	if(type == "pdf") {
827		var openWindow = window.open("about:blank");
828		openWindow.location.href = '/upload/pdf/' + filename;
829
830		increase_column = "pdf_down";
831
832	} else if(type == "pdf_a") {
833		var openWindow = window.open("about:blank");
834		openWindow.location.href = '/upload/article/' + filename;
835
836		increase_column = "pdf_down";
837
838	} else if(type == "epub") {		
839		location.href = '/func/download.php?' + filename;		
840		increase_column = "epub_down";
841	}
842
843	$.ajax({
844		type: 'POST',
845		data: {table: 'journal_tbl', column: increase_column, count: 1, condition_column: 'sid', condition_value: sid},
846		url: '/func/count_increase.php'
847	});
848}
849
850
851function openPhotoView(obj,xml_file,img_file) {
852	if (window.outerWidth >= 1361) {
853		$.ajax({
854			type: 'POST',
855			data: {xml_file: xml_file,img_file:img_file},
856			url: '/journal/image_view_text.php',
857			success: function(result) {
858				$(".main_image_txt").append(result);
859			}
860		});
861
862		var y = $(this).scrollTop();
863		$("#overlay").css("margin-top", y-250);
864		$("#overlay").css("z-index", 101);
865		$("#overlay").show();
866		thumb_array = new Array();
867
868
869		console.log(obj);
870		$(obj).parent().parent().find('img.article_image').each(function (index) {
871			thumb_array.push($(this).attr("src"));
872			if($(obj).attr("src") == $(this).attr("src")) {
873				thumb_index = index;
874				//썸네일 이미지 확대시 원본 이미지를 보여주기 위함.
875				img_name = $(this).attr("src");
876				
877
878				
879				if (img_name.match('thum_')) { //썸네일 이미지일 경우 
880					value = img_name.replace(/thum_/,''); //특정문자 제거
881					changeMainImage(value);
882				}else { //원본 이미지 일 경우
883					changeMainImage($(this).attr("src"));
884				}
885
886
887				//changeMainImage($(this).attr("src"));
888			}
889		});
890	}
891}
892
893
894function openPhotoView_MainPage(obj,xml_file,img_file) {
895
896
897	if (window.outerWidth >= 1361) {
898
899		event.preventDefault();
900
901		$.ajax({
902			type: 'POST',
903			data: {xml_file: xml_file,img_file:img_file},
904			url: '/journal/image_view_text.php',
905			success: function(result) {
906				$(".main_image_txt").append(result);
907			}
908		});
909
910		var y = $(this).scrollTop();
911		//$("#overlay").css("margin-top", y-250);
912		$("#overlay").css("margin-top", y+100);
913		$("#overlay").css("z-index", 101);
914		$("#overlay").show();
915		thumb_array = new Array();
916
917
918		console.log(obj);
919		$(obj).parent().parent().find('img.article_image').each(function (index) {
920			thumb_array.push($(this).attr("src"));
921			if($(obj).attr("src") == $(this).attr("src")) {
922				thumb_index = index;
923				//썸네일 이미지 확대시 원본 이미지를 보여주기 위함.
924				img_name = $(this).attr("src");
925				
926
927				
928				if (img_name.match('thum_')) { //썸네일 이미지일 경우 
929					value = img_name.replace(/thum_/,''); //특정문자 제거
930					changeMainImage(value);
931				}else { //원본 이미지 일 경우
932					changeMainImage($(this).attr("src"));
933				}
934
935
936				//changeMainImage($(this).attr("src"));
937			}
938		});
939
940		
941	}
942}
943
944
945function openPhotoView_btn(obj,xml_file,img_file) {
946	if (window.outerWidth >= 1361) {
947		img_file = "/upload/thumbnails/"+img_file;
948		changeMainImage(img_file);
949
950
951		var y = $(this).scrollTop();
952		$("#overlay").css("margin-top", y+150);
953		$("#overlay").css("z-index", 101);
954		$("#overlay").show();
955		thumb_array = new Array();
956		$(obj).parent().parent().find('img.article_image').each(function (index) {
957			thumb_array.push($(this).attr("src"));
958			if($(obj).attr("src") == $(this).attr("src")) {
959				thumb_index = index;
960				console.log(thumb_index);
961
962				img_name = $(this).attr("src");
963				if (img_name.match('thum_')) { //썸네일 이미지일 경우 
964					value = img_name.replace(/thum_/,''); //특정문자 제거
965					changeMainImage(value);
966				}else { //원본 이미지 일 경우
967					changeMainImage($(this).attr("src"));
968				}
969				//170302_저널_김마루_변경	
970			}
971		});
972	}
973}
974
975
976function closePhotoView() {
977	$('#overlay').hide();
978	$(".change_txt").remove();
979	thumb_array = new Array();
980}
981
982function changeMainImage(src) {
983
984	$("<img />").attr("src", src).load(function() {
985		var ratio = 800 / this.width;
986		var width = this.width * ratio;
987		var height = this.height * ratio;
988		if(height > 448) {
989			ratio = 448 / this.height;
990			width = this.width * ratio;
991			height = this.height * ratio;
992		}
993		$("#overlay #main_image_wrap #main_image").attr('src', this.src
993);
994		$("#overlay #main_image_wrap #main_image").attr('width', width);
995		$("#overlay #main_image_wrap #main_image").attr('height', height);
996	});
997}
998
999
1000$(window).resize(function (){  
1001	if (window.outerWidth <= 1361) {
1002		closePhotoView();
1003	}
1004})
1005
1006
1007$(function() {
1008    // 스크롤 로직을 함수로 분리
1009    function scrollToTarget(targetHash) {
1010        var target = $(targetHash);
1011        if (target.length) {
1012            var header_height = $('.fixed').height() || 0; // 높이가 정의되지 않은 경우 0으로 처리
1013            var articleMenu_height = $('.articleMenu').height() || 0; // 높이가 정의되지 않은 경우 0으로 처리
1014            var offset_top;
1015
1016            // 목표 위치 계산
1017            offset_top = target.offset().top - header_height - articleMenu_height;
1018
1019            // 스크롤 이동
1020            $('html, body').animate({ scrollTop: offset_top }, 1, function() {
1021                window.location.hash = targetHash; // URL에 앵커 추가
1022                
1023                // 목표 위치에 도달한 후 추가로 300px 아래로 스크롤
1024                $('html, body').animate({ scrollTop: offset_top - 8}, 1);
1025            });
1026        } else {
1027            console.error("Target element not found:", targetHash); // 오류 로그 출력
1028        }
1029    }
1030
1031    // 페이지 로드 시 앵커로 이동
1032    if (window.location.hash) {
1033        scrollToTarget(window.location.hash);
1034    }
1035
1036    // 링크 클릭 시 앵커로 이동
1037    $('a[href*="#"]:not([href="#"])').click(function(event) {
1038        var thisDomain = window.location.hostname;
1039        var linkDomain = this.hostname;
1040
1041        if (thisDomain === linkDomain && this.pathname === window.location.pathname) {
1042            event.preventDefault(); // 기본 동작 막기
1043            var targetHash = this.hash;
1044            scrollToTarget(targetHash); // 함수 호출
1045        } else {
1046            // 다른 페이지로 이동 (기본 동작 수행)
1047            window.location.href = this.href;
1048        }
1049    });
1050});
1051

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.