function display(id, show) {
	document.getElementById(id).style.display = show;
}

function display_checkbox(id, value) {
    var show;
    if (value == false)
        show = ''
    else
        show = 'none'
    document.getElementById(id).style.display = show;
}

function validate(sText) {
    var ValidChars = "0123456789";
    var Char;
    for (i = 0; i < sText.length; i++)
    {
        Char = sText.charAt(i);
        if (ValidChars.indexOf(Char) == -1)
        {
            alert('Zadané množství není celé číslo.');
            return false;
        }
    }

    if (sText == '')
    {
        alert('Zadejte množství zboží.');
        return false;
    }
    return true;
}

function bgcolor(id, sel) {
    document.getElementById('td_' + id).className = 'transport' + sel;
    document.getElementById('td_' + id + '_price').className = 'transport_price' + sel;
}

function bgcolor_load(trans) {
    for (i = 0; i < trans.transport.length; i++) {
        if (trans.transport[i].checked == true)
            bgcolor(trans.transport[i].value, '_sel');
        else
            bgcolor(trans.transport[i].value, '');
    }
}

function fill_contact_person(id) {
    var index = null;
    for (i = 0; i < KOs_ID.length; i++) {
        if (KOs_ID[i] == id)
            index = i;
    }
    document.reg.Email.value = KOs_Email[index];
    document.reg.kosJmeno.value = KOs_Jmeno[index];
    document.reg.kosPrijmeni.value = KOs_Prijmeni[index];
    document.reg.KOsMobil.value = KOs_Mobil[index];
    document.reg.KOsTelefon.value = KOs_PevnaLinka[index];

}
