$(document).ready(function () {
    //LoadUserList();
    //$('#tblforms').DataTable();
    //$('#loaderimg').hide();
    //$('#Referral_content_preview').hide();
    //$('#Profile_Update').hide();
    //$('#Others_Hide').hide();
    //$('#Help_h').hide();
});
$('#UserRoleList_1').change(function () {
    var role_id = $('#UserRoleList_1').val();
    $("#doctor_role_id").val(role_id);
    LoadUserList(role_id);
})
$('#UserRoleList_2').change(function () {
    var role_id = $('#UserRoleList_2').val();
    if (role_id == 1)
    {
        $('#Profile_Update').show();
        $('#Others_Hide').show();
    }
    else {
        $('#Profile_Update').hide();
        $('#Others_Hide').hide();
    }
    $("#doctor_role_id").val(role_id);
    LoadUserList(role_id);
})


function LoadUserList(role_id)
{
    var userdata = {
        Dml_Indicator: "UL",
        hospital_id: $('#HospitalId').val(),
        doctor_user_role_id: role_id
    }
    $.ajax({
        async: true,
        type: 'POST',
        url: '/UserCreate/UserRoleRights_Ins_Upd_Del',
        contentType: 'application/json; charset=UTF-8',
        data: JSON.stringify(userdata),
        success: function (data) {
            console.log(data);
            if (jQuery.isEmptyObject((data))) {
            }
            else {
                var SelRole = '', default_opt = '<option value="0">--Select--</option>';
                if (data.length > 0)
                {
                    var data = JSON.parse(data);
                    if (data.msg == "Success")
                    {
                        $('#HospitalUserList').empty();
                        if (data["data"].length > 0) {
                            for (var i = 0; i < data["data"].length; i++) {
                                SelRole = SelRole + '<option value="' + data["data"][i].doctor_user_id + '">' + data["data"][i].user_name + '</option>';
                            }
                            $('#HospitalUserList').html(default_opt + SelRole);
                        }
                    }
                    else
                    {
                        $('#HospitalUserList').html(default_opt);
                    }
                }
                else
                {
                    $('#HospitalUserList').html(default_opt);
                }
            }
        }
    });
    
}

$('#6').change(function () {
    var toggle = $('#6').val();
    if(toggle=="2")
    {
        //Patient List
        $('a[data-toggle=7][data-title=1]').removeClass('active');
        $('a[data-toggle=7][data-title=1]').addClass('disabled');
        $('a[data-toggle=7][data-title=2]').removeClass('not-active');
        $('a[data-toggle=7][data-title=2]').addClass('active');
        $('#7').val('2');

        $('a[data-toggle=8][data-title=1]').removeClass('active');
        $('a[data-toggle=8][data-title=1]').addClass('disabled');
        $('a[data-toggle=8][data-title=2]').removeClass('not-active');
        $('a[data-toggle=8][data-title=2]').addClass('active');
        $('#8').val('2');

        $('a[data-toggle=9][data-title=1]').removeClass('active');
        $('a[data-toggle=9][data-title=1]').addClass('disabled');
        $('a[data-toggle=9][data-title=2]').removeClass('not-active');
        $('a[data-toggle=9][data-title=2]').addClass('active');
        $('#9').val('2');

        $('a[data-toggle=10][data-title=1]').removeClass('active');
        $('a[data-toggle=10][data-title=1]').addClass('disabled');
        $('a[data-toggle=10][data-title=2]').removeClass('not-active');
        $('a[data-toggle=10][data-title=2]').addClass('active');
        $('#10').val('2');

        $('a[data-toggle=116][data-title=1]').removeClass('active');
        $('a[data-toggle=116][data-title=1]').addClass('disabled');
        $('a[data-toggle=116][data-title=2]').removeClass('not-active');
        $('a[data-toggle=116][data-title=2]').addClass('active');
        $('#116').val('2');
    }
    else {
        //Patient List
        $('a[data-toggle=7][data-title=1]').removeClass('disabled');
        $('a[data-toggle=7][data-title=1]').addClass('active');
        $('a[data-toggle=7][data-title=2]').removeClass('active');
        $('a[data-toggle=7][data-title=2]').addClass('not-active');
        $('#7').val('');

        $('a[data-toggle=8][data-title=1]').removeClass('disabled');
        $('a[data-toggle=8][data-title=1]').addClass('active');
        $('a[data-toggle=8][data-title=2]').removeClass('active');
        $('a[data-toggle=8][data-title=2]').addClass('not-active');
        $('#8').val('');

        $('a[data-toggle=9][data-title=1]').removeClass('disabled');
        $('a[data-toggle=9][data-title=1]').addClass('active');
        $('a[data-toggle=9][data-title=2]').removeClass('active');
        $('a[data-toggle=9][data-title=2]').addClass('not-active');
        $('#9').val('');

        $('a[data-toggle=10][data-title=1]').removeClass('disabled');
        $('a[data-toggle=10][data-title=1]').addClass('active');
        $('a[data-toggle=10][data-title=2]').removeClass('active');
        $('a[data-toggle=10][data-title=2]').addClass('not-active');
        $('#10').val('');

        $('a[data-toggle=116][data-title=1]').removeClass('disabled');
        $('a[data-toggle=116][data-title=1]').addClass('active');
        $('a[data-toggle=116][data-title=2]').removeClass('active');
        $('a[data-toggle=116][data-title=2]').addClass('not-active');
        $('#116').val('');
    }

})
$("#11").change(function () {
    var toggle = $("#11").val();
    if (toggle == "2") {
        //Patient Creation
        $('a[data-toggle=123][data-title=1]').removeClass('active');
        $('a[data-toggle=123][data-title=1]').addClass('disabled');
        $('a[data-toggle=123][data-title=2]').removeClass('not-active');
        $('a[data-toggle=123][data-title=2]').addClass('active');
        $('#123').val('2');
        //Detail Patient Creation
        $('a[data-toggle=124][data-title=1]').removeClass('active');
        $('a[data-toggle=124][data-title=1]').addClass('disabled');
        $('a[data-toggle=124][data-title=2]').removeClass('not-active');
        $('a[data-toggle=124][data-title=2]').addClass('active');
        $('#124').val('2');
    }
    else {
        $('a[data-toggle=123][data-title=1]').removeClass('disabled');
        $('a[data-toggle=123][data-title=1]').addClass('not-active');
        $('a[data-toggle=123][data-title=2]').removeClass('active');
        $('a[data-toggle=123][data-title=2]').addClass('not-active');
        $('#123').val('');

        $('a[data-toggle=124][data-title=1]').removeClass('disabled');
        $('a[data-toggle=124][data-title=1]').addClass('not-active');
        $('a[data-toggle=124][data-title=2]').removeClass('active');
        $('a[data-toggle=124][data-title=2]').addClass('not-active');
        $('#124').val('');
    }
})

