function isMobile() { var UserAgent = navigator.userAgent; if (UserAgent.match(/iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null) { return true; } else { return false; } } if(isMobile()){ $("html").addClass("mobile"); }else{ $("html").addClass("pc"); } function topNav(){ var $headerNav = $(".header-nav"); var $headerNavDep1 = $(".header-nav .gnav-dep1"); $headerNavDep1.mouseenter(gnavOpen); $headerNav.mouseleave(gnavClose); $headerNavDep1.children().children("a").keydown(function(e){ if(e.keyCode == 13){ e.preventDefault(); $headerNav.hasClass("active") ? gnavClose() : gnavOpen(); } }); $headerNavDep1.find("a").last().focusout(gnavClose); $headerNavDep1.children().children("a").focus(function(e){ gnavOpen(); }); function gnavOpen(){ $headerNav.addClass("active"); } function gnavClose(){ $headerNav.removeClass("active"); } } function mobileNav(index){ //$("#gnav-m").html($("#gnav").html()); $(".mobile-nav .gnav-dep3").parent().addClass("is-sub"); //$(".mobile-nav .gnav-dep1").children().eq(index-1).addClass("on"); $("#gnav-m .btn-all-menu").remove(); var $headerNav = $(".mobile-nav"); var $btn = $(".btn-mobile-menu"); $btn.click(function(){ if(!$(this).hasClass("active")){ gnavOpen(); }else{ gnavClose(); } }); function gnavOpen(){ $headerNav.addClass("active"); $btn.addClass("active"); $("html").css("overflow", "hidden"); } function gnavClose(){ $headerNav.removeClass("active"); $btn.removeClass("active"); $("html").css("overflow", "auto"); } $(".mobile-nav .gnav-dep1 > li > a").click(function(e){ e.preventDefault(); $(this).parent().toggleClass("active"); }); $(".mobile-nav .gnav-dep2 > li.is-sub > a").click(function(e){ e.preventDefault(); $(this).parent().toggleClass("active"); }); } //°ü·Ã»çÀÌÆ® function fn_colleague() { var linkValue = document.getElementById("site_link2").value; if( linkValue == "nonexecutive_director"){ window.open('/jsppage/bisangim/news/02_news_01.jsp', '', ''); } else if(linkValue == "committee"){ window.open('/jsppage/judge/main.jsp', '', ''); } else if(linkValue == "committee2"){ window.open('/jsppage/disabilityJudge/main.jsp', '', ''); } else if(linkValue == "employe_email"){ window.open('http://mail.nps.or.kr', '', ''); } else if(linkValue == "obstacle"){ window.open('/jsppage/welfare/welfare_service_login_01.jsp', 'name', 'width=800,height=700,toolbar=no,menubar=no,scrollbars=auto,resizable=yes,location=no,directories=no,status=no'); } else if(linkValue == "citizenComm"){ window.open('/jsppage/citizenComm/news/02_news_01.jsp', '', ''); } else if(linkValue == "suggest_pop"){ window.open('/jsppage/intro/nps/consult/suggest_form.jsp', 'name', 'width=710,height=620,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=no'); } } function fn_site() { var linkValue = document.getElementById("site_link3").value; if(linkValue == "mohw"){ window.open('http://www.mohw.go.kr', '', ''); } else if(linkValue == "nhis"){ window.open('http://www.nhis.or.kr', '', ''); } else if(linkValue == "edi"){ window.open('https://edi.nps.or.kr', '', ''); } else if(linkValue == "public"){ window.open('/jsppage/publicPension/publicPension/main.html', 'name1', 'width=980,height=725,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no'); } else if(linkValue == "4insure"){ window.open('http://www.4insure.or.kr', '', ''); } else if(linkValue == "resort"){ window.open('https://www.cheongpungresort.co.kr/web/kor/asp/index/index.asp', '', ''); } } function fn_site_m() { var linkValue = document.getElementById("site_link4").value; if(linkValue == "mohw"){ window.open('http://www.mohw.go.kr', '', ''); } else if(linkValue == "nhis"){ window.open('http://www.nhis.or.kr', '', ''); } else if(linkValue == "go"){ window.open('http://www.ei.go.kr', '', ''); } else if(linkValue == "san"){ window.open('http://www.kcomwel.or.kr', '', ''); } else if(linkValue == "webmail"){ window.open('http://mail.nps.or.kr', '', ''); } else if(linkValue == "resort"){ window.open('http://m.nps.or.kr/jsppage/mobile/vi/visit_01.jsp', '', ''); } } $(document).ready(function () { topNav(); //¸ð¹ÙÀϸ޴º //mobileNav(onIndex); mobileNav(); //¾ð¾î¼±Åà $(".select-lang button").click(function(){ $(this).next().toggleClass("active"); }) $(".select-lang").mouseleave(function(){ $(this).children(".select-lang-list").removeClass("active"); }) $(".select-lang").find("a").last().focusout(function(){ $(".select-lang .select-lang-list").removeClass("active"); }) //°¡·Î»çÀÌÁî üũ //deviceWidthSet(); function deviceWidthSet(){ var winWidth = $("html").width(); widthCheck(winWidth); $(window).resize(function(){ winWidth =$("html").width(); }, function(){ widthCheck(winWidth); }); function widthCheck(width){ //console.log(width); if(width > 1024){ $("html").removeClass("w-mobile").addClass("w-pc"); }else{ $("html").removeClass("w-pc").addClass("w-mobile"); } } } //Àüü¸Þ´º if($(".btn-all-menu").find("span").length < 1){ $(".btn-all-menu").append("¿­±â"); } $(".btn-all-menu").click(function(){ var $headerNav = $(".header-nav"); var $btn = $(this); if($headerNav.hasClass("type-allmenu")){ $headerNav.removeClass("type-allmenu"); $headerNav.removeClass("active"); $btn.children("span").text("¿­±â"); }else{ $headerNav.addClass("type-allmenu"); $("#gnav .gnav-dep1 a").first().focus(); $btn.children("span").text("´Ý±â"); } }); //ÆäÀÌÁöÀ§Ä¡-¸ð¹ÙÀÏ¿ë $(".page-name").append("
"+$(".section-head .section-route").html()+"
"); //°Ô½ÃÆÇ °Ë»öÆû $(".data-search-wrap").each(function () { if ($(this).find(".keyword-guide").length > 0) { $(this).addClass("is-guide"); } }); //ÅǸ޴º $(".tabWrap").each(function () { var $tabNav = $(this).find(".tabNav"); var $tabNav_a = $(this).find(".tabNav a"); var $tabContents = $(this).find(".tabContents"); var $tabPage = $(this).find(".tabPage"); var ACTIVE_NAME = "active"; if ($(this).attr("data-tab-active") != undefined) { var activeNum = parseInt($(this).attr("data-tab-active")); $tabNav.children().eq(activeNum).addClass(ACTIVE_NAME); $tabContents.children().eq(activeNum).addClass(ACTIVE_NAME); } else { $tabNav.children().first().addClass(ACTIVE_NAME); $tabContents.children().first().addClass(ACTIVE_NAME); } $tabNav_a.click(function (e) { e.preventDefault(); var target = $(this).attr("href"); $(".con-tab-nav .active a").removeAttr("title"); $(this).parent().siblings(".active").removeClass(ACTIVE_NAME); $(this).parent().addClass(ACTIVE_NAME); $(".con-tab-nav .active a").attr("title","¼±ÅõÊ"); $tabPage.removeClass(ACTIVE_NAME); $tabContents.find(target).addClass(ACTIVE_NAME); //$(target).attr("tabIndex","0").focus(); }); }); //side nav $(".side-dep2-list").parent().addClass("is-sub"); $(".side-dep1-a").click(function(e){ var $parent = $(this).parent(); if($parent.hasClass("is-sub")){ e.preventDefault(); if($parent.hasClass("active")){ $parent.removeClass("active"); }else{ $parent.siblings(".active").removeClass("active"); $parent.addClass("active"); } } }); //¸ð¹ÙÀÏ - °Ô½ÃÆǸñ·Ï °øÁö ¿ÀÇ $(".m-data-list td.no").each(function(){ if($(this).find("img").length > 0){ $(this).parent().addClass("notice"); } }); $(".m-data-list td.file").each(function(){ if($(this).find("img").length < 1){ $(this).html(""); $(this).css("padding","0 !important"); } }); $(".infoCategory .active a").attr("title","¼±ÅõÊ"); $(".con-tab-nav .active a").attr("title","¼±ÅõÊ"); $(".statistics-tab-nav .active a").attr("title","¼±ÅõÊ"); $(".paging .current").attr("title","ÇöÀçÆäÀÌÁö"); $(".page-part-info .copy img").attr("alt", "±¹¹ÎÀ» µçµçÇÏ°Ô ¿¬±ÝÀ» Æ°Æ°ÇÏ°Ô"); });