okresy_select = new Array(); kraj_select = 0; // zobrazeni function af_cis_village_part_show(parent_id){ parent_el = "mch_parent_" + parent_id; af_cis_village_part_unset_all(parent_el); if (tge(parent_el)) { ge(parent_el).style.display = "block"; } // end if } // end function // skryti a odskrtnuti vsech podskupin function af_cis_village_part_unset_all(exception_id){ cont_el = "searchform_advanced_field_cont_cis_village_part"; if (tge(cont_el)) { el_ch = ge(cont_el); el_ch = el_ch.childNodes; c = el_ch.length; for (var j=0; j < c; j++) { cur_el = el_ch[j]; // skryti divu cur_el_ch = cur_el.childNodes; c_ch = cur_el_ch.length; for (var i=0; i < c_ch; i++) { cur_el_ch_2 = cur_el_ch[i]; if (cur_el_ch_2.nodeName && cur_el_ch_2.nodeName == "DIV") { cur_el_ch_2.style.display = "none"; // preskoceni prevybraneho if ((exception_id != "" || exception_id != 0) && cur_el_ch_2.id == exception_id) { continue; } // end if // --- // odskrtnuti inputu cur_el_ch_3 = cur_el_ch_2.childNodes; c_ch_3 = cur_el_ch_3.length; for (var k=0; k < c_ch_3; k++) { cur_el_ch_4 = cur_el_ch_3[k]; if (cur_el_ch_4.nodeName && cur_el_ch_4.nodeName == "DIV") { // div obsahuje jeste input cur_el_ch_5 = cur_el_ch_4.childNodes; c_ch_5 = cur_el_ch_5.length; for (var l=0; l < c_ch_5; l++) { cur_el_ch_6 = cur_el_ch_5[l]; //alert(cur_el_ch_6.nodeName); if (cur_el_ch_6.nodeName && cur_el_ch_6.nodeName == "INPUT") { cur_el_ch_6.checked = false; } // end if } // end for // --- } // end if } // end for // --- } // end if } // end for } // end for } // end if } // end function // predvyber hodnoty z ajaxe function af_select_first(field, id, name){ //alert("!"); el_hidden_field = "el_" + field; el_text_field = "text_" + field; el_div_field = "div_" + field; if (document.getElementById(el_hidden_field) != null) hidden_field = document.getElementById(el_hidden_field); if (document.getElementById(el_text_field) != null) text_field = document.getElementById(el_text_field); //if (document.getElementById(div_field) != null) div_field = document.getElementById(el_div_field); hidden_field.value = id; text_field.value = name; //div_field.innerHTML = ""; //x.style.display = "none"; } // end function function update_map(def_val, def_name){ if (tge("iframe_form_input_advanced")) { // vycisteni okresy_clean = new Array(); for (id in okresy_select) { if (okresy_select[id] == "") { continue; } // end if okresy_clean.push(okresy_select[id]); } // end for // --- se_v("ajax_field_advanced", "city"); if (def_val != 0) { se_v("iframe_form_value_advanced", def_val); } // end if if (def_name != "") { se_v("iframe_form_name_advanced", def_name); } // end if se_v("iframe_form_input_advanced", okresy_clean); document.iframe_form_advanced.submit(); } // end if } // end function // funkce rozbali kategorii, pokud v ni jsou zaskrtnute checkboxy function rozbal_selected(zero_parents){ for (id in zero_parents) { id_group_div = "mch_div_group_" + zero_parents[id]; if(tge(id_group_div)) { el = ge(id_group_div); el_ch = el.childNodes; c = el_ch.length; any_checked = false; for (var j=0; j < c; j++) { cur_el = el_ch[j]; cur_el_ch = cur_el.childNodes; c_ch = cur_el_ch.length; for (var i=0; i < c_ch; i++) { cur_el_ch_2 = cur_el_ch[i]; if (cur_el_ch_2.nodeName && cur_el_ch_2.nodeName == "INPUT") { if (cur_el_ch_2.checked) { any_checked = true; break; } // end if } // end if } // end if } // end for if (any_checked) { switchdisplay_2(id_group_div); el_group_input = "searchform_advanced_field_id_reality_type_" + zero_parents[id]; ge(el_group_input).checked = true; } // end if } // end if } // end for //el = ge("searchform_advanced_field_cont_reality_type"); //mch_div_group_4 //switchdisplay } // end function // --- // function multicheckbox_invert_group(id_control, id_group_div){ // po zaskrnuti elementu "id_control" se zaskrtnou checkboxy v divu id="id_group_div" // funguje pouze pro search v generovanem tvaru - tedy pro jedno vnoreni (v divu) checker = ge(id_control).checked; el = ge(id_group_div); el_ch = el.childNodes; c = el_ch.length; for (var j=0; j < c; j++) { cur_el = el_ch[j]; cur_el_ch = cur_el.childNodes; c_ch = cur_el_ch.length; for (var i=0; i < c_ch; i++) { cur_el_ch_2 = cur_el_ch[i]; if (cur_el_ch_2.nodeName && cur_el_ch_2.nodeName == "INPUT") { cur_el_ch_2.checked = checker; } // end if } // end if } // end for } // end function function clear_selection_all(){ okresy_select = new Array(); for(i=0;i<=141;i++) // 20 - pocet krajuuu { el_id = "unselect_all_" + i; if (tge(el_id)) { ge(el_id).onclick(); } // end if } // end for update_vybrane_okresy(); } // end function function init_okresy_select(region){ for (id in region) { okresy_select[region[id]] = region[id]; } // end for update_vybrane_okresy(); } // end function function show_kraj(nazev) { se_c("vybrany_kraj", nazev); } // end function function set_kraj(nazev, kraj_id){ if (nazev == "") { nazev = " "; } // end if document.getElementById("popis_kraje").innerHTML = nazev; } // end function function select_kraj(kraj_id){ kraj_select = kraj_id; for(i=0;i<=141;i++) // 20 - pocet krajuuu { el_id = "kraj_" + i; if (document.getElementById(el_id) != null) { document.getElementById(el_id).style.display = "none"; } // end if } // end for el_id = "kraj_" + kraj_id; document.getElementById(el_id).style.display = "inline"; } // end function function select_all(kraj_id, okresy_pocet, state){ for (var i = 0; i < okresy_pocet; i++) { el_id = "kraj_" + kraj_id + "_okresy_" + i; document.getElementById(el_id).checked = state; document.getElementById(el_id).onclick(); } // end for } // end function function set_okres(el_okres, okres_id, okres_name){ if (!el_okres.checked) { okresy_select[okres_id] = ""; } else { okresy_select[okres_id] = okres_id; } // end else update_vybrane_okresy(); } // end function function update_vybrane_okresy(){ vybrane_okresy_text = ""; for (id in okresy_select) { if (okresy_select[id] == "") { continue; } // end if vybrane_okresy_text += document.getElementById("nazev_okresu_" + okresy_select[id]).innerHTML + " | "; } // end for document.getElementById("vybrane_okresy").innerHTML = vybrane_okresy_text; } // end function // funkce se stara o skryvani / zobrazovani (podle show) selectu ze search, tak aby bylo videt menicko. function display_search_select(el_this, show){ if (el_this.id != "") { if (tge(el_this.id)) { li_hl_menu = ge(el_this.id); if (li_hl_menu) { licka = li_hl_menu.getElementsByTagName("LI"); // menu licka_height = 0; licka_weight = 0; for (var k=0; k " + menu_x1 + " && " + sel_x1 + " < " + menu_x2 + " || " + sel_x2 + " > " + menu_x1 + " && " + sel_x2 + " < " + menu_x2 ); // Y - staci, pokud presahuje && X - zasahuje levym rohem || zasahuje pravym rohem if ( menu_y2 > sel_y1 && ((sel_x1 > menu_x1 && sel_x1 < menu_x2) || (sel_x2 > menu_x1 && sel_x2 < menu_x2)) ) { if (!show) { el_id_display_hide(cur_el.id); } // end if //alert(cur_el.id); } // end if // alert(menu_x1+","+ menu_y1+","+ menu_x2+","+ menu_y2 + " --- " + sel_x1+","+ sel_y1+","+ sel_x2+","+ sel_y2); } // end if } // end for } // end if } // end if } // end if } // end if } // end function