$("#12").change(function () {
    var toggle = $('#12').val();
    if (toggle == "2") {
        //--Calender--
        $('a[data-toggle=13][data-title=1]').removeClass('active');
        $('a[data-toggle=13][data-title=1]').addClass('disabled');
        $('a[data-toggle=13][data-title=2]').removeClass('not-active');
        $('a[data-toggle=13][data-title=2]').addClass('active');
        $('#13').val('2');
        //--Calender Sub tab--
        //Add Schedule
        $('a[data-toggle=14][data-title=1]').removeClass('active');
        $('a[data-toggle=14][data-title=1]').addClass('disabled');
        $('a[data-toggle=14][data-title=2]').removeClass('not-active');
        $('a[data-toggle=14][data-title=2]').addClass('active');
        $('#14').val('2');

        //--Print_Paper--
        $('a[data-toggle=15][data-title=1]').removeClass('active');
        $('a[data-toggle=15][data-title=1]').addClass('disabled');
        $('a[data-toggle=15][data-title=2]').removeClass('not-active');
        $('a[data-toggle=15][data-title=2]').addClass('active');
        $('#15').val('2');
        //--Print_paper--
        //Prescription
        $('a[data-toggle=16][data-title=1]').removeClass('active');
        $('a[data-toggle=16][data-title=1]').addClass('disabled');
        $('a[data-toggle=16][data-title=2]').removeClass('not-active');
        $('a[data-toggle=16][data-title=2]').addClass('active');
        $('#16').val('2');
        //Invoice
        $('a[data-toggle=17][data-title=1]').removeClass('active');
        $('a[data-toggle=17][data-title=1]').addClass('disabled');
        $('a[data-toggle=17][data-title=2]').removeClass('not-active');
        $('a[data-toggle=17][data-title=2]').addClass('active');
        $('#17').val('2');
        //Lab results
        $('a[data-toggle=18][data-title=1]').removeClass('active');
        $('a[data-toggle=18][data-title=1]').addClass('disabled');
        $('a[data-toggle=18][data-title=2]').removeClass('not-active');
        $('a[data-toggle=18][data-title=2]').addClass('active');
        $('#18').val('2');
        //Procedure
        $('a[data-toggle=19][data-title=1]').removeClass('active');
        $('a[data-toggle=19][data-title=1]').addClass('disabled');
        $('a[data-toggle=19][data-title=2]').removeClass('not-active');
        $('a[data-toggle=19][data-title=2]').addClass('active');
        $('#19').val('2');
        //Diet
        $('a[data-toggle=20][data-title=1]').removeClass('active');
        $('a[data-toggle=20][data-title=1]').addClass('disabled');
        $('a[data-toggle=20][data-title=2]').removeClass('not-active');
        $('a[data-toggle=20][data-title=2]').addClass('active');
        $('#20').val('2');
        //Lab Advice
        $('a[data-toggle=21][data-title=1]').removeClass('active');
        $('a[data-toggle=21][data-title=1]').addClass('disabled');
        $('a[data-toggle=21][data-title=2]').removeClass('not-active');
        $('a[data-toggle=21][data-title=2]').addClass('active');
        $('#21').val('2');
        //Medical Certificate
        $('a[data-toggle=22][data-title=1]').removeClass('active');
        $('a[data-toggle=22][data-title=1]').addClass('disabled');
        $('a[data-toggle=22][data-title=2]').removeClass('not-active');
        $('a[data-toggle=22][data-title=2]').addClass('active');
        $('#22').val('2');
        //Discharge summary
        $('a[data-toggle=23][data-title=1]').removeClass('active');
        $('a[data-toggle=23][data-title=1]').addClass('disabled');
        $('a[data-toggle=23][data-title=2]').removeClass('not-active');
        $('a[data-toggle=23][data-title=2]').addClass('active');
        $('#23').val('2');
        //Refferal Print Setting
        $('a[data-toggle=24][data-title=1]').removeClass('active');
        $('a[data-toggle=24][data-title=1]').addClass('disabled');
        $('a[data-toggle=24][data-title=2]').removeClass('not-active');
        $('a[data-toggle=24][data-title=2]').addClass('active');
        $('#24').val('2');
        //--Lab Setting--
        $('a[data-toggle=25][data-title=1]').removeClass('active');
        $('a[data-toggle=25][data-title=1]').addClass('disabled');
        $('a[data-toggle=25][data-title=2]').removeClass('not-active');
        $('a[data-toggle=25][data-title=2]').addClass('active');
        $('#25').val('2');
        //--Lab Setting--
        //Test Creation
        $('a[data-toggle=26][data-title=1]').removeClass('active');
        $('a[data-toggle=26][data-title=1]').addClass('disabled');
        $('a[data-toggle=26][data-title=2]').removeClass('not-active');
        $('a[data-toggle=26][data-title=2]').addClass('active');
        $('#26').val('2');
        //Panel Creation
        $('a[data-toggle=27][data-title=1]').removeClass('active');
        $('a[data-toggle=27][data-title=1]').addClass('disabled');
        $('a[data-toggle=27][data-title=2]').removeClass('not-active');
        $('a[data-toggle=27][data-title=2]').addClass('active');
        $('#27').val('2');
        //--CaseSheet Configuration--
        $('a[data-toggle=28][data-title=1]').removeClass('active');
        $('a[data-toggle=28][data-title=1]').addClass('disabled');
        $('a[data-toggle=28][data-title=2]').removeClass('not-active');
        $('a[data-toggle=28][data-title=2]').addClass('active');
        $('#28').val('2');
        //--Chat--
        $('a[data-toggle=29][data-title=1]').removeClass('active');
        $('a[data-toggle=29][data-title=1]').addClass('disabled');
        $('a[data-toggle=29][data-title=2]').removeClass('not-active');
        $('a[data-toggle=29][data-title=2]').addClass('active');
        $('#29').val('2');
        //--User--
        $('a[data-toggle=30][data-title=1]').removeClass('active');
        $('a[data-toggle=30][data-title=1]').addClass('disabled');
        $('a[data-toggle=30][data-title=2]').removeClass('not-active');
        $('a[data-toggle=30][data-title=2]').addClass('active');
        $('#30').val('2');
        //--User Sub menu--
        //Edit User
        $('a[data-toggle=32][data-title=1]').removeClass('active');
        $('a[data-toggle=32][data-title=1]').addClass('disabled');
        $('a[data-toggle=32][data-title=2]').removeClass('not-active');
        $('a[data-toggle=32][data-title=2]').addClass('active');
        $('#32').val('2');
        //Add User
        $('a[data-toggle=31][data-title=1]').removeClass('active');
        $('a[data-toggle=31][data-title=1]').addClass('disabled');
        $('a[data-toggle=31][data-title=2]').removeClass('not-active');
        $('a[data-toggle=31][data-title=2]').addClass('active');
        $('#31').val('2');
        //--Template Management--
        $('a[data-toggle=33][data-title=1]').removeClass('active');
        $('a[data-toggle=33][data-title=1]').addClass('disabled');
        $('a[data-toggle=33][data-title=2]').removeClass('not-active');
        $('a[data-toggle=33][data-title=2]').addClass('active');
        $('#33').val('2');
        //--Template management sub tab--
        // Template management--> Lab
        $('a[data-toggle=34][data-title=1]').removeClass('active');
        $('a[data-toggle=34][data-title=1]').addClass('disabled');
        $('a[data-toggle=34][data-title=2]').removeClass('not-active');
        $('a[data-toggle=34][data-title=2]').addClass('active');
        $('#34').val('2');
        // Template management--> Diet
        $('a[data-toggle=35][data-title=1]').removeClass('active');
        $('a[data-toggle=35][data-title=1]').addClass('disabled');
        $('a[data-toggle=35][data-title=2]').removeClass('not-active');
        $('a[data-toggle=35][data-title=2]').addClass('active');
        $('#35').val('2');
        // Template management--> Prescription
        $('a[data-toggle=36][data-title=1]').removeClass('active');
        $('a[data-toggle=36][data-title=1]').addClass('disabled');
        $('a[data-toggle=36][data-title=2]').removeClass('not-active');
        $('a[data-toggle=36][data-title=2]').addClass('active');
        $('#36').val('2');
        //Template management-->Complaints
        $('a[data-toggle=37][data-title=1]').removeClass('active');
        $('a[data-toggle=37][data-title=1]').addClass('disabled');
        $('a[data-toggle=37][data-title=2]').removeClass('not-active');
        $('a[data-toggle=37][data-title=2]').addClass('active');
        $('#37').val('2');
        //Template management-->Diagnosis
        $('a[data-toggle=38][data-title=1]').removeClass('active');
        $('a[data-toggle=38][data-title=1]').addClass('disabled');
        $('a[data-toggle=38][data-title=2]').removeClass('not-active');
        $('a[data-toggle=38][data-title=2]').addClass('active');
        $('#38').val('2');
        //--Service Traffic--
        $('a[data-toggle=39][data-title=1]').removeClass('active');
        $('a[data-toggle=39][data-title=1]').addClass('disabled');
        $('a[data-toggle=39][data-title=2]').removeClass('not-active');
        $('a[data-toggle=39][data-title=2]').addClass('active');
        $('#39').val('2');
        //--Service Traffic-->Add Service Traffic
        $('a[data-toggle=40][data-title=1]').removeClass('active');
        $('a[data-toggle=40][data-title=1]').addClass('disabled');
        $('a[data-toggle=40][data-title=2]').removeClass('not-active');
        $('a[data-toggle=40][data-title=2]').addClass('active');
        $('#40').val('2');
        //--Service Traffic-->Delete Service Traffic
        $('a[data-toggle=41][data-title=1]').removeClass('active');
        $('a[data-toggle=41][data-title=1]').addClass('disabled');
        $('a[data-toggle=41][data-title=2]').removeClass('not-active');
        $('a[data-toggle=41][data-title=2]').addClass('active');
        $('#41').val('2');
        //--Service Traffic-->Edit Service Traffic
        $('a[data-toggle=42][data-title=1]').removeClass('active');
        $('a[data-toggle=42][data-title=1]').addClass('disabled');
        $('a[data-toggle=42][data-title=2]').removeClass('not-active');
        $('a[data-toggle=42][data-title=2]').addClass('active');
        $('#42').val('2');
        //--Manage Bank Account--
        $('a[data-toggle=43][data-title=1]').removeClass('active');
        $('a[data-toggle=43][data-title=1]').addClass('disabled');
        $('a[data-toggle=43][data-title=2]').removeClass('not-active');
        $('a[data-toggle=43][data-title=2]').addClass('active');
        $('#43').val('2');
        //Manage Bank Account-->Add Bank
        $('a[data-toggle=44][data-title=1]').removeClass('active');
        $('a[data-toggle=44][data-title=1]').addClass('disabled');
        $('a[data-toggle=44][data-title=2]').removeClass('not-active');
        $('a[data-toggle=44][data-title=2]').addClass('active');
        $('#44').val('2');
        //Manage Bank Account-->Edit Bank
        $('a[data-toggle=45][data-title=1]').removeClass('active');
        $('a[data-toggle=45][data-title=1]').addClass('disabled');
        $('a[data-toggle=45][data-title=2]').removeClass('not-active');
        $('a[data-toggle=45][data-title=2]').addClass('active');
        $('#45').val('2');
        //Manage Bank Delete-->Delete Bank
        $('a[data-toggle=46][data-title=1]').removeClass('active');
        $('a[data-toggle=46][data-title=1]').addClass('disabled');
        $('a[data-toggle=46][data-title=2]').removeClass('not-active');
        $('a[data-toggle=46][data-title=2]').addClass('active');
        $('#46').val('2');
        //--Mobile Fee Management--
        $('a[data-toggle=47][data-title=1]').removeClass('active');
        $('a[data-toggle=47][data-title=1]').addClass('disabled');
        $('a[data-toggle=47][data-title=2]').removeClass('not-active');
        $('a[data-toggle=47][data-title=2]').addClass('active');
        $('#47').val('2');
        //--ip ward management
        $('a[data-toggle=113][data-title=1]').removeClass('active');
        $('a[data-toggle=113][data-title=1]').addClass('disabled');
        $('a[data-toggle=113][data-title=2]').removeClass('not-active');
        $('a[data-toggle=113][data-title=2]').addClass('active');
        $('#113').val('2');
        //--ip ward management
        $('a[data-toggle=114][data-title=1]').removeClass('active');
        $('a[data-toggle=114][data-title=1]').addClass('disabled');
        $('a[data-toggle=114][data-title=2]').removeClass('not-active');
        $('a[data-toggle=114][data-title=2]').addClass('active');
        $('#114').val('2');

        //--Fee Management
        $('a[data-toggle=125][data-title=1]').removeClass('active');
        $('a[data-toggle=125][data-title=1]').addClass('disabled');
        $('a[data-toggle=125][data-title=2]').removeClass('not-active');
        $('a[data-toggle=125][data-title=2]').addClass('active');
        $('#125').val('2');

        //--Configuration
        $('a[data-toggle=126][data-title=1]').removeClass('active');
        $('a[data-toggle=126][data-title=1]').addClass('disabled');
        $('a[data-toggle=126][data-title=2]').removeClass('not-active');
        $('a[data-toggle=126][data-title=2]').addClass('active');
        $('#126').val('2');

    }
    else {
        //Calender
        $('a[data-toggle=13][data-title=1]').removeClass('disabled');
        $('a[data-toggle=13][data-title=1]').addClass('active');
        $('a[data-toggle=13][data-title=2]').removeClass('active');
        $('a[data-toggle=13][data-title=2]').addClass('not-active');
        $('#13').val('');
        //--Calender Sub tab--
        //Add Schedule
        $('a[data-toggle=14][data-title=1]').removeClass('disabled');
        $('a[data-toggle=14][data-title=1]').addClass('active');
        $('a[data-toggle=14][data-title=2]').removeClass('active');
        $('a[data-toggle=14][data-title=2]').addClass('not-active');
        $('#14').val('');
        //Print_Paper
        $('a[data-toggle=15][data-title=1]').removeClass('disabled');
        $('a[data-toggle=15][data-title=1]').addClass('active');
        $('a[data-toggle=15][data-title=2]').removeClass('active');
        $('a[data-toggle=15][data-title=2]').addClass('not-active');
        $('#15').val('');
        //--Print_paper--
        //Prescription
        $('a[data-toggle=16][data-title=1]').removeClass('disabled');
        $('a[data-toggle=16][data-title=1]').addClass('active');
        $('a[data-toggle=16][data-title=2]').removeClass('active');
        $('a[data-toggle=16][data-title=2]').addClass('not-active');
        $('#16').val('');
        //Invoice
        $('a[data-toggle=17][data-title=1]').removeClass('disabled');
        $('a[data-toggle=17][data-title=1]').addClass('active');
        $('a[data-toggle=17][data-title=2]').removeClass('active');
        $('a[data-toggle=17][data-title=2]').addClass('not-active');
        $('#17').val('');
        //Lab Result
        $('a[data-toggle=18][data-title=1]').removeClass('disabled');
        $('a[data-toggle=18][data-title=1]').addClass('active');
        $('a[data-toggle=18][data-title=2]').removeClass('active');
        $('a[data-toggle=18][data-title=2]').addClass('not-active');
        $('#18').val('');
        //Procedure
        $('a[data-toggle=19][data-title=1]').removeClass('disabled');
        $('a[data-toggle=19][data-title=1]').addClass('active');
        $('a[data-toggle=19][data-title=2]').removeClass('active');
        $('a[data-toggle=19][data-title=2]').addClass('not-active');
        $('#19').val('');
        //Diet
        $('a[data-toggle=20][data-title=1]').removeClass('disabled');
        $('a[data-toggle=20][data-title=1]').addClass('active');
        $('a[data-toggle=20][data-title=2]').removeClass('active');
        $('a[data-toggle=20][data-title=2]').addClass('not-active');
        $('#20').val('');
        //Lab Advice
        $('a[data-toggle=21][data-title=1]').removeClass('disabled');
        $('a[data-toggle=21][data-title=1]').addClass('active');
        $('a[data-toggle=21][data-title=2]').removeClass('active');
        $('a[data-toggle=21][data-title=2]').addClass('not-active');
        $('#21').val('');
        //Medical Certificate
        $('a[data-toggle=22][data-title=1]').removeClass('disabled');
        $('a[data-toggle=22][data-title=1]').addClass('active');
        $('a[data-toggle=22][data-title=2]').removeClass('active');
        $('a[data-toggle=22][data-title=2]').addClass('not-active');
        $('#22').val('');
        //Discharge Summary
        $('a[data-toggle=23][data-title=1]').removeClass('disabled');
        $('a[data-toggle=23][data-title=1]').addClass('active');
        $('a[data-toggle=23][data-title=2]').removeClass('active');
        $('a[data-toggle=23][data-title=2]').addClass('not-active');
        $('#23').val('');
        //Refferal Print Setting
        $('a[data-toggle=24][data-title=1]').removeClass('disabled');
        $('a[data-toggle=24][data-title=1]').addClass('active');
        $('a[data-toggle=24][data-title=2]').removeClass('active');
        $('a[data-toggle=24][data-title=2]').addClass('not-active');
        $('#24').val('');

        //--Lab Setting--
        $('a[data-toggle=25][data-title=1]').removeClass('disabled');
        $('a[data-toggle=25][data-title=1]').addClass('active');
        $('a[data-toggle=25][data-title=2]').removeClass('active');
        $('a[data-toggle=25][data-title=2]').addClass('not-active');
        $('#25').val('');
        //--Lab Setting--
        //Test Creation
        $('a[data-toggle=26][data-title=1]').removeClass('disabled');
        $('a[data-toggle=26][data-title=1]').addClass('active');
        $('a[data-toggle=26][data-title=2]').removeClass('active');
        $('a[data-toggle=26][data-title=2]').addClass('not-active');
        $('#26').val('');
        //Panel Creation
        $('a[data-toggle=27][data-title=1]').removeClass('disabled');
        $('a[data-toggle=27][data-title=1]').addClass('active');
        $('a[data-toggle=27][data-title=2]').removeClass('active');
        $('a[data-toggle=27][data-title=2]').addClass('not-active');
        $('#27').val('');
        //--CaseSheet Configuration--
        $('a[data-toggle=28][data-title=1]').removeClass('disabled');
        $('a[data-toggle=28][data-title=1]').addClass('active');
        $('a[data-toggle=28][data-title=2]').removeClass('active');
        $('a[data-toggle=28][data-title=2]').addClass('not-active');
        $('#28').val('');
        //--Chat--
        $('a[data-toggle=29][data-title=1]').removeClass('disabled');
        $('a[data-toggle=29][data-title=1]').addClass('active');
        $('a[data-toggle=29][data-title=2]').removeClass('active');
        $('a[data-toggle=29][data-title=2]').addClass('not-active');
        $('#29').val('');
        //--User--
        $('a[data-toggle=30][data-title=1]').removeClass('disabled');
        $('a[data-toggle=30][data-title=1]').addClass('active');
        $('a[data-toggle=30][data-title=2]').removeClass('active');
        $('a[data-toggle=30][data-title=2]').addClass('not-active');
        $('#30').val('');
        //--User Sub tab
        //Edit User
        $('a[data-toggle=32][data-title=1]').removeClass('disabled');
        $('a[data-toggle=32][data-title=1]').addClass('active');
        $('a[data-toggle=32][data-title=2]').removeClass('active');
        $('a[data-toggle=32][data-title=2]').addClass('not-active');
        $('#32').val('');
        //Add User
        $('a[data-toggle=31][data-title=1]').removeClass('disabled');
        $('a[data-toggle=31][data-title=1]').addClass('active');
        $('a[data-toggle=31][data-title=2]').removeClass('active');
        $('a[data-toggle=31][data-title=2]').addClass('not-active');
        $('#31').val('');
        //--Template Management--
        $('a[data-toggle=33][data-title=1]').removeClass('disabled');
        $('a[data-toggle=33][data-title=1]').addClass('active');
        $('a[data-toggle=33][data-title=2]').removeClass('active');
        $('a[data-toggle=33][data-title=2]').addClass('not-active');
        $('#33').val('');
        //--Template Management Sub tab--
        //--Template Management-->Lab
        $('a[data-toggle=34][data-title=1]').removeClass('disabled');
        $('a[data-toggle=34][data-title=1]').addClass('active');
        $('a[data-toggle=34][data-title=2]').removeClass('active');
        $('a[data-toggle=34][data-title=2]').addClass('not-active');
        $('#34').val('');
        //--Template Management-->Diet
        $('a[data-toggle=35][data-title=1]').removeClass('disabled');
        $('a[data-toggle=35][data-title=1]').addClass('active');
        $('a[data-toggle=35][data-title=2]').removeClass('active');
        $('a[data-toggle=35][data-title=2]').addClass('not-active');
        $('#35').val('');
        //--Template Management-->Prescription
        $('a[data-toggle=36][data-title=1]').removeClass('disabled');
        $('a[data-toggle=36][data-title=1]').addClass('active');
        $('a[data-toggle=36][data-title=2]').removeClass('active');
        $('a[data-toggle=36][data-title=2]').addClass('not-active');
        $('#36').val('');
        //--Template Management-->Complaints
        $('a[data-toggle=37][data-title=1]').removeClass('disabled');
        $('a[data-toggle=37][data-title=1]').addClass('active');
        $('a[data-toggle=37][data-title=2]').removeClass('active');
        $('a[data-toggle=37][data-title=2]').addClass('not-active');
        $('#37').val('');
        //--Template Management-->Diagnosis
        $('a[data-toggle=38][data-title=1]').removeClass('disabled');
        $('a[data-toggle=38][data-title=1]').addClass('active');
        $('a[data-toggle=38][data-title=2]').removeClass('active');
        $('a[data-toggle=38][data-title=2]').addClass('not-active');
        $('#38').val('');
        //--Service Traffic--
        $('a[data-toggle=39][data-title=1]').removeClass('disabled');
        $('a[data-toggle=39][data-title=1]').addClass('active');
        $('a[data-toggle=39][data-title=2]').removeClass('active');
        $('a[data-toggle=39][data-title=2]').addClass('not-active');
        $('#39').val('');
        //Service Traffic-->Add Service Traffic
        $('a[data-toggle=40][data-title=1]').removeClass('disabled');
        $('a[data-toggle=40][data-title=1]').addClass('active');
        $('a[data-toggle=40][data-title=2]').removeClass('active');
        $('a[data-toggle=40][data-title=2]').addClass('not-active');
        $('#40').val('');
        //Service Traffic-->Delete Service Traffic
        $('a[data-toggle=41][data-title=1]').removeClass('disabled');
        $('a[data-toggle=41][data-title=1]').addClass('active');
        $('a[data-toggle=41][data-title=2]').removeClass('active');
        $('a[data-toggle=41][data-title=2]').addClass('not-active');
        $('#41').val('');
        //Service Traffic-->Edit Service Traffic 
        $('a[data-toggle=42][data-title=1]').removeClass('disabled');
        $('a[data-toggle=42][data-title=1]').addClass('active');
        $('a[data-toggle=42][data-title=2]').removeClass('active');
        $('a[data-toggle=42][data-title=2]').addClass('not-active');
        $('#42').val('');
        //--Manage Bank Account--
        $('a[data-toggle=43][data-title=1]').removeClass('disabled');
        $('a[data-toggle=43][data-title=1]').addClass('active');
        $('a[data-toggle=43][data-title=2]').removeClass('active');
        $('a[data-toggle=43][data-title=2]').addClass('not-active');
        $('#43').val('');
        //Manage Bank Account-->Add Bank
        $('a[data-toggle=44][data-title=1]').removeClass('disabled');
        $('a[data-toggle=44][data-title=1]').addClass('active');
        $('a[data-toggle=44][data-title=2]').removeClass('active');
        $('a[data-toggle=44][data-title=2]').addClass('not-active');
        $('#44').val('');
        //Manage Bank Account-->Edit Bank
        $('a[data-toggle=45][data-title=1]').removeClass('disabled');
        $('a[data-toggle=45][data-title=1]').addClass('active');
        $('a[data-toggle=45][data-title=2]').removeClass('active');
        $('a[data-toggle=45][data-title=2]').addClass('not-active');
        $('#45').val('');
        //Manage Bank Account-->Delete Bank
        $('a[data-toggle=46][data-title=1]').removeClass('disabled');
        $('a[data-toggle=46][data-title=1]').addClass('active');
        $('a[data-toggle=46][data-title=2]').removeClass('active');
        $('a[data-toggle=46][data-title=2]').addClass('not-active');
        $('#46').val('');
        //--Mobile Fee Management--
        $('a[data-toggle=47][data-title=1]').removeClass('disabled');
        $('a[data-toggle=47][data-title=1]').addClass('active');
        $('a[data-toggle=47][data-title=2]').removeClass('active');
        $('a[data-toggle=47][data-title=2]').addClass('not-active');
        $('#47').val('');
         //--ip ward management
        $('a[data-toggle=113][data-title=1]').removeClass('disabled');
        $('a[data-toggle=113][data-title=1]').addClass('active');
        $('a[data-toggle=113][data-title=2]').removeClass('active');
        $('a[data-toggle=113][data-title=2]').addClass('not-active');
        $('#113').val('');
        //--ip operation session
        $('a[data-toggle=114][data-title=1]').removeClass('disabled');
        $('a[data-toggle=114][data-title=1]').addClass('active');
        $('a[data-toggle=114][data-title=2]').removeClass('active');
        $('a[data-toggle=114][data-title=2]').addClass('not-active');
        $('#114').val('');

        //--Fee Management
        $('a[data-toggle=125][data-title=1]').removeClass('disabled');
        $('a[data-toggle=125][data-title=1]').addClass('active');
        $('a[data-toggle=125][data-title=2]').removeClass('active');
        $('a[data-toggle=125][data-title=2]').addClass('not-active');
        $('#125').val('');

        //--Configuration
        $('a[data-toggle=126][data-title=1]').removeClass('disabled');
        $('a[data-toggle=126][data-title=1]').addClass('active');
        $('a[data-toggle=126][data-title=2]').removeClass('active');
        $('a[data-toggle=126][data-title=2]').addClass('not-active');
        $('#126').val('');
    }


})
//Setting-->Calender
$('#13').change(function () {
    var toggle = $('#13').val();
    if(toggle=="2")
    {
        //--Calender Sub tab--
        //Add Schedule
        $('a[data-toggle=14][data-title=1]').removeClass('active');
        $('a[data-toggle=14][data-title=1]').addClass('disabled');
        $('a[data-toggle=14][data-title=2]').removeClass('not-active');
        $('a[data-toggle=14][data-title=2]').addClass('active');
        $('#14').val('2');
    }
    else {
        //--Calender Sub tab--
        //Add Schedule
        $('a[data-toggle=14][data-title=1]').removeClass('disabled');
        $('a[data-toggle=14][data-title=1]').addClass('active');
        $('a[data-toggle=14][data-title=2]').removeClass('active');
        $('a[data-toggle=14][data-title=2]').addClass('not-active');
        $('#14').val('');
    }
})
//Setting-->Print Paper
$("#15").change(function () {
    var toggle = $('#15').val();
    if (toggle == "2") {
        //Prescription
        $('a[data-toggle=16][data-title=1]').removeClass('active');
        $('a[data-toggle=16][data-title=1]').addClass('disabled');
        $('a[data-toggle=16][data-title=2]').removeClass('not-active');
        $('a[data-toggle=16][data-title=2]').addClass('active');
        $('#16').val('2');
        //Invoice
        $('a[data-toggle=17][data-title=1]').removeClass('active');
        $('a[data-toggle=17][data-title=1]').addClass('disabled');
        $('a[data-toggle=17][data-title=2]').removeClass('not-active');
        $('a[data-toggle=17][data-title=2]').addClass('active');
        $('#17').val('2');
        //Lab results
        $('a[data-toggle=18][data-title=1]').removeClass('active');
        $('a[data-toggle=18][data-title=1]').addClass('disabled');
        $('a[data-toggle=18][data-title=2]').removeClass('not-active');
        $('a[data-toggle=18][data-title=2]').addClass('active');
        $('#18').val('2');
        //Procedure
        $('a[data-toggle=19][data-title=1]').removeClass('active');
        $('a[data-toggle=19][data-title=1]').addClass('disabled');
        $('a[data-toggle=19][data-title=2]').removeClass('not-active');
        $('a[data-toggle=19][data-title=2]').addClass('active');
        $('#19').val('2');
        //Diet
        $('a[data-toggle=20][data-title=1]').removeClass('active');
        $('a[data-toggle=20][data-title=1]').addClass('disabled');
        $('a[data-toggle=20][data-title=2]').removeClass('not-active');
        $('a[data-toggle=20][data-title=2]').addClass('active');
        $('#20').val('2');
        //Lab Advice
        $('a[data-toggle=21][data-title=1]').removeClass('active');
        $('a[data-toggle=21][data-title=1]').addClass('disabled');
        $('a[data-toggle=21][data-title=2]').removeClass('not-active');
        $('a[data-toggle=21][data-title=2]').addClass('active');
        $('#21').val('2');
        //Medical Certificate
        $('a[data-toggle=22][data-title=1]').removeClass('active');
        $('a[data-toggle=22][data-title=1]').addClass('disabled');
        $('a[data-toggle=22][data-title=2]').removeClass('not-active');
        $('a[data-toggle=22][data-title=2]').addClass('active');
        $('#22').val('2');
        //Discharge summary
        $('a[data-toggle=23][data-title=1]').removeClass('active');
        $('a[data-toggle=23][data-title=1]').addClass('disabled');
        $('a[data-toggle=23][data-title=2]').removeClass('not-active');
        $('a[data-toggle=23][data-title=2]').addClass('active');
        $('#23').val('2');
        //Refferal Print Setting
        $('a[data-toggle=24][data-title=1]').removeClass('active');
        $('a[data-toggle=24][data-title=1]').addClass('disabled');
        $('a[data-toggle=24][data-title=2]').removeClass('not-active');
        $('a[data-toggle=24][data-title=2]').addClass('active');
        $('#24').val('2');
    }
    else {
        //Prescription
        $('a[data-toggle=16][data-title=1]').removeClass('disabled');
        $('a[data-toggle=16][data-title=1]').addClass('active');
        $('a[data-toggle=16][data-title=2]').removeClass('active');
        $('a[data-toggle=16][data-title=2]').addClass('not-active');
        $('#16').val('');
        //Invoice
        $('a[data-toggle=17][data-title=1]').removeClass('disabled');
        $('a[data-toggle=17][data-title=1]').addClass('active');
        $('a[data-toggle=17][data-title=2]').removeClass('active');
        $('a[data-toggle=17][data-title=2]').addClass('not-active');
        $('#17').val('');
        //Lab Result
        $('a[data-toggle=18][data-title=1]').removeClass('disabled');
        $('a[data-toggle=18][data-title=1]').addClass('active');
        $('a[data-toggle=18][data-title=2]').removeClass('active');
        $('a[data-toggle=18][data-title=2]').addClass('not-active');
        $('#18').val('');
        //Procedure
        $('a[data-toggle=19][data-title=1]').removeClass('disabled');
        $('a[data-toggle=19][data-title=1]').addClass('active');
        $('a[data-toggle=19][data-title=2]').removeClass('active');
        $('a[data-toggle=19][data-title=2]').addClass('not-active');
        $('#19').val('');
        //Diet
        $('a[data-toggle=20][data-title=1]').removeClass('disabled');
        $('a[data-toggle=20][data-title=1]').addClass('active');
        $('a[data-toggle=20][data-title=2]').removeClass('active');
        $('a[data-toggle=20][data-title=2]').addClass('not-active');
        $('#20').val('');
        //Lab Advice
        $('a[data-toggle=21][data-title=1]').removeClass('disabled');
        $('a[data-toggle=21][data-title=1]').addClass('active');
        $('a[data-toggle=21][data-title=2]').removeClass('active');
        $('a[data-toggle=21][data-title=2]').addClass('not-active');
        $('#21').val('');
        //Medical Certificate
        $('a[data-toggle=22][data-title=1]').removeClass('disabled');
        $('a[data-toggle=22][data-title=1]').addClass('active');
        $('a[data-toggle=22][data-title=2]').removeClass('active');
        $('a[data-toggle=22][data-title=2]').addClass('not-active');
        $('#22').val('');
        //Discharge Summary
        $('a[data-toggle=23][data-title=1]').removeClass('disabled');
        $('a[data-toggle=23][data-title=1]').addClass('active');
        $('a[data-toggle=23][data-title=2]').removeClass('active');
        $('a[data-toggle=23][data-title=2]').addClass('not-active');
        $('#23').val('');
        //Refferal Print Setting
        $('a[data-toggle=24][data-title=1]').removeClass('disabled');
        $('a[data-toggle=24][data-title=1]').addClass('active');
        $('a[data-toggle=24][data-title=2]').removeClass('active');
        $('a[data-toggle=24][data-title=2]').addClass('not-active');
        $('#24').val('');

    }
})
//Setting-->Lab Setting
$('#25').change(function () {
    var toggle = $('#25').val();
    if (toggle == "2") {
        //Test Creation
        $('a[data-toggle=26][data-title=1]').removeClass('active');
        $('a[data-toggle=26][data-title=1]').addClass('disabled');
        $('a[data-toggle=26][data-title=2]').removeClass('not-active');
        $('a[data-toggle=26][data-title=2]').addClass('active');
        $('#26').val('2');
        //Panel Creation
        $('a[data-toggle=27][data-title=1]').removeClass('active');
        $('a[data-toggle=27][data-title=1]').addClass('disabled');
        $('a[data-toggle=27][data-title=2]').removeClass('not-active');
        $('a[data-toggle=27][data-title=2]').addClass('active');
        $('#27').val('2');
    }
    else {
        //Test Creation
        $('a[data-toggle=26][data-title=1]').removeClass('disabled');
        $('a[data-toggle=26][data-title=1]').addClass('active');
        $('a[data-toggle=26][data-title=2]').removeClass('active');
        $('a[data-toggle=26][data-title=2]').addClass('not-active');
        $('#26').val('');
        //Panel Creation
        $('a[data-toggle=27][data-title=1]').removeClass('disabled');
        $('a[data-toggle=27][data-title=1]').addClass('active');
        $('a[data-toggle=27][data-title=2]').removeClass('active');
        $('a[data-toggle=27][data-title=2]').addClass('not-active');
        $('#27').val('');
    }
})
//Setting-->Users
$('#30').change(function () {
    var toggle = $('#30').val();
    if (toggle == "2") {
        //Edit User
        $('a[data-toggle=32][data-title=1]').removeClass('active');
        $('a[data-toggle=32][data-title=1]').addClass('disabled');
        $('a[data-toggle=32][data-title=2]').removeClass('not-active');
        $('a[data-toggle=32][data-title=2]').addClass('active');
        $('#32').val('2');
        //Add User
        $('a[data-toggle=31][data-title=1]').removeClass('active');
        $('a[data-toggle=31][data-title=1]').addClass('disabled');
        $('a[data-toggle=31][data-title=2]').removeClass('not-active');
        $('a[data-toggle=31][data-title=2]').addClass('active');
        $('#31').val('2');

    }
    else {
        //Edit User
        $('a[data-toggle=32][data-title=1]').removeClass('disabled');
        $('a[data-toggle=32][data-title=1]').addClass('active');
        $('a[data-toggle=32][data-title=2]').removeClass('active');
        $('a[data-toggle=32][data-title=2]').addClass('not-active');
        $('#32').val('');
        //Add User
        $('a[data-toggle=31][data-title=1]').removeClass('disabled');
        $('a[data-toggle=31][data-title=1]').addClass('active');
        $('a[data-toggle=31][data-title=2]').removeClass('active');
        $('a[data-toggle=31][data-title=2]').addClass('not-active');
        $('#31').val('');
    }
})
//Setting-->Template Management
$('#33').change(function () {
    var toggle = $('#33').val();
    if (toggle == "2") {
        // Template management--> Lab
        $('a[data-toggle=34][data-title=1]').removeClass('active');
        $('a[data-toggle=34][data-title=1]').addClass('disabled');
        $('a[data-toggle=34][data-title=2]').removeClass('not-active');
        $('a[data-toggle=34][data-title=2]').addClass('active');
        $('#34').val('2');
        // Template management--> Diet
        $('a[data-toggle=35][data-title=1]').removeClass('active');
        $('a[data-toggle=35][data-title=1]').addClass('disabled');
        $('a[data-toggle=35][data-title=2]').removeClass('not-active');
        $('a[data-toggle=35][data-title=2]').addClass('active');
        $('#35').val('2');
        // Template management--> Prescription
        $('a[data-toggle=36][data-title=1]').removeClass('active');
        $('a[data-toggle=36][data-title=1]').addClass('disabled');
        $('a[data-toggle=36][data-title=2]').removeClass('not-active');
        $('a[data-toggle=36][data-title=2]').addClass('active');
        $('#36').val('2');
        //Template management-->Complaints
        $('a[data-toggle=37][data-title=1]').removeClass('active');
        $('a[data-toggle=37][data-title=1]').addClass('disabled');
        $('a[data-toggle=37][data-title=2]').removeClass('not-active');
        $('a[data-toggle=37][data-title=2]').addClass('active');
        $('#37').val('2');
        //Template management-->Diagnosis
        $('a[data-toggle=38][data-title=1]').removeClass('active');
        $('a[data-toggle=38][data-title=1]').addClass('disabled');
        $('a[data-toggle=38][data-title=2]').removeClass('not-active');
        $('a[data-toggle=38][data-title=2]').addClass('active');
        $('#38').val('2');
    }
    else {
        //--Template Management-->Lab
        $('a[data-toggle=34][data-title=1]').removeClass('disabled');
        $('a[data-toggle=34][data-title=1]').addClass('active');
        $('a[data-toggle=34][data-title=2]').removeClass('active');
        $('a[data-toggle=34][data-title=2]').addClass('not-active');
        $('#34').val('');
        //--Template Management-->Diet
        $('a[data-toggle=35][data-title=1]').removeClass('disabled');
        $('a[data-toggle=35][data-title=1]').addClass('active');
        $('a[data-toggle=35][data-title=2]').removeClass('active');
        $('a[data-toggle=35][data-title=2]').addClass('not-active');
        $('#35').val('');
        //--Template Management-->Prescription
        $('a[data-toggle=36][data-title=1]').removeClass('disabled');
        $('a[data-toggle=36][data-title=1]').addClass('active');
        $('a[data-toggle=36][data-title=2]').removeClass('active');
        $('a[data-toggle=36][data-title=2]').addClass('not-active');
        $('#36').val('');
        //--Template Management-->Complaints
        $('a[data-toggle=37][data-title=1]').removeClass('disabled');
        $('a[data-toggle=37][data-title=1]').addClass('active');
        $('a[data-toggle=37][data-title=2]').removeClass('active');
        $('a[data-toggle=37][data-title=2]').addClass('not-active');
        $('#37').val('');
        //--Template Management-->Diagnosis
        $('a[data-toggle=38][data-title=1]').removeClass('disabled');
        $('a[data-toggle=38][data-title=1]').addClass('active');
        $('a[data-toggle=38][data-title=2]').removeClass('active');
        $('a[data-toggle=38][data-title=2]').addClass('not-active');
        $('#38').val('');

    }
})
//Settings-->Service Traffic
$('#39').change(function () {
    var toggle = $('#39').val();
    if (toggle == "2") {
        //--Service Traffic-->Add Service Traffic
        $('a[data-toggle=40][data-title=1]').removeClass('active');
        $('a[data-toggle=40][data-title=1]').addClass('disabled');
        $('a[data-toggle=40][data-title=2]').removeClass('not-active');
        $('a[data-toggle=40][data-title=2]').addClass('active');
        $('#40').val('2');
        //--Service Traffic-->Delete Service Traffic
        $('a[data-toggle=41][data-title=1]').removeClass('active');
        $('a[data-toggle=41][data-title=1]').addClass('disabled');
        $('a[data-toggle=41][data-title=2]').removeClass('not-active');
        $('a[data-toggle=41][data-title=2]').addClass('active');
        $('#41').val('2');
        //--Service Traffic-->Edit Service Traffic
        $('a[data-toggle=42][data-title=1]').removeClass('active');
        $('a[data-toggle=42][data-title=1]').addClass('disabled');
        $('a[data-toggle=42][data-title=2]').removeClass('not-active');
        $('a[data-toggle=42][data-title=2]').addClass('active');
        $('#42').val('2');

    }
    else {
        //Service Traffic-->Add Service Traffic
        $('a[data-toggle=40][data-title=1]').removeClass('disabled');
        $('a[data-toggle=40][data-title=1]').addClass('active');
        $('a[data-toggle=40][data-title=2]').removeClass('active');
        $('a[data-toggle=40][data-title=2]').addClass('not-active');
        $('#40').val('');
        //Service Traffic-->Delete Service Traffic
        $('a[data-toggle=41][data-title=1]').removeClass('disabled');
        $('a[data-toggle=41][data-title=1]').addClass('active');
        $('a[data-toggle=41][data-title=2]').removeClass('active');
        $('a[data-toggle=41][data-title=2]').addClass('not-active');
        $('#41').val('');
        //Service Traffic-->Edit Service Traffic 
        $('a[data-toggle=42][data-title=1]').removeClass('disabled');
        $('a[data-toggle=42][data-title=1]').addClass('active');
        $('a[data-toggle=42][data-title=2]').removeClass('active');
        $('a[data-toggle=42][data-title=2]').addClass('not-active');
        $('#42').val('');

    }
})
//Setting-->Manage Bank Account
$('#43').change(function () {
    var toggle = $('#43').val();
    if (toggle == "2") {
        //Manage Bank Account-->Add Bank
        $('a[data-toggle=44][data-title=1]').removeClass('active');
        $('a[data-toggle=44][data-title=1]').addClass('disabled');
        $('a[data-toggle=44][data-title=2]').removeClass('not-active');
        $('a[data-toggle=44][data-title=2]').addClass('active');
        $('#44').val('2');
        //Manage Bank Account-->Edit Bank
        $('a[data-toggle=45][data-title=1]').removeClass('active');
        $('a[data-toggle=45][data-title=1]').addClass('disabled');
        $('a[data-toggle=45][data-title=2]').removeClass('not-active');
        $('a[data-toggle=45][data-title=2]').addClass('active');
        $('#45').val('2');
        //Manage Bank Delete-->Delete Bank
        $('a[data-toggle=46][data-title=1]').removeClass('active');
        $('a[data-toggle=46][data-title=1]').addClass('disabled');
        $('a[data-toggle=46][data-title=2]').removeClass('not-active');
        $('a[data-toggle=46][data-title=2]').addClass('active');
        $('#46').val('2');
    }
    else {
        //Manage Bank Account-->Add Bank
        $('a[data-toggle=44][data-title=1]').removeClass('disabled');
        $('a[data-toggle=44][data-title=1]').addClass('active');
        $('a[data-toggle=44][data-title=2]').removeClass('active');
        $('a[data-toggle=44][data-title=2]').addClass('not-active');
        $('#44').val('');
        //Manage Bank Account-->Edit Bank
        $('a[data-toggle=45][data-title=1]').removeClass('disabled');
        $('a[data-toggle=45][data-title=1]').addClass('active');
        $('a[data-toggle=45][data-title=2]').removeClass('active');
        $('a[data-toggle=45][data-title=2]').addClass('not-active');
        $('#45').val('');
        //Manage Bank Account-->Delete Bank
        $('a[data-toggle=46][data-title=1]').removeClass('disabled');
        $('a[data-toggle=46][data-title=1]').addClass('active');
        $('a[data-toggle=46][data-title=2]').removeClass('active');
        $('a[data-toggle=46][data-title=2]').addClass('not-active');
        $('#46').val('');
    }
})
//Communication
$("#52").change(function () {
    var toggle = $('#52').val();
    if (toggle == "2") {
        //Communication-->Chat
        $('a[data-toggle=53][data-title=1]').removeClass('active');
        $('a[data-toggle=53][data-title=1]').addClass('disabled');
        $('a[data-toggle=53][data-title=2]').removeClass('not-active');
        $('a[data-toggle=53][data-title=2]').addClass('active');
        $('#53').val('2');
        //Communication-->BroadCast
        $('a[data-toggle=54][data-title=1]').removeClass('active');
        $('a[data-toggle=54][data-title=1]').addClass('disabled');
        $('a[data-toggle=54][data-title=2]').removeClass('not-active');
        $('a[data-toggle=54][data-title=2]').addClass('active');
        $('#54').val('2');
        //Communication-->Sms Campaign
        $('a[data-toggle=55][data-title=1]').removeClass('active');
        $('a[data-toggle=55][data-title=1]').addClass('disabled');
        $('a[data-toggle=55][data-title=2]').removeClass('not-active');
        $('a[data-toggle=55][data-title=2]').addClass('active');
        $('#55').val('2');

    }
    else {
        //Communication-->Chat
        $('a[data-toggle=53][data-title=1]').removeClass('disabled');
        $('a[data-toggle=53][data-title=1]').addClass('active');
        $('a[data-toggle=53][data-title=2]').removeClass('active');
        $('a[data-toggle=53][data-title=2]').addClass('not-active');
        $('#53').val('');
        //Communication-->BroadCast
        $('a[data-toggle=54][data-title=1]').removeClass('disabled');
        $('a[data-toggle=54][data-title=1]').addClass('active');
        $('a[data-toggle=54][data-title=2]').removeClass('active');
        $('a[data-toggle=54][data-title=2]').addClass('not-active');
        $('#54').val('');
        //Communication-->Sms Campaign
        $('a[data-toggle=55][data-title=1]').removeClass('disabled');
        $('a[data-toggle=55][data-title=1]').addClass('active');
        $('a[data-toggle=55][data-title=2]').removeClass('active');
        $('a[data-toggle=55][data-title=2]').addClass('not-active');
        $('#55').val('');

    }
})
//Reports
$("#56").change(function () {
    var toggle = $('#56').val();
    if (toggle == "2") {
        //--Operational Reports--
        $('a[data-toggle=57][data-title=1]').removeClass('active');
        $('a[data-toggle=57][data-title=1]').addClass('disabled');
        $('a[data-toggle=57][data-title=2]').removeClass('not-active');
        $('a[data-toggle=57][data-title=2]').addClass('active');
        $('#57').val('2');
        //Operational Reports-->Appointment
        $('a[data-toggle=58][data-title=1]').removeClass('active');
        $('a[data-toggle=58][data-title=1]').addClass('disabled');
        $('a[data-toggle=58][data-title=2]').removeClass('not-active');
        $('a[data-toggle=58][data-title=2]').addClass('active');
        $('#58').val('2');
        //Operational Reports-->Revenue
        $('a[data-toggle=59][data-title=1]').removeClass('active');
        $('a[data-toggle=59][data-title=1]').addClass('disabled');
        $('a[data-toggle=59][data-title=2]').removeClass('not-active');
        $('a[data-toggle=59][data-title=2]').addClass('active');
        $('#59').val('2');
        //Operational Reports-->Medicine
        $('a[data-toggle=60][data-title=1]').removeClass('active');
        $('a[data-toggle=60][data-title=1]').addClass('disabled');
        $('a[data-toggle=60][data-title=2]').removeClass('not-active');
        $('a[data-toggle=60][data-title=2]').addClass('active');
        $('#60').val('2');
        //Operational Reports-->Lab
        $('a[data-toggle=61][data-title=1]').removeClass('active');
        $('a[data-toggle=61][data-title=1]').addClass('disabled');
        $('a[data-toggle=61][data-title=2]').removeClass('not-active');
        $('a[data-toggle=61][data-title=2]').addClass('active');
        $('#61').val('2');
        //Operational Reports-->Daily Summary
        $('a[data-toggle=62][data-title=1]').removeClass('active');
        $('a[data-toggle=62][data-title=1]').addClass('disabled');
        $('a[data-toggle=62][data-title=2]').removeClass('not-active');
        $('a[data-toggle=62][data-title=2]').addClass('active');
        $('#62').val('2');
        //Operational Reports-->Patient Report
        $('a[data-toggle=112][data-title=1]').removeClass('active');
        $('a[data-toggle=112][data-title=1]').addClass('disabled');
        $('a[data-toggle=112][data-title=2]').removeClass('not-active');
        $('a[data-toggle=112][data-title=2]').addClass('active');
        $('#112').val('2');
        //--Functional Reports--
        $('a[data-toggle=63][data-title=1]').removeClass('active');
        $('a[data-toggle=63][data-title=1]').addClass('disabled');
        $('a[data-toggle=63][data-title=2]').removeClass('not-active');
        $('a[data-toggle=63][data-title=2]').addClass('active');
        $('#63').val('2');
        //Functional Reports-->SMS
        $('a[data-toggle=64][data-title=1]').removeClass('active');
        $('a[data-toggle=64][data-title=1]').addClass('disabled');
        $('a[data-toggle=64][data-title=2]').removeClass('not-active');
        $('a[data-toggle=64][data-title=2]').addClass('active');
        $('#64').val('2');
        //Functional Reports-->Medicine
        $('a[data-toggle=65][data-title=1]').removeClass('active');
        $('a[data-toggle=65][data-title=1]').addClass('disabled');
        $('a[data-toggle=65][data-title=2]').removeClass('not-active');
        $('a[data-toggle=65][data-title=2]').addClass('active');
        $('#65').val('2');
        //Functional Reports-->Lab
        $('a[data-toggle=66][data-title=1]').removeClass('active');
        $('a[data-toggle=66][data-title=1]').addClass('disabled');
        $('a[data-toggle=66][data-title=2]').removeClass('not-active');
        $('a[data-toggle=66][data-title=2]').addClass('active');
        $('#66').val('2');
        //Functional Reports-->Package
        $('a[data-toggle=67][data-title=1]').removeClass('active');
        $('a[data-toggle=67][data-title=1]').addClass('disabled');
        $('a[data-toggle=67][data-title=2]').removeClass('not-active');
        $('a[data-toggle=67][data-title=2]').addClass('active');
        $('#67').val('2');
        //Functional Reports-->Appointment Boooking
        $('a[data-toggle=68][data-title=1]').removeClass('active');
        $('a[data-toggle=68][data-title=1]').addClass('disabled');
        $('a[data-toggle=68][data-title=2]').removeClass('not-active');
        $('a[data-toggle=68][data-title=2]').addClass('active');
        $('#68').val('2');
        //Covid Vaccine
        $('a[data-toggle=115][data-title=1]').removeClass('active');
        $('a[data-toggle=115][data-title=1]').addClass('disabled');
        $('a[data-toggle=115][data-title=2]').removeClass('not-active');
        $('a[data-toggle=115][data-title=2]').addClass('active');
        $('#115').val('2');
    }
    else {
        //--Operational Reports--
        $('a[data-toggle=57][data-title=1]').removeClass('disabled');
        $('a[data-toggle=57][data-title=1]').addClass('active');
        $('a[data-toggle=57][data-title=2]').removeClass('active');
        $('a[data-toggle=57][data-title=2]').addClass('not-active');
        $('#57').val('');
        //Operational Reports-->Appointment
        $('a[data-toggle=58][data-title=1]').removeClass('disabled');
        $('a[data-toggle=58][data-title=1]').addClass('active');
        $('a[data-toggle=58][data-title=2]').removeClass('active');
        $('a[data-toggle=58][data-title=2]').addClass('not-active');
        $('#58').val('');
        //Operational Reports-->Revenue
        $('a[data-toggle=59][data-title=1]').removeClass('disabled');
        $('a[data-toggle=59][data-title=1]').addClass('active');
        $('a[data-toggle=59][data-title=2]').removeClass('active');
        $('a[data-toggle=59][data-title=2]').addClass('not-active');
        $('#59').val('');
        //Operational Reports-->Medicine
        $('a[data-toggle=60][data-title=1]').removeClass('disabled');
        $('a[data-toggle=60][data-title=1]').addClass('active');
        $('a[data-toggle=60][data-title=2]').removeClass('active');
        $('a[data-toggle=60][data-title=2]').addClass('not-active');
        $('#60').val('');
        //Operational Reports-->Lab
        $('a[data-toggle=61][data-title=1]').removeClass('disabled');
        $('a[data-toggle=61][data-title=1]').addClass('active');
        $('a[data-toggle=61][data-title=2]').removeClass('active');
        $('a[data-toggle=61][data-title=2]').addClass('not-active');
        $('#61').val('');
        //Operational Reports-->Daily Summary
        $('a[data-toggle=62][data-title=1]').removeClass('disabled');
        $('a[data-toggle=62][data-title=1]').addClass('active');
        $('a[data-toggle=62][data-title=2]').removeClass('active');
        $('a[data-toggle=62][data-title=2]').addClass('not-active');
        $('#62').val('');

        //Operational Reports-->Patient Report
        $('a[data-toggle=112][data-title=1]').removeClass('disabled');
        $('a[data-toggle=112][data-title=1]').addClass('active');
        $('a[data-toggle=112][data-title=2]').removeClass('active');
        $('a[data-toggle=112][data-title=2]').addClass('not-active');
        $('#112').val('');

        //--Functional Reports--
        $('a[data-toggle=63][data-title=1]').removeClass('disabled');
        $('a[data-toggle=63][data-title=1]').addClass('active');
        $('a[data-toggle=63][data-title=2]').removeClass('active');
        $('a[data-toggle=63][data-title=2]').addClass('not-active');
        $('#63').val('');
        //Functional Reports-->SMS
        $('a[data-toggle=64][data-title=1]').removeClass('disabled');
        $('a[data-toggle=64][data-title=1]').addClass('active');
        $('a[data-toggle=64][data-title=2]').removeClass('active');
        $('a[data-toggle=64][data-title=2]').addClass('not-active');
        $('#64').val('');
        //Functional Reports-->Medicine
        $('a[data-toggle=65][data-title=1]').removeClass('disabled');
        $('a[data-toggle=65][data-title=1]').addClass('active');
        $('a[data-toggle=65][data-title=2]').removeClass('active');
        $('a[data-toggle=65][data-title=2]').addClass('not-active');
        $('#65').val('');
        //Functional Reports-->Lab
        $('a[data-toggle=66][data-title=1]').removeClass('disabled');
        $('a[data-toggle=66][data-title=1]').addClass('active');
        $('a[data-toggle=66][data-title=2]').removeClass('active');
        $('a[data-toggle=66][data-title=2]').addClass('not-active');
        $('#66').val('');
        //Functional Reports-->Package
        $('a[data-toggle=67][data-title=1]').removeClass('disabled');
        $('a[data-toggle=67][data-title=1]').addClass('active');
        $('a[data-toggle=67][data-title=2]').removeClass('active');
        $('a[data-toggle=67][data-title=2]').addClass('not-active');
        $('#67').val('');
        //Functional Reports-->Appointment Booking
        $('a[data-toggle=68][data-title=1]').removeClass('disabled');
        $('a[data-toggle=68][data-title=1]').addClass('active');
        $('a[data-toggle=68][data-title=2]').removeClass('active');
        $('a[data-toggle=68][data-title=2]').addClass('not-active');
        $('#68').val('');
        //covid vaccine
        $('a[data-toggle=115][data-title=1]').removeClass('disabled');
        $('a[data-toggle=115][data-title=1]').addClass('active');
        $('a[data-toggle=115][data-title=2]').removeClass('active');
        $('a[data-toggle=115][data-title=2]').addClass('not-active');
        $('#115').val('');
    }
})
//Operational Reports
$('#57').change(function () {
    var toggle = $('#57').val();
    if (toggle == "2") {
        //Operational Reports-->Appointment
        $('a[data-toggle=58][data-title=1]').removeClass('active');
        $('a[data-toggle=58][data-title=1]').addClass('disabled');
        $('a[data-toggle=58][data-title=2]').removeClass('not-active');
        $('a[data-toggle=58][data-title=2]').addClass('active');
        $('#58').val('2');
        //Operational Reports-->Revenue
        $('a[data-toggle=59][data-title=1]').removeClass('active');
        $('a[data-toggle=59][data-title=1]').addClass('disabled');
        $('a[data-toggle=59][data-title=2]').removeClass('not-active');
        $('a[data-toggle=59][data-title=2]').addClass('active');
        $('#59').val('2');
        //Operational Reports-->Medicine
        $('a[data-toggle=60][data-title=1]').removeClass('active');
        $('a[data-toggle=60][data-title=1]').addClass('disabled');
        $('a[data-toggle=60][data-title=2]').removeClass('not-active');
        $('a[data-toggle=60][data-title=2]').addClass('active');
        $('#60').val('2');
        //Operational Reports-->Lab
        $('a[data-toggle=61][data-title=1]').removeClass('active');
        $('a[data-toggle=61][data-title=1]').addClass('disabled');
        $('a[data-toggle=61][data-title=2]').removeClass('not-active');
        $('a[data-toggle=61][data-title=2]').addClass('active');
        $('#61').val('2');
        //Operational Reports-->Daily Summary
        $('a[data-toggle=62][data-title=1]').removeClass('active');
        $('a[data-toggle=62][data-title=1]').addClass('disabled');
        $('a[data-toggle=62][data-title=2]').removeClass('not-active');
        $('a[data-toggle=62][data-title=2]').addClass('active');
        $('#62').val('2');
        //Operational Reports-->Patient Report
        $('a[data-toggle=112][data-title=1]').removeClass('active');
        $('a[data-toggle=112][data-title=1]').addClass('disabled');
        $('a[data-toggle=112][data-title=2]').removeClass('not-active');
        $('a[data-toggle=112][data-title=2]').addClass('active');
        $('#112').val('2');

    }
    else {
        //Operational Reports-->Appointment
        $('a[data-toggle=58][data-title=1]').removeClass('disabled');
        $('a[data-toggle=58][data-title=1]').addClass('active');
        $('a[data-toggle=58][data-title=2]').removeClass('active');
        $('a[data-toggle=58][data-title=2]').addClass('not-active');
        $('#58').val('');
        //Operational Reports-->Revenue
        $('a[data-toggle=59][data-title=1]').removeClass('disabled');
        $('a[data-toggle=59][data-title=1]').addClass('active');
        $('a[data-toggle=59][data-title=2]').removeClass('active');
        $('a[data-toggle=59][data-title=2]').addClass('not-active');
        $('#59').val('');
        //Operational Reports-->Medicine
        $('a[data-toggle=60][data-title=1]').removeClass('disabled');
        $('a[data-toggle=60][data-title=1]').addClass('active');
        $('a[data-toggle=60][data-title=2]').removeClass('active');
        $('a[data-toggle=60][data-title=2]').addClass('not-active');
        $('#60').val('');
        //Operational Reports-->Lab
        $('a[data-toggle=61][data-title=1]').removeClass('disabled');
        $('a[data-toggle=61][data-title=1]').addClass('active');
        $('a[data-toggle=61][data-title=2]').removeClass('active');
        $('a[data-toggle=61][data-title=2]').addClass('not-active');
        $('#61').val('');
        //Operational Reports-->Daily Summary
        $('a[data-toggle=62][data-title=1]').removeClass('disabled');
        $('a[data-toggle=62][data-title=1]').addClass('active');
        $('a[data-toggle=62][data-title=2]').removeClass('active');
        $('a[data-toggle=62][data-title=2]').addClass('not-active');
        $('#62').val('');
        //Operational Reports-->Patient Report
        $('a[data-toggle=112][data-title=1]').removeClass('disabled');
        $('a[data-toggle=112][data-title=1]').addClass('active');
        $('a[data-toggle=112][data-title=2]').removeClass('active');
        $('a[data-toggle=112][data-title=2]').addClass('not-active');
        $('#112').val('');

    }
})
//Functional Reports
$("#63").change(function () {
    var toggle = $('#63').val();
    if (toggle == "2") {
        //Functional Reports-->SMS
        $('a[data-toggle=64][data-title=1]').removeClass('active');
        $('a[data-toggle=64][data-title=1]').addClass('disabled');
        $('a[data-toggle=64][data-title=2]').removeClass('not-active');
        $('a[data-toggle=64][data-title=2]').addClass('active');
        $('#64').val('2');
        //Functional Reports-->Medicine
        $('a[data-toggle=65][data-title=1]').removeClass('active');
        $('a[data-toggle=65][data-title=1]').addClass('disabled');
        $('a[data-toggle=65][data-title=2]').removeClass('not-active');
        $('a[data-toggle=65][data-title=2]').addClass('active');
        $('#65').val('2');
        //Functional Reports-->Lab
        $('a[data-toggle=66][data-title=1]').removeClass('active');
        $('a[data-toggle=66][data-title=1]').addClass('disabled');
        $('a[data-toggle=66][data-title=2]').removeClass('not-active');
        $('a[data-toggle=66][data-title=2]').addClass('active');
        $('#66').val('2');
        //Functional Reports-->Package
        $('a[data-toggle=67][data-title=1]').removeClass('active');
        $('a[data-toggle=67][data-title=1]').addClass('disabled');
        $('a[data-toggle=67][data-title=2]').removeClass('not-active');
        $('a[data-toggle=67][data-title=2]').addClass('active');
        $('#67').val('2');
        //Functional Reports-->Appointment Boooking
        $('a[data-toggle=68][data-title=1]').removeClass('active');
        $('a[data-toggle=68][data-title=1]').addClass('disabled');
        $('a[data-toggle=68][data-title=2]').removeClass('not-active');
        $('a[data-toggle=68][data-title=2]').addClass('active');
        $('#68').val('2');

    }
    else {
        //Functional Reports-->SMS
        $('a[data-toggle=64][data-title=1]').removeClass('disabled');
        $('a[data-toggle=64][data-title=1]').addClass('active');
        $('a[data-toggle=64][data-title=2]').removeClass('active');
        $('a[data-toggle=64][data-title=2]').addClass('not-active');
        $('#64').val('');
        //Functional Reports-->Medicine
        $('a[data-toggle=65][data-title=1]').removeClass('disabled');
        $('a[data-toggle=65][data-title=1]').addClass('active');
        $('a[data-toggle=65][data-title=2]').removeClass('active');
        $('a[data-toggle=65][data-title=2]').addClass('not-active');
        $('#65').val('');
        //Functional Reports-->Lab
        $('a[data-toggle=66][data-title=1]').removeClass('disabled');
        $('a[data-toggle=66][data-title=1]').addClass('active');
        $('a[data-toggle=66][data-title=2]').removeClass('active');
        $('a[data-toggle=66][data-title=2]').addClass('not-active');
        $('#66').val('');
        //Functional Reports-->Package
        $('a[data-toggle=67][data-title=1]').removeClass('disabled');
        $('a[data-toggle=67][data-title=1]').addClass('active');
        $('a[data-toggle=67][data-title=2]').removeClass('active');
        $('a[data-toggle=67][data-title=2]').addClass('not-active');
        $('#67').val('');
        //Functional Reports-->Appointment Booking
        $('a[data-toggle=68][data-title=1]').removeClass('disabled');
        $('a[data-toggle=68][data-title=1]').addClass('active');
        $('a[data-toggle=68][data-title=2]').removeClass('active');
        $('a[data-toggle=68][data-title=2]').addClass('not-active');
        $('#68').val('');

    }
})
//Lab Setting
$("#69").change(function () {
    var toggle = $('#69').val();
    if (toggle == "2") {
        //--Lab Diagnosis--
        $('a[data-toggle=70][data-title=1]').removeClass('active');
        $('a[data-toggle=70][data-title=1]').addClass('disabled');
        $('a[data-toggle=70][data-title=2]').removeClass('not-active');
        $('a[data-toggle=70][data-title=2]').addClass('active');
        $('#70').val('2');
        //Lab Diagnosis-->Add walk in
        $('a[data-toggle=71][data-title=1]').removeClass('active');
        $('a[data-toggle=71][data-title=1]').addClass('disabled');
        $('a[data-toggle=71][data-title=2]').removeClass('not-active');
        $('a[data-toggle=71][data-title=2]').addClass('active');
        $('#71').val('2');
        //Lab Diagnosis-->Lab Advice
        $('a[data-toggle=72][data-title=1]').removeClass('active');
        $('a[data-toggle=72][data-title=1]').addClass('disabled');
        $('a[data-toggle=72][data-title=2]').removeClass('not-active');
        $('a[data-toggle=72][data-title=2]').addClass('active');
        $('#72').val('2');
        //Lab Diagnosis-->Order View
        $('a[data-toggle=73][data-title=1]').removeClass('active');
        $('a[data-toggle=73][data-title=1]').addClass('disabled');
        $('a[data-toggle=73][data-title=2]').removeClass('not-active');
        $('a[data-toggle=73][data-title=2]').addClass('active');
        $('#73').val('2');
        //Lab Diagnosis-->Job View
        $('a[data-toggle=74][data-title=1]').removeClass('active');
        $('a[data-toggle=74][data-title=1]').addClass('disabled');
        $('a[data-toggle=74][data-title=2]').removeClass('not-active');
        $('a[data-toggle=74][data-title=2]').addClass('active');
        $('#74').val('2');
        //--Lab Home Collection--
        $('a[data-toggle=75][data-title=1]').removeClass('active');
        $('a[data-toggle=75][data-title=1]').addClass('disabled');
        $('a[data-toggle=75][data-title=2]').removeClass('not-active');
        $('a[data-toggle=75][data-title=2]').addClass('active');
        $('#75').val('2');
        //Lab Home Collection-->Self Pickup
        $('a[data-toggle=76][data-title=1]').removeClass('active');
        $('a[data-toggle=76][data-title=1]').addClass('disabled');
        $('a[data-toggle=76][data-title=2]').removeClass('not-active');
        $('a[data-toggle=76][data-title=2]').addClass('active');
        $('#76').val('2');
        //Lab Home Collection-->I2H Pickup
        $('a[data-toggle=77][data-title=1]').removeClass('active');
        $('a[data-toggle=77][data-title=1]').addClass('disabled');
        $('a[data-toggle=77][data-title=2]').removeClass('not-active');
        $('a[data-toggle=77][data-title=2]').addClass('active');
        $('#77').val('2');
        //Lab Home Collection-->Cancel Order
        $('a[data-toggle=78][data-title=1]').removeClass('active');
        $('a[data-toggle=78][data-title=1]').addClass('disabled');
        $('a[data-toggle=78][data-title=2]').removeClass('not-active');
        $('a[data-toggle=78][data-title=2]').addClass('active');
        $('#78').val('2');
    }
    else {
        //--Lab Diagnosis--
        $('a[data-toggle=70][data-title=1]').removeClass('disabled');
        $('a[data-toggle=70][data-title=1]').addClass('active');
        $('a[data-toggle=70][data-title=2]').removeClass('active');
        $('a[data-toggle=70][data-title=2]').addClass('not-active');
        $('#70').val('');
        //Lab Diagnosis-->Add Walk In
        $('a[data-toggle=71][data-title=1]').removeClass('disabled');
        $('a[data-toggle=71][data-title=1]').addClass('active');
        $('a[data-toggle=71][data-title=2]').removeClass('active');
        $('a[data-toggle=71][data-title=2]').addClass('not-active');
        $('#71').val('');
        //Lab Diagnosis-->Lab Advice
        $('a[data-toggle=72][data-title=1]').removeClass('disabled');
        $('a[data-toggle=72][data-title=1]').addClass('active');
        $('a[data-toggle=72][data-title=2]').removeClass('active');
        $('a[data-toggle=72][data-title=2]').addClass('not-active');
        $('#72').val('');
        //Lab Diagnosis-->Order View
        $('a[data-toggle=73][data-title=1]').removeClass('disabled');
        $('a[data-toggle=73][data-title=1]').addClass('active');
        $('a[data-toggle=73][data-title=2]').removeClass('active');
        $('a[data-toggle=73][data-title=2]').addClass('not-active');
        $('#73').val('');
        //Lab Dianosis-->Job View
        $('a[data-toggle=74][data-title=1]').removeClass('disabled');
        $('a[data-toggle=74][data-title=1]').addClass('active');
        $('a[data-toggle=74][data-title=2]').removeClass('active');
        $('a[data-toggle=74][data-title=2]').addClass('not-active');
        $('#74').val('');
        //--Lab Home Collection--
        $('a[data-toggle=75][data-title=1]').removeClass('disabled');
        $('a[data-toggle=75][data-title=1]').addClass('active');
        $('a[data-toggle=75][data-title=2]').removeClass('active');
        $('a[data-toggle=75][data-title=2]').addClass('not-active');
        $('#75').val('');
        //Lab Home Collection-->Self Pickup
        $('a[data-toggle=76][data-title=1]').removeClass('disabled');
        $('a[data-toggle=76][data-title=1]').addClass('active');
        $('a[data-toggle=76][data-title=2]').removeClass('active');
        $('a[data-toggle=76][data-title=2]').addClass('not-active');
        $('#76').val('');
        //Lab Home Collection-->I2H Pickup
        $('a[data-toggle=77][data-title=1]').removeClass('disabled');
        $('a[data-toggle=77][data-title=1]').addClass('active');
        $('a[data-toggle=77][data-title=2]').removeClass('active');
        $('a[data-toggle=77][data-title=2]').addClass('not-active');
        $('#77').val('');
        //Lab Home Collection-->Cancel Order
        $('a[data-toggle=78][data-title=1]').removeClass('disabled');
        $('a[data-toggle=78][data-title=1]').addClass('active');
        $('a[data-toggle=78][data-title=2]').removeClass('active');
        $('a[data-toggle=78][data-title=2]').addClass('not-active');
        $('#78').val('');
    }
})
//Lab Diagnosis
$("#70").change(function () {
    var toggle = $('#70').val();
    if (toggle == "2") {
        //Lab Diagnosis-->Add walk in
        $('a[data-toggle=71][data-title=1]').removeClass('active');
        $('a[data-toggle=71][data-title=1]').addClass('disabled');
        $('a[data-toggle=71][data-title=2]').removeClass('not-active');
        $('a[data-toggle=71][data-title=2]').addClass('active');
        $('#71').val('2');
        //Lab Diagnosis-->Lab Advice
        $('a[data-toggle=72][data-title=1]').removeClass('active');
        $('a[data-toggle=72][data-title=1]').addClass('disabled');
        $('a[data-toggle=72][data-title=2]').removeClass('not-active');
        $('a[data-toggle=72][data-title=2]').addClass('active');
        $('#72').val('2');
        //Lab Diagnosis-->Order View
        $('a[data-toggle=73][data-title=1]').removeClass('active');
        $('a[data-toggle=73][data-title=1]').addClass('disabled');
        $('a[data-toggle=73][data-title=2]').removeClass('not-active');
        $('a[data-toggle=73][data-title=2]').addClass('active');
        $('#73').val('2');
        //Lab Diagnosis-->Job View
        $('a[data-toggle=74][data-title=1]').removeClass('active');
        $('a[data-toggle=74][data-title=1]').addClass('disabled');
        $('a[data-toggle=74][data-title=2]').removeClass('not-active');
        $('a[data-toggle=74][data-title=2]').addClass('active');
        $('#74').val('2');
    }
    else {
        //Lab Diagnosis-->Add Walk In
        $('a[data-toggle=71][data-title=1]').removeClass('disabled');
        $('a[data-toggle=71][data-title=1]').addClass('active');
        $('a[data-toggle=71][data-title=2]').removeClass('active');
        $('a[data-toggle=71][data-title=2]').addClass('not-active');
        $('#71').val('');
        //Lab Diagnosis-->Lab Advice
        $('a[data-toggle=72][data-title=1]').removeClass('disabled');
        $('a[data-toggle=72][data-title=1]').addClass('active');
        $('a[data-toggle=72][data-title=2]').removeClass('active');
        $('a[data-toggle=72][data-title=2]').addClass('not-active');
        $('#72').val('');
        //Lab Diagnosis-->Order View
        $('a[data-toggle=73][data-title=1]').removeClass('disabled');
        $('a[data-toggle=73][data-title=1]').addClass('active');
        $('a[data-toggle=73][data-title=2]').removeClass('active');
        $('a[data-toggle=73][data-title=2]').addClass('not-active');
        $('#73').val('');
        //Lab Dianosis-->Job View
        $('a[data-toggle=74][data-title=1]').removeClass('disabled');
        $('a[data-toggle=74][data-title=1]').addClass('active');
        $('a[data-toggle=74][data-title=2]').removeClass('active');
        $('a[data-toggle=74][data-title=2]').addClass('not-active');
        $('#74').val('');
    }
})
//Lab Home Collection
$("#75").change(function () {
    var toggle = $('#75').val();
    if (toggle == "2") {
        //Lab Home Collection-->Self Pickup
        $('a[data-toggle=76][data-title=1]').removeClass('active');
        $('a[data-toggle=76][data-title=1]').addClass('disabled');
        $('a[data-toggle=76][data-title=2]').removeClass('not-active');
        $('a[data-toggle=76][data-title=2]').addClass('active');
        $('#76').val('2');
        //Lab Home Collection-->I2H Pickup
        $('a[data-toggle=77][data-title=1]').removeClass('active');
        $('a[data-toggle=77][data-title=1]').addClass('disabled');
        $('a[data-toggle=77][data-title=2]').removeClass('not-active');
        $('a[data-toggle=77][data-title=2]').addClass('active');
        $('#77').val('2');
        //Lab Home Collection-->Cancel Order
        $('a[data-toggle=78][data-title=1]').removeClass('active');
        $('a[data-toggle=78][data-title=1]').addClass('disabled');
        $('a[data-toggle=78][data-title=2]').removeClass('not-active');
        $('a[data-toggle=78][data-title=2]').addClass('active');
        $('#78').val('2');
    }
    else {
        //Lab Home Collection-->Self Pickup
        $('a[data-toggle=76][data-title=1]').removeClass('disabled');
        $('a[data-toggle=76][data-title=1]').addClass('active');
        $('a[data-toggle=76][data-title=2]').removeClass('active');
        $('a[data-toggle=76][data-title=2]').addClass('not-active');
        $('#76').val('');
        //Lab Home Collection-->I2H Pickup
        $('a[data-toggle=77][data-title=1]').removeClass('disabled');
        $('a[data-toggle=77][data-title=1]').addClass('active');
        $('a[data-toggle=77][data-title=2]').removeClass('active');
        $('a[data-toggle=77][data-title=2]').addClass('not-active');
        $('#77').val('');
        //Lab Home Collection-->Cancel Order
        $('a[data-toggle=78][data-title=1]').removeClass('disabled');
        $('a[data-toggle=78][data-title=1]').addClass('active');
        $('a[data-toggle=78][data-title=2]').removeClass('active');
        $('a[data-toggle=78][data-title=2]').addClass('not-active');
        $('#78').val('');
    }
})
//Package
$("#79").change(function () {
    var toggle = $('#79').val();
    if (toggle == "2") {
        //Package Dashboard
        $('a[data-toggle=80][data-title=1]').removeClass('active');
        $('a[data-toggle=80][data-title=1]').addClass('disabled');
        $('a[data-toggle=80][data-title=2]').removeClass('not-active');
        $('a[data-toggle=80][data-title=2]').addClass('active');
        $('#80').val('2');
        //Set up Package
        $('a[data-toggle=81][data-title=1]').removeClass('active');
        $('a[data-toggle=81][data-title=1]').addClass('disabled');
        $('a[data-toggle=81][data-title=2]').removeClass('not-active');
        $('a[data-toggle=81][data-title=2]').addClass('active');
        $('#81').val('2');
        //Coupon Details
        $('a[data-toggle=82][data-title=1]').removeClass('active');
        $('a[data-toggle=82][data-title=1]').addClass('disabled');
        $('a[data-toggle=82][data-title=2]').removeClass('not-active');
        $('a[data-toggle=82][data-title=2]').addClass('active');
        $('#82').val('2');
        //hospital care
        $('a[data-toggle=117][data-title=1]').removeClass('active');
        $('a[data-toggle=117][data-title=1]').addClass('disabled');
        $('a[data-toggle=117][data-title=2]').removeClass('not-active');
        $('a[data-toggle=117][data-title=2]').addClass('active');
        $('#117').val('2');
        //home care
        $('a[data-toggle=118][data-title=1]').removeClass('active');
        $('a[data-toggle=118][data-title=1]').addClass('disabled');
        $('a[data-toggle=118][data-title=2]').removeClass('not-active');
        $('a[data-toggle=118][data-title=2]').addClass('active');
        $('#118').val('2');
        //home care schedule
        $('a[data-toggle=119][data-title=1]').removeClass('active');
        $('a[data-toggle=119][data-title=1]').addClass('disabled');
        $('a[data-toggle=119][data-title=2]').removeClass('not-active');
        $('a[data-toggle=119][data-title=2]').addClass('active');
        $('#119').val('2');
        //lab home collection
        $('a[data-toggle=120][data-title=1]').removeClass('active');
        $('a[data-toggle=120][data-title=1]').addClass('disabled');
        $('a[data-toggle=120][data-title=2]').removeClass('not-active');
        $('a[data-toggle=120][data-title=2]').addClass('active');
        $('#120').val('2');
    }
    else {
        //Package Dashboard
        $('a[data-toggle=80][data-title=1]').removeClass('disabled');
        $('a[data-toggle=80][data-title=1]').addClass('active');
        $('a[data-toggle=80][data-title=2]').removeClass('active');
        $('a[data-toggle=80][data-title=2]').addClass('not-active');
        $('#80').val('');
        //Set Up Package
        $('a[data-toggle=81][data-title=1]').removeClass('disabled');
        $('a[data-toggle=81][data-title=1]').addClass('active');
        $('a[data-toggle=81][data-title=2]').removeClass('active');
        $('a[data-toggle=81][data-title=2]').addClass('not-active');
        $('#81').val('');
        //Coupon Details
        $('a[data-toggle=82][data-title=1]').removeClass('disabled');
        $('a[data-toggle=82][data-title=1]').addClass('active');
        $('a[data-toggle=82][data-title=2]').removeClass('active');
        $('a[data-toggle=82][data-title=2]').addClass('not-active');
        $('#82').val('');
        //hospital care
        $('a[data-toggle=117][data-title=1]').removeClass('disabled');
        $('a[data-toggle=117][data-title=1]').addClass('active');
        $('a[data-toggle=117][data-title=2]').removeClass('active');
        $('a[data-toggle=117][data-title=2]').addClass('not-active');
        $('#117').val('');
        //home care
        $('a[data-toggle=118][data-title=1]').removeClass('disabled');
        $('a[data-toggle=118][data-title=1]').addClass('active');
        $('a[data-toggle=118][data-title=2]').removeClass('active');
        $('a[data-toggle=118][data-title=2]').addClass('not-active');
        $('#118').val('');
        //home care schedule
        $('a[data-toggle=119][data-title=1]').removeClass('disabled');
        $('a[data-toggle=119][data-title=1]').addClass('active');
        $('a[data-toggle=119][data-title=2]').removeClass('active');
        $('a[data-toggle=119][data-title=2]').addClass('not-active');
        $('#119').val('');
        //lab home collection
        $('a[data-toggle=120][data-title=1]').removeClass('disabled');
        $('a[data-toggle=120][data-title=1]').addClass('active');
        $('a[data-toggle=120][data-title=2]').removeClass('active');
        $('a[data-toggle=120][data-title=2]').addClass('not-active');
        $('#120').val('');
    }
})
//Others
$("#83").change(function () {
    var toggle = $('#83').val();
    if (toggle == "2") {
        //Rep Management
        $('a[data-toggle=84][data-title=1]').removeClass('active');
        $('a[data-toggle=84][data-title=1]').addClass('disabled');
        $('a[data-toggle=84][data-title=2]').removeClass('not-active');
        $('a[data-toggle=84][data-title=2]').addClass('active');
        $('#84').val('2');
        //Medical Certificate
        $('a[data-toggle=85][data-title=1]').removeClass('active');
        $('a[data-toggle=85][data-title=1]').addClass('disabled');
        $('a[data-toggle=85][data-title=2]').removeClass('not-active');
        $('a[data-toggle=85][data-title=2]').addClass('active');
        $('#85').val('2');
    }
    else {
        //Rep Management
        $('a[data-toggle=84][data-title=1]').removeClass('disabled');
        $('a[data-toggle=84][data-title=1]').addClass('active');
        $('a[data-toggle=84][data-title=2]').removeClass('active');
        $('a[data-toggle=84][data-title=2]').addClass('not-active');
        $('#84').val('');
        //Medical Certificate
        $('a[data-toggle=85][data-title=1]').removeClass('disabled');
        $('a[data-toggle=85][data-title=1]').addClass('active');
        $('a[data-toggle=85][data-title=2]').removeClass('active');
        $('a[data-toggle=85][data-title=2]').addClass('not-active');
        $('#85').val('');
    }
})
//IP Management Setting
$("#86").change(function () {
    var toggle = $('#86').val();
    if (toggle == "2") {
        //Admit Patient
        $('a[data-toggle=87][data-title=1]').removeClass('active');
        $('a[data-toggle=87][data-title=1]').addClass('disabled');
        $('a[data-toggle=87][data-title=2]').removeClass('not-active');
        $('a[data-toggle=87][data-title=2]').addClass('active');
        $('#87').val('2');
        //IP Patient Details Page
        $('a[data-toggle=88][data-title=1]').removeClass('active');
        $('a[data-toggle=88][data-title=1]').addClass('disabled');
        $('a[data-toggle=88][data-title=2]').removeClass('not-active');
        $('a[data-toggle=88][data-title=2]').addClass('active');
        $('#88').val('2');
        //Examination
        $('a[data-toggle=89][data-title=1]').removeClass('active');
        $('a[data-toggle=89][data-title=1]').addClass('disabled');
        $('a[data-toggle=89][data-title=2]').removeClass('not-active');
        $('a[data-toggle=89][data-title=2]').addClass('active');
        $('#89').val('2');
        //Patient History
        $('a[data-toggle=90][data-title=1]').removeClass('active');
        $('a[data-toggle=90][data-title=1]').addClass('disabled');
        $('a[data-toggle=90][data-title=2]').removeClass('not-active');
        $('a[data-toggle=90][data-title=2]').addClass('active');
        $('#90').val('2');
        //Investigation history
        $('a[data-toggle=91][data-title=1]').removeClass('active');
        $('a[data-toggle=91][data-title=1]').addClass('disabled');
        $('a[data-toggle=91][data-title=2]').removeClass('not-active');
        $('a[data-toggle=91][data-title=2]').addClass('active');
        $('#91').val('2');
        //Doctor prescription
        $('a[data-toggle=92][data-title=1]').removeClass('active');
        $('a[data-toggle=92][data-title=1]').addClass('disabled');
        $('a[data-toggle=92][data-title=2]').removeClass('not-active');
        $('a[data-toggle=92][data-title=2]').addClass('active');
        $('#92').val('2');
        //Investigation
        $('a[data-toggle=93][data-title=1]').removeClass('active');
        $('a[data-toggle=93][data-title=1]').addClass('disabled');
        $('a[data-toggle=93][data-title=2]').removeClass('not-active');
        $('a[data-toggle=93][data-title=2]').addClass('active');
        $('#93').val('2');
        //Vitals monitoring
        $('a[data-toggle=94][data-title=1]').removeClass('active');
        $('a[data-toggle=94][data-title=1]').addClass('disabled');
        $('a[data-toggle=94][data-title=2]').removeClass('not-active');
        $('a[data-toggle=94][data-title=2]').addClass('active');
        $('#94').val('2');
        //Diabetic flow sheet
        $('a[data-toggle=95][data-title=1]').removeClass('active');
        $('a[data-toggle=95][data-title=1]').addClass('disabled');
        $('a[data-toggle=95][data-title=2]').removeClass('not-active');
        $('a[data-toggle=95][data-title=2]').addClass('active');
        $('#95').val('2');
        //PA notes
        $('a[data-toggle=96][data-title=1]').removeClass('active');
        $('a[data-toggle=96][data-title=1]').addClass('disabled');
        $('a[data-toggle=96][data-title=2]').removeClass('not-active');
        $('a[data-toggle=96][data-title=2]').addClass('active');
        $('#96').val('2');
        //IV fluids
        $('a[data-toggle=97][data-title=1]').removeClass('active');
        $('a[data-toggle=97][data-title=1]').addClass('disabled');
        $('a[data-toggle=97][data-title=2]').removeClass('not-active');
        $('a[data-toggle=97][data-title=2]').addClass('active');
        $('#97').val('2');
        //Operation details
        $('a[data-toggle=98][data-title=1]').removeClass('active');
        $('a[data-toggle=98][data-title=1]').addClass('disabled');
        $('a[data-toggle=98][data-title=2]').removeClass('not-active');
        $('a[data-toggle=98][data-title=2]').addClass('active');
        $('#98').val('2');
        //Transfer order
        $('a[data-toggle=99][data-title=1]').removeClass('active');
        $('a[data-toggle=99][data-title=1]').addClass('disabled');
        $('a[data-toggle=99][data-title=2]').removeClass('not-active');
        $('a[data-toggle=99][data-title=2]').addClass('active');
        $('#99').val('2');
        //Discharge
        $('a[data-toggle=100][data-title=1]').removeClass('active');
        $('a[data-toggle=100][data-title=1]').addClass('disabled');
        $('a[data-toggle=100][data-title=2]').removeClass('not-active');
        $('a[data-toggle=100][data-title=2]').addClass('active');
        $('#100').val('2');
        //IP Invoice
        $('a[data-toggle=101][data-title=1]').removeClass('active');
        $('a[data-toggle=101][data-title=1]').addClass('disabled');
        $('a[data-toggle=101][data-title=2]').removeClass('not-active');
        $('a[data-toggle=101][data-title=2]').addClass('active');
        $('#101').val('2');
        //Feedback
        $('a[data-toggle=102][data-title=1]').removeClass('active');
        $('a[data-toggle=102][data-title=1]').addClass('disabled');
        $('a[data-toggle=102][data-title=2]').removeClass('not-active');
        $('a[data-toggle=102][data-title=2]').addClass('active');
        $('#102').val('2');
    }
    else {
        //Admit Patient
        $('a[data-toggle=87][data-title=1]').removeClass('disabled');
        $('a[data-toggle=87][data-title=1]').addClass('active');
        $('a[data-toggle=87][data-title=2]').removeClass('active');
        $('a[data-toggle=87][data-title=2]').addClass('not-active');
        $('#87').val('');
        //IP Patient Detail Page
        $('a[data-toggle=88][data-title=1]').removeClass('disabled');
        $('a[data-toggle=88][data-title=1]').addClass('active');
        $('a[data-toggle=88][data-title=2]').removeClass('active');
        $('a[data-toggle=88][data-title=2]').addClass('not-active');
        $('#88').val('');
        //Examination
        $('a[data-toggle=89][data-title=1]').removeClass('disabled');
        $('a[data-toggle=89][data-title=1]').addClass('active');
        $('a[data-toggle=89][data-title=2]').removeClass('active');
        $('a[data-toggle=89][data-title=2]').addClass('not-active');
        $('#89').val('');
        //Patient History
        $('a[data-toggle=90][data-title=1]').removeClass('disabled');
        $('a[data-toggle=90][data-title=1]').addClass('active');
        $('a[data-toggle=90][data-title=2]').removeClass('active');
        $('a[data-toggle=90][data-title=2]').addClass('not-active');
        $('#90').val('');
        //Investigation history
        $('a[data-toggle=91][data-title=1]').removeClass('disabled');
        $('a[data-toggle=91][data-title=1]').addClass('active');
        $('a[data-toggle=91][data-title=2]').removeClass('active');
        $('a[data-toggle=91][data-title=2]').addClass('not-active');
        $('#91').val('');
        //Doctor prescription
        $('a[data-toggle=92][data-title=1]').removeClass('disabled');
        $('a[data-toggle=92][data-title=1]').addClass('active');
        $('a[data-toggle=92][data-title=2]').removeClass('active');
        $('a[data-toggle=92][data-title=2]').addClass('not-active');
        $('#92').val('');
        //Investigation
        $('a[data-toggle=93][data-title=1]').removeClass('disabled');
        $('a[data-toggle=93][data-title=1]').addClass('active');
        $('a[data-toggle=93][data-title=2]').removeClass('active');
        $('a[data-toggle=93][data-title=2]').addClass('not-active');
        $('#93').val('');
        //Vitals monitoring
        $('a[data-toggle=94][data-title=1]').removeClass('disabled');
        $('a[data-toggle=94][data-title=1]').addClass('active');
        $('a[data-toggle=94][data-title=2]').removeClass('active');
        $('a[data-toggle=94][data-title=2]').addClass('not-active');
        $('#94').val('');
        //Diabetic flow sheet
        $('a[data-toggle=95][data-title=1]').removeClass('disabled');
        $('a[data-toggle=95][data-title=1]').addClass('active');
        $('a[data-toggle=95][data-title=2]').removeClass('active');
        $('a[data-toggle=95][data-title=2]').addClass('not-active');
        $('#95').val('');
        //PA notes
        $('a[data-toggle=96][data-title=1]').removeClass('disabled');
        $('a[data-toggle=96][data-title=1]').addClass('active');
        $('a[data-toggle=96][data-title=2]').removeClass('active');
        $('a[data-toggle=96][data-title=2]').addClass('not-active');
        $('#96').val('');
        //IV fluids
        $('a[data-toggle=97][data-title=1]').removeClass('disabled');
        $('a[data-toggle=97][data-title=1]').addClass('active');
        $('a[data-toggle=97][data-title=2]').removeClass('active');
        $('a[data-toggle=97][data-title=2]').addClass('not-active');
        $('#97').val('');
        //Operation details
        $('a[data-toggle=98][data-title=1]').removeClass('disabled');
        $('a[data-toggle=98][data-title=1]').addClass('active');
        $('a[data-toggle=98][data-title=2]').removeClass('active');
        $('a[data-toggle=98][data-title=2]').addClass('not-active');
        $('#98').val('');
        //Transfer order
        $('a[data-toggle=99][data-title=1]').removeClass('disabled');
        $('a[data-toggle=99][data-title=1]').addClass('active');
        $('a[data-toggle=99][data-title=2]').removeClass('active');
        $('a[data-toggle=99][data-title=2]').addClass('not-active');
        $('#99').val('');
        //Discharge
        $('a[data-toggle=100][data-title=1]').removeClass('disabled');
        $('a[data-toggle=100][data-title=1]').addClass('active');
        $('a[data-toggle=100][data-title=2]').removeClass('active');
        $('a[data-toggle=100][data-title=2]').addClass('not-active');
        $('#100').val('');
        //IP Invoice
        $('a[data-toggle=101][data-title=1]').removeClass('disabled');
        $('a[data-toggle=101][data-title=1]').addClass('active');
        $('a[data-toggle=101][data-title=2]').removeClass('active');
        $('a[data-toggle=101][data-title=2]').addClass('not-active');
        $('#101').val('');
        //Feedback
        $('a[data-toggle=102][data-title=1]').removeClass('disabled');
        $('a[data-toggle=102][data-title=1]').addClass('active');
        $('a[data-toggle=102][data-title=2]').removeClass('active');
        $('a[data-toggle=102][data-title=2]').addClass('not-active');
        $('#102').val('');
    }
})
//IP Billing
$("#103").change(function () {
    var toggle = $('#103').val();
    if (toggle == "2") {
        //Patient Overview
        $('a[data-toggle=104][data-title=1]').removeClass('active');
        $('a[data-toggle=104][data-title=1]').addClass('disabled');
        $('a[data-toggle=104][data-title=2]').removeClass('not-active');
        $('a[data-toggle=104][data-title=2]').addClass('active');
        $('#104').val('2');
        //Invoice
        $('a[data-toggle=105][data-title=1]').removeClass('active');
        $('a[data-toggle=105][data-title=1]').addClass('disabled');
        $('a[data-toggle=105][data-title=2]').removeClass('not-active');
        $('a[data-toggle=105][data-title=2]').addClass('active');
        $('#105').val('2');
        //Payment
        $('a[data-toggle=106][data-title=1]').removeClass('active');
        $('a[data-toggle=106][data-title=1]').addClass('disabled');
        $('a[data-toggle=106][data-title=2]').removeClass('not-active');
        $('a[data-toggle=106][data-title=2]').addClass('active');
        $('#106').val('2');
    }
    else {
        //Patient Overview
        $('a[data-toggle=104][data-title=1]').removeClass('disabled');
        $('a[data-toggle=104][data-title=1]').addClass('active');
        $('a[data-toggle=104][data-title=2]').removeClass('active');
        $('a[data-toggle=104][data-title=2]').addClass('not-active');
        $('#104').val('');
        //Invoice
        $('a[data-toggle=105][data-title=1]').removeClass('disabled');
        $('a[data-toggle=105][data-title=1]').addClass('active');
        $('a[data-toggle=105][data-title=2]').removeClass('active');
        $('a[data-toggle=105][data-title=2]').addClass('not-active');
        $('#105').val('');
        //Payment
        $('a[data-toggle=106][data-title=1]').removeClass('disabled');
        $('a[data-toggle=106][data-title=1]').addClass('active');
        $('a[data-toggle=106][data-title=2]').removeClass('active');
        $('a[data-toggle=106][data-title=2]').addClass('not-active');
        $('#106').val('');
    }
})
//Referral Content Preview
$("#107").change(function () {
    var toggle = $('#107').val();
    if (toggle == "2") {
        //Add New Patient
        $('a[data-toggle=108][data-title=1]').removeClass('active');
        $('a[data-toggle=108][data-title=1]').addClass('disabled');
        $('a[data-toggle=108][data-title=2]').removeClass('not-active');
        $('a[data-toggle=108][data-title=2]').addClass('active');
        $('#108').val('2');
        //Referral History
        $('a[data-toggle=109][data-title=1]').removeClass('active');
        $('a[data-toggle=109][data-title=1]').addClass('disabled');
        $('a[data-toggle=109][data-title=2]').removeClass('not-active');
        $('a[data-toggle=109][data-title=2]').addClass('active');
        $('#109').val('2');
        //Refer a Patient
        $('a[data-toggle=110][data-title=1]').removeClass('active');
        $('a[data-toggle=110][data-title=1]').addClass('disabled');
        $('a[data-toggle=110][data-title=2]').removeClass('not-active');
        $('a[data-toggle=110][data-title=2]').addClass('active');
        $('#110').val('2');
    }
    else {
        //Add New Patient
        $('a[data-toggle=108][data-title=1]').removeClass('disabled');
        $('a[data-toggle=108][data-title=1]').addClass('active');
        $('a[data-toggle=108][data-title=2]').removeClass('active');
        $('a[data-toggle=108][data-title=2]').addClass('not-active');
        $('#108').val('');
        //Referral History
        $('a[data-toggle=109][data-title=1]').removeClass('disabled');
        $('a[data-toggle=109][data-title=1]').addClass('active');
        $('a[data-toggle=109][data-title=2]').removeClass('active');
        $('a[data-toggle=109][data-title=2]').addClass('not-active');
        $('#109').val('');
        //Refer a Patient
        $('a[data-toggle=110][data-title=1]').removeClass('disabled');
        $('a[data-toggle=110][data-title=1]').addClass('active');
        $('a[data-toggle=110][data-title=2]').removeClass('active');
        $('a[data-toggle=110][data-title=2]').addClass('not-active');
        $('#110').val('');
    }
})
//--Configuration--
$("#126").change(function () {
    var toggle = $('#126').val();
    if (toggle == "2") {
        //--Calender--
        $('a[data-toggle=13][data-title=1]').removeClass('active');
        $('a[data-toggle=13][data-title=1]').addClass('disabled');
        $('a[data-toggle=13][data-title=2]').removeClass('not-active');
        $('a[data-toggle=13][data-title=2]').addClass('active');
        $('#13').val('2');
        //--Calender Sub tab--
        //Add Schedule
        $('a[data-toggle=14][data-title=1]').removeClass('active');
        $('a[data-toggle=14][data-title=1]').addClass('disabled');
        $('a[data-toggle=14][data-title=2]').removeClass('not-active');
        $('a[data-toggle=14][data-title=2]').addClass('active');
        $('#14').val('2');

        //--Print_Paper--
        $('a[data-toggle=15][data-title=1]').removeClass('active');
        $('a[data-toggle=15][data-title=1]').addClass('disabled');
        $('a[data-toggle=15][data-title=2]').removeClass('not-active');
        $('a[data-toggle=15][data-title=2]').addClass('active');
        $('#15').val('2');
        //--Print_paper--
        //Prescription
        $('a[data-toggle=16][data-title=1]').removeClass('active');
        $('a[data-toggle=16][data-title=1]').addClass('disabled');
        $('a[data-toggle=16][data-title=2]').removeClass('not-active');
        $('a[data-toggle=16][data-title=2]').addClass('active');
        $('#16').val('2');
        //Invoice
        $('a[data-toggle=17][data-title=1]').removeClass('active');
        $('a[data-toggle=17][data-title=1]').addClass('disabled');
        $('a[data-toggle=17][data-title=2]').removeClass('not-active');
        $('a[data-toggle=17][data-title=2]').addClass('active');
        $('#17').val('2');
        //Lab results
        $('a[data-toggle=18][data-title=1]').removeClass('active');
        $('a[data-toggle=18][data-title=1]').addClass('disabled');
        $('a[data-toggle=18][data-title=2]').removeClass('not-active');
        $('a[data-toggle=18][data-title=2]').addClass('active');
        $('#18').val('2');
        //Procedure
        $('a[data-toggle=19][data-title=1]').removeClass('active');
        $('a[data-toggle=19][data-title=1]').addClass('disabled');
        $('a[data-toggle=19][data-title=2]').removeClass('not-active');
        $('a[data-toggle=19][data-title=2]').addClass('active');
        $('#19').val('2');
        //Diet
        $('a[data-toggle=20][data-title=1]').removeClass('active');
        $('a[data-toggle=20][data-title=1]').addClass('disabled');
        $('a[data-toggle=20][data-title=2]').removeClass('not-active');
        $('a[data-toggle=20][data-title=2]').addClass('active');
        $('#20').val('2');
        //Lab Advice
        $('a[data-toggle=21][data-title=1]').removeClass('active');
        $('a[data-toggle=21][data-title=1]').addClass('disabled');
        $('a[data-toggle=21][data-title=2]').removeClass('not-active');
        $('a[data-toggle=21][data-title=2]').addClass('active');
        $('#21').val('2');
        //Medical Certificate
        $('a[data-toggle=22][data-title=1]').removeClass('active');
        $('a[data-toggle=22][data-title=1]').addClass('disabled');
        $('a[data-toggle=22][data-title=2]').removeClass('not-active');
        $('a[data-toggle=22][data-title=2]').addClass('active');
        $('#22').val('2');
        //Discharge summary
        $('a[data-toggle=23][data-title=1]').removeClass('active');
        $('a[data-toggle=23][data-title=1]').addClass('disabled');
        $('a[data-toggle=23][data-title=2]').removeClass('not-active');
        $('a[data-toggle=23][data-title=2]').addClass('active');
        $('#23').val('2');
        //Refferal Print Setting
        $('a[data-toggle=24][data-title=1]').removeClass('active');
        $('a[data-toggle=24][data-title=1]').addClass('disabled');
        $('a[data-toggle=24][data-title=2]').removeClass('not-active');
        $('a[data-toggle=24][data-title=2]').addClass('active');
        $('#24').val('2');
        //--Lab Setting--
        $('a[data-toggle=25][data-title=1]').removeClass('active');
        $('a[data-toggle=25][data-title=1]').addClass('disabled');
        $('a[data-toggle=25][data-title=2]').removeClass('not-active');
        $('a[data-toggle=25][data-title=2]').addClass('active');
        $('#25').val('2');
        //--Lab Setting--
        //Test Creation
        $('a[data-toggle=26][data-title=1]').removeClass('active');
        $('a[data-toggle=26][data-title=1]').addClass('disabled');
        $('a[data-toggle=26][data-title=2]').removeClass('not-active');
        $('a[data-toggle=26][data-title=2]').addClass('active');
        $('#26').val('2');
        //Panel Creation
        $('a[data-toggle=27][data-title=1]').removeClass('active');
        $('a[data-toggle=27][data-title=1]').addClass('disabled');
        $('a[data-toggle=27][data-title=2]').removeClass('not-active');
        $('a[data-toggle=27][data-title=2]').addClass('active');
        $('#27').val('2');
        //--CaseSheet Configuration--
        $('a[data-toggle=28][data-title=1]').removeClass('active');
        $('a[data-toggle=28][data-title=1]').addClass('disabled');
        $('a[data-toggle=28][data-title=2]').removeClass('not-active');
        $('a[data-toggle=28][data-title=2]').addClass('active');
        $('#28').val('2');
        //--Chat--
        $('a[data-toggle=29][data-title=1]').removeClass('active');
        $('a[data-toggle=29][data-title=1]').addClass('disabled');
        $('a[data-toggle=29][data-title=2]').removeClass('not-active');
        $('a[data-toggle=29][data-title=2]').addClass('active');
        $('#29').val('2');
       
        //--ip ward management
        $('a[data-toggle=113][data-title=1]').removeClass('active');
        $('a[data-toggle=113][data-title=1]').addClass('disabled');
        $('a[data-toggle=113][data-title=2]').removeClass('not-active');
        $('a[data-toggle=113][data-title=2]').addClass('active');
        $('#113').val('2');
        //--ip ward management
        $('a[data-toggle=114][data-title=1]').removeClass('active');
        $('a[data-toggle=114][data-title=1]').addClass('disabled');
        $('a[data-toggle=114][data-title=2]').removeClass('not-active');
        $('a[data-toggle=114][data-title=2]').addClass('active');
        $('#114').val('2');

    }
    else {
        //Calender
        $('a[data-toggle=13][data-title=1]').removeClass('disabled');
        $('a[data-toggle=13][data-title=1]').addClass('active');
        $('a[data-toggle=13][data-title=2]').removeClass('active');
        $('a[data-toggle=13][data-title=2]').addClass('not-active');
        $('#13').val('');
        //--Calender Sub tab--
        //Add Schedule
        $('a[data-toggle=14][data-title=1]').removeClass('disabled');
        $('a[data-toggle=14][data-title=1]').addClass('active');
        $('a[data-toggle=14][data-title=2]').removeClass('active');
        $('a[data-toggle=14][data-title=2]').addClass('not-active');
        $('#14').val('');
        //Print_Paper
        $('a[data-toggle=15][data-title=1]').removeClass('disabled');
        $('a[data-toggle=15][data-title=1]').addClass('active');
        $('a[data-toggle=15][data-title=2]').removeClass('active');
        $('a[data-toggle=15][data-title=2]').addClass('not-active');
        $('#15').val('');
        //--Print_paper--
        //Prescription
        $('a[data-toggle=16][data-title=1]').removeClass('disabled');
        $('a[data-toggle=16][data-title=1]').addClass('active');
        $('a[data-toggle=16][data-title=2]').removeClass('active');
        $('a[data-toggle=16][data-title=2]').addClass('not-active');
        $('#16').val('');
        //Invoice
        $('a[data-toggle=17][data-title=1]').removeClass('disabled');
        $('a[data-toggle=17][data-title=1]').addClass('active');
        $('a[data-toggle=17][data-title=2]').removeClass('active');
        $('a[data-toggle=17][data-title=2]').addClass('not-active');
        $('#17').val('');
        //Lab Result
        $('a[data-toggle=18][data-title=1]').removeClass('disabled');
        $('a[data-toggle=18][data-title=1]').addClass('active');
        $('a[data-toggle=18][data-title=2]').removeClass('active');
        $('a[data-toggle=18][data-title=2]').addClass('not-active');
        $('#18').val('');
        //Procedure
        $('a[data-toggle=19][data-title=1]').removeClass('disabled');
        $('a[data-toggle=19][data-title=1]').addClass('active');
        $('a[data-toggle=19][data-title=2]').removeClass('active');
        $('a[data-toggle=19][data-title=2]').addClass('not-active');
        $('#19').val('');
        //Diet
        $('a[data-toggle=20][data-title=1]').removeClass('disabled');
        $('a[data-toggle=20][data-title=1]').addClass('active');
        $('a[data-toggle=20][data-title=2]').removeClass('active');
        $('a[data-toggle=20][data-title=2]').addClass('not-active');
        $('#20').val('');
        //Lab Advice
        $('a[data-toggle=21][data-title=1]').removeClass('disabled');
        $('a[data-toggle=21][data-title=1]').addClass('active');
        $('a[data-toggle=21][data-title=2]').removeClass('active');
        $('a[data-toggle=21][data-title=2]').addClass('not-active');
        $('#21').val('');
        //Medical Certificate
        $('a[data-toggle=22][data-title=1]').removeClass('disabled');
        $('a[data-toggle=22][data-title=1]').addClass('active');
        $('a[data-toggle=22][data-title=2]').removeClass('active');
        $('a[data-toggle=22][data-title=2]').addClass('not-active');
        $('#22').val('');
        //Discharge Summary
        $('a[data-toggle=23][data-title=1]').removeClass('disabled');
        $('a[data-toggle=23][data-title=1]').addClass('active');
        $('a[data-toggle=23][data-title=2]').removeClass('active');
        $('a[data-toggle=23][data-title=2]').addClass('not-active');
        $('#23').val('');
        //Refferal Print Setting
        $('a[data-toggle=24][data-title=1]').removeClass('disabled');
        $('a[data-toggle=24][data-title=1]').addClass('active');
        $('a[data-toggle=24][data-title=2]').removeClass('active');
        $('a[data-toggle=24][data-title=2]').addClass('not-active');
        $('#24').val('');

        //--Lab Setting--
        $('a[data-toggle=25][data-title=1]').removeClass('disabled');
        $('a[data-toggle=25][data-title=1]').addClass('active');
        $('a[data-toggle=25][data-title=2]').removeClass('active');
        $('a[data-toggle=25][data-title=2]').addClass('not-active');
        $('#25').val('');
        //--Lab Setting--
        //Test Creation
        $('a[data-toggle=26][data-title=1]').removeClass('disabled');
        $('a[data-toggle=26][data-title=1]').addClass('active');
        $('a[data-toggle=26][data-title=2]').removeClass('active');
        $('a[data-toggle=26][data-title=2]').addClass('not-active');
        $('#26').val('');
        //Panel Creation
        $('a[data-toggle=27][data-title=1]').removeClass('disabled');
        $('a[data-toggle=27][data-title=1]').addClass('active');
        $('a[data-toggle=27][data-title=2]').removeClass('active');
        $('a[data-toggle=27][data-title=2]').addClass('not-active');
        $('#27').val('');
        //--CaseSheet Configuration--
        $('a[data-toggle=28][data-title=1]').removeClass('disabled');
        $('a[data-toggle=28][data-title=1]').addClass('active');
        $('a[data-toggle=28][data-title=2]').removeClass('active');
        $('a[data-toggle=28][data-title=2]').addClass('not-active');
        $('#28').val('');
        //--Chat--
        $('a[data-toggle=29][data-title=1]').removeClass('disabled');
        $('a[data-toggle=29][data-title=1]').addClass('active');
        $('a[data-toggle=29][data-title=2]').removeClass('active');
        $('a[data-toggle=29][data-title=2]').addClass('not-active');
        $('#29').val('');
        
        //--ip ward management
        $('a[data-toggle=113][data-title=1]').removeClass('disabled');
        $('a[data-toggle=113][data-title=1]').addClass('active');
        $('a[data-toggle=113][data-title=2]').removeClass('active');
        $('a[data-toggle=113][data-title=2]').addClass('not-active');
        $('#113').val('');
        //--ip operation session
        $('a[data-toggle=114][data-title=1]').removeClass('disabled');
        $('a[data-toggle=114][data-title=1]').addClass('active');
        $('a[data-toggle=114][data-title=2]').removeClass('active');
        $('a[data-toggle=114][data-title=2]').addClass('not-active');
        $('#114').val('');

    }


})
//--Fee Management--
$("#125").change(function () {
    var toggle = $('#125').val();
    if (toggle == "2") {
       
        //--Service Traffic--
        $('a[data-toggle=39][data-title=1]').removeClass('active');
        $('a[data-toggle=39][data-title=1]').addClass('disabled');
        $('a[data-toggle=39][data-title=2]').removeClass('not-active');
        $('a[data-toggle=39][data-title=2]').addClass('active');
        $('#39').val('2');
        //--Service Traffic-->Add Service Traffic
        $('a[data-toggle=40][data-title=1]').removeClass('active');
        $('a[data-toggle=40][data-title=1]').addClass('disabled');
        $('a[data-toggle=40][data-title=2]').removeClass('not-active');
        $('a[data-toggle=40][data-title=2]').addClass('active');
        $('#40').val('2');
        //--Service Traffic-->Delete Service Traffic
        $('a[data-toggle=41][data-title=1]').removeClass('active');
        $('a[data-toggle=41][data-title=1]').addClass('disabled');
        $('a[data-toggle=41][data-title=2]').removeClass('not-active');
        $('a[data-toggle=41][data-title=2]').addClass('active');
        $('#41').val('2');
        //--Service Traffic-->Edit Service Traffic
        $('a[data-toggle=42][data-title=1]').removeClass('active');
        $('a[data-toggle=42][data-title=1]').addClass('disabled');
        $('a[data-toggle=42][data-title=2]').removeClass('not-active');
        $('a[data-toggle=42][data-title=2]').addClass('active');
        $('#42').val('2');
        //--Manage Bank Account--
        $('a[data-toggle=43][data-title=1]').removeClass('active');
        $('a[data-toggle=43][data-title=1]').addClass('disabled');
        $('a[data-toggle=43][data-title=2]').removeClass('not-active');
        $('a[data-toggle=43][data-title=2]').addClass('active');
        $('#43').val('2');
        //Manage Bank Account-->Add Bank
        $('a[data-toggle=44][data-title=1]').removeClass('active');
        $('a[data-toggle=44][data-title=1]').addClass('disabled');
        $('a[data-toggle=44][data-title=2]').removeClass('not-active');
        $('a[data-toggle=44][data-title=2]').addClass('active');
        $('#44').val('2');
        //Manage Bank Account-->Edit Bank
        $('a[data-toggle=45][data-title=1]').removeClass('active');
        $('a[data-toggle=45][data-title=1]').addClass('disabled');
        $('a[data-toggle=45][data-title=2]').removeClass('not-active');
        $('a[data-toggle=45][data-title=2]').addClass('active');
        $('#45').val('2');
        //Manage Bank Delete-->Delete Bank
        $('a[data-toggle=46][data-title=1]').removeClass('active');
        $('a[data-toggle=46][data-title=1]').addClass('disabled');
        $('a[data-toggle=46][data-title=2]').removeClass('not-active');
        $('a[data-toggle=46][data-title=2]').addClass('active');
        $('#46').val('2');
        //--Mobile Fee Management--
        $('a[data-toggle=47][data-title=1]').removeClass('active');
        $('a[data-toggle=47][data-title=1]').addClass('disabled');
        $('a[data-toggle=47][data-title=2]').removeClass('not-active');
        $('a[data-toggle=47][data-title=2]').addClass('active');
        $('#47').val('2');
       
    }
    else {
        
        //--Service Traffic--
        $('a[data-toggle=39][data-title=1]').removeClass('disabled');
        $('a[data-toggle=39][data-title=1]').addClass('active');
        $('a[data-toggle=39][data-title=2]').removeClass('active');
        $('a[data-toggle=39][data-title=2]').addClass('not-active');
        $('#39').val('');
        //Service Traffic-->Add Service Traffic
        $('a[data-toggle=40][data-title=1]').removeClass('disabled');
        $('a[data-toggle=40][data-title=1]').addClass('active');
        $('a[data-toggle=40][data-title=2]').removeClass('active');
        $('a[data-toggle=40][data-title=2]').addClass('not-active');
        $('#40').val('');
        //Service Traffic-->Delete Service Traffic
        $('a[data-toggle=41][data-title=1]').removeClass('disabled');
        $('a[data-toggle=41][data-title=1]').addClass('active');
        $('a[data-toggle=41][data-title=2]').removeClass('active');
        $('a[data-toggle=41][data-title=2]').addClass('not-active');
        $('#41').val('');
        //Service Traffic-->Edit Service Traffic 
        $('a[data-toggle=42][data-title=1]').removeClass('disabled');
        $('a[data-toggle=42][data-title=1]').addClass('active');
        $('a[data-toggle=42][data-title=2]').removeClass('active');
        $('a[data-toggle=42][data-title=2]').addClass('not-active');
        $('#42').val('');
        //--Manage Bank Account--
        $('a[data-toggle=43][data-title=1]').removeClass('disabled');
        $('a[data-toggle=43][data-title=1]').addClass('active');
        $('a[data-toggle=43][data-title=2]').removeClass('active');
        $('a[data-toggle=43][data-title=2]').addClass('not-active');
        $('#43').val('');
        //Manage Bank Account-->Add Bank
        $('a[data-toggle=44][data-title=1]').removeClass('disabled');
        $('a[data-toggle=44][data-title=1]').addClass('active');
        $('a[data-toggle=44][data-title=2]').removeClass('active');
        $('a[data-toggle=44][data-title=2]').addClass('not-active');
        $('#44').val('');
        //Manage Bank Account-->Edit Bank
        $('a[data-toggle=45][data-title=1]').removeClass('disabled');
        $('a[data-toggle=45][data-title=1]').addClass('active');
        $('a[data-toggle=45][data-title=2]').removeClass('active');
        $('a[data-toggle=45][data-title=2]').addClass('not-active');
        $('#45').val('');
        //Manage Bank Account-->Delete Bank
        $('a[data-toggle=46][data-title=1]').removeClass('disabled');
        $('a[data-toggle=46][data-title=1]').addClass('active');
        $('a[data-toggle=46][data-title=2]').removeClass('active');
        $('a[data-toggle=46][data-title=2]').addClass('not-active');
        $('#46').val('');
        //--Mobile Fee Management--
        $('a[data-toggle=47][data-title=1]').removeClass('disabled');
        $('a[data-toggle=47][data-title=1]').addClass('active');
        $('a[data-toggle=47][data-title=2]').removeClass('active');
        $('a[data-toggle=47][data-title=2]').addClass('not-active');
        $('#47').val('');
       
    }


})
//Insert And Update
$("#btnlabsave").click(function () {
    if ($("#HospitalUserList").val() == 0) {
        $('#P_HospitalUserList').show();
        $('#P_HospitalUserList').fadeOut(8000);
        $('#P_HospitalUserList').html('Select the List');
        $('#HospitalUserList').focus();
        $('#HospitalUserList').val('0');
        return false;
    }
    var a=$("#1").val();
    if (a==2 || a==0) {
        $('#P_1').show();
        $('#P_1').fadeOut(8000);
        $('#P_1').html('Dashboard Should Be Yes');
        $('#1').focus();
        $('#1').val('');
        return false;
    }
    else {
        $('#loaderimg').show();
        var list = $('#HospitalUserList option:selected').text().split('/');
        var doctor_id = list[3];
        var user_id = list[5];
        var user_role_id = list[4];
        var role_rights;
        var j = 1;
        for (let i = 1; i <= $('#txtTotalModuleCount').val() ; i++) {
            role_rights = $('#' + i).val();
            var UserData = {
                doctor_id: doctor_id,
                doctor_user_id: user_id,
                doctor_user_role_id: user_role_id,
                hospital_id: $('#HospitalId').val(),
                doctor_user_role_rights: role_rights,
                DML_Indicator: "IUR",
                doctor_user_module_id:i
            }
            $.ajax({
                async: true,
                type: 'POST',
                url: '/UserCreate/UserRoleRights_Ins_Upd_Del',
                contentType: 'application/json; charset=UTF-8',
                data: JSON.stringify(UserData),
                success: function (data) {
                    j++;
                    if (j == $('#txtTotalModuleCount').val()) {
                        $('#loaderimg').hide();
                        toastr.success("Updated Successfully");
                        location.reload();
                    }

                }
            });
            
        }
        
    }
    
})
//User List Change Function
$("#HospitalUserList").change(function () {
    $("#radioBtn > a.active").removeClass("active").addClass("not-active");
    $('#loaderimg').show();
    var list = $('#HospitalUserList option:selected').text().split('/');
    var user_id = list[5];
    var UserData = {
        doctor_user_role_id:$("#doctor_role_id").val(),
        doctor_user_id: user_id,
        DML_Indicator: "HUL"
    }
    $.ajax({
        async: true,
        type: 'POST',
        url: '/UserCreate/UserRoleRights_Ins_Upd_Del',
        contentType: 'application/json; charset=UTF-8',
        data: JSON.stringify(UserData),
        success: function (data) {
            if (jQuery.isEmptyObject((data))) {
            }
            else {
                debugger;
                var data = JSON.parse(data);
                if (data.msg == "Success") {
                    if (data["module"].length > 0) {
                        var count = data["module"][0].doctor_module_count;
                        $('#txtTotalModuleCount').val(count);
                    }
                    else {
                        $('#txtTotalModuleCount').val(122);
                    }

                    if (data["data"].length > 0) {
                        var j = 1;
                        for (i = 0; i < data["data"].length; i++) {
                            var title = data.data[i].doctor_user_role_rights;
                            $('a[data-toggle="' + j + '"][data-title="' + title + '"]').removeClass('not-active');
                            $('a[data-toggle="' + j + '"][data-title="' + title + '"]').addClass('active');
                            $("#" + j).val(title);
                            j = j + 1;
                        }
                        if (i == $('#txtTotalModuleCount').val() || ((j-1) < $('#txtTotalModuleCount').val())) {
                            $('#loaderimg').hide();
                        }
                    }
                    else {
                        $('#loaderimg').hide();
                    }

                    
                }
            }
        }
    });
});


