function fileCheck( file )
{
    // 사이즈체크
    var maxSize  = 10 * 1024 * 1024    //30MB
    var fileSize = 0;

    // 브라우저 확인
    var browser=navigator.appName;

    // 익스플로러일 경우
    if (browser=="Microsoft Internet Explorer")
    {
        var oas = new ActiveXObject("Scripting.FileSystemObject");
        fileSize = oas.getFile( file.value ).size;
    }
    // 익스플로러가 아닐경우
    else
    {
        fileSize = document.getElementById("s3-file").files[0].size;
    }

    if(fileSize > maxSize)
    {
        alert("첨부파일 사이즈는 10MB 이내로 등록 가능합니다.    ");
        throw "stop";
    }


}

var LinkDaph1;
var LinkDaph2;

//오늘하루만 닫기
function setCookiePop(name, value, expiredays) {
	var todayDate = new Date();   
    todayDate = new Date(parseInt(todayDate.getTime() / 86400000) * 86400000 + 54000000);
    if ( todayDate > new Date() ){  
    	expiredays = expiredays - 1;  
    } 
    todayDate.setDate( todayDate.getDate() + expiredays );   
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"   
}

function getCookiePop(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0) {
			return null;
		}
	} else {
		begin += 2;
	}

	var end = document.cookie.indexOf(";", begin);
	if (end == -1) {
		end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}


