<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
	$(window).scroll(function() {
		var scrollValue = $(window).scrollTop(),
		basic_h = $(".header_wrap").outerHeight()+50;
		if (scrollValue &gt; basic_h) {
			$("div.navigation_wrap").addClass("fixed");
			$("dl.gnbSearch").addClass("fixed");
			$(".article_paging").addClass("fixed");
			$(".wrapper").addClass("fixed");
			$(".top_btn").addClass("fixed");
		} else {
			$("div.navigation_wrap").removeClass("fixed");
			$("dl.gnbSearch").removeClass("fixed");
			$(".article_paging").removeClass("fixed");
			$(".wrapper").removeClass("fixed");
			$(".top_btn").removeClass("fixed");
		}
	});


//View Page JS

function journal_download(type, sid, filename) {
	var increase_column;

	if(type == "pdf") {
		var openWindow = window.open("about:blank");
		openWindow.location.href = '/upload/pdf/' + filename;

		increase_column = "pdf_down";

	} else if(type == "pdf_a") {
		var openWindow = window.open("about:blank");
		openWindow.location.href = '/upload/article/' + filename;

		increase_column = "pdf_down";

	} else if(type == "epub") {		
		location.href = '/func/download.php?' + filename;		
		increase_column = "epub_down";
	}

	$.ajax({
		type: 'POST',
		data: {table: 'journal_tbl', column: increase_column, count: 1, condition_column: 'sid', condition_value: sid},
		url: '/func/count_increase.php'
	});
}




// Photo Viewer Functions

function openPhotoView(obj, xml_file, img_file) {
    if (window.outerWidth &gt;= 1361) {
        fetchImageData(xml_file, img_file);
        initializeOverlay();
        handleThumbnail(obj);
    }
}

function openPhotoView_MainPage(obj, xml_file, img_file) {
    if (window.outerWidth &gt;= 1361) {
        event.preventDefault();
        fetchImageData(xml_file, img_file);
        initializeOverlay();
        handleThumbnail(obj);
    }
}

function openPhotoView_btn(obj, xml_file, img_file) {
    if (window.outerWidth &gt;= 1361) {
        img_file = `/upload/thumbnails/${img_file}`;
        changeMainImage(img_file);
        initializeOverlay();
        handleThumbnail(obj);
    }
}

function fetchImageData(xml_file, img_file) {
    $.ajax({
        type: 'POST',
        data: { xml_file: xml_file, img_file: img_file },
        url: '/journal/image_view_text.php',
        success: function (result) {
			$(".main_image_txt").html("");
            $(".main_image_txt").append(result);
        }
    });
}

function initializeOverlay() {
    $("#overlay").show();
    thumb_array = [];
}

function handleThumbnail(obj) {
    $(obj).parent().parent().find('img.article_image').each(function (index) {
        thumb_array.push($(this).attr("src"));

        if ($(obj).attr("src") === $(this).attr("src")) {
            thumb_index = index;
            let img_name = $(this).attr("src");

            if (img_name.includes('thum_')) {
                const originalImage = img_name.replace(/thum_/, '');
                changeMainImage(originalImage);
            } else {
                changeMainImage(img_name);
            }
        }
    });
}

function closePhotoView() {
    $('#overlay').hide();
    $(".change_txt").remove();
    thumb_array = [];
}

function changeMainImage(src) {
    $("&lt;img /&gt;").attr("src", src).on("load", function () {
        let ratio = 800 / this.width;
        let width = this.width * ratio;
        let height = this.height * ratio;

        if (height &gt; 448) {
            ratio = 448 / this.height;
            width = this.width * ratio;
            height = this.height * ratio;
        }

        const mainImage = $("#overlay #main_image_wrap #main_image");
        mainImage.attr('src', this.src);
        mainImage.attr('width', width);
        mainImage.attr('height', height);
    });
}


//페이지 선택
function page_search(page){
	$('#page')[0].value = page;
	$('#filter_form')[0].submit();
}

//페이지새로고침
function f_page_reload(){
	location.href = location.href;
}	

//필터 초기화
function f_filter_reset(){
	history.replaceState({}, null, location.pathname);// GET 파라미터가 있는 경우 파라미터 삭제
	$("ul &gt; li &gt; input:checkbox[name='p_filter_topic[]']").each(function() {
		$(this)[0].checked = false;
	});
	$("ul &gt; li &gt; input:checkbox[name='p_filter_category[]']").each(function() {
		$(this)[0].checked = false;
	});
	$("ul &gt; li &gt; input:checkbox[name='p_filter_keyword[]']").each(function() {
		$(this)[0].checked = false;
	});
	$("ul &gt; li &gt; input:checkbox[name='p_filter_author[]']").each(function() {
		$(this)[0].checked = false;
	});
	$("ul &gt; li &gt; input:checkbox[name='p_filter_year[]']").each(function() {
		$(this)[0].checked = false;
	});
	$("ul &gt; li &gt; input:checkbox[name='p_filter_fund[]']").each(function() {
		$(this)[0].checked = false;
	});
	$('#filter_form')[0].submit();

}