function ChangePatientCreation(selectedValue) {
    var id = $(selectedValue).attr('id');
    if (id == "123") {
        var selVal = $('#' + id).val();

        if (selVal == "1") {
            $('a[data-toggle=124][data-title=1]').removeClass('active');
            $('a[data-toggle=124][data-title=1]').addClass('disabled');
            $('a[data-toggle=124][data-title=1]').addClass('not-active');

            $('a[data-toggle=124][data-title=2]').removeClass('not-active');
            $('a[data-toggle=124][data-title=2]').removeClass('disabled');
            $('a[data-toggle=124][data-title=2]').addClass('active');
            $('#124').val('2');
        }
        else {
            $('a[data-toggle=124][data-title=1]').removeClass('not-active');
            $('a[data-toggle=124][data-title=1]').removeClass('disabled');
            $('a[data-toggle=124][data-title=1]').addClass('active');

            $('a[data-toggle=124][data-title=2]').removeClass('active');
            $('a[data-toggle=124][data-title=2]').addClass('disabled');
            $('a[data-toggle=124][data-title=2]').addClass('not-active');
            $('#124').val('1');
        }
    }
    else {
        var selVal = $('#' + id).val();

        if (selVal == "1") {
            $('a[data-toggle=123][data-title=1]').removeClass('active');
            $('a[data-toggle=123][data-title=1]').addClass('disabled');
            $('a[data-toggle=123][data-title=1]').addClass('not-active');

            $('a[data-toggle=123][data-title=2]').removeClass('not-active');
            $('a[data-toggle=123][data-title=2]').removeClass('disabled');
            $('a[data-toggle=123][data-title=2]').addClass('active');
            $('#123').val('2');
        }
        else {
            $('a[data-toggle=123][data-title=1]').removeClass('not-active');
            $('a[data-toggle=123][data-title=1]').removeClass('disabled');
            $('a[data-toggle=123][data-title=1]').addClass('active');

            $('a[data-toggle=123][data-title=2]').removeClass('active');
            $('a[data-toggle=123][data-title=2]').addClass('disabled');
            $('a[data-toggle=123][data-title=2]').addClass('not-active');
            $('#123').val('1');
        }
    }
}
// new role rights functions code