$(document).ready(function(){
	/* gnb pc링크를 넣기 */
	var daph1=new Array();
	var daph2=new Array();
	var temp=new Array();
	for(var menu1=0;menu1<$(".all-menu-con > li").length;menu1++){
		daph1.push($(".all-menu-con > li:eq("+menu1+") .menu-tit > a").attr("href"));
		daph2[menu1]=new Array();
	}
	LinkDaph1=daph1;
	LinkDaph2=daph2;
	
	/* 팝업창 */
	$('#slider001').flexslider({
		animation: "fade",
		animationLoop: true,
		smoothHeight: false,
		slideshow: true,
		slideshowSpeed:5000,
		animationSpeed: 600,
		controlNav: true,
		directionNav: true,
		prevText: "이전",
		nextText: "다음",
		pausePlay: true
	});
	$(".popDiv a").click(function(){
		if($(this).hasClass("on")){
			$("#slider001").slideUp("fast");
			//$(this).find("img").attr({"src":$(this).find("img").attr("src").replace("_up","_down"),"alt":"상단배너 열기"});
			$(this).text("배너 ▼");
			$(".popDiv a").attr("title","배너열기");
			$(this).removeClass("on");
			setCookiePop("copyright_pop","bannerClose",1);
		}else{
			$("#slider001").slideDown("fast");
			//$(this).find("img").attr({"src":$(this).find("img").attr("src").replace("_down","_up"),"alt":"상단배너 닫기"});
			$(this).text("배너 ▲");
			$(".popDiv a").attr("title","배너닫기");
			$(this).addClass("on");
			setCookiePop("copyright_pop","",-1);
		}
	});
	
	/* 팝업창 */

    /*주요서비스 전체보기*/
    /*주요서비스 전체보기*/
    var btn_service = $('#btn-service');
    var service_area = $('#main-service-area');
    var service_bg = $('#main-service-bg');
    btn_service.click(function() {
        if(btn_service.attr('class') == 'on') {
            service_area.slideUp('fast');
            service_bg.hide();
            btn_service.removeClass('on');
            $(this).find("a").text("주요 서비스 전체 보기");
            $(this).find("a").css({background:"url(/images/main/main_03.png) no-repeat 92% 1px"});

        }else {
            service_area.slideDown('swing');
            service_bg.show();
            btn_service.addClass('on');
            $(this).find("a").text("주요 서비스 전체 닫기");
            $(this).find("a").css({background:"url(/images/main/main_03_on.png) no-repeat 92% 1px"});

        }
    });
    $('.online-btn').click(function(){
        $('.online-btn-con').show();
    });


    /* 통합검색버튼 활성화 */
    $(".search-btn a").click(function(){
        if($(this).hasClass('on')){
            $(".a-search").stop().slideUp();
            $('.search-btn a > img').attr({"src":"/images/common/search_off.gif","alt":"검색창 열기"});
            $(this).removeClass('on');
            $('.focus-back').hide();
        }else{
            $(".a-search").slideDown();
            $(this).addClass('on');
            $(".a-search-lf > #searchCollname").focus();
            $('.search-btn a > img').attr({"src":"/images/common/search_on.gif","alt":"검색창 닫기"});
            $('.focus-back').show();
         }
    });
    
    $('.focus-setting').focus(function(){
    	$(".search-btn a").focus();
    });    
    $('.focus-back').on("focus",function(){
    	$(".a-search-lf #searchCollname").focus();
    });
    
    // 웹접근성 주석처리
//    $('.a-search-rt').focusout(function(e) {
//    	$(".search-btn a").focus();
//    });
//    
//    $('.search-btn a').keydown(function (e) {
//    	if($(this).hasClass("on")){
//        	if (e.which === 9){
//        		$(".a-search-lf > #searchCollname").focus();
//        	}
//    	}
//	});



    /*통합검색*/
    $(".search_popu_open").click(function(){
        if($(this).hasClass('on')){
            $(".search_wrap").stop().slideUp();
            $(this).removeClass('on');
        }else{
            $(".search_wrap").slideDown();
            $(this).addClass('on');
            $(".wrap_input_none").hide();
            $(".search_popu").hide();
        }
    });
    $(".search_popu_close").click(function(){
        $(".search_popu").stop().slideUp();
    });
    $(".search_wrap_menu > li").click(function(){
        $(this).children('a').next('div').show();
    });
    $(".search_wrap_menu > li.last > a").click(function(){
        $(".search_popu").show();
    });


    /*관련사이트 배너*/
    if ( $(".bannerArea").length ) bannerArea();

    function bannerArea() {

        var $bannerArea = $(".bannerArea"),
            $controlArea = $bannerArea.children(".controlArea"),
            $prev = $controlArea.find(".controlPrev").children("a"),
            $next = $controlArea.find(".controlNext").children("a"),
            $play = $controlArea.find(".controlPlay").children("a"),
            $stop = $controlArea.find(".controlStop").children("a"),
            $outerWrap = $("<div />",{"class" : "outerWrap"}).appendTo($bannerArea),
            $innerWrap = $bannerArea.children(".banner").appendTo($outerWrap),
            $item = $innerWrap.find("li"),
            itemLength = $item.length,
            movingWidth = $item.first().width(),
            currentIdx = 0,
            visibleItem = 3,
            lastIdx = itemLength - visibleItem - 1,
            rollTimer,
            rollDelay = 2000,
            clickable = true,
            rolling = true;

        if ( itemLength > visibleItem ) mainFunc();

        // mainFunc
        function mainFunc() {

            if ( rollTimer ) rollTimer;
            rollTimer = setInterval(rollingDirect, rollDelay);

            $stop.on({
                click : function() {
                    clearInterval(rollTimer);
                    rolling =  false;
                    return false;
                }
            });

            $play.on({
                click : function() {
                    if ( !rolling ) {
                        if ( rollTimer ) rollTimer;
                        rollTimer = setInterval(rollingDirect, rollDelay);
                    }
                    return false;
                }
            });

            $prev.on({
                click : function() {
                    if ( clickable ) {
                        clearInterval(rollTimer);
                        rolling = false;
                        rollReverse();
                    }
                    return false;
                }
            });

            $next.on({
                click : function() {
                    if ( clickable ) {
                        clearInterval(rollTimer);
                        rolling = false;
                        rollingDirect();
                    }
                    return false;
                }
            });

        }

        // rolling
        function rollingDirect() {
            clickable = false;
            currentIdx += 1;
            if ( currentIdx == itemLength ) currentIdx = 0;
            $innerWrap.stop(true, true).animate({
                "margin-left" : - movingWidth
            }, 250, function() {
                $(this).find("li").first().appendTo($(this));
                $(this).css("margin-left",0);
                clickable = true;
            });
        }

        // rollReverse
        function rollReverse() {
            clickable = false;
            currentIdx -= 1;
            if ( currentIdx < 0 ) currentIdx = $item.length - 1;
            $innerWrap.find("li").last().prependTo($innerWrap);
            $innerWrap.css("margin-left", - movingWidth);
            $innerWrap.stop(true, true).animate({
                "margin-left" : 0
            }, 250, function() {
                clickable = true;
            });
        }

        // setButton
        function setButton() {

        }
    }




    // 메뉴 스크립트
    $(".pc-menu .menu-deaph1 > li > a").mouseover(function(){

    	$(".pc-menu .menu-deaph2").css({display:"none"});
    	$(this).next(".menu-deaph2").css({display:"block"});
        $(this).next('.pc-menu .menu-deaph2').css({backgroundColor:"#fff7f5"});
        $(this).css({backgroundColor:"#fff7f5"});

        $(".pc-menu .menu-deaph2").hover(function(){
            $(this).css({backgroundColor:"#fff7f5"});
            $(this).prev().css({backgroundColor:"#fff7f5"});

        },function(){
            $('.pc-menu .menu-deaph2').css({backgroundColor:"#ffffff",display:"none"});
            $('.pc-menu .menu-deaph1 > li > a').css({backgroundColor:"#ffffff"});
        });
        
        $(".pc-menu .menu-deaph1 > li").hover(function(){
        },function(){
            $('.pc-menu .menu-deaph2').css({backgroundColor:"#ffffff",display:"none"});
            $('.pc-menu .menu-deaph1 > li > a').css({backgroundColor:"#ffffff"});
        });

        //$(".pc-deaph2-bg").css({display:"block"});
        $(".pc-menu").removeAttr("style");
    });


    /*
    $(".pc-menu").mouseleave(function(){
        $(".pc-menu .menu-deaph2").css({display:"none"});
        $(".pc-deaph2-bg").css({display:"none"});
    });
    */

    $("#allMenuBtn").click(function(){
    	if($(window).width() <= 1024){
    		if($("#allMenuBtn").hasClass('on')){
    			$(".all-menu-con, .all-menu-bg").slideUp("fast");
    			$(".global-lf, .global-rt").hide();
    			$(this).find("img").attr("alt","전체메뉴 열기");
    			$('#allMenuBtn > img.mm').attr("src","/images/common/all_menu_mob.gif");
    			$(this).removeClass('on');
    		}else{
    			$(".all-menu-con, .all-menu-bg").slideDown("fast");
    			$(".global-lf, .global-rt").show();
    			$(this).find("img").attr("alt","전체메뉴 닫기");
    			$('#allMenuBtn > img.mm').attr("src","/images/common/all_menu_mobon.gif");
    			$(this).addClass('on');
    		}
    		
    	}else{
    		$(".menu-deaph2").hide();
    		if($("#allMenuBtn").hasClass('on')){
    			$(".all-menu-con").hide();
    			$(".all-menu-bg").hide();
    			$(this).removeClass("on");
    		}else{
    			$(".all-menu-con").show();
    			$(this).addClass("on");
    			$(".all-menu-bg").show();
    		}
			
		}
            
            
            //$(".pc-deaph2-bg").hide();
            
    });
// 메뉴 스크립트 END

    
	
// 메뉴 스크립트(접근성) START

    $(".pc-menu .menu-deaph1 > li > a").focus(function(){
    	$(".menu-deaph2").css("background-color","#ffffff").hide();
    	$(".pc-menu .menu-deaph1 > li > a").css("background-color","#ffffff");
    	$(this).next(".menu-deaph2").show();
        $(this).css("background-color","#fff7f5");
        $(this).next(".menu-deaph2").css("background-color","#fff7f5");
    });

    $(".pc-menu .menu-deaph2 > li > a").focus(function(){
    	$(this).css("color","#f87654");
    });

    $(".pc-menu .menu-deaph2 > li > a").focusout(function(){
    	$(this).css("color","#232323");

    	var thisIndex,liLen; 
    	liLen = $(this).closest("ul").find("li").length;
    	thisIndex = $(this).closest("li").index();
    	thisIndex = thisIndex + 1;
    	if(thisIndex == liLen){
    		$(this).closest(".menu-deaph2").prev("a").css("background-color","#ffffff");
        	$(this).closest(".menu-deaph2").css("background-color","#ffffff").hide();
    	}
    });


	$(".all-menu a").focusout(function(){
		var nowLink = $(this).attr("href");
		var lastLink = "/customer-center/faq/list.do";
		if(nowLink == lastLink){
			$("#allMenuBtn").focus();
		}
	});

	$("#allMenuBtn").keydown(function(e){
		if(e.keyCode == "9" && e.shiftKey) {
            $(".all-menu-con, .all-menu-bg").css("display","none");
            $(this).removeClass('on');
            $(this).find("img").attr("alt","전체메뉴 열기");
            $(".menu-deaph2").hide();
            $(".pc-deaph2-bg").hide();
		}
	});


 // 메뉴 스크립트(접근성) END








    $(".top_ico a").click(function(){
        $('html,body').animate({scrollTop: '0px'}, 300);
    });


    $(".left-deaph1 > li > a").click(function(){
        if ( $(this).hasClass('on') ){
            $(".left-deaph1 > li > a").removeClass("on");
            $(".left-deaph2").slideUp("fast");
            $(".left-deaph1 > li").each(function(){
                if($(this).children("ul").hasClass('left-deaph2')){
                    $(this).children("a").css({background:"url(/images/sub/left_deaph04.gif) no-repeat 218px center"});
                }
            });
        }else{
            $(".left-deaph1 > li > a").removeClass("on");
            $(".left-deaph2").slideUp("fast");
            $(".left-deaph1 > li").each(function(){
                if($(this).children("ul").hasClass('left-deaph2')){
                    $(this).children("a").css({background:"url(/images/sub/left_deaph04.gif) no-repeat 218px center"});
                }
            });
            
            if($(this).next("ul").hasClass("left-deaph2")){
                $(this).attr("href","#none");
                $(this).next(".left-deaph2").slideDown("fast");
                $(this).removeAttr("style");
                $(this).addClass("on");
                $(this).css({background:"url(/images/sub/left_deaph03.gif) no-repeat 218px center"});
            }
        }
    });






    $('.view-pop').click(function(){
        $(this).next('div').show();
        $('.pop-bg').show();
    });

    $('.pop-tit a.close').click(function(){
        $('.pop-bg').hide();
        $('.pop').hide();

    });



    $('.file_pop_btn').click(function(){
        $(this).next('div').show();
    });

    $('.file_close').click(function(){
        $(this).parent().hide();

    });


    $('.apply_btn').click(function(){
        $(this).next('div').show();
        $('.pop-bg').show();
    });

    $('.apply_pop a.close').click(function(){
        $('.pop-bg').hide();
        $('.apply_pop').hide();

    });


    /*회원정보팝업*/
    $('.id_click').click(function(){
        $(this).nextAll('div').show();
    });
    $('.id_close').click(function(){
        $('.id_click_con').hide();
        $('.id_click_bg').hide();

    });

    /*회원로그인 도움말*/
    $('.log_help').click(function(){
        $(this).next('div').show();
        $('.pop-bg').show();
    });
    $('.log_abs .close').click(function(){
        $('.log_abs').hide();
        $('.pop-bg').hide();

    });
    /*회원로그인 도움말 끝*/





    $(".sub5-chart > a").click(function(){
        var this_class=$(this).attr("class").split(" ");
        $(".sub5-chart-con").css({display:"none"});
        $(".sub5-chart > a").removeClass("on");
        $("."+this_class+"_con").css({display:"block"});
        $(this).addClass("on");
    });


    $(".sub07_board > ul > li").click(function(){
        $(".sub07_board > ul > li > a").removeClass('on');
        $(".sub07_board_con").hide();
        $(this).children('a').nextAll('div').show();
        $(this).children('a').addClass('on');
    });




    $('.qr_btn').click(function(){
        var btn = $(this).children().find('img');

        if(btn.attr('class') != 'on') {
            $(this).siblings('.qr_img').show();
            var str = !btn.attr('src') ? '' : btn.attr('src');
            btn.attr('src', str.replace(/(_on.gif|.gif)$/i, '_on.gif'));
            btn.addClass('on');
        }else{
            $(this).siblings('.qr_img').hide();
            var str = !btn.attr('src') ? '' : btn.attr('src');
            btn.attr('src', str.replace(/(_on.gif|.gif)$/i, '.gif'));
            btn.removeClass('on');
        }

    }).keydown(function(key) {
        if(key.keyCode == "13"){
            var btn = $(this).children().find('img');

            if(btn.attr('class') != 'on') {
                $(this).siblings('.qr_img').show();
                var str = !btn.attr('src') ? '' : btn.attr('src');
                btn.attr('src', str.replace(/(_on.gif|.gif)$/i, '_on.gif'));
                btn.addClass('on');
            }else{
                $(this).siblings('.qr_img').hide();
                var str = !btn.attr('src') ? '' : btn.attr('src');
                btn.attr('src', str.replace(/(_on.gif|.gif)$/i, '.gif'));
                btn.removeClass('on');
            }
        }
    });










    $(".sb5_video_tx a").click(function(){
        if($(this).hasClass('on'))
        {
            $(".vd_con").css("display","none");
            $(".sb5_video_tx a").removeClass("on");
            $(".sb5_video_tx a").text("자막보기");
        }else{
            $(".vd_con").css("display","block");
            $(".sb5_video_tx a").removeClass("on");
            $(".vd_con").css("display","block");
            $(this).addClass("on");
            $(".sb5_video_tx a").text("자막접기");
        }
    });


    $(".faq_qt > a").click(function(){
        var this_class=$(this).attr("class").split(" ");
        $(".list_none").css({display:"none"});
        $(".faq_qt > a").removeClass("on");
        $("."+this_class+"_con").css({display:"table-row"});
        $(this).addClass("on");
    });



    /* left메뉴 180123*/


    //$('.left-deaph1 li ul').hide();
    $('.left-deaph1 .on > ul').show();

    var uls = $(this).parent().find('ul').size();
    if(uls == 1){
        $(".left-deaph1 > li > a").parent().addClass('on');
        $(".left-deaph1 > li > a").next(".left-deaph2").show();
        $(".left-deaph1 > li > a").parent().siblings().removeClass('on');
        $(".left-deaph1 > li > a").parent().siblings().find('ul').hide();
    }

    /* left메뉴 끝*/

    //윤리경영.행동강령 메뉴이벤트 180123
    $(".ethical_tab > li > a").click(function(){
        $(".ethical_tab > li > a").removeClass('on');
        $(this).addClass('on');

        if($(this).attr('class') == "e02 on"){
            $('.ethical_01').attr('style','display:none;');
            $('.ethical_02').attr('style','display:block;');
        }else if($(this).attr('class') == "e01 on"){
            $('.ethical_01').attr('style','display:block;');
            $('.ethical_02').attr('style','display:none;');
        }

    });

    //정보공개 메뉴이벤트 180123
    $('.ethicals_01').attr('style','display:block;');
    $('.ethicals_02').attr('style','display:none;');
    $('.ethicals_03').attr('style','display:none;');
    $('.ethicals_04').attr('style','display:none;');

    $(".ethicals_tab > li > a").click(function(){
        $(".ethicals_tab > li > a").removeClass('on');
        $(this).addClass('on');

        if($(this).attr('class') == "e01 on"){
            $('.ethicals_01').attr('style','display:block;');
            $('.ethicals_02').attr('style','display:none;');
            $('.ethicals_03').attr('style','display:none;');
            $('.ethicals_04').attr('style','display:none;');
        }else if($(this).attr('class') == "e02 on"){
            $('.ethicals_01').attr('style','display:none;');
            $('.ethicals_02').attr('style','display:block;');
            $('.ethicals_03').attr('style','display:none;');
            $('.ethicals_04').attr('style','display:none;');
        }else if($(this).attr('class') == "e03 on"){
            $('.ethicals_01').attr('style','display:none;');
            $('.ethicals_02').attr('style','display:none;');
            $('.ethicals_03').attr('style','display:block;');
            $('.ethicals_04').attr('style','display:none;');
        }else if($(this).attr('class') == "e04 on"){
            $('.ethicals_01').attr('style','display:none;');
            $('.ethicals_02').attr('style','display:none;');
            $('.ethicals_03').attr('style','display:none;');
            $('.ethicals_04').attr('style','display:block;');
        }

    });

    //공공누리 메뉴이벤트 180123
    $('.nuriguide_01').attr('style','display:block;');
    $('.nuriguide_02').attr('style','display:none;');
    $('.nuriguide_03').attr('style','display:none;');
    $('.nuriguide_04').attr('style','display:none;');
    $(".nuri_tab > li > a").click(function(){
        $(".nuri_tab > li > a").removeClass('on');
        $(this).addClass('on');

        if($(this).attr('class') == "e01 on"){
            $('.nuriguide_01').attr('style','display:block;');
            $('.nuriguide_02').attr('style','display:none;');
            $('.nuriguide_03').attr('style','display:none;');
            $('.nuriguide_04').attr('style','display:none;');
        }else if($(this).attr('class') == "e02 on"){
            $('.nuriguide_01').attr('style','display:none;');
            $('.nuriguide_02').attr('style','display:block;');
            $('.nuriguide_03').attr('style','display:none;');
            $('.nuriguide_04').attr('style','display:none;');
        }else if($(this).attr('class') == "e03 on"){
            $('.nuriguide_01').attr('style','display:none;');
            $('.nuriguide_02').attr('style','display:none;');
            $('.nuriguide_03').attr('style','display:block;');
            $('.nuriguide_04').attr('style','display:none;');
        }else if($(this).attr('class') == "e04 on"){
            $('.nuriguide_01').attr('style','display:none;');
            $('.nuriguide_02').attr('style','display:none;');
            $('.nuriguide_03').attr('style','display:none;');
            $('.nuriguide_04').attr('style','display:block;');
        }

    });


    /*회원정보팝업 180123*/
    $('.id_click').click(function(){
        $(this).nextAll('div').show();
    });
    $('.id_close').click(function(){
        $('.id_click_con').hide();
        $('.id_click_bg').hide();

    });



	/*2018.09.06*/
    $(".news-ul > li").click(function(){
		$(".news-ul > li > a").removeClass('on');
		$(".news-con").hide();
		$(this).children('a').nextAll('div').show();
		$(this).children('a').addClass('on');
	});
    
    
	$(".all-menu-con > li").click(function(){
		if($(window).width() <= 1024){
			if($(window).width() <= 1024 && $(this).hasClass('on')){
				$(this).removeClass('on');
				$(".allmenu-deaph").css("display","none"); 
			}else{
				$(".all-menu-con > li").removeClass('on');
				$(this).addClass('on');
				$(".allmenu-deaph").css("display","none");
				$(this).find(".allmenu-deaph").css("display","block");
				$(this).children('p').children('a').attr("href","#none");
			}
		}
	});
    /*2018.09.06*/





	//$('#sub-area').find('a').attr('id','body_quick');
	$('a[href="#gnb"]').click(function(){
		$('#gnb').focus();
	});
	$('a[href="#body_quick"]').click(function(){
		$('#body_quick').focus();
	});
	$('a[href="#main-content"]').click(function(){
		$('#main-content').focus();
	});



});






