

function make_main_btn( which )
{
    // create a button
    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)
{
    // make one button selected
    var tex = document.getElementById("cve_editor_basemenu_btn_"+which);
    tex.style.backgroundColor = "#FFCF71";
    tex.style.border = "1px solid white";
}

function make_main_buttons_header(select_which, header_caption)
{
    // create edito header with buttons and label

    // 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 = "#D2D8E0";
    div1.style.borderBottom = "1px solid #AAAAAA";
    div1.style.zIndex = 100;
    document.body.appendChild(div1);
    

    // div3 is for buttons
    div3 = document.createElement("div");
    div3.id = "cve_editor_basemenu_div";
    div3.style.marginTop= "4px";
    div1.appendChild(div3);

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

    // div4 is for big label
    div4 = document.createElement("div");
    div4.style.textAlign = "center";
    div1.appendChild(div4);

    // minimize / restore all blocks
    div4.onclick = function()
    { 
        if(all_blocks_are_minimized()) restore_all_blocks(); 
        else minimize_all_blocks();
    }
    div4.style.cursor = "pointer";

    // the label
    fnt = document.createElement("font");
    fnt.id = "main_header_div_label";
    fnt.style.fontSize = "18px";
    fnt.style.textShadow="0px 0px 15px #FFFFFF";
    fnt.style.color = "black";
    fnt.style.fontWeight="bolder";
    fnt.innerText = header_caption;
    div4.appendChild(fnt);
    div4.onmouseover = function() { document.getElementById("main_header_div_label").style.color="white"; }
    div4.onmouseout = function () { document.getElementById("main_header_div_label").style.color="black"; }
    
    // add editor buttons
    for(var i=0; i<=10; i++) make_main_btn( i );
    
    // select one button
    select_main_button(select_which);
}