$(document).ready(function () {
    user();
    LoadBranch();
    Load_Roles();
    LoadHospital();
});

// hospital branch dropdown function

function LoadBranch() {

    var subdepartment = {
        Dml_Indicator: "LBRAN"
    }
    $.ajax({
        async: true,
        type: 'POST',
        url: '/Hospitalsetup/Category_Department_Ins_Upd_sel',
        contentType: 'application/json; charset=UTF-8',
        data: JSON.stringify(subdepartment),
        success: function (data) {
            var data1 = JSON.parse(data);
            if (data1.msg == "Success") {
                var data1 = data1.data;
                console.log(data1);
                if (jQuery.isEmptyObject((data1))) {
                }
                else {
                    debugger;
                    var SubDepartment;
                    var default_opt = '<option value="">--Select--</option>';
                    $.each(data1.Table, function (i, emp) {
                        SubDepartment = SubDepartment + '<option value="' + emp.hospital_branch_id + '">' + emp.branch_name + '</option>';
                    });
                    if (data1.Table.length == 1) {
                        $('#ddbranch').append(SubDepartment);
                        $('#ddbranch').change();
                    }
                    else {
                        $('#ddbranch').append(default_opt + SubDepartment);
                    }


                    if ($('#hiddenRole_id').val() == 6) {

                        $('#ddbranch').val($('#HospitalBranchID').val());
                        $('#ddbranch').attr('disabled', true);

                        $('#ddbranch').change();
                    }

                }
            }
            else {
                console.log(data1);
            }
        }
    });
}

