function clearModel(Obj){ $("#CarModelID").find('option').remove() } function numbersonly(myfield,e,dec){var key;var keychar;if(window.event)key=window.event.keyCode;else if(e)key=e.which;else return true;keychar=String.fromCharCode(key);if((key==null)||(key==0)||(key==8)||(key==9)||(key==13)||(key==27))return true;else if((("0123456789").indexOf(keychar)>-1))return true;else if(dec&&(keychar==".")){myfield.form.elements[dec].focus();return false;}else return false;} function inspectbox(){if(document.forms.searcher.checkcountry1.checked)document.forms.searcher.regionsk.style.visibility='visible';else document.forms.searcher.regionsk.style.visibility='hidden';} function inspectbox2(){if(document.forms.searcher.checkcountry2.checked)document.forms.searcher.regioncz.style.visibility='visible';else document.forms.searcher.regioncz.style.visibility='hidden';} function inspectbox3(){if(document.forms.searcher.checkcountry4.checked)document.forms.searcher.regionpl.style.visibility='visible';else document.forms.searcher.regionpl.style.visibility='hidden';} function inspectbox4(){if(document.forms.searcher.checkcountry5.checked)document.forms.searcher.regionuk.style.visibility='visible';else document.forms.searcher.regionuk.style.visibility='hidden';} function hideDiv(){if(document.getElementById){document.getElementById('reklama').style.visibility='hidden';}}function hideDiv(){if(document.getElementById){document.getElementById('fixme').style.visibility='hidden';}} function my_checkbox (nazev) { var muj_select = document.getElementById('select_'+nazev); var muj_span = document.getElementById('span_'+nazev); var muj_checkbox = document.getElementById('checkbox_'+nazev); if (muj_checkbox.checked) muj_select.style.display='block'; else { muj_select.style.display='none'; muj_select.value=''; var keSmazani = document.getElementById ('input_'+nazev); if(keSmazani) keSmazani.parentNode.removeChild (keSmazani); if (nazev=='clima') { } else if(document.getElementById(nazev)) document.getElementById(nazev).value=''; muj_span.innerHTML=puvodniTexty[nazev]; ajaxFunctionSerialize(); } } function my_select (nazev) { var muj_select = document.getElementById('select_'+nazev); var muj_span = document.getElementById('span_'+nazev); if (muj_select.value != '') { muj_span.innerHTML=muj_select.options[muj_select.selectedIndex].text; muj_select.style.display='none'; var polozka = document.createElement('input'); polozka.value = muj_select.value; polozka.id = 'input_'+nazev; polozka.type = 'hidden'; polozka.name = nazev; muj_select.form.appendChild (polozka); } else { var keSmazani = document.getElementById ('input_'+nazev); keSmazani.parentNode.removeChild (keSmazani); } ajaxFunctionSerialize(); } function my_setup (nazev, hodnota) { if(document.getElementById('select_'+nazev)){ var muj_select = document.getElementById('select_'+nazev); var muj_span = document.getElementById('span_'+nazev); var muj_checkbox = document.getElementById('checkbox_'+nazev); if (hodnota != '') { muj_checkbox.checked = true; muj_select.style.display='block'; for (i=0;i"+ advancedtext +""; $('#advanced_search').html(HTML); //document.getElementById('advanced_search').innerHTML = HTML; } function multibind(){ //toto klika secky podradene checky na stav parent checka $(".klasik input").click(function(e){var stav=$(this).prop( "checked" ); if(e.originalEvent==undefined) {stav=!stav; $(this).prop('checked', stav);} $(this).parent().parent().nextUntil( ".klasik" ).find("input").prop('checked', stav); nasrefresh(); }) //toto odklikne dofaka parenta ak je child neodfajknuty $(".odsad input").click(function(e){var stav=$(this).is(':checked'); if(e.originalEvent==undefined) {stav=!stav; $(this).prop('checked', stav);} if(!stav) {$(this).parent().parent().prevAll( ".klasik:first" ).find("input").prop('checked', stav);} else{ var hlp=true; //cekneme pred $(this).parent().parent().prevUntil( ".klasik" ).find("input").each(function() { //alert($(this).prop('checked')); if($(this).prop('checked')==false) hlp=false; }); //cekneme po $(this).parent().parent().nextUntil( ".klasik" ).find("input").each(function() { //alert($(this).prop('checked')); if($(this).prop('checked')==false) hlp=false; }); //result if(hlp) $(this).parent().parent().prevAll( ".klasik:first" ).find("input").prop('checked', true); } nasrefresh(); }) } function nasrefresh(){ $("#CarModelID").val($("#CarModelID").multiselect("getChecked").map(function(){ return this.value; }).get()); } function isNumeric(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function chooseModel(Obj){ if($("#CarModelID").attr('multiple')=='multiple') chooseModelMulti(Obj); else chooseModelOld(Obj); } function chooseModelOld(Obj){ clearModel(Obj); ActualBrandID=Obj.BrandID.options[Obj.BrandID.selectedIndex].value; eval('ActualArrayID=CarModelID'+ActualBrandID+';'); eval('ActualArrayName=CarModelName'+ActualBrandID+';'); for (a=0;a'+ActualArrayName[a].replace('- ',"")+''); $('#CarModelID').append(''); } advanced_search(); } function chooseModelMulti(Obj){ var ceknute=$("#CarModelID").multiselect("getChecked").map(function(){ return this.value; }).get(); clearModel(Obj); $("#CarModelID").multiselect("refresh"); $("#CarModelID").children().remove("optgroup"); var znackyarr=($("#BrandID").val()); var data,brandtxt; if(znackyarr){ for (index = 0, len = znackyarr.length; index < len; ++index) { data=''; ActualBrandID=znackyarr[index]; brandtxt= $("#BrandID option[value='"+ActualBrandID+"']").text(); //ActualBrandID=Obj.BrandID.options[Obj.BrandID.selectedIndex].value; eval('ActualArrayID=CarModelID'+ActualBrandID+';'); eval('ActualArrayName=CarModelName'+ActualBrandID+';'); for (a=0;a'+ActualArrayName[a]+''); } if(data){ $('#CarModelID').append(''+data+''); } } //$("#CarModelID").multiselect('refresh').multiselect('uncheckAll'); if(ceknute){ $("#CarModelID").val(ceknute); $("#CarModelID").multiselect('refresh');} multibind(); /* //toto klika secky podradene checky na stav parent checka $(".klasik input").click(function(){var stav=$(this).prop( "checked" ); //$(this).parent().parent().nextUntil( ".klasik" ).find("input").prop('checked', stav); if(stav==true)$(this).parent().parent().nextUntil( ".klasik" ).find("input:not(:checked)").click(); else $(this).parent().parent().nextUntil( ".klasik" ).find("input:checked").click(); }) //toto odklikne dofaka parenta ak je child neodfajknuty */ } advanced_search(); } function najdipod(){ $("#moremodels").html(''); var nasli=1; vybrane=$("#CarModelID").prop("selectedIndex"); if($("#CarModelID").attr('multiple')=='multiple'){ }else if($("#CarModelID").val().indexOf('a')>-1) { while (nasli==1 ) { nasli=0; vybrane=vybrane+1; if($("#CarModelID>option:eq("+vybrane+")").text().indexOf(String.fromCharCode(160)+String.fromCharCode(160))>-1){ nasli=1; var hlp=$("#CarModelID>option:eq("+vybrane+")").val(); //alert(vybrane+':'+hlp); $("#moremodels").append(""); } //nasli=1; } } }