
image_dict = {'DAPI': [{'source': 'data:image/png;base64,[encoded data, 6239556 characters]', 'xref': 'x', 'yref': 'y', 'sizing': 'stretch', 'layer': 'below', 'x': 0, 'y': 0, 'sizex': 26460, 'sizey': 26460}]}
// Function to show annotation explain
function show_annotation(event) {
    let oevent = event || window.event
    if (document.all) {
        oevent.cancelBubble = true
    } else {
        oevent.stopPropagation()
    }
    if (document.getElementById('div_explain_annotation').style.display === 'none' || document.getElementById('div_explain_annotation').style.display === '') {
        document.getElementById('div_explain_annotation').style.display = 'block'
    } else {
        document.getElementById('div_explain_annotation').style.display = 'none'
    }
}
document.onclick = function () {
    document.getElementById('div_explain_annotation').style.display = 'none'
}
document.getElementById('div_explain_annotation').onclick = function (event) {
    let oevent = event || window.event
    oevent.stopPropagation()
}


// Function to show rna mapping explain
function show_rna_mapping(event) {
    let oevent = event || window.event
    if (document.all) {
        oevent.cancelBubble = true
    } else {
        oevent.stopPropagation()
    }
    if (document.getElementById('div_explain_rna_mapping').style.display === 'none' || document.getElementById('div_explain_rna_mapping').style.display === '') {
        document.getElementById('div_explain_rna_mapping').style.display = 'block'
    } else {
        document.getElementById('div_explain_rna_mapping').style.display = 'none'
    }
}
document.onclick = function () {
    document.getElementById('div_explain_rna_mapping').style.display = 'none'
}
document.getElementById('div_explain_rna_mapping').onclick = function (event) {
    let oevent = event || window.event
    oevent.stopPropagation()
}

// Function to show tissueCut explain
function show_tissueCut(event) {
    let oevent = event || window.event
    if (document.all) {
        oevent.cancelBubble = true
    } else {
        oevent.stopPropagation()
    }
    if (document.getElementById('div_explain_tissueCut').style.display === 'none' || document.getElementById('div_explain_tissueCut').style.display === '') {
        document.getElementById('div_explain_tissueCut').style.display = 'block'
    } else {
        document.getElementById('div_explain_tissueCut').style.display = 'none'
    }
}
document.onclick = function () {
    document.getElementById('div_explain_tissueCut').style.display = 'none'
}
document.getElementById('div_explain_tissueCut').onclick = function (event) {
    let oevent = event || window.event
    oevent.stopPropagation()
}

// Function to show sequencing saturation explain
function show_sequencing_saturation(event) {
    let oevent = event || window.event
    if (document.all) {
        oevent.cancelBubble = true
    } else {
        oevent.stopPropagation()
    }
    if (document.getElementById('div_explain_sequencing_saturation').style.display === 'none' || document.getElementById('div_explain_sequencing_saturation').style.display === '') {
        document.getElementById('div_explain_sequencing_saturation').style.display = 'block'
    } else {
        document.getElementById('div_explain_sequencing_saturation').style.display = 'none'
    }
}
document.onclick = function () {
    document.getElementById('div_explain_sequencing_saturation').style.display = 'none'
}
document.getElementById('div_explain_sequencing_saturation').onclick = function (event) {
    let oevent = event || window.event
    oevent.stopPropagation()
}

//Funtion to display explain div
function show(event) {
    let oevent = event || window.event
    if (document.all) {
        oevent.cancelBubble = true
    } else {
        oevent.stopPropagation()
    }
    if (document.getElementById('div_quation').style.display === 'none' || document.getElementById('div_quation').style.display === '') {
        document.getElementById('div_quation').style.display = 'block'
    } else {
        document.getElementById('div_quation').style.display = 'none'
    }
}
document.onclick = function () {
    document.getElementById('div_quation').style.display = 'none'
}
document.getElementById('div_quation').onclick = function (event) {
    let oevent = event || window.event
    oevent.stopPropagation()
}


// Function to select backgroup of image 
function imageselection() {
    var objselect = document.getElementById("image_select");
    var layerName = objselect.value;
    if (layerName == "no-image") {
        var update = {
            'images': [],
        };
        Plotly.relayout(divScatter, update)
    } else {
        var update = {
            'images': image_dict[layerName]
        }
        Plotly.relayout(divScatter, update)
    }
}