// Modules dropdown function
function LoadModules() {

    var Moduledata = {
        Dml_Indicator: "HMD",
        hospital_id: $('#HospitalId').val(),
        branch_id: $('#ddbranch').val()
    }

    $.ajax({
        async: true,
        type: 'POST',
        url: '/UserCreate/UserRoleRights_Ins_Upd_Del',
        contentType: 'application/json; charset=UTF-8',
        data: JSON.stringify(Moduledata),
        success: function (data) {
            var data2 = JSON.parse(data);
            if (jQuery.isEmptyObject((data2.data))) {

            }
            else {

                if (data2.msg == "Success") {
                    var data1 = data2.data;

                    var Modules;
                    $('#ddModules').empty();
                    var default_opt = '<option value="">--Select--</option>';
                    $.each(data1, function (i, emp) {

                        Modules = Modules + '<option value="' + emp.doctor_module_id + '">' + emp.doctor_module_name + '</option>';

                    });
                    $('#ddModules').append(default_opt + Modules);


                }
                else {
                    console.log(data);
                }
            }
        }
    });
}

//$('#ddhospital').change(function () {
//    debugger;
//    if ($('#ddhospital').val() != '') {
//        var subdepartment = {
//            Dml_Indicator: "LB",
//            hospital_id: $('#ddhospital').val()
//        }
//        $.ajax({
//            async: true,
//            type: 'POST',
//            url: '/UserCreate/UserRoleRights_Ins_Upd_Del',
//            contentType: 'application/json; charset=UTF-8',
//            data: JSON.stringify(subdepartment),
//            success: function (data) {
//                var data1 = JSON.parse(data);
//                if (data1.msg == "Success") {
//                    var data1 = data1.data;
//                    console.log(data1);
//                    if (jQuery.isEmptyObject((data1))) {
//                    }
//                    else {
//                        debugger;
//                        var SubDepartment;
//                        $('#ddbranch').empty()
//                        var default_opt = '<option value="">--Select--</option>';
//                        $.each(data1, function (i, emp) {
//                            SubDepartment = SubDepartment + '<option value="' + emp.hospital_branch_id + '">' + emp.branch_name + '</option>';
//                        });
//                        if (data1.length == 1) {
//                            $('#ddbranch').append(SubDepartment);
//                            $('#ddbranch').change();
//                        }
//                        else {
//                            $('#ddbranch').append(default_opt + SubDepartment);
//                        }