$(window).on("load resize", function(){
    $(".left-deaph1 > li").each(function(){
		if($(this).children("ul").hasClass('left-deaph2')){
			if($(this).hasClass("on")){
				$(this).children("a").css({background:"url(/images/sub/left_deaph03.gif) no-repeat 218px center"});
			} else {
				$(this).children("a").css({background:"url(/images/sub/left_deaph04.gif) no-repeat 218px center"});
			}
            
        }
    });
    
    /*2018.09.06*/
    if ($(window).width() <= "1024" ){
    	$('#allMenuBtn > img').attr("src","/images/common/all_menu_mob.gif");
    	if($("#allMenuBtn").hasClass('on')){
			$('#allMenuBtn > img').attr("src","/images/common/all_menu_mobon.gif");
			$(".global-lf, .global-rt").show();
		}else{
			$(".global-lf, .global-rt").hide();
		}
		/**/
		
		$(".allmenu-deaph").css("display","none");
		/*$(".all-menu-con > li").click(function(){
			if($(window).width() <= 1024 && $(this).hasClass('on')){
				$(this).removeClass('on');
				$(".allmenu-deaph").css("display","none"); 
			}else{
				$(".all-menu-con > li").removeClass('on');
				$(this).addClass('on');
				$(".allmenu-deaph").css("display","none");
				$(this).find(".allmenu-deaph").css("display","block");
				$(this).children('p').children('a').attr("href","#none");
			}
			
		});*/
    	
		$(".all-menu-bg").height($("#wrap").height() - 49);
		$(".all-menu-con").height($("#wrap").height() - 187);
		
		
		
	}else{
		$('#allMenuBtn > img').attr("src","/images/common/all_menu.png");
		$(".all-menu-bg").removeAttr("style");
		$(".all-menu-con").removeAttr("style");
		$(".global-lf, .global-rt").removeAttr("style");
		if($(window).width() > 1024 && $("#allMenuBtn").hasClass('on')){
			$(".all-menu-bg").attr('style','display:block;');
			$(".all-menu-con").attr('style','display:block;');
		}
		
		$(".allmenu-deaph").css("display","block");
		
	}
    /*2018.09.06*/
});

$(window).resize(function(){
	if($(window).width() > 1024){
		/*
		for(var mm=0;mm<LinkDaph1.length;mm++){
			$(".all-menu-con > li:eq("+mm+") .menu-tit > a").attr("href",LinkDaph1[mm]);
		}
		*/
	}else{
		if(getCookiePop("copyright_pop") != "bannerClose"){
			$("#slider001").removeAttr("style");
			$(".popDiv a").addClass("on");
			//$(".popDiv img").attr({"src":$(".popDiv img").attr("src").replace("_up","_down"),"alt":"상단배너 닫기"});
			$(".popDiv a").text("배너 ▲");
			$(".popDiv a").attr("title","배너닫기");
		}
	}
});

$(document).ready(function(){
	if( getCookiePop("copyright_pop") != "" && getCookiePop("copyright_pop") !=null){
		$("#slider001").css("display","none");
		//$(".popDiv a").find("img").attr({"src":$(".popDiv a").find("img").attr("src").replace("_up","_down"),"alt":"상단배너 열기"});
		$(".popDiv a").text("배너 ▼");
		$(".popDiv a").attr("title","배너열기");
		$(".popDiv a").removeClass("on");
	}
});


var alioPopItemView = function(locationUrl, apbaId, reportFormRootNo, apbaName, reportGubun){
	if(reportGubun == "JUNG"){	// 정기보고서 일경우
		if(reportFormRootNo == "63601") {
			var result = fromApbaId(apbaId);
			if(result == "true") {
				alert("주요 12개 대상기관이 아닙니다.");
				return;
			} else {
				window.open(locationUrl + "/item/itemReportTerm.do?apbaId=" + apbaId + "&reportFormRootNo=" + reportFormRootNo, "_blank", "frame=no, scrollbars=yes, resizable=yes, width=1240, noopener");
			}
		} else {
			window.open(locationUrl + "/item/itemReportTerm.do?apbaId=" + apbaId + "&reportFormRootNo=" + reportFormRootNo, "_blank", "frame=no, scrollbars=yes, resizable=yes, width=1240, noopener");
		}
	} else {
		window.open(locationUrl + "/item/itemOrganList.do?apbaId=" + apbaId + "&reportFormRootNo=" + reportFormRootNo, "_blank", "frame=no, scrollbars=yes, resizable=yes, top=0, width=1620, height=950, noopener");
	}		
}
 
var fromApbaId = function(apbaId) {
	var se_apba_id = 'C0053,C0057,C0101,C0147,C0183,C0214,C0221,C0247,C0268,C0270,C0396,C0415';
	var apba_id = se_apba_id.split(',');
	var result = "true";
	
	for(var i = 0; i < apba_id.length; i++) {
		if(apbaId == apba_id[i]) {
			result = "false";
		} 
	}
	
	return result;
}
