

function make_main_btn( which )
{
    add_texture("cve_editor_basemenu_btn_"+which, "Editor\\main_ico_"+which+".png", 20, 20, "", "", "cve_editor_basemenu_div", No, "0px solid grey", Yes);
    var tex = document.getElementById("cve_editor_basemenu_btn_"+which);
    tex.style.marginRight = 1;
    tex.onclick = function () 
    {
        add_lua_script("cve:EdyRequestEditWhat("+which+");")
    }
}

function select_main_button(which)
{
    var tex = document.getElementById("cve_editor_basemenu_btn_"+which);
    tex.style.backgroundColor = "#FFEECC";
    tex.style.border = "2px solid white";
}

function make_main_buttons_header(select_which, header_caption)
{

    // header divs  

    div1 = document.createElement("div");
    div1.id = "main_header_div1";
    div1.style.position = "fixed";
    div1.style.margin = "0px";
    div1.style.borderTop = "1px solid #CCCCCC";
    div1.style.top = "0px";
    div1.style.left = "0px";
    div1.style.width = "100%";
    div1.style.height = "64px";
    div1.style.backgroundColor = "#E3ECFC";
    div1.style.borderBottom = "1px solid #AAAAAA";
    div1.style.zIndex = 100;
    document.body.appendChild(div1);
    
    div2 = document.createElement("div");
    div2.style.height = "4px";
    div1.appendChild(div2);

    div3 = document.createElement("div");
    div3.id = "cve_editor_basemenu_div";
    div1.appendChild(div3);

    div1.appendChild(document.createElement("hr"));

    div4 = document.createElement("div");
    div4.style.textAlign = "center";
    div1.appendChild(div4);

    div4.onclick = function(){ if(all_blocks_are_minimized()) restore_all_blocks(); else minimize_all_blocks();}
    div4.style.cursor = "pointer";

    fnt = document.createElement("font");
    fnt.id = "main_header_div_label";
    fnt.style.fontSize = "16px";
    fnt.style.color = "darkred";
    fnt.innerText = header_caption;
    div4.appendChild(fnt);
    
    div4.onmouseover = function() { document.getElementById("main_header_div_label").style.fontWeight="bolder";};
    div4.onmouseout = function () {document.getElementById("main_header_div_label").style.fontWeight="normal";}
    

    // add buttons
    for(var i=0; i<=10; i++) make_main_btn( i );
    
    // select one button
    select_main_button(select_which);
}