//                    }
//                }
//                else {
//                    console.log(data1);
//                }
//            }
//        });
//    }
//});

// Branch change function
//$('#ddbranch').change(function () {     //one master concept
    function Load_Roles(){
    debugger;
    //if ($('#ddbranch').val() != '') {      //one master concept

    var roledata = {
        Dml_Indicator: "HBR",
        hospital_id: $('#HospitalId').val()
        // ,branch_id: $('#ddbranch').val()     //one master concept
    }       
    $.ajax({
        async: true,
        type: 'POST',
        url: '/UserCreate/UserRoleRights_Ins_Upd_Del',
        contentType: 'application/json; charset=UTF-8',
        data: JSON.stringify(roledata),
        success: function (data) {
            var data1 = JSON.parse(data);
            if (data1.msg == "Success") {
                var data1 = data1.data;
                console.log(data1);
                if (jQuery.isEmptyObject((data1))) {
                }
                else {
                    debugger;
                    var role;
                    $('#ddRoles').empty();
                    var default_opt = '<option value="">--Select--</option>';
                    $.each(data1, function (i, emp) {
                        debugger;
                        role = role + '<option value="' + emp.doctor_user_role_id + '">' + emp.doctor_user_role_name + '</option>';
                    });
                    $('#ddRoles').append(default_opt + role);

                }
            }
            else {
                console.log(data1);
            }
        }
    });

    //} //One master concept 

   //}); //One master concept 
}