// Function to plot Heatmap
function ssdna() {
    var update = {
        'marker.opacity': 0,
    };
    Plotly.restyle(divScatter, update);
    document.getElementById('range').value = 0;
}

// Function to plot heatmap ssDNA
function heatmap() {
    var update = {
        'marker.opacity': 1,
    };
    Plotly.restyle(divScatter, update);
    document.getElementById('range').value = 1;
}

// Function to show sunburst explain
function show_sunburst(event) {
    let oevent = event || window.event
    if (document.all) {
        oevent.cancelBubble = true
    } else {
        oevent.stopPropagation()
    }
    if (document.getElementById('div_explain_sunburst').style.display === 'none' || document.getElementById('div_explain_sunburst').style.display === '') {
        document.getElementById('div_explain_sunburst').style.display = 'block'
    } else {
        document.getElementById('div_explain_sunburst').style.display = 'none'
    }
}
document.onclick = function () {
    document.getElementById('div_explain_sunburst').style.display = 'none'
}
document.getElementById('div_explain_sunburst').onclick = function (event) {
    let oevent = event || window.event
    oevent.stopPropagation()
}

// Function to show sunburst explain
function show_list_element(level, event) {
    let oevent = event || window.event
    if (document.all) {
        oevent.cancelBubble = true
    } else {
        oevent.stopPropagation()
    }
    if (level === '1') {
        if (document.getElementById('list_key1').style.display === 'none' || document.getElementById('list_key1').style.display === '') {
            var l1 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13'];
            var l2 = ['1', '2', '3', '4', '5'];
            var l3 = ['1', '11', '2', '3', '31', '32', '4', '5'];
            for (var i in l1) {
              if (document.getElementById('list_key' + l1[i])) {
                document.getElementById('list_key' + l1[i]).style.display = 'block'
              }
            }
            for (var i in l2) {
                document.getElementById('list_box' + l2[i]).style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAACqADAAQAAAABAAAACgAAAAA7eLj1AAAAXUlEQVQYGWM0Pvp/638GBi8GPICRgWEbg9HR/wQBSA0THoNQpIhWyALTln+dgeHIexgPQtsIMjBM1ISw8ZrICPQFDMBNhOmESaDTeE1EVky0QhZQYBofIxDgjAxbASFnMftNUPqUAAAAAElFTkSuQmCC)'
            }
            for (var i in l3) {
                if(document.getElementById('sunburst_line' + l3[i])) document.getElementById('sunburst_line' + l3[i]).style.display = 'block'
            }
            var RemoverRNAlengthSet = ['430px', '310px', '190px', '110px', '425px', '345px', 0]
            var AddrRNAlengthSet = ['470px','350px','190px','110px','465px','345px','385px']
            document.getElementById('sunburst_line1').style.height = RemoverRNAlengthSet[0];
            document.getElementById('sunburst_line2').style.height = RemoverRNAlengthSet[1];
            document.getElementById('sunburst_line3').style.height = RemoverRNAlengthSet[2];
            document.getElementById('sunburst_line4').style.height = RemoverRNAlengthSet[3];
            document.getElementById('sunburst_line21').style.marginTop = RemoverRNAlengthSet[4];
            document.getElementById('sunburst_line31').style.marginTop = RemoverRNAlengthSet[5];
            if(RemoverRNAlengthSet[6]) document.getElementById('sunburst_line32').style.marginTop = RemoverRNAlengthSet[6];
        } else {
            var l1 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13'];
            var l3 = ['1', '21', '2', '3', '31', '32', '4', '5'];
            for (var i in l1) {
              if (document.getElementById('list_key' + l1[i])) {
                document.getElementById('list_key' + l1[i]).style.display = 'none'
              }
            }
            for (var i in l3) {
                if(document.getElementById('sunburst_line' + l3[i])) document.getElementById('sunburst_line' + l3[i]).style.display = 'none'
            }
            document.getElementById('list_box1').style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAFVJREFUKFNjNDr6/zADA4MNA35whNHo6P//Z63wqzI+xsCAoTD5CkTTXB2EZqwKQYIggGwLikKQSRc+oTrBgA9iMnkKYWYRtBqmkGjPYAsomBuJCnAAiTo/JajQ0FgAAAAASUVORK5CYII=)'
        }
    } else if (level === '2') {
    


        if (document.getElementById('list_key2').style.display === 'none' || document.getElementById('list_key1').style.display === '') {
            var l1 = ['2', '3', '4', '5', '6', '7', '8', '9', '10', '12', '13'];
            var l2 = ['1', '2', '3', '4', '5'];
            var l3 = ['1', '21', '2', '3', '31', '32', '4', '5'];
            for (var i in l1) {
              if (document.getElementById('list_key' + l1[i])) {
                document.getElementById('list_key' + l1[i]).style.display = 'block'
              }
            }
            for (var i in l2) {
                document.getElementById('list_box' + l2[i]).style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAACqADAAQAAAABAAAACgAAAAA7eLj1AAAAXUlEQVQYGWM0Pvp/638GBi8GPICRgWEbg9HR/wQBSA0THoNQpIhWyALTln+dgeHIexgPQtsIMjBM1ISw8ZrICPQFDMBNhOmESaDTeE1EVky0QhZQYBofIxDgjAxbASFnMftNUPqUAAAAAElFTkSuQmCC)'
            }
            for (var i in l3) {
                if(document.getElementById('sunburst_line' + l3[i])) document.getElementById('sunburst_line' + l3[i]).style.display = 'block'
            }
            var RemoverRNAlengthSet = ['430px', '310px', '190px', '110px', '425px', '345px', 0]
            var AddrRNAlengthSet = ['470px', '350px', '190px', '110px', '465px', '345px', '385px']
            document.getElementById('sunburst_line1').style.height = RemoverRNAlengthSet[0];
            document.getElementById('sunburst_line2').style.height = RemoverRNAlengthSet[1];
            document.getElementById('sunburst_line3').style.height = RemoverRNAlengthSet[2];
            document.getElementById('sunburst_line4').style.height = RemoverRNAlengthSet[3];
            document.getElementById('sunburst_line21').style.marginTop = RemoverRNAlengthSet[4];
            document.getElementById('sunburst_line31').style.marginTop = RemoverRNAlengthSet[5];
            if(RemoverRNAlengthSet[6]) document.getElementById('sunburst_line32').style.marginTop = RemoverRNAlengthSet[6];




        } else {
            var l1 = ['2', '3', '4', '5', '6', '7', '8', '9', '10', '12','13'];
            var l3 = ['2', '21', '3', '31', '32', '4', '5'];
            for (var i in l1) {
              if (document.getElementById('list_key' + l1[i])) {
                document.getElementById('list_key' + l1[i]).style.display = 'none'
              }
            }
            for (var i in l3) {
                if(document.getElementById('sunburst_line' + l3[i])) document.getElementById('sunburst_line' + l3[i]).style.display = 'none'
            }
            document.getElementById('sunburst_line1').style.height = '30px';
            document.getElementById('sunburst_line21').style.marginTop = '105px';
            document.getElementById('list_box2').style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAFVJREFUKFNjNDr6/zADA4MNA35whNHo6P//Z63wqzI+xsCAoTD5CkTTXB2EZqwKQYIggGwLikKQSRc+oTrBgA9iMnkKYWYRtBqmkGjPYAsomBuJCnAAiTo/JajQ0FgAAAAASUVORK5CYII=)'
        }





    } else if (level === '3') {
        if (document.getElementById('list_key3').style.display === 'none' || document.getElementById('list_key1').style.display === '') {
            var l1 = ['3', '4', '5', '6', '7', '8', '9', '13'];
            var l2 = ['3', '4', '5'];
            var l3 = ['1', '21', '2', '3', '31', '32', '4', '5'];
            for (var i in l1) {
              if (document.getElementById('list_key' + l1[i])) {
                document.getElementById('list_key' + l1[i]).style.display = 'block'
              }
            }
            for (var i in l2) {
                document.getElementById('list_box' + l2[i]).style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAACqADAAQAAAABAAAACgAAAAA7eLj1AAAAXUlEQVQYGWM0Pvp/638GBi8GPICRgWEbg9HR/wQBSA0THoNQpIhWyALTln+dgeHIexgPQtsIMjBM1ISw8ZrICPQFDMBNhOmESaDTeE1EVky0QhZQYBofIxDgjAxbASFnMftNUPqUAAAAAElFTkSuQmCC)'
            }
            for (var i in l3) {
                if(document.getElementById('sunburst_line' + l3[i])) document.getElementById('sunburst_line' + l3[i]).style.display = 'block'
            }
            var RemoverRNAlengthSet = ['430px', '310px', '190px', '110px', '425px', '345px', '0px']
            var AddrRNAlengthSet = ['470px', '350px', '190px', '110px', '465px', '345px', '385px']
            document.getElementById('sunburst_line1').style.height = RemoverRNAlengthSet[0];
            document.getElementById('sunburst_line2').style.height = RemoverRNAlengthSet[1];
            document.getElementById('sunburst_line3').style.height = RemoverRNAlengthSet[2];
            document.getElementById('sunburst_line4').style.height = RemoverRNAlengthSet[3];
            document.getElementById('sunburst_line21').style.marginTop = RemoverRNAlengthSet[4];
            document.getElementById('sunburst_line31').style.marginTop = RemoverRNAlengthSet[5];
            if(RemoverRNAlengthSet[6]) document.getElementById('sunburst_line32').style.marginTop = RemoverRNAlengthSet[6];
        } else {
            var l1 = ['3', '4', '5', '6', '7', '8', '9', '13'];
            var l3 = ['3', '31', '32', '4', '5'];
            for (var i in l1) {
                if (document.getElementById('list_key' + l1[i])) {
                  document.getElementById('list_key' + l1[i]).style.display = 'none';
                }            
            }
            for (var i in l3) {
                
                if(document.getElementById('sunburst_line' + l3[i])) document.getElementById('sunburst_line' + l3[i]).style.display = 'none'
            }
            document.getElementById('sunburst_line2').style.height = '30px';
            document.getElementById('sunburst_line1').style.height = '150px';
            document.getElementById('sunburst_line21').style.marginTop = '145px';
            document.getElementById('list_box3').style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAFVJREFUKFNjNDr6/zADA4MNA35whNHo6P//Z63wqzI+xsCAoTD5CkTTXB2EZqwKQYIggGwLikKQSRc+oTrBgA9iMnkKYWYRtBqmkGjPYAsomBuJCnAAiTo/JajQ0FgAAAAASUVORK5CYII=)'
        }















    } else if (level === '4') {
        if (document.getElementById('list_key4').style.display === 'none' || document.getElementById('list_key1').style.display === '') {
            var l1 = ['4', '5', '6', '7'];
            var l2 = ['4', '5'];
            var l3 = ['1', '21', '2', '3', '31', '32', '4', '5'];
            for (var i in l1) {
                document.getElementById('list_key' + l1[i]).style.display = 'block'
            }
            for (var i in l2) {
                document.getElementById('list_box' + l2[i]).style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAACqADAAQAAAABAAAACgAAAAA7eLj1AAAAXUlEQVQYGWM0Pvp/638GBi8GPICRgWEbg9HR/wQBSA0THoNQpIhWyALTln+dgeHIexgPQtsIMjBM1ISw8ZrICPQFDMBNhOmESaDTeE1EVky0QhZQYBofIxDgjAxbASFnMftNUPqUAAAAAElFTkSuQmCC)'
            }
            for (var i in l3) {
                if(document.getElementById('sunburst_line' + l3[i])) document.getElementById('sunburst_line' + l3[i]).style.display = 'block'
            }
            var RemoverRNAlengthSet = ['430px', '310px', '190px', '110px', '425px', '345px', 0]
            var AddrRNAlengthSet = ['470px', '350px', '190px', '110px', '465px', '345px', '385px']
            document.getElementById('sunburst_line1').style.height = RemoverRNAlengthSet[0];
            document.getElementById('sunburst_line2').style.height = RemoverRNAlengthSet[1];
            document.getElementById('sunburst_line3').style.height = RemoverRNAlengthSet[2];
            document.getElementById('sunburst_line4').style.height = RemoverRNAlengthSet[3];
            document.getElementById('sunburst_line21').style.marginTop = RemoverRNAlengthSet[4];
            document.getElementById('sunburst_line31').style.marginTop = RemoverRNAlengthSet[5];
            if(RemoverRNAlengthSet[6]) document.getElementById('sunburst_line32').style.marginTop = RemoverRNAlengthSet[6];
        } else {
            var l1 = ['4', '5', '6', '7'];
            var l3 = ['4', '5'];
            for (var i in l1) {
                document.getElementById('list_key' + l1[i]).style.display = 'none'
            }
            for (var i in l3) {
                document.getElementById('sunburst_line' + l3[i]).style.display = 'none'
            }
            var RemoverRNAlengthSet = ['270px', '150px', '265px', 0]
            var AddrRNAlengthSet = ['310px', '190px', '305px', '225px']
            document.getElementById('sunburst_line1').style.height = RemoverRNAlengthSet[0];
            document.getElementById('sunburst_line2').style.height = RemoverRNAlengthSet[1];
            document.getElementById('sunburst_line3').style.height = '30px';
            document.getElementById('sunburst_line21').style.marginTop = RemoverRNAlengthSet[2];
            document.getElementById('sunburst_line31').style.marginTop = '185px';
            if(RemoverRNAlengthSet[3]) document.getElementById('sunburst_line32').style.marginTop = RemoverRNAlengthSet[3];
            document.getElementById('list_box4').style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAFVJREFUKFNjNDr6/zADA4MNA35whNHo6P//Z63wqzI+xsCAoTD5CkTTXB2EZqwKQYIggGwLikKQSRc+oTrBgA9iMnkKYWYRtBqmkGjPYAsomBuJCnAAiTo/JajQ0FgAAAAASUVORK5CYII=)'
        }




        



    } else if (level === '5') {
        if (document.getElementById('list_key5').style.display === 'none' || document.getElementById('list_key1').style.display === '') {
            var l1 = ['5', '6'];
            var l3 = ['1', '21', '2', '3', '31', '4', '5'];
            for (var i in l1) {
                document.getElementById('list_key' + l1[i]).style.display = 'block'
            }
            for (var i in l3) {
                document.getElementById('sunburst_line' + l3[i]).style.display = 'block'
            }
            document.getElementById('list_box5').style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAACqADAAQAAAABAAAACgAAAAA7eLj1AAAAXUlEQVQYGWM0Pvp/638GBi8GPICRgWEbg9HR/wQBSA0THoNQpIhWyALTln+dgeHIexgPQtsIMjBM1ISw8ZrICPQFDMBNhOmESaDTeE1EVky0QhZQYBofIxDgjAxbASFnMftNUPqUAAAAAElFTkSuQmCC)'
            var RemoverRNAlengthSet = ['430px', '310px', '190px', '110px', '425px', '345px', '0px']
            var AddrRNAlengthSet = ['470px','350px','190px','110px','465px','345px','385px']
            document.getElementById('sunburst_line1').style.height = RemoverRNAlengthSet[0];
            document.getElementById('sunburst_line2').style.height = RemoverRNAlengthSet[1];
            document.getElementById('sunburst_line3').style.height = RemoverRNAlengthSet[2];
            document.getElementById('sunburst_line4').style.height = RemoverRNAlengthSet[3];
            document.getElementById('sunburst_line21').style.marginTop = RemoverRNAlengthSet[4];
            document.getElementById('sunburst_line31').style.marginTop = RemoverRNAlengthSet[5];
            if(RemoverRNAlengthSet[6]) document.getElementById('sunburst_line32').style.marginTop = RemoverRNAlengthSet[6];
            document.getElementById('sunburst_line5').style.display = 'block';

        } else {
            var l1 = ['5', '6'];
            for (var i in l1) {
                document.getElementById('list_key' + l1[i]).style.display = 'none'
            }
            var RemoverRNAlengthSet = ['350px', '230px', '345px']
            var AddrRNAlengthSet = ['390px','270px','385px']
            document.getElementById('sunburst_line1').style.height = RemoverRNAlengthSet[0];
            document.getElementById('sunburst_line2').style.height = RemoverRNAlengthSet[1];
            document.getElementById('sunburst_line3').style.height = '110px';
            document.getElementById('sunburst_line21').style.marginTop = RemoverRNAlengthSet[2];
            document.getElementById('sunburst_line31').style.marginTop = '265px'; 
            if(document.getElementById('sunburst_line32')) document.getElementById('sunburst_line32').style.marginTop = '305px';
            document.getElementById('sunburst_line4').style.height = '30px'
            document.getElementById('sunburst_line5').style.display = 'none'
            document.getElementById('list_box5').style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAFVJREFUKFNjNDr6/zADA4MNA35whNHo6P//Z63wqzI+xsCAoTD5CkTTXB2EZqwKQYIggGwLikKQSRc+oTrBgA9iMnkKYWYRtBqmkGjPYAsomBuJCnAAiTo/JajQ0FgAAAAASUVORK5CYII=)'
        }
    }
}

