import * as Objekty from "./object.js";
import { getTypTopologieIndex } from './configurator.js';

export function formularUpdateLabel(label, text, barva) {
    label.innerHTML = text;
    label.style.color = barva;
}

export function formularUpdateInput(input, barvaBorder, sirka, styl, pozadi, pismo) {
    input.style.borderColor = barvaBorder;
    input.style.borderWidth = sirka;
    input.style.borderStyle = styl;
    input.style.backgroundColor = pozadi;
    input.style.color = pismo;
}


export function odstranitFormular(formular, classID) {
    const formularContainer = document.querySelector("." + classID);
    formularContainer.removeChild(formular);
}

export function odstranitVsechnyFormulare(classID) {
    var formularElements = document.querySelectorAll("." + classID);
    formularElements.forEach(function (formularElement) {
        formularElement.removeChild(formularElement);
    });
}

export function upravitProgressBar(Constants, formularHorni, formularSpodni) {
    let spojProKoeficient = new Objekty.Spoj("Pouze pro", "Výpočet koeficientu", "koeficient", "");

    spojProKoeficient.typKabelu = formularSpodni.typKabeluInput.value;
    spojProKoeficient.rokInstalaceKabelu = formularSpodni.rokInstalaceKabeluInput.value;
    spojProKoeficient.vzdalenost = formularHorni.vzdalenostInput.value;
    spojProKoeficient.prurezKabelu = formularSpodni.prurezKabeluInput.value;
    spojProKoeficient.pocetSpojek = formularSpodni.pocetSpojekInput.value;
    spojProKoeficient.rokInstalaceSpojek = formularSpodni.rokInstalaceSpojekInput.value;
    spojProKoeficient.typSpojek = formularSpodni.typSpojekInput.value;
    spojProKoeficient.zatez = formularSpodni.zatezInput.value;
    spojProKoeficient.zemneni = formularSpodni.zemneniSelect.value;
    spojProKoeficient.download = formularHorni.downloadInput.value;

    let koeficient = new Objekty.Koeficient(Constants, spojProKoeficient, false);

    formularSpodni.koeficientInput.value = koeficient.value;
    progressBar.value = koeficient.value;

    let red;
    let green;

    if (koeficient.value < Constants.KOEFICIENT_MINIMUM) {
        red = 255;
        green = 0;
    } else {
        red = 255 - (koeficient.value - Constants.KOEFICIENT_MINIMUM) * Constants.KOEFICIENT_BARVY;
        green = (koeficient.value - Constants.KOEFICIENT_MINIMUM) * Constants.KOEFICIENT_BARVY;
    }

    let color = 'rgb(' + red.toString() + ',' + green.toString() + ',0)';
    formularSpodni.koeficientProgressStyle.innerHTML = "#progressBar::-webkit-progress-value { background-color: " + color + "; }";

}


