function changeDynamicList() {
    var index = document.filialsForm.city.options[document.filialsForm.city.selectedIndex].value;
    var list = eval('document.filialsForm.fltype');
    for (i in list.options.length) {
        list.options[i] = null;
    }
    i = 0;
    for (x in sub_filials) {
        if (sub_filials[x][0] == index) {
            var tp = sub_filials[x][1];
            list.options[i] = new Option(sub_urls[tp][0], tp);
            i++;
        }
    }
    list.length = i;
}
function initCities() {
    i = 0;
    var list = eval('document.filialsForm.city');
    var checkbox = eval('document.filialsForm.rub2');
    if (checkbox.checked) {
        for (x in sub_cities) {
            if (sub_cities[x][2] == '2') {
                list.options[i] = new Option(sub_cities[x][0], sub_cities[x][1]);
                i++;
            }
        }
    } else {
        for (x in sub_cities) {
            list.options[i] = new Option(sub_cities[x][0], sub_cities[x][1]);
            if (sub_cities[x][1] == '1') {
                list.options[i].selected = true;
            }
            i++;
        }
    }
    list.length = i;
}
function get_info() {
    var url = "";
    var index = document.filialsForm.fltype.options[document.filialsForm.fltype.selectedIndex].value;
    for (x in sub_urls) {
        if (x == index) {
            url = sub_urls[x][1];
        }
    }
    if (url != "") {
        document.filialsForm.action = url;
        document.filialsForm.submit();
    }
}