// Function to show sequencing saturation explain
function show_sequencing(event) {
    let oevent = event || window.event
    if (document.all) {
        oevent.cancelBubble = true
    } else {
        oevent.stopPropagation()
    }
    if (document.getElementById('div_explain_sequencing').style.display === 'none' || document.getElementById('div_explain_sequencing').style.display === '') {
        document.getElementById('div_explain_sequencing').style.display = 'block'
    } else {
        document.getElementById('div_explain_sequencing').style.display = 'none'
    }
}
document.onclick = function () {
    document.getElementById('div_explain_sequencing').style.display = 'none'
}
document.getElementById('div_explain_sequencing').onclick = function (event) {
    let oevent = event || window.event
    oevent.stopPropagation()
}




// Function to show sunburst explain
function show_list_element_protein(level, event) {
  let oevent = event || window.event
  if (document.all) {
      oevent.cancelBubble = true
  } else {
      oevent.stopPropagation()
  }
  if (level === '1') {
      if (document.getElementById('list_key1').style.display === 'none' || document.getElementById('list_key1').style.display === '') {
          var l1 = ['1', '2', '3', '4', '5', '6'];
          var l2 = ['1', '2', '3'];
          var l3 = ['1',  '2', '3'];
          for (var i in l1) {
              document.getElementById('list_key' + l1[i]).style.display = 'block'
          }
          for (var i in l2) {
              document.getElementById('list_box' + l2[i]).style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAACqADAAQAAAABAAAACgAAAAA7eLj1AAAAXUlEQVQYGWM0Pvp/638GBi8GPICRgWEbg9HR/wQBSA0THoNQpIhWyALTln+dgeHIexgPQtsIMjBM1ISw8ZrICPQFDMBNhOmESaDTeE1EVky0QhZQYBofIxDgjAxbASFnMftNUPqUAAAAAElFTkSuQmCC)'
          }
          for (var i in l3) {
              document.getElementById('sunburst_protein_line' + l3[i]).style.display = 'block'
          }
          document.getElementById('sunburst_protein_line1').style.height = '190px';
          document.getElementById('sunburst_protein_line2').style.height = '110px';
          document.getElementById('sunburst_protein_line3').style.height = '30px';
      } else {
          var l1 = ['1', '2', '3', '4', '5', '6'];
          var l3 = ['1', '2', '3'];
          for (var i in l1) {
              document.getElementById('list_key' + l1[i]).style.display = 'none'
          }
          for (var i in l3) {
              document.getElementById('sunburst_protein_line' + l3[i]).style.display = 'none'
          }
          document.getElementById('list_box1').style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAFVJREFUKFNjNDr6/zADA4MNA35whNHo6P//Z63wqzI+xsCAoTD5CkTTXB2EZqwKQYIggGwLikKQSRc+oTrBgA9iMnkKYWYRtBqmkGjPYAsomBuJCnAAiTo/JajQ0FgAAAAASUVORK5CYII=)'
      }
  } else if (level === '2') {
      if (document.getElementById('list_key2').style.display === 'none' || document.getElementById('list_key1').style.display === '') {
          var l1 = ['2', '3', '4', '5'];
          var l2 = ['1', '2', '3'];
          var l3 = ['2', '3'];
          for (var i in l1) {
              document.getElementById('list_key' + l1[i]).style.display = 'block'
          }
          for (var i in l2) {
              document.getElementById('list_box' + l2[i]).style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAACqADAAQAAAABAAAACgAAAAA7eLj1AAAAXUlEQVQYGWM0Pvp/638GBi8GPICRgWEbg9HR/wQBSA0THoNQpIhWyALTln+dgeHIexgPQtsIMjBM1ISw8ZrICPQFDMBNhOmESaDTeE1EVky0QhZQYBofIxDgjAxbASFnMftNUPqUAAAAAElFTkSuQmCC)'
          }
          for (var i in l3) {
              document.getElementById('sunburst_protein_line' + l3[i]).style.display = 'block'
          }
          document.getElementById('sunburst_protein_line1').style.height = '190px';
          document.getElementById('sunburst_protein_line2').style.height = '110px';
          document.getElementById('sunburst_protein_line3').style.height = '30px';
      } else {
          var l1 = ['2', '3', '4', '5'];
          var l3 = ['2', '3'];
          for (var i in l1) {
              document.getElementById('list_key' + l1[i]).style.display = 'none'
          }
          for (var i in l3) {
              document.getElementById('sunburst_protein_line' + l3[i]).style.display = 'none'
          }
          document.getElementById('sunburst_protein_line1').style.height = '30px';
          document.getElementById('list_box2').style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAFVJREFUKFNjNDr6/zADA4MNA35whNHo6P//Z63wqzI+xsCAoTD5CkTTXB2EZqwKQYIggGwLikKQSRc+oTrBgA9iMnkKYWYRtBqmkGjPYAsomBuJCnAAiTo/JajQ0FgAAAAASUVORK5CYII=)'
      }
  } else if (level === '3') {
      if (document.getElementById('list_key3').style.display === 'none' || document.getElementById('list_key1').style.display === '') {
          var l1 = ['3', '4'];
          var l2 = ['3'];
          var l3 = ['3'];
          for (var i in l1) {
              document.getElementById('list_key' + l1[i]).style.display = 'block'
          }
          for (var i in l2) {
              document.getElementById('list_box' + l2[i]).style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAACqADAAQAAAABAAAACgAAAAA7eLj1AAAAXUlEQVQYGWM0Pvp/638GBi8GPICRgWEbg9HR/wQBSA0THoNQpIhWyALTln+dgeHIexgPQtsIMjBM1ISw8ZrICPQFDMBNhOmESaDTeE1EVky0QhZQYBofIxDgjAxbASFnMftNUPqUAAAAAElFTkSuQmCC)'
          }
          for (var i in l3) {
              document.getElementById('sunburst_protein_line' + l3[i]).style.display = 'block'
          }
          document.getElementById('sunburst_protein_line1').style.height = '190px';
          document.getElementById('sunburst_protein_line2').style.height = '110px';
          document.getElementById('sunburst_protein_line3').style.height = '30px';
      } else {
          var l1 = ['3', '4'];
          var l3 = ['3'];
          for (var i in l1) {
              document.getElementById('list_key' + l1[i]).style.display = 'none'
          }
          for (var i in l3) {
              document.getElementById('sunburst_protein_line' + l3[i]).style.display = 'none'
          }
          document.getElementById('sunburst_protein_line2').style.height = '30px';
          document.getElementById('sunburst_protein_line1').style.height = '110px';
          document.getElementById('list_box3').style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAFVJREFUKFNjNDr6/zADA4MNA35whNHo6P//Z63wqzI+xsCAoTD5CkTTXB2EZqwKQYIggGwLikKQSRc+oTrBgA9iMnkKYWYRtBqmkGjPYAsomBuJCnAAiTo/JajQ0FgAAAAASUVORK5CYII=)'
      }
  } else if (level === '4') {
      if (document.getElementById('list_key4').style.display === 'none' || document.getElementById('list_key1').style.display === '') {
          var l1 = ['4', '5', '6', '7'];
          var l2 = ['4', '5'];
          var l3 = ['1', '11', '2', '3', '31', '4', '5'];
          for (var i in l1) {
              document.getElementById('list_key' + l1[i]).style.display = 'block'
          }
          for (var i in l2) {
              document.getElementById('list_box' + l2[i]).style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAACqADAAQAAAABAAAACgAAAAA7eLj1AAAAXUlEQVQYGWM0Pvp/638GBi8GPICRgWEbg9HR/wQBSA0THoNQpIhWyALTln+dgeHIexgPQtsIMjBM1ISw8ZrICPQFDMBNhOmESaDTeE1EVky0QhZQYBofIxDgjAxbASFnMftNUPqUAAAAAElFTkSuQmCC)'
          }
          for (var i in l3) {
              document.getElementById('sunburst_line' + l3[i]).style.display = 'block'
          }
          document.getElementById('sunburst_line1').style.height = '390px';
          document.getElementById('sunburst_line2').style.height = '310px';
          document.getElementById('sunburst_line3').style.height = '190px';
          document.getElementById('sunburst_line4').style.height = '110px';
          document.getElementById('sunburst_line11').style.marginTop = '465px';
          document.getElementById('sunburst_line31').style.marginTop = '345px';
      } else {
          var l1 = ['4', '5', '6', '7'];
          var l3 = ['4', '5'];
          for (var i in l1) {
              document.getElementById('list_key' + l1[i]).style.display = 'none'
          }
          for (var i in l3) {
              document.getElementById('sunburst_line' + l3[i]).style.display = 'none'
          }
          document.getElementById('sunburst_line1').style.height = '230px';
          document.getElementById('sunburst_line2').style.height = '150px';
          document.getElementById('sunburst_line3').style.height = '30px';
          document.getElementById('sunburst_line11').style.marginTop = '305px';
          document.getElementById('sunburst_line31').style.marginTop = '185px';
          document.getElementById('list_box4').style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAFVJREFUKFNjNDr6/zADA4MNA35whNHo6P//Z63wqzI+xsCAoTD5CkTTXB2EZqwKQYIggGwLikKQSRc+oTrBgA9iMnkKYWYRtBqmkGjPYAsomBuJCnAAiTo/JajQ0FgAAAAASUVORK5CYII=)'
      }
  } else if (level === '5') {
      if (document.getElementById('list_key5').style.display === 'none' || document.getElementById('list_key1').style.display === '') {
          var l1 = ['5', '6'];
          var l3 = ['1', '11', '2', '3', '31', '4', '5'];
          for (var i in l1) {
              document.getElementById('list_key' + l1[i]).style.display = 'block'
          }
          for (var i in l3) {
              document.getElementById('sunburst_line' + l3[i]).style.display = 'block'
          }
          document.getElementById('list_box5').style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAACqADAAQAAAABAAAACgAAAAA7eLj1AAAAXUlEQVQYGWM0Pvp/638GBi8GPICRgWEbg9HR/wQBSA0THoNQpIhWyALTln+dgeHIexgPQtsIMjBM1ISw8ZrICPQFDMBNhOmESaDTeE1EVky0QhZQYBofIxDgjAxbASFnMftNUPqUAAAAAElFTkSuQmCC)'
          document.getElementById('sunburst_line1').style.height = '390px';
          document.getElementById('sunburst_line2').style.height = '310px';
          document.getElementById('sunburst_line3').style.height = '190px';
          document.getElementById('sunburst_line4').style.height = '110px';
          document.getElementById('sunburst_line11').style.marginTop = '465px';
          document.getElementById('sunburst_line31').style.marginTop = '345px';
      } else {
          var l1 = ['5', '6'];
          for (var i in l1) {
              document.getElementById('list_key' + l1[i]).style.display = 'none'
          }
          document.getElementById('sunburst_line1').style.height = '310px';
          document.getElementById('sunburst_line2').style.height = '230px';
          document.getElementById('sunburst_line3').style.height = '110px';
          document.getElementById('sunburst_line11').style.marginTop = '385px';
          document.getElementById('sunburst_line31').style.marginTop = '265px';
          document.getElementById('sunburst_line4').style.height = '30px'
          document.getElementById('sunburst_line5').style.display = 'none'
          document.getElementById('list_box5').style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAFVJREFUKFNjNDr6/zADA4MNA35whNHo6P//Z63wqzI+xsCAoTD5CkTTXB2EZqwKQYIggGwLikKQSRc+oTrBgA9iMnkKYWYRtBqmkGjPYAsomBuJCnAAiTo/JajQ0FgAAAAASUVORK5CYII=)'
      }
  }
}
