$(document).ready(function(){
    $(".select_box").click(function() {
        var select = $(this);
        
        //드롭다운 열기
        select.addClass("open").next('.select_box_dropDown').slideDown(100).addClass("open");
        
        //다른영역 클릭 시 닫기
        $(document).mouseup(function(e) {
        var seting = $(".select_box_dropDown");
        if (seting.has(e.target).length === 0) {
            seting.removeClass("open").slideUp(100);
            select.removeClass("open");
        }
        });
    
        $(".select_box_dropDown a").click(function() {
        var option = $(this).text();
        
        //클릭 시 드롭다운 닫기
        $(".select_box_dropDown a").removeClass('selected');
        $(".select_box_dropDown").removeClass("open").slideUp(100);
        select.removeClass("open");
        $(this).addClass('selected');
        
        //select에  text 넣기
        select.text(option);
        });
    });

    
    $(".select_box02").click(function() {
        var select = $(this);
        
        //드롭다운 열기
        select.addClass("open02").next('.select_box_dropDown02').slideDown(100).addClass("open02");
        
        //다른영역 클릭 시 닫기
        $(document).mouseup(function(e) {
        var seting = $(".select_box_dropDown02");
        if (seting.has(e.target).length === 0) {
            seting.removeClass("open02").slideUp(100);
            select.removeClass("open02");
        }
        });
    
        $(".select_box_dropDown02 a").click(function() {
        var option = $(this).text();
        
        //클릭 시 드롭다운 닫기
        $(".select_box_dropDown02 a").removeClass('selected02');
        $(".select_box_dropDown02").removeClass("open02").slideUp(100);
        select.removeClass("open02");
        $(this).addClass('selected02');
        
        //select에  text 넣기
        select.text(option);
        });
    });
});