///////////////Main Page function/////////////////////////

function Main_goPage(vol, no) {
	
	var f = document.paging;

	f.vol.value = vol;
	f.no.value = no;

	f.action = "./index.php"

	f.method = "post"
	f.submit();
	
};

///////////////View Page function/////////////////////////

function View_XMLDownload(doi) {
	
	var f = document.paging;
	f.doi.value = doi;
	f.action = "./scholar_xmls.php";
	f.method = "post"
	f.submit();
	
	
};

//////////////////////////////////////////////////////////


$(window).resize(function () {
    if (window.outerWidth &lt;= 1361) {
        closePhotoView();
    }
});

$(function () {

///////////////////////filter script	/////////////////////////////
	$(document).on("click","a#filter_category_more",function() {
		
		if($("#filter_category_layer").css("display") == "none"){
			$('#filter_category_layer').show();
		} else {
			$('#filter_category_layer').hide();
		}

		return false
	});

	$(document).on("click","a#filter_topic_more",function() {
		
		if($("#filter_topic_layer").css("display") == "none"){
			$('#filter_topic_layer').show();
		} else {
			$('#filter_topic_layer').hide();
		}

		return false
	});

	$(document).on("click","a#filter_keyword_more",function() {
		
		if($("#filter_keyword_layer").css("display") == "none"){
			$('#filter_keyword_layer').show();
		} else {
			$('#filter_keyword_layer').hide();
		}

		return false
	});

	$(document).on("click","a#filter_author_more",function() {
		
		if($("#filter_author_layer").css("display") == "none"){
			$('#filter_author_layer').show();
		} else {
			$('#filter_author_layer').hide();
		}

		return false
	});

	$(document).on("click","a#filter_year_more",function() {
		
		if($("#filter_year_layer").css("display") == "none"){
			$('#filter_year_layer').show();
		} else {
			$('#filter_year_layer').hide();
		}

		return false
	});

	$(document).on("click","a#filter_fund_more",function() {
		
		if($("#filter_fund_layer").css("display") == "none"){
			$('#filter_fund_layer').show();
		} else {
			$('#filter_fund_layer').hide();
		}

		return false
	});

	$('ul &gt; li &gt; input:checkbox').on("click", function(){		
		var this_name = $(this)[0].name;
		var this_value = $(this)[0].value;
		var this_checked = $(this)[0].checked;

		$('ul &gt; li &gt; input:checkbox').each(function() {
			if($(this)[0].name == this_name &amp;&amp; $(this)[0].value == this_value) { 
				$(this)[0].checked = this_checked;
			}
		});
	});

	$('ul[name="filter"] &gt; li &gt; input:checkbox').on("click", function(){	
		history.replaceState({}, null, location.pathname);// GET 파라미터가 있는 경우 파라미터 삭제
		$('#page')[0].value = "1";
		$('#filter_form')[0].submit();
	});

	//filer layer
	$(document).on("click","input#filter_layer_submit",function() {
		history.replaceState({}, null, location.pathname);// GET 파라미터가 있는 경우 파라미터 삭제
		$('#page')[0].value = "1";
		$('#filter_form')[0].submit();
	});

	$(document).on("click","a#filter_layer_close",function() {
		$('.layer_pop').each(function() {
			$(this).hide();
		});
	});	

	//기타
	$(document).on("click","span[name='funded_link']",function() {
		var this_value = $(this)[0].innerText;

		$("ul &gt; li &gt; input:checkbox[name='p_filter_fund[]']").each(function() {
			if($(this)[0].value == this_value) { 
				$(this)[0].checked = true;
			}
		});

		$('#page')[0].value = "1";
		$('#filter_form')[0].submit();
	});
//////////////////////////////////////////////////////////////////////////


////////////////viewpage script///////////////////////////

    $('form[name="cited_btn"] a.btnPoint_down').on("click", function (e) {
        e.preventDefault(); // 기본 동작 방지

        // .layer_pop 요소 찾기
        //var cited_popup = $(this).closest(".layer_pop");
		var cited_popup = $(this).closest(".articleAside").find(".layer_pop");

		// .layer_pop의 display 속성 확인 및 토글
		if (cited_popup.is(":hidden")) {
			cited_popup.show(); // 보이기
		} else {
			cited_popup.hide(); // 숨기기
		}

        return false;
    });

    // Close 버튼 클릭 이벤트
    $(".layer_pop .close").on("click", function (e) {
        e.preventDefault(); // 기본 동작 방지

        // .layer_pop 숨기기
        $(this).closest(".layer_pop").hide();

        return false;
    });

    // 닫기 버튼(.close_ic a) 클릭 이벤트
    $(".close_ic a").on("click", function (e) {
        e.preventDefault(); // 기본 동작 방지

        // .close_ic 기준으로 .div_dc_back 숨기기
        var cited_popup = $(this).closest(".div_dc_back");
        cited_popup.hide();

        return false;
    });

	if ($('form[name="cited_btn"]').length) {

		$('form[name="cited_btn"] select').change( function(){
			type = $(this).val();
			number = $(this).closest('.popupWrap').find('input:hidden[name="number"]').val();
			//text = $(this).closest("dd").find('.popupCon')[0];
			text = $(this).closest('.popupWrap').find('#cited_text');
			$.ajax({
				type: 'POST',
				data: {type:type, number:number},
				url: '../journal/ajax_cited_text.php',
				success: function(result) {
					text.html(result);
				}
			});
		});

		$('form[name="cited_btn"] a.btnPoint').on("click", function(){
			//text = $(this).closest("dd").find('.popupCon')[0].innerText;
			var text = $(this).parents(".popupWrap").find("#cited_text").text();
			$('#clip_target').val(text);
			$('#clip_target').select();
			
			document.execCommand('copy');
			alert('Citation successfully copied.');
		});

	

		$('form[name="cited_btn"] a.btnDef').on("click", function(){
			type = $(this).val();
			number = $(this).closest('.popupWrap').find('input:hidden[name="number"]').val();
			//text = $(this).closest("dd").find('.popupCon')[0];
			text = $(this).closest('.popupWrap').find('#cited_text');
			$.ajax({
				type: 'POST',
				data: {type:type, number:number},
				url: '../journal/ajax_cited_text.php',
				success: function(result) {
					text.html(result);
				}
			});
		});
	}
//////////////////////////////////////////////////////////
	/*
    $('a[href*="#"]:not([href="#"])').click(function () {
        event.preventDefault();
        const target = $(this.hash);
        const headerHeight = $('.header__container').height();
        const articleMenuHeight = $('.articleMenu').height() || 0;
        const offsetTop = target.offset().top - (headerHeight + articleMenuHeight);

        $('html, body').animate({ scrollTop: offsetTop }, 1);
    });
	*/

    function scrollToAnchor() {
        var target = $(window.location.hash);
        if (target.length) {
            var header_height = $('.navigation_wrap').height() || 0;
            var articleMenu_height = $('.articleMenu').height() || 0;
			alert(header_height);
			alert(articleMenu_height);
            var offset_top = target.offset().top - (header_height + articleMenu_height + 150);
            $('html, body').stop(true, true).animate({scrollTop: offset_top}, 500);
        }
    }
	/*
    // 링크 클릭 시 앵커로 이동
    $('a[href*="#"]:not([href="#"])').click(function(event) {
        var thisDomain = window.location.hostname;
        var linkDomain = this.hostname;

        if (thisDomain === linkDomain) {
            event.preventDefault();
            window.location.hash = this.hash; // URL에 앵커 추가
            scrollToAnchor(); // 스크롤 이동
        } else {
            window.location.href = this.href; // 다른 도메인으로 가는 경우 기본 동작 수행
        }
    });
	*/

	$('a[href*="#"]:not([href="#"])').click(function (event) {
		const href = $(this).attr('href'); // 클릭된 링크의 href
		const currentUrl = window.location.origin + window.location.pathname; // 현재 페이지의 URL (도메인+경로)
		const targetUrl = href.split('#')[0] ? new URL(href, window.location.origin).href : currentUrl; // 링크의 URL (앵커 제외)

		// 같은 페이지 내 앵커인지 확인
		const isSamePage = currentUrl === targetUrl;

		if (isSamePage) {
			// 같은 페이지 내 앵커 처리
			event.preventDefault(); // 기본 동작 방지
			const target = $(this.hash); // 앵커 타겟
			if (target.length) {
				const headerHeight = $('.navigation_wrap').height() || 0;
				const articleMenuHeight = $('.articleMenu').height() || 0;
				const offsetTop = target.offset().top - (headerHeight + articleMenuHeight);

				// 스크롤 애니메이션
				$('html, body').stop(true, true).animate({ scrollTop: offsetTop }, 500);
			}
		} else {
			// 다른 페이지 이동
			// 이동 후 앵커 동작을 브라우저 기본 동작에 맡김
		}
	});


});

	//Supple 관련
	$(window).on("load", function () {
		const hash = window.location.hash;
		if(hash){
			if (hash === "#supplementary-material" || hash === "#supplementary-materials") {
				const targetLink = $('.conMenu li a').filter(function () {
					return $(this).text().trim().toLowerCase() === "supplementary materials" ||
						   $(this).text().trim().toLowerCase() === "supplementary material";
				});

				if (targetLink.length) {
					// 링크에 "on" 클래스 추가
					$('.conMenu li a').removeClass('on'); // 다른 링크의 "on" 클래스 제거
					targetLink.addClass('on');

					// 스크롤 이동
					const headerHeight = $('.navigation_wrap').height();
					const articleMenuHeight = $('.articleMenu').height() || 0;
					const targetSection = $(targetLink.attr('href')); // 링크의 href 속성을 기준으로 섹션 찾기
					if (targetSection.length) {
						const offsetTop = targetSection.offset().top - (headerHeight + articleMenuHeight);
						$('html, body').animate({ scrollTop: offsetTop }, 1);
					}
				}

			}
		}
	});</pre></body></html>