export function Formular(Constants, stranka, volba, poleTopologii, vybranaTopologie) {
    let prvniStanice = undefined;
    let max;
    var koefStep = "0.";
    for (let i = 1; i < Constants.ROUNDKOEF; i++)koefStep = koefStep + "0";
    koefStep = koefStep + "1";

    switch (stranka) {
        case "Topologie":
            switch (volba) {
                case "Vytvořit":
                    this.form = document.createElement("form");
                    this.form.id = "formularTopologieVytvorit";

                    this.nazevLabel = document.createElement("label");
                    this.nazevLabel.innerHTML = "Název topologie";
                    this.nazevLabel.setAttribute("for", "nazev");
                    this.form.appendChild(this.nazevLabel);

                    this.nazevInput = document.createElement("input");
                    this.nazevInput.type = "text";
                    this.nazevInput.id = "formularHalf";
                    this.nazevInput.name = "nazev";
                    this.nazevInput.required = true;
                    this.form.appendChild(this.nazevInput);


                    this.typTopologieLabel = document.createElement("label");
                    this.typTopologieLabel.innerHTML = "Typ topologie";
                    this.typTopologieLabel.setAttribute("for", "typTopologie");
                    this.form.appendChild(this.typTopologieLabel);

                    this.typTopologieSelect = document.createElement("select");
                    this.typTopologieSelect.id = "formularHalf";
                    this.typTopologieSelect.name = "typTopologie";


                    Constants.TYP_TOPOLOGIE.forEach(typ => {
                        let option = document.createElement("option");
                        option.value = typ;
                        option.innerHTML = typ;
                        this.typTopologieSelect.appendChild(option);
                    })
                    this.form.appendChild(this.typTopologieSelect);

                    //this.radek = document.createElement("br");
                    //this.form.appendChild(this.radek);

                    var radek1 = document.createElement("br");
                    this.form.appendChild(radek1);

                    this.poznamkaLabel = document.createElement("label");
                    this.poznamkaLabel.innerHTML = "Poznámka";
                    this.poznamkaLabel.setAttribute("for", "poznamka");
                    this.form.appendChild(this.poznamkaLabel);

                    this.poznamkaInput = document.createElement("input");
                    this.poznamkaInput.type = "text";
                    this.poznamkaInput.id = "formularFull";
                    this.poznamkaInput.name = "poznamka";
                    this.form.appendChild(this.poznamkaInput);

                    this.submit = document.createElement("input");
                    this.submit.setAttribute("type", "submit");
                    this.submit.value = "Vytvořit";
                    this.submit.id = "submitButton"
                    this.form.appendChild(this.submit);




                    break;
                case "Vybrat":
                    this.form = document.createElement("form");
                    this.form.id = "formularTopologieVybrat";
                    //this.options = [];

                    this.topologieSelect = document.createElement("label");
                    this.topologieSelect.innerHTML = "Topologie:";
                    this.topologieSelect.setAttribute("for", "topologie");
                    this.form.appendChild(this.topologieSelect);

                    this.topologieSelect = document.createElement("select");
                    this.topologieSelect.id = "formularFull";
                    this.topologieSelect.name = "topologie";

                    // TODO setřídit podle názvu
                    // TODO první vypsat zvolenou topologii?

                    poleTopologii.forEach(topologie => {
                        let option = document.createElement("option");
                        option.value = topologie.nazev;
                        option.innerHTML = topologie.nazev;
                        this.topologieSelect.appendChild(option);
                    })
                    this.form.appendChild(this.topologieSelect);

                    this.submit = document.createElement("input");
                    this.submit.setAttribute("type", "submit");
                    this.submit.id = "submitButton";
                    this.submit.value = "Vybrat";
                    this.form.appendChild(this.submit);
                    break;
                case "Editovat":
                    let prvniTopologie = undefined;
                    this.form = document.createElement("form");
                    this.form.id = "formularTopologieEditovat";

                    this.topologieSelect = document.createElement("label");
                    this.topologieSelect.innerHTML = "Topologie:";
                    this.topologieSelect.setAttribute("for", "topologie");
                    this.form.appendChild(this.topologieSelect);

                    this.topologieSelect = document.createElement("select");
                    this.topologieSelect.id = "formularFull";
                    this.topologieSelect.name = "topologie";


                    // TODO setřídit podle názvu
                    // TODO první vypsat zvolenou topologii?¨
                    // Vytvořit metodu, která vrátí index typu topologie (=pozici)

                    poleTopologii.forEach(topologie => {
                        if (prvniTopologie == undefined) prvniTopologie = topologie;
                        let option = document.createElement("option");
                        option.value = topologie.nazev;
                        option.innerHTML = topologie.nazev;
                        this.topologieSelect.appendChild(option);
                    })
                    this.form.appendChild(this.topologieSelect);

                    var radek1 = document.createElement("br");
                    this.form.appendChild(radek1);


                    this.nazevLabel = document.createElement("label");
                    this.nazevLabel.innerHTML = "Název topologie";
                    this.nazevLabel.setAttribute("for", "nazev");
                    this.form.appendChild(this.nazevLabel);

                    this.nazevInput = document.createElement("input");
                    this.nazevInput.type = "text";
                    this.nazevInput.id = "formularHalf";
                    this.nazevInput.name = "nazev";
                    this.nazevInput.value = prvniTopologie.nazev;
                    this.form.appendChild(this.nazevInput);

                    this.typTopologieLabel = document.createElement("label");
                    this.typTopologieLabel.innerHTML = "Typ topologie";
                    this.typTopologieLabel.setAttribute("for", "typTopologie");
                    this.form.appendChild(this.typTopologieLabel);

                    this.typTopologieSelect = document.createElement("select");
                    this.typTopologieSelect.id = "formularHalf";
                    this.typTopologieSelect.name = "typTopologie";


                    Constants.TYP_TOPOLOGIE.forEach(typ => {
                        let option = document.createElement("option");
                        option.value = typ;
                        option.innerHTML = typ;
                        this.typTopologieSelect.appendChild(option);
                    })

                    this.form.appendChild(this.typTopologieSelect);
                    this.typTopologieSelect.selectedIndex = getTypTopologieIndex(Constants, prvniTopologie.typ);


                    var radek2 = document.createElement("br");
                    this.form.appendChild(radek2);


                    this.poznamkaLabel = document.createElement("label");
                    this.poznamkaLabel.innerHTML = "Poznámka";
                    this.poznamkaLabel.setAttribute("for", "poznamka");
                    this.form.appendChild(this.poznamkaLabel);

                    this.poznamkaInput = document.createElement("input");
                    this.poznamkaInput.type = "text";
                    this.poznamkaInput.id = "formularFull";
                    this.poznamkaInput.name = "poznamka";
                    this.poznamkaInput.value = prvniTopologie.poznamka;
                    this.form.appendChild(this.poznamkaInput);




                    //this.radek = document.createElement("br");
                    //this.form.appendChild(this.radek);

                    this.reset = document.createElement("input");
                    this.reset.setAttribute("type", "reset");
                    this.reset.value = "Vymazat vše";
                    this.reset.id = "resetButton";
                    this.form.appendChild(this.reset);

                    this.default = document.createElement("input");
                    this.default.setAttribute("type", "button");
                    this.default.value = "Výchozí hodnoty";
                    this.default.id = "restoreDefaultButton";
                    this.form.appendChild(this.default);

                    this.submit = document.createElement("input");
                    this.submit.setAttribute("type", "submit");
                    this.submit.value = "Editovat";
                    this.submit.id = "submitButton";
                    this.form.appendChild(this.submit);

                    break;
                case "Odstranit":
                    this.form = document.createElement("form");
                    this.form.id = "formularTopologieOdstranit";

                    this.topologieSelect = document.createElement("label");
                    this.topologieSelect.innerHTML = "Topologie k odstranění";
                    this.topologieSelect.setAttribute("for", "topologie");
                    this.form.appendChild(this.topologieSelect);

                    this.topologieSelect = document.createElement("select");
                    this.topologieSelect.id = "TopologieOdstranitFull";
                    this.topologieSelect.name = "topologie";

                    // TODO setřídit podle názvu
                    // TODO první vypsat zvolenou topologii?

                    poleTopologii.forEach(topologie => {
                        if (prvniStanice == undefined) prvniStanice = topologie;
                        let option = document.createElement("option");
                        option.value = topologie.nazev;
                        option.innerHTML = topologie.nazev;
                        this.topologieSelect.appendChild(option);
                    })
                    this.form.appendChild(this.topologieSelect);

                    this.nazevLabel = document.createElement("label");
                    this.nazevLabel.innerHTML = "Opiš název topologie k odstranění";
                    this.nazevLabel.setAttribute("for", "nazev");
                    this.form.appendChild(this.nazevLabel);

                    this.nazevInput = document.createElement("input");
                    this.nazevInput.type = "text";
                    this.nazevInput.id = "TopologieOdstranitFull";
                    this.nazevInput.name = "nazev";
                    this.form.appendChild(this.nazevInput);


                    this.pocetSpojuLabel = document.createElement("label");
                    let pocetStanic = 0;
                    let pocetSpoju = 0;
                    if (prvniStanice.poleSpoju != undefined) pocetSpoju = prvniStanice.poleSpoju.length;
                    if (prvniStanice.poleStanic != undefined) pocetStanic = prvniStanice.poleStanic.length;
                    this.pocetSpojuLabel.innerHTML = "Obsahuje Spojů: " + pocetSpoju + ", Stanic: " + pocetStanic;
                    this.pocetSpojuLabel.setAttribute("for", "pocetSpoju");
                    this.form.appendChild(this.pocetSpojuLabel);



                    this.submit = document.createElement("input");
                    this.submit.setAttribute("type", "submit");
                    this.submit.value = "Odstranit";
                    this.submit.disabled = true;
                    this.submit.id = "blockedButton"
                    this.form.appendChild(this.submit);
                    break;
            }
            break;
        case "Spoje":
            var formcopy;
            let multipleVolba = volba.split(" ");

            if (multipleVolba[1] == undefined) {
                if (multipleVolba[0] == "Vytvořit" || multipleVolba[0] == "Editovat") {
                    this.aktualniSpoj = undefined;
                    this.form = document.createElement("form");
                    if (volba == "Editovat") {
                        this.form.id = "formularSpojeEditovat";

                        this.spojSelectLabel = document.createElement("label");
                        this.spojSelectLabel.innerHTML = "Spoj:";
                        this.spojSelectLabel.setAttribute("for", "spoj");
                        this.form.appendChild(this.spojSelectLabel);

                        this.spojSelect = document.createElement("select");
                        this.spojSelect.id = "formularFull";
                        this.spojSelect.name = "spoj";

                        vybranaTopologie.poleSpoju.forEach(spoj => {
                            if (this.aktualniSpoj == undefined) this.aktualniSpoj = spoj;
                            let option = document.createElement("option");
                            option.value = spoj.nazev;
                            option.innerHTML = spoj.nazev;
                            this.spojSelect.appendChild(option);
                        })
                        this.form.appendChild(this.spojSelect);
                    }
                    else this.form.id = "formularSpojeVytvorit";


                    this.ALabel = document.createElement("label");
                    this.ALabel.innerHTML = "Stanice A:";
                    this.ALabel.setAttribute("for", "A");
                    this.form.appendChild(this.ALabel);

                    this.ASelect = document.createElement("select");
                    this.ASelect.id = "formularHalf";
                    this.ASelect.name = "A";
                    this.ASelect.required = true;

                    vybranaTopologie.poleStanic.forEach(stanice => {
                        let option = document.createElement("option");
                        option.value = stanice.nazev;
                        option.innerHTML = stanice.nazev;
                        this.ASelect.appendChild(option);
                    })
                    this.ASelect.selectedIndex = -1;
                    this.form.appendChild(this.ASelect);

                    this.BLabel = document.createElement("label");
                    this.BLabel.innerHTML = "Stanice B:";
                    this.BLabel.setAttribute("for", "B");
                    this.form.appendChild(this.BLabel);

                    this.BSelect = document.createElement("select");
                    this.BSelect.id = "formularHalf";
                    this.BSelect.name = "B";
                    this.BSelect.required = true;

                    vybranaTopologie.poleStanic.forEach(stanice => {
                        let option = document.createElement("option");
                        option.value = stanice.nazev;
                        option.innerHTML = stanice.nazev;
                        this.BSelect.appendChild(option);
                    })
                    this.BSelect.selectedIndex = -1;
                    this.form.appendChild(this.BSelect);

                    this.technologieLabel = document.createElement("label");
                    this.technologieLabel.innerHTML = "Technologie";
                    this.technologieLabel.setAttribute("for", "technologie");
                    this.form.appendChild(this.technologieLabel);

                    this.technologieSelect = document.createElement("select");
                    this.technologieSelect.id = "formularHalf";
                    this.technologieSelect.name = "technologie";
                    this.technologieSelect.required = true;

                    Constants.TECHNOLOGIE.forEach(technologie => {
                        let option = document.createElement("option");
                        option.value = technologie;
                        option.innerHTML = technologie;
                        this.technologieSelect.appendChild(option);
                    })
                    this.technologieSelect.selectedIndex = -1;
                    this.form.appendChild(this.technologieSelect);




                    this.vzdalenostLabel = document.createElement("label");
                    this.vzdalenostLabel.innerHTML = "Vzdálenost [km]";
                    this.vzdalenostLabel.setAttribute("for", "vzdalenost");
                    this.form.appendChild(this.vzdalenostLabel);

                    this.vzdalenostInput = document.createElement("input");
                    this.vzdalenostInput.type = "number";
                    this.vzdalenostInput.min = "0";
                    this.vzdalenostInput.title = "Vzdálenost mezi stanicemi, délka vedení, ... Pokud je parametr neznámý, ponechte 0";
                    this.vzdalenostInput.step = "0.0001";
                    this.vzdalenostInput.id = "formularHalf";
                    this.vzdalenostInput.name = "technologie";
                    this.vzdalenostInput.value = 0;
                    this.form.appendChild(this.vzdalenostInput);


                    this.downloadLabel = document.createElement("label");
                    this.downloadLabel.innerHTML = "Download [Mbps]";
                    this.downloadLabel.setAttribute("for", "download");
                    this.form.appendChild(this.downloadLabel);

                    this.downloadInput = document.createElement("input");
                    this.downloadInput.type = "number";
                    this.downloadInput.min = "0";
                    this.downloadInput.id = "formularHalf";
                    this.downloadInput.title = "Pokud je parametr neznámý, ponechte 0";
                    this.downloadInput.step = "0.01";
                    this.downloadInput.name = "download";
                    this.downloadInput.value = 0;
                    this.form.appendChild(this.downloadInput);

                    this.uploadLabel = document.createElement("label");
                    this.uploadLabel.innerHTML = "Upload [Mbps]";
                    this.uploadLabel.setAttribute("for", "upload");
                    this.form.appendChild(this.uploadLabel);

                    this.uploadInput = document.createElement("input");
                    this.uploadInput.type = "number";
                    this.uploadInput.min = "0";
                    this.uploadInput.step = "0.01";
                    this.uploadInput.id = "formularHalf";
                    this.uploadInput.title = "Pokud je parametr neznámý, ponechte 0";
                    this.uploadInput.name = "download";
                    this.uploadInput.value = 0;
                    this.form.appendChild(this.uploadInput);



                    this.oznaceniLabel = document.createElement("label");
                    this.oznaceniLabel.innerHTML = "Označení";
                    this.oznaceniLabel.setAttribute("for", "oznaceni");
                    this.form.appendChild(this.oznaceniLabel);


                    this.oznaceniInput = document.createElement("input");
                    this.oznaceniInput.type = "text";
                    this.oznaceniInput.name = "oznaceni";
                    this.oznaceniInput.id = "formularHalf";
                    this.form.appendChild(this.oznaceniInput);


                    this.poznamkaLabel = document.createElement("label");
                    this.poznamkaLabel.innerHTML = "Poznámka";
                    this.poznamkaLabel.setAttribute("for", "poznamkaText");
                    this.form.appendChild(this.poznamkaLabel);


                    this.poznamkaInput = document.createElement("input");
                    this.poznamkaInput.type = "text";
                    this.poznamkaInput.name = "poznamkaText";
                    this.poznamkaInput.id = "formularHalf";
                    this.form.appendChild(this.poznamkaInput);

                    /*this.submit = document.createElement("input");
                    this.submit.setAttribute("type", "submit");
                    this.submit.value = "Vytvořit";
                    this.submit.disabled = true;
                    this.submit.id = "blockedButton"
                    this.form.appendChild(this.submit);*/
                    formcopy = this.form;


                } else if (multipleVolba[0] == "Odstranit") {
                    this.form = document.createElement("form");
                    this.form.id = "formularSpojOdstranit";

                    this.spojSelectLabel = document.createElement("label");
                    this.spojSelectLabel.innerHTML = "Spoj k odstranění:";
                    this.spojSelectLabel.setAttribute("for", "spoj");
                    this.form.appendChild(this.spojSelectLabel);

                    this.spojSelect = document.createElement("select");
                    this.spojSelect.id = "SpojOdstranitFull";
                    this.spojSelect.name = "spoj";

                    vybranaTopologie.poleSpoju.forEach(spoj => {
                        if (this.aktualniSpoj == undefined) this.aktualniSpoj = spoj;
                        let option = document.createElement("option");
                        option.value = spoj.nazev;
                        option.innerHTML = spoj.nazev;
                        this.spojSelect.appendChild(option);
                    })
                    this.form.appendChild(this.spojSelect);

                    this.nazevLabel = document.createElement("label");
                    this.nazevLabel.innerHTML = "Opiš název spoje k odstranění";
                    this.nazevLabel.setAttribute("for", "nazev");
                    this.form.appendChild(this.nazevLabel);

                    this.nazevInput = document.createElement("input");
                    this.nazevInput.type = "text";
                    this.nazevInput.id = "SpojOdstranitFull";
                    this.nazevInput.name = "nazev";
                    this.form.appendChild(this.nazevInput);


                    this.submit = document.createElement("input");
                    this.submit.setAttribute("type", "submit");
                    this.submit.value = "Odstranit";
                    this.submit.disabled = true;
                    this.submit.id = "blockedButton"
                    this.form.appendChild(this.submit);
                }



            } else {
    // PŘIDÁNÍ FORMULÁŘE PRO SPECIFICKOU TECHNOLOGII
                switch (multipleVolba[1]) {
                    case "BPL":
                        this.form = document.createElement("form");
                        this.form.id = volba;

                        this.kabel = document.createElement("label");
                        this.kabel.innerHTML = "Parametry kabelu:";
                        this.kabel.id = "podnadpis";
                        this.form.appendChild(this.kabel);


                        //this.form.appendChild(document.createElement("br"));

                        this.delkaUsekuKabeluLabel = document.createElement("label");
                        this.delkaUsekuKabeluLabel.innerHTML = "Délka úseků";
                        //this.delkaUsekuKabeluLabel.id = "formularThirdLabel";
                        this.delkaUsekuKabeluLabel.setAttribute("for", "delkaUsekuKabelu");
                        this.form.appendChild(this.delkaUsekuKabeluLabel);

                        this.delkaUsekuKabeluInput = document.createElement("input");
                        this.delkaUsekuKabeluInput.type = "text";
                        this.delkaUsekuKabeluInput.id = "formularHalf";
                        this.delkaUsekuKabeluInput.name = "delkaUsekuKabelu";
                        this.form.appendChild(this.delkaUsekuKabeluInput);


                        this.typKabeluLabel = document.createElement("label");
                        this.typKabeluLabel.innerHTML = "Typ";
                        //this.typKabeluLabel.id = "formularThirdLabel";
                        this.typKabeluLabel.setAttribute("for", "typKabelu");
                        this.form.appendChild(this.typKabeluLabel);

                        this.typKabeluInput = document.createElement("input");
                        this.typKabeluInput.type = "text";
                        this.typKabeluInput.name = "typKabelu";
                        this.typKabeluInput.id = "formularHalf";
                        this.form.appendChild(this.typKabeluInput);

                        this.rokInstalaceKabeluLabel = document.createElement("label");
                        this.rokInstalaceKabeluLabel.innerHTML = "Rok instalace";
                        //this.rokInstalaceKabeluLabel.id = "formularThirdLabel"
                        this.rokInstalaceKabeluLabel.setAttribute("for", "rokInstalaceKabelu");
                        this.form.appendChild(this.rokInstalaceKabeluLabel);

                        this.rokInstalaceKabeluInput = document.createElement("input");
                        this.rokInstalaceKabeluInput.type = "text";
                        this.rokInstalaceKabeluInput.name = "rokInstalaceKabelu";
                        this.rokInstalaceKabeluInput.id = "formularHalf";
                        this.form.appendChild(this.rokInstalaceKabeluInput);

                        this.prurezKabeluLabel = document.createElement("label");
                        this.prurezKabeluLabel.innerHTML = "Průřez [mm<sup>2</sup>]";
                        //this.prurezKabeluLabel.id = "formularThirdLabel"
                        this.prurezKabeluLabel.setAttribute("for", "prurezKabelu");
                        this.form.appendChild(this.prurezKabeluLabel);

                        this.prurezKabeluInput = document.createElement("input");
                        this.prurezKabeluInput.type = "number";
                        this.prurezKabeluInput.min = "0";
                        this.prurezKabeluInput.step = "0.01";
                        this.prurezKabeluInput.name = "prurezKabelu";
                        this.prurezKabeluInput.title = "Pokud je parametr neznámý, ponechte 0";
                        this.prurezKabeluInput.value = "0";
                        this.prurezKabeluInput.id = "formularHalf";
                        this.form.appendChild(this.prurezKabeluInput);


                        this.spojky = document.createElement("label");
                        this.spojky.innerHTML = "Parametry spojek:";
                        this.spojky.id = "podnadpis";
                        this.form.appendChild(this.spojky);

                        this.pocetSpojekLabel = document.createElement("label");
                        this.pocetSpojekLabel.innerHTML = "Počet";
                        //this.pocetSpojekLabel.id = "formularThirdLabel";
                        this.pocetSpojekLabel.setAttribute("for", "pocetSpojek");
                        this.form.appendChild(this.pocetSpojekLabel);

                        this.pocetSpojekInput = document.createElement("input");
                        this.pocetSpojekInput.type = "number";
                        this.pocetSpojekInput.min = "-1";
                        this.pocetSpojekInput.title = "Zadejte počet spojek na trase. Pokud je počet spojek neznámý, zadejte -1!";
                        this.pocetSpojekInput.value = "-1";
                        this.pocetSpojekInput.id = "formularHalf";
                        this.pocetSpojekInput.name = "pocetSpojek";
                        this.form.appendChild(this.pocetSpojekInput);



                        this.typSpojekLabel = document.createElement("label");
                        this.typSpojekLabel.innerHTML = "Typ";
                        //his.typSpojekLabel.id = "formularThirdLabel";
                        this.typSpojekLabel.setAttribute("for", "typSpojek");
                        this.form.appendChild(this.typSpojekLabel);

                        this.typSpojekInput = document.createElement("input");
                        this.typSpojekInput.type = "text";
                        this.typSpojekInput.name = "typSpojek";
                        this.typSpojekInput.id = "formularHalf";
                        this.form.appendChild(this.typSpojekInput);

                        this.rokInstalaceSpojekLabel = document.createElement("label");
                        this.rokInstalaceSpojekLabel.innerHTML = "Rok instalace";
                        //this.rokInstalaceSpojekLabel.id = "formularThirdLabel"
                        this.rokInstalaceSpojekLabel.setAttribute("for", "rokInstalaceSpojek");
                        this.form.appendChild(this.rokInstalaceSpojekLabel);

                        this.rokInstalaceSpojekInput = document.createElement("input");
                        this.rokInstalaceSpojekInput.type = "text";
                        this.rokInstalaceSpojekInput.name = "rokInstalaceSpojek";
                        this.rokInstalaceSpojekInput.title = "Zadejte jednotlivé roky instalace spojek na trase oddělené libovolným znakem vyjma číslice.";
                        this.rokInstalaceSpojekInput.id = "formularHalf";
                        this.form.appendChild(this.rokInstalaceSpojekInput);

                        this.materialSpojekLabel = document.createElement("label");
                        this.materialSpojekLabel.innerHTML = "Materiál";
                        //this.materialSpojekLabel.id = "formularThirdLabel"
                        this.materialSpojekLabel.setAttribute("for", "materialSpojky");
                        this.form.appendChild(this.materialSpojekLabel);

                        this.materialSpojekInput = document.createElement("input");
                        this.materialSpojekInput.type = "text";
                        this.materialSpojekInput.name = "materialSpojky";
                        this.materialSpojekInput.id = "formularHalf";
                        this.form.appendChild(this.materialSpojekInput);

                        this.ostatni = document.createElement("label");
                        this.ostatni.innerHTML = "Ostatní:";
                        this.ostatni.id = "podnadpis";
                        this.form.appendChild(this.ostatni);

                        this.zatezLabel = document.createElement("label");
                        this.zatezLabel.innerHTML = "Zátěž [%]";
                        //this.zatezLabel.id = "formularThirdLabel";
                        this.zatezLabel.setAttribute("for", "zatez");
                        this.form.appendChild(this.zatezLabel);

                        this.zatezInput = document.createElement("input");
                        this.zatezInput.type = "number";
                        this.zatezInput.min = "-1";
                        this.zatezInput.max = "100";
                        this.zatezInput.step = "0.01";
                        this.zatezInput.value = "-1";
                        this.zatezInput.id = "formularHalf";
                        this.zatezInput.title = "Zadejte zatížení kabelové trasy. Pokud je parametr neznámý zadejte -1!";
                        this.zatezInput.name = "zatez";
                        this.form.appendChild(this.zatezInput);


                        this.zemneniLabel = document.createElement("label");
                        this.zemneniLabel.innerHTML = "Zemnění";
                        //this.zemneniLabel.id = "formularThirdLabel";
                        this.zemneniLabel.setAttribute("for", "zemneni");
                        this.form.appendChild(this.zemneniLabel);

                        this.zemneniSelect = document.createElement("select");
                        this.zemneniSelect.id = "formularHalf";
                        this.zemneniSelect.name = "zemneni";
                        this.zemneniSelect.required = true;


                        Constants.ZEMNENI.forEach(zemneni => {
                            let option = document.createElement("option");
                            option.value = zemneni;
                            option.innerHTML = zemneni;
                            this.zemneniSelect.appendChild(option);
                        })
                        this.zemneniSelect.selectedIndex = Constants.ZEMNENI.length - 1;
                        this.form.appendChild(this.zemneniSelect);
                        
                        this.bleTxLabel = document.createElement("label");
                        this.bleTxLabel.innerHTML = "BLE Tx";
                        this.bleTxLabel.id = "formularThirdLabel"
                        this.bleTxLabel.setAttribute("for", "bleTx");
                        this.form.appendChild(this.bleTxLabel);

                        this.bleTxInput = document.createElement("input");
                        this.bleTxInput.type = "number";
                        this.bleTxInput.min = "0";
                        this.bleTxInput.value = "0";
                        this.bleTxInput.name = "bleTx";
                        this.bleTxInput.title = "Pokud je parametr neznámý, ponechte 0";
                        this.bleTxInput.step = "0.01";
                        this.bleTxInput.id = "formularThird";
                        this.form.appendChild(this.bleTxInput);

                        this.bleRxLabel = document.createElement("label");
                        this.bleRxLabel.innerHTML = "BLE Rx";
                        this.bleRxLabel.id = "formularThirdLabel"
                        this.bleRxLabel.setAttribute("for", "bleRx");
                        this.form.appendChild(this.bleRxLabel);

                        this.bleRxInput = document.createElement("input");
                        this.bleRxInput.type = "number";
                        this.bleRxInput.min = "0";
                        this.bleRxInput.value = "0";
                        this.bleRxInput.step = "0.01";
                        this.bleRxInput.name = "bleRx";
                        this.bleRxInput.title = "Pokud je parametr neznámý, ponechte 0";
                        this.bleRxInput.id = "formularThird";
                        this.form.appendChild(this.bleRxInput);


                        this.koeficientLabel = document.createElement("label");
                        this.koeficientLabel.innerHTML = "Koeficient";
                        this.koeficientLabel.id = "formularThirdLabel"
                        this.koeficientLabel.setAttribute("for", "koeficient");
                        this.form.appendChild(this.koeficientLabel);

                        this.koeficientInput = document.createElement("input");
                        this.koeficientInput.type = "number";
                        this.koeficientInput.min = "0";
                        this.koeficientInput.max = "1";
                        this.koeficientInput.step = koefStep;
                        this.koeficientInput.name = "koeficient";
                        this.koeficientInput.id = "formularThird";
                        this.form.appendChild(this.koeficientInput);

                        this.koeficientProgress = document.createElement("progress");
                        this.koeficientProgress.max = "1";
                        this.koeficientProgress.value = "0";
                        this.koeficientProgress.id = "progressBar";
                        //this.koeficientProgress.style.color = "black";
                        this.koeficientProgress.style.backgroundColor = "white !important";
                        this.form.appendChild(this.koeficientProgress);

                        // Nastavení výplně progress baru
                        this.koeficientProgressStyle = document.createElement("style");
                        this.koeficientProgressStyle.innerHTML = `#progressBar::-webkit-progress-value { background-color: red; }`;
                        document.head.appendChild(this.koeficientProgressStyle);

                        // Nastavení události pro aktualizaci progress baru při změně hodnoty vstupního pole


                        this.form.appendChild(document.createElement("br"));
                        this.form.appendChild(document.createElement("br"));
                        formcopy = this.form;

                        break;

                    case "MW":
                        this.form = document.createElement("form");
                        this.form.id = volba;

                        this.RxLabel = document.createElement("label");
                        this.RxLabel.innerHTML = "Rx [MHz]";
                        this.RxLabel.setAttribute("for", "Rx");
                        this.form.appendChild(this.RxLabel);

                        this.RxInput = document.createElement("input");
                        this.RxInput.type = "number";
                        this.RxInput.min = "0";
                        this.RxInput.name = "Rx";
                        this.RxInput.id = "formularHalf";
                        this.form.appendChild(this.RxInput);

                        this.TxLabel = document.createElement("label");
                        this.TxLabel.innerHTML = "Tx [MHz]";
                        this.TxLabel.setAttribute("for", "Tx");
                        this.form.appendChild(this.TxLabel);

                        this.TxInput = document.createElement("input");
                        this.TxInput.type = "number";
                        this.TxInput.min = "0";
                        this.TxInput.name = "Tx";
                        this.TxInput.id = "formularHalf";
                        this.form.appendChild(this.TxInput);

                        this.bandWidthLabel = document.createElement("label");
                        this.bandWidthLabel.innerHTML = "BandWidth [MHz]";
                        this.bandWidthLabel.setAttribute("for", "bandWidth");
                        this.form.appendChild(this.bandWidthLabel);

                        this.bandWidthInput = document.createElement("input");
                        this.bandWidthInput.type = "number";
                        this.bandWidthInput.min = "0";
                        this.bandWidthInput.name = "bandWidth";
                        this.bandWidthInput.id = "formularHalf";
                        this.form.appendChild(this.bandWidthInput);

                        this.modulaceLabel = document.createElement("label");
                        this.modulaceLabel.innerHTML = "Modulace";
                        this.modulaceLabel.setAttribute("for", "modulace");
                        this.form.appendChild(this.modulaceLabel);

                        this.modulaceInput = document.createElement("input");
                        this.modulaceInput.type = "text";
                        this.modulaceInput.name = "modulace";
                        this.modulaceInput.id = "formularHalf";
                        this.form.appendChild(this.modulaceInput);

                        formcopy = this.form;

                        break;
                    default:
                        this.form = document.createElement("form");
                        this.form.id = volba;
                        formcopy = this.form;
                        break;
                }

                if (multipleVolba[0] == "Vytvořit") {
                    this.submit = document.createElement("input");
                    this.submit.setAttribute("type", "submit");
                    this.submit.value = "Vytvořit";
                    this.submit.disabled = true;
                    this.submit.id = "blockedButton"


                    formcopy.appendChild(this.submit);
                }

                if (multipleVolba[0] == "Editovat") {
                    this.reset = document.createElement("input");
                    this.reset.setAttribute("type", "reset");
                    this.reset.value = "Vymazat vše";
                    this.reset.id = "resetButton";
                    formcopy.appendChild(this.reset);

                    this.default = document.createElement("input");
                    this.default.setAttribute("type", "button");
                    this.default.value = "Výchozí hodnoty";
                    this.default.id = "restoreDefaultButton";
                    formcopy.appendChild(this.default);

                    this.submit = document.createElement("input");
                    this.submit.setAttribute("type", "submit");
                    this.submit.value = "Editovat";
                    this.submit.id = "submitButton";
                    formcopy.appendChild(this.submit);
                }
            }

            break;

        case "Stanice":
            var step = "0.";
            for (let i = 1; i < Constants.SOURADNICE_DESETINNA_MISTA; i++)step = step + "0";
            step = step + "1";
            switch (volba) {
                case "Vytvořit":
                    this.form = document.createElement("form");
                    this.form.id = "formularStaniceVytvorit";

                    this.nazevLabel = document.createElement("label");
                    this.nazevLabel.innerHTML = "Název stanice";
                    this.nazevLabel.setAttribute("for", "nazevText");
                    this.form.appendChild(this.nazevLabel);

                    this.nazevInput = document.createElement("input");
                    this.nazevInput.type = "text";
                    this.nazevInput.id = "formularFull";
                    this.nazevInput.name = "nazevText";
                    this.nazevInput.required = true;
                    this.form.appendChild(this.nazevInput);

                    //var radek2 = document.createElement("br");
                    //this.form.appendChild(radek2);

                    this.latitudeLabel = document.createElement("label");
                    this.latitudeLabel.innerHTML = "Latitude (šířka)";
                    this.latitudeLabel.setAttribute("for", "latitude");
                    this.form.appendChild(this.latitudeLabel);

                    this.latitudeInput = document.createElement("input");
                    this.latitudeInput.type = "number";
                    this.latitudeInput.min = "-180";
                    this.latitudeInput.max = "180";
                    this.latitudeInput.step = step;
                    this.latitudeInput.id = "formularHalf";
                    this.latitudeInput.name = "latitude";
                    this.latitudeInput.required = true;
                    this.form.appendChild(this.latitudeInput);

                    this.latitudeLabel = document.createElement("label");
                    this.latitudeLabel.innerHTML = "Longitude (délka)";
                    this.latitudeLabel.setAttribute("for", "latitude");
                    this.form.appendChild(this.latitudeLabel);

                    this.longitudeInput = document.createElement("input");
                    this.longitudeInput.type = "number";
                    this.longitudeInput.min = "-90";
                    this.longitudeInput.max = "90";
                    this.longitudeInput.step = step;
                    this.longitudeInput.id = "formularHalf";
                    this.longitudeInput.name = "latitude";
                    this.longitudeInput.required = true;
                    this.form.appendChild(this.longitudeInput);

                    //var radek1 = document.createElement("br");
                    //this.form.appendChild(radek1);

                    this.poznamkaLabel = document.createElement("label");
                    this.poznamkaLabel.innerHTML = "Poznámka";
                    this.poznamkaLabel.setAttribute("for", "poznamkaText");
                    this.form.appendChild(this.poznamkaLabel);

                    this.poznamkaInput = document.createElement("input");
                    this.poznamkaInput.type = "text";
                    this.poznamkaInput.name = "poznamkaText";
                    this.poznamkaInput.id = "formularFull";
                    this.form.appendChild(this.poznamkaInput);

                    this.idLabel = document.createElement("label");
                    this.idLabel.innerHTML = "Poradi";
                    this.idLabel.setAttribute("for", "idText");
                    this.form.appendChild(this.idLabel);

                    this.idInput = document.createElement("input");
                    this.idInput.type = "number";
                    this.idInput.min = "1";
                    max = vybranaTopologie.poleStanic.length + 1;
                    this.idInput.max = max.toString();
                    this.idInput.step = "1";
                    this.idInput.name = "idText";
                    this.idInput.id = "formularHalf";
                    this.idInput.value = max;
                    this.form.appendChild(this.idInput);


                    this.submit = document.createElement("input");
                    this.submit.setAttribute("type", "submit");
                    this.submit.value = "Vytvořit";
                    this.submit.id = "submitButton"
                    this.form.appendChild(this.submit);


                    break;
                case "Editovat":
                    this.form = document.createElement("form");
                    this.form.id = "formularStaniceEditovat";

                    this.staniceSelectLabel = document.createElement("label");
                    this.staniceSelectLabel.innerHTML = "Stanice:";
                    this.staniceSelectLabel.setAttribute("for", "stanice");
                    this.form.appendChild(this.staniceSelectLabel);

                    this.staniceSelect = document.createElement("select");
                    this.staniceSelect.id = "formularHalf";
                    this.staniceSelect.name = "stanice";
                    this.staniceSelect.required = true;

                    // TODO setřídit podle názvu
                    // TODO první vypsat zvolenou topologii?


                    vybranaTopologie.poleStanic.forEach(stanice => {
                        if (prvniStanice == undefined) prvniStanice = stanice;
                        let option = document.createElement("option");
                        option.value = stanice.nazev;
                        option.innerHTML = stanice.nazev;
                        this.staniceSelect.appendChild(option);
                    })
                    this.form.appendChild(this.staniceSelect);


                    this.nazevLabel = document.createElement("label");
                    this.nazevLabel.innerHTML = "Název stanice";
                    this.nazevLabel.setAttribute("for", "nazev");
                    this.form.appendChild(this.nazevLabel);

                    this.nazevInput = document.createElement("input");
                    this.nazevInput.type = "text";
                    this.nazevInput.id = "formularHalf";
                    this.nazevInput.name = "nazev";
                    this.nazevInput.value = prvniStanice.nazev;
                    this.nazevInput.required = true;
                    this.form.appendChild(this.nazevInput);



                    this.latitudeLabel = document.createElement("label");
                    this.latitudeLabel.innerHTML = "Latitude (šířka)";
                    this.latitudeLabel.setAttribute("for", "latitude");
                    this.form.appendChild(this.latitudeLabel);

                    this.latitudeInput = document.createElement("input");
                    this.latitudeInput.type = "number";
                    this.latitudeInput.min = "-180";
                    this.latitudeInput.max = "180";
                    this.latitudeInput.step = step;
                    this.latitudeInput.id = "formularHalf";
                    this.latitudeInput.name = "latitude";
                    this.latitudeInput.value = prvniStanice.lat;
                    this.latitudeInput.required = true;
                    this.form.appendChild(this.latitudeInput);

                    this.longitudeLabel = document.createElement("label");
                    this.longitudeLabel.innerHTML = "Longitude (délka)";
                    this.longitudeLabel.setAttribute("for", "longitude");
                    this.form.appendChild(this.longitudeLabel);

                    this.longitudeInput = document.createElement("input");
                    this.longitudeInput.type = "number";
                    this.longitudeInput.min = "-90";
                    this.longitudeInput.max = "90";
                    this.longitudeInput.step = step;
                    this.longitudeInput.id = "formularHalf";
                    this.longitudeInput.name = "latitude";
                    this.longitudeInput.value = prvniStanice.long;
                    this.longitudeInput.required = true;
                    this.form.appendChild(this.longitudeInput);

                    var radek1 = document.createElement("br");
                    this.form.appendChild(radek1);

                    this.poznamkaLabel = document.createElement("label");
                    this.poznamkaLabel.innerHTML = "Poznámka";
                    this.poznamkaLabel.setAttribute("for", "poznamkaText");
                    this.form.appendChild(this.poznamkaLabel);

                    this.poznamkaInput = document.createElement("input");
                    this.poznamkaInput.type = "text";
                    this.poznamkaInput.name = "poznamkaText";
                    this.poznamkaInput.id = "formularFull";
                    this.poznamkaInput.value = prvniStanice.poznamka;
                    this.form.appendChild(this.poznamkaInput);

                    var radek3 = document.createElement("br");
                    this.form.appendChild(radek3);

                    this.idLabel = document.createElement("label");
                    this.idLabel.innerHTML = "Poradi";
                    this.idLabel.setAttribute("for", "idText");
                    this.form.appendChild(this.idLabel);

                    this.idInput = document.createElement("input");
                    this.idInput.type = "number";
                    this.idInput.min = "1";
                    max = vybranaTopologie.poleStanic.length;
                    this.idInput.max = max.toString();
                    this.idInput.step = "1";
                    this.idInput.name = "idText";
                    this.idInput.id = "formularHalf";
                    this.idInput.value = prvniStanice.poradi;
                    this.form.appendChild(this.idInput);


                    radek3 = document.createElement("br");
                    this.form.appendChild(radek3);

                    this.reset = document.createElement("input");
                    this.reset.setAttribute("type", "reset");
                    this.reset.value = "Vymazat vše";
                    this.reset.id = "resetButton";
                    this.form.appendChild(this.reset);

                    this.default = document.createElement("input");
                    this.default.setAttribute("type", "button");
                    this.default.value = "Výchozí hodnoty";
                    this.default.id = "restoreDefaultButton";
                    this.form.appendChild(this.default);

                    this.submit = document.createElement("input");
                    this.submit.setAttribute("type", "submit");
                    this.submit.value = "Upravit";
                    this.submit.id = "submitButton"
                    this.form.appendChild(this.submit);

                    break;
                case "Odstranit":
                    this.form = document.createElement("form");
                    this.form.id = "formularStaniceOdstranit";

                    this.staniceSelect = document.createElement("label");
                    this.staniceSelect.innerHTML = "Stanice:";
                    this.staniceSelect.setAttribute("for", "stanice");
                    this.form.appendChild(this.staniceSelect);

                    this.staniceSelect = document.createElement("select");
                    this.staniceSelect.id = "StaniceOdstranitFull";
                    this.staniceSelect.name = "stanice";

                    vybranaTopologie.poleStanic.forEach(stanice => {
                        if (prvniStanice == undefined) prvniStanice = stanice;
                        let option = document.createElement("option");
                        option.value = stanice.nazev;
                        option.innerHTML = stanice.nazev;
                        this.staniceSelect.appendChild(option);
                    })
                    this.form.appendChild(this.staniceSelect);

                    this.nazevLabel = document.createElement("label");
                    this.nazevLabel.innerHTML = "Opiš název stanice k odstranění";
                    this.nazevLabel.setAttribute("for", "nazev");
                    this.form.appendChild(this.nazevLabel);

                    this.nazevInput = document.createElement("input");
                    this.nazevInput.type = "text";
                    this.nazevInput.id = "StaniceOdstranitFull";
                    this.nazevInput.name = "nazev";
                    this.form.appendChild(this.nazevInput);

                    let count = 0;
                    for (let i = 0; i < vybranaTopologie.poleSpoju.length; i++) {
                        if (vybranaTopologie.poleSpoju[i].A == prvniStanice) {
                            count++;
                        }
                        else if (vybranaTopologie.poleSpoju[i].B == prvniStanice) {
                            count++;;
                        }
                    }

                    this.pocetSpojuSelectLabel = document.createElement("label");
                    if (count == 1) this.pocetSpojuSelectLabel.innerHTML = "Stanice je součástí " + count + " spoje.";
                    else this.pocetSpojuSelectLabel.innerHTML = "Stanice je součástí " + count + " spojů.";
                    this.pocetSpojuSelectLabel.setAttribute("for", "pocetSpoju");
                    this.form.appendChild(this.pocetSpojuSelectLabel);



                    this.submit = document.createElement("input");
                    this.submit.setAttribute("type", "submit");
                    this.submit.value = "Odstranit";
                    this.submit.disabled = true;
                    this.submit.id = "blockedButton"
                    this.form.appendChild(this.submit);
                    break;
            }
            break;

        case "condition":
            this.form = document.createElement("form");
            this.form.id = "formularSpoje";


            this.topologieSelectLabel = document.createElement("label");
            this.topologieSelectLabel.innerHTML = "Topologie:";
            this.topologieSelectLabel.setAttribute("for", "topologie");
            this.form.appendChild(this.topologieSelectLabel);

            this.topologieSelect = document.createElement("select");
            this.topologieSelect.id = "formularFull";
            this.topologieSelect.name = "topologie";

            let option = document.createElement("option");
            option.value = "Všechny topologie";
            option.innerHTML = option.value;
            this.topologieSelect.appendChild(option);

            poleTopologii.forEach(topologie => {
                // Pokud topologie obsahuje nějaké spoje, bude v menu
                if (topologie.poleSpoju.length > 0) {
                    option = document.createElement("option");
                    option.value = topologie.nazev;
                    option.innerHTML = topologie.nazev;
                    this.topologieSelect.appendChild(option);
                }
            })
            this.form.appendChild(this.topologieSelect);


            this.koeficientLabel = document.createElement("label");
            this.koeficientLabel.innerHTML = "Koeficient &#8804";
            this.koeficientLabel.setAttribute("for", "koeficient");
            this.form.appendChild(this.koeficientLabel);

            this.koeficientInput = document.createElement("input");
            this.koeficientInput.type = "number";
            this.koeficientInput.min = "0";
            this.koeficientInput.max = "1";
            this.koeficientInput.step = koefStep;
            this.koeficientInput.name = "koeficient";
            this.koeficientInput.id = "formularFull";
            this.form.appendChild(this.koeficientInput);
            break;

        case "backup":
            this.form = document.createElement("form");
            this.form.id = "formularZaloha";

            this.souborLabel = document.createElement("label");
            this.souborLabel.innerHTML = "Název souboru";
            this.souborLabel.setAttribute("for", "soubor");
            this.form.appendChild(this.souborLabel);

            // Vytvoření nové instance objektu Date
            let d = new Date();

            // Uložení aktuálního roku do proměnné
            let rok = d.getFullYear();

            // Uložení aktuálního měsíce do proměnné
            let mesic = d.getMonth() + 1; // Zde přidáváme 1, protože index měsíce začíná od 0 (leden) a končí 11 (prosinec)
            if (mesic < 10)mesic = "0" + mesic;

            // Uložení aktuálního dne do proměnné
            let den = d.getDate();
            if (den < 10)den = "0" + den;

            // Uložení aktuální hodiny do proměnné
            let hodina = d.getHours();
            if (hodina < 10)hodina = "0" + hodina;

            // Uložení aktuální minuty do proměnné
            let minuta = d.getMinutes();
            if (minuta < 10)minuta = "0" + minuta;

            // Uložení aktuální sekundy do proměnné
            let sekunda = d.getSeconds();
            if (sekunda < 10)sekunda = "0" + sekunda;
            this.souborInput = document.createElement("input");
            this.souborInput.type = "text";
            this.souborInput.value = rok + "-" + mesic + "-" + den + "-" + hodina + "-" + minuta + "-" + sekunda;
            this.souborInput.name = "soubor";
            this.souborInput.id = "formularFull";
            this.form.appendChild(this.souborInput);

            this.submit = document.createElement("input");
            this.submit.setAttribute("type", "submit");
            this.submit.id = "submitButton";
            this.submit.value = "Vytvořit zálohu";
            this.form.appendChild(this.submit);
            break;
    }


}