function ModulesTable() {

    debugger;
    var indicator = ''
    if ($('#hiddenRole_id').val() == 0) {
        indicator = "MFS"
    }
    else if ($('#hiddenRole_id').val() == 2 || $('#hiddenRole_id').val() == 6) {
        indicator = "MFA"
    }
    else {
        indicator = "MFB"
    }

    var roleid = ''
    if ($('#hiddenRole_id').val() == 0) {
        roleid = '2'
    }
    else {
        roleid = $("#ddRoles").val()
    }

    var hospitalid = ''
    if ($('#hiddenRole_id').val() == 0) {
        hospitalid = $('#ddhospital').val()
    }
    else {
        hospitalid = $("#HospitalId").val()
    }

    var branchid = ''
    if ($('#hiddenRole_id').val() == 0 || $('#hiddenRole_id').val() == 2 || $('#hiddenRole_id').val() == 6) {
        branchid = '0'
    }
    else {
        branchid = $("#ddbranch").val()
    }

    var roledata = {
        Dml_Indicator: indicator,
        hospital_id: hospitalid,
        //doctor_user_module_id: $('#ddModules').val()
        doctor_user_role_id: roleid,
        branch_id: branchid
    }
    $.ajax({
        async: true,
        type: 'POST',
        url: '/UserCreate/UserRoleRights_Ins_Upd_Del',
        contentType: 'application/json; charset=UTF-8',
        data: JSON.stringify(roledata),
        success: function (data) {

            var data2 = JSON.parse(data);
            if (jQuery.isEmptyObject(data)) {

            }
            else {

                if (data2.msg == "Success") {

                    debugger;
                    var data1 = data2.data;
                    //$('#tblforms').DataTable().destroy();
                    $('#tblforms tbody').empty();
                    var ModulesName = '';
                    var Tblmodules = '';

                    $.each(data1, function (i, emp) {
                       // debugger;
                        var Status = '', add = '', edit = '', deletes = '', view = '', functions = '';

                        condition = "ShowHideFunction(this)";

                        Status = '<div class="onoffswitch"><input type="checkbox" name="Fradio_' + i + '" class="onoffswitch-checkbox_product allstatus_check" id="RSH_' + i + '" onclick="' + condition + '"><label class="onoffswitch-label_product" for="RSH_' + i + '"><span class="onoffswitch-inner_product"></span><span class="onoffswitch-switch_product"></span></label></div>';

                        //Status = '<input class="active_radio" type="radio" id="RSH_' + i + '" name="Fradio_' + i + '" value="1" onclick="' + condition + '"><label for="html" class="mr-15">Active</label><input class="inactive_radio" type="radio" id="RSH_' + i + '" name="Fradio_' + i + '" value="0" onclick="' + condition + '"><label for="css">Inactive</label><br>';


                        add = ' <input class="allsel_check RSH_' + i + ' hidden" type="checkbox" id="addcheck_' + i + '" name="check_1" value="1">';
                        edit = ' <input class="allsel_check RSH_' + i + ' hidden" type="checkbox" id="editcheck_' + i + '" name="check_1" value="1">';
                        deletes = ' <input class="allsel_check RSH_' + i + ' hidden" type="checkbox" id="deletescheck_' + i + '" name="check_1" value="1">';
                        view = ' <input class="allsel_check RSH_' + i + ' hidden" type="checkbox" id="viewcheck_' + i + '" name="check_1" value="1">';
                        functions = ' <input class="allsel_check RSH_' + i + ' hidden" type="checkbox" id="functionscheck_' + i + '" name="check_1" value="1">';



                        if (ModulesName != emp.doctor_module_name) {
                            Tblmodules = emp.doctor_module_name;
                        }
                        else {
                            Tblmodules = '';
                        }
                        ModulesName = emp.doctor_module_name;

                        var row_data = "<tr class='" + emp.moduleid + "'><input type='hidden' id='Moduleid_" + i + "' value='" + emp.moduleid + "' /><input type='hidden' id='Fno_" + i + "' value='" + emp.form_id + "' /><td>" + emp.RowNo + "</td><td>" + Tblmodules + "</td><td>" + emp.form_name + "</td><td>" + Status + "</td><td>" + add + "</td><td>" + edit + "</td><td>" + deletes + "</td><td>" + view + "</td><td>" + functions + "</td></tr>";
                        $('#tblforms tbody').append(row_data);
                        //debugger;
                        $('#hdnmodule_count').val(i);


                    });
                    //datatable('tblforms');


                }
                else {
                    console.log(data);
                }



            }
        }
    });
}

