function RegistrarCombobox(id) {
    var idComponente = "#" + id + " ";
    //select estilizado
    $(idComponente + ".box-sel .sel-val").on("click", function () {
        if ($(this).next().is(":hidden")) {
            $(".box-sel").css({ "z-index": "1" });
            $(this).parent().css({ "z-index": "8000" });
            $(".box-sel .sel-val, .box-sel .sel-val-megaselect").next().hide();
            $(".sel-arrow-up").removeClass("sel-arrow-up").addClass("sel-arrow-down");
            $(".sel-val-megaselect").css({ "background": "#fff" });
            $(this).next().show();
            $(this).closest(".efeito-acc").css({ "overflow": "inherit" });
            $(".sel-arrow-down", this).removeClass("sel-arrow-down").addClass("sel-arrow-up");
        } else {
            $(this).next().hide();
            $(".sel-arrow-up", this).removeClass("sel-arrow-up").addClass("sel-arrow-down");
        }
    });

    $(idComponente + ".box-sel.disabled, " + idComponente + ".box-sel.disabled .sel-val").off("click");

    RegistrarClickLinhaBombobox(id);
}

function RegistrarClickLinhaBombobox(id) {
    var idComponente = "#" + id + " ";
    $(idComponente + ".sel-list li").on("click", function () {
        var vlr = $(this).text();

        $(this).parent().hide();
        $(this).parent().parent().find(".txt-val").text(vlr);
        $(".sel-arrow-up").removeClass().addClass("sel-arrow-down");

        if ($(this).parents(".box-sel").find(".txt-val").text() !== "Selecione") {
            $(this).parents(".box-sel").find(".txt-val").removeClass("txt-default");

            //console.log($(this).parents(".box-sel").find(".txt-val"));
        } else {
            $(this).parents(".box-sel").find(".txt-val").addClass("txt-default");
            //console.log($(this).parents(".box-sel").find(".txt-val"));
        }
    });
}