// Create Forms table function
$('#ddModules').change(function () {

    if ($('#ddModules').val() != '') {
        var roledata = {
            Dml_Indicator: "MFS",
            hospital_id: $('#HospitalId').val(),
            doctor_user_module_id: $('#ddModules').val()
        }
        $.ajax({
            async: true,
            type: 'POST',
            url: '/UserCreate/UserRoleRights_Ins_Upd_Del',
            contentType: 'application/json; charset=UTF-8',
            data: JSON.stringify(roledata),
            success: function (data) {

                var data2 = JSON.parse(data);
                if (jQuery.isEmptyObject(data)) {

                }
                else {

                    if (data2.msg == "Success") {

                        debugger;
                        var data1 = data2.data;
                        //$('#tblforms').DataTable().destroy();
                        $('#tblforms tbody').empty();
                        var ModulesName = '';
                        var Tblmodules = '';

                        $.each(data1, function (i, emp) {
                            debugger;
                            var Status = '', add = '', edit = '', deletes = '', view = '', functions = '';

                            condition = "ShowHideFunction(this)";

                            Status = '<div class="onoffswitch"><input type="checkbox" name="Fradio_' + i + '" class="onoffswitch-checkbox_product allstatus_check" id="RSH_' + i + '" onclick="' + condition + '"><label class="onoffswitch-label_product" for="RSH_' + (i + 1) + '"><span class="onoffswitch-inner_product"></span><span class="onoffswitch-switch_product"></span></label></div>';

                            //Status = '<input class="active_radio" type="radio" id="RSH_' + i + '" name="Fradio_' + i + '" value="1" onclick="' + condition + '"><label for="html" class="mr-15">Active</label><input class="inactive_radio" type="radio" id="RSH_' + i + '" name="Fradio_' + i + '" value="0" onclick="' + condition + '"><label for="css">Inactive</label><br>';


                            if (emp.is_crud == 1) {
                                add = ' <input class="allsel_check RSH_' + i + ' hidden" type="checkbox" id="addcheck_' + i + '" name="check_1" value="1">';
                                edit = ' <input class="allsel_check RSH_' + i + ' hidden" type="checkbox" id="editcheck_' + i + '" name="check_1" value="1">';
                                deletes = ' <input class="allsel_check RSH_' + i + ' hidden" type="checkbox" id="deletescheck_' + i + '" name="check_1" value="1">';
                                view = ' <input class="allsel_check RSH_' + i + ' hidden" type="checkbox" id="viewcheck_' + i + '" name="check_1" value="1">';
                                functions = '-';
                            }
                            else {
                                functions = ' <input class="allsel_check RSH_' + i + ' hidden" type="checkbox" id="functionscheck_' + i + '" name="check_1" value="1">';
                                add = '-', edit = '-', deletes = '-', view = '-';
                            }


                            if (ModulesName != emp.doctor_module_name) {
                                Tblmodules = emp.doctor_module_name;
                            }
                            else {
                                Tblmodules = '';
                            }
                            ModulesName = emp.doctor_module_name;

                            var row_data = "<tr class='" + emp.moduleid + "'><input type='hidden' id='Fno_" + i + "' value='" + emp.form_id + "' /><td>" + emp.RowNo + "</td><td>" + Tblmodules + "</td><td>" + emp.form_name + "</td><td>" + Status + "</td><td>" + add + "</td><td>" + edit + "</td><td>" + deletes + "</td><td>" + view + "</td><td>" + functions + "</td></tr>";
                            $('#tblforms tbody').append(row_data);

                            $('#hdnmodule_count').val(i);

                        });
                        //datatable('tblforms');
                        if ($("#ddModules").val() != '' && $("#ddRoles").val() != '') {
                            var count = $('#hdnmodule_count').val();

                            for (var i = 0; i <= count; i++) {

                                //$("input[name='Fradio_" + (i) + "']").prop('checked', false);
                                $('#RSH_' + (i)).prop('checked', false);

                                $('#addcheck_' + (i)).prop('checked', false);

                                $('#editcheck_' + (i)).prop('checked', false);

                                $('#deletescheck_' + (i)).prop('checked', false);

                                $('#viewcheck_' + (i)).prop('checked', false);

                                $('#functionscheck_' + (i)).prop('checked', false);


                            }

                            GetUser_rights();
                        }
                    }
                    else {
                        console.log(data);
                    }

                }
            }
        });
    }

});

function ShowHideFunction(e) {

    debugger;

    var id = e.id;
    //var val=$("input[id=" + id + "]:checked").val();
    var val = ($('#' + (id)).prop('checked')) ? 1 : 0;
    if (val == 1) {

        $('.' + id).removeClass('hidden');
        $('.' + id).prop('checked', true);

    }
    else {

        $('.' + id).addClass('hidden');
        $('.' + id).prop('checked', false);

    }
}


$('#btnSubmit').click(function () {

    Saveuser_rights();
});

function Saveuser_rights() {

    debugger;

    //if ($.trim($('#ddbranch').val()) == "") {
    //    $('#Pddbranch').show();
    //    $('#Pddbranch').fadeOut(8000);
    //    $('#Pddbranch').html('Select Branch');
    //    $('#ddbranch').focus();
    //    $('#ddbranch').val('');
    //    return false;
    //}

    //if ($.trim($('#ddRoles').val()) == "") {
    //    $('#PddRoles').show();
    //    $('#PddRoles').fadeOut(8000);
    //    $('#PddRoles').html('Select Role');
    //    $('#ddRoles').focus();
    //    $('#ddRoles').val('');
    //    return false;
    //}

    //if ($.trim($('#ddModules').val()) == "") {
    //    $('#PddModules').show();
    //    $('#PddModules').fadeOut(8000);
    //    $('#PddModules').html('Select Modules');
    //    $('#ddModules').focus();
    //    $('#ddModules').val('');
    //    return false;
    //}

    if ($('#hdnmodule_count').val() == '' || $('#hdnmodule_count').val() == null) {
        return false;
    }
    var count = $('#hdnmodule_count').val();

    var P_hospital = ''

    if ($('#hiddenRole_id').val() == 0) {
        P_hospital = $("#ddhospital").val()
    }
    else {
        P_hospital = $("#HospitalId").val()
    }

    var RoleRightForm = [];
    for (var i = 0; i <= count; i++) {

        debugger;

        var MFform_id = $('#Fno_' + (i)).val();
        var MFModulesid = $('#Moduleid_' + (i)).val();
        //var MFforms_status = $("input[name='Fradio_" + (i) + "']:checked").val();
        var MFforms_status = ($('#RSH_' + (i)).prop('checked') == true) ? "1" : "0";
        var MFrole_rights_add = ($('#addcheck_' + (i)).prop('checked') == true) ? "1" : "0";
        var MFrole_rights_edit = ($('#editcheck_' + (i)).prop('checked') == true) ? "1" : "0";
        var MFrole_rights_delete = ($('#deletescheck_' + (i)).prop('checked') == true) ? "1" : "0";
        var MFrole_rights_view = ($('#viewcheck_' + (i)).prop('checked') == true) ? "1" : "0";
        var MFrole_rights_function = ($('#functionscheck_' + (i)).prop('checked') == true) ? "1" : "0";
        var id = i + 1;

        var role_id = '', branchid = ''
        if ($('#hiddenRole_id').val() == 0) {
            role_id = '2',
            branchid = '0'
        }
        else {
            role_id = $("#ddRoles").val(),
            branchid = $("#ddbranch").val()
        }

        RoleRightForm.push({
            form_id: MFform_id,
            // user_role_id: $("#ddRoles").val(),
            user_role_id: role_id,
            role_rights_add: MFrole_rights_add,
            role_rights_edit: MFrole_rights_edit,
            role_rights_delete: MFrole_rights_delete,
            role_rights_view: MFrole_rights_view,
            role_rights_function: MFrole_rights_function,
            created_by: $("#hiddenUser_id").val(),
            forms_status: MFforms_status,
            hospital_id: P_hospital,
            branch_id: branchid,
            DML_Indicator: "FI",
            role_rights_id: id,
            modules_id: MFModulesid
        })
    }


    $.ajax({
        async: true,
        type: 'POST',
        url: '/UserCreate/RoleRightForm_Ins_Upd',
        contentType: 'application/json; charset=UTF-8',
        data: JSON.stringify(RoleRightForm),
        success: function (data) {

            var data2 = JSON.parse(data);
            if (data2.msg == "Success") {
                var data1 = data2.data;

                toastr.success('User Role Rights Details Added Successfully..',
                            {
                                //closeButton: false,
                                progressBar: true,
                                allowHtml: true,
                                timeOut: 0,
                            });
            }
            else {
                console.log(data);
            }
        },
        error: function (data) {
            toastr.warning('some issue');
        }
    });
}
$('#ddbranch').change(function () {
    $("#ddRoles").change()
});

$("#ddRoles").change(function () {
    debugger;
    $('#All_chk').prop('checked', false);
    if ($("#ddRoles").val() != '') {
        ModulesTable();
        var count = $('#hdnmodule_count').val();

        for (var i = 0; i <= count; i++) {

            //$("input[name='Fradio_" + (i) + "']").prop('checked', false);
            $('#RSH_' + (i)).prop('checked', false);

            $('#addcheck_' + (i)).prop('checked', false);

            $('#editcheck_' + (i)).prop('checked', false);

            $('#deletescheck_' + (i)).prop('checked', false);

            $('#viewcheck_' + (i)).prop('checked', false);

            $('#functionscheck_' + (i)).prop('checked', false);

            $('.RSH_' + (i)).addClass('hidden');


        }

        GetUser_rights();

    }

});

function GetUser_rights() {
    debugger;
    var hospitalid = ''
    if ($('#hiddenRole_id').val() == 0) {
        P_hospital = $("#ddhospital").val()
    }
    else {
        P_hospital = $("#HospitalId").val()
    }

    var RoleRightForm = [];
    var roleid = '', branchid = ''
    if ($('#hiddenRole_id').val() == 0) {
        roleid = '2',
        branchid = '0',
        indicator="SFS"
    }
    else {
        roleid = $("#ddRoles").val(),
        branchid = $("#ddbranch").val()
        indicator="FS"
    }
    RoleRightForm.push({
        modules_id: '0',
        hospital_id: P_hospital,
        branch_id: branchid,
        DML_Indicator: indicator,
        user_role_id: roleid,
        login_user_role_id: $('#hiddenRole_id').val()
    })


    $.ajax({
        async: true,
        type: 'POST',
        url: '/UserCreate/RoleRightForm_Ins_Upd',
        contentType: 'application/json; charset=UTF-8',
        data: JSON.stringify(RoleRightForm),
        success: function (data) {

            var data2 = JSON.parse(data);
            if (data2.msg == "Success") {
                var data1 = data2.data;
                var j = 0;
                var i = 0



                $.each(data1.Table, function (i, emp) {

                    //$("input[name='Fradio_" + (i) + "'][value='" + emp.status + "']").prop('checked', true);

                    if (emp.status == 1) {
                        $('#RSH_' + (i)).prop('checked', true);
                        $('.RSH_' + (i)).removeClass('hidden');
                    }
                    else {
                        $('#RSH_' + (i)).prop('checked', false);
                        $('.RSH_' + (i)).addClass('hidden');
                    }

                    if (emp.role_rights_add == 1) {
                        $('#addcheck_' + (i)).prop('checked', true);
                    }
                    else {
                        $('#addcheck_' + (i)).prop('checked', false);
                    }

                    if (emp.role_rights_edit == 1) {
                        $('#editcheck_' + (i)).prop('checked', true);
                    }
                    else {
                        $('#editcheck_' + (i)).prop('checked', false);
                    }

                    if (emp.role_rights_delete == 1) {
                        $('#deletescheck_' + (i)).prop('checked', true);
                    }
                    else {
                        $('#deletescheck_' + (i)).prop('checked', false);
                    }

                    if (emp.role_rights_view == 1) {
                        $('#viewcheck_' + (i)).prop('checked', true);
                    }
                    else {
                        $('#viewcheck_' + (i)).prop('checked', false);
                    }

                    if (emp.role_rights_function == 1) {
                        $('#functionscheck_' + (i)).prop('checked', true);
                    }
                    else {
                        $('#functionscheck_' + (i)).prop('checked', false);
                    }
                    //$('#All_chk').change();

                });
            }
            else {
                console.log(data);
            }
        },
        error: function (data) {
            toastr.warning('some issue');
        }
    });

}

$('#All_chk').change(function () {
    //debugger;
    if ($('#All_chk').prop('checked') == true) {
        $('.allsel_check').removeClass('hidden');
        $('.allsel_check').prop('checked', true);
        //$('.active_radio').prop('checked', true);
        $('.allstatus_check').prop('checked', true);



    }
    else {
        $('.allsel_check').addClass('hidden');
        $('.allsel_check').prop('checked', false);
        //$('.inactive_radio').prop('checked', true);
        $('.allstatus_check').prop('checked', false);
    }
});
function LoadHospital() {
    debugger;
    var subdepartment = {
        Dml_Indicator: "LH"
    }
    $.ajax({
        async: true,
        type: 'POST',
        url: '/UserCreate/UserRoleRights_Ins_Upd_Del',
        contentType: 'application/json; charset=UTF-8',
        data: JSON.stringify(subdepartment),
        success: function (data) {
            var data1 = JSON.parse(data);
            if (data1.msg == "Success") {
                var data1 = data1.data;
                console.log(data1);
                if (jQuery.isEmptyObject((data1))) {
                }
                else {
                    debugger;
                    var SubDepartment;
                    var default_opt = '<option value="">--Select--</option>';
                    $.each(data1, function (i, emp) {
                        SubDepartment = SubDepartment + '<option value="' + emp.hospital_id + '">' + emp.hospital_name + '</option>';
                    });
                    if (data1.length == 1) {
                        $('#ddhospital').append(SubDepartment);
                        $('#ddhospital').change();
                    }
                    else {
                        $('#ddhospital').append(default_opt + SubDepartment);
                    }

                }
            }
            else {
                console.log(data1);
            }
        }
    });
}

function user() {
    if ($('#hiddenRole_id').val() == 0) {
        debugger;
        $("#U_hospital").show();
    }
    else {
        $("#U_hospital").hide();
    }
    if ($('#hiddenRole_id').val() == 0) {
        debugger;
        $("#U_branch").hide();
    }
    else {
        $("#U_branch").show();
    }
    if ($('#hiddenRole_id').val() == 0) {
        debugger;
        $("#U_role").hide();
    }
    else {
        $("#U_role").show();
    }
}
$('#ddhospital').change(function () {
    debugger;
    ModulesTable();
    GetUser_rights()
})
