function show_reset_button_marki(flag)
{ var btn = document.getElementById('reset_btn_marki_id'); if (!flag)
{ btn.style.display = "none";}
else
{ btn.style.display = "block";}
}
function show_reset_button(btnid,flag)
{ var btn = document.getElementById(btnid); if (!flag)
{ }
else
{ }
}
function get_models_cb(data)
{ document.getElementById('div_model_id').innerHTML = data;}
function get_models()
{ var marka = document.getElementById('fmarka'); var kind = document.getElementById('car_kind_id').value; x_a_get_models(marka.value,kind,get_models_cb); query();}
function get_fulldata_left_cb(data)
{ document.getElementById('div_compare_left_id').innerHTML = data;}
function get_fulldata_left(submodel_id,engine_id)
{ x_a_get_fulldata(submodel_id, engine_id,'left',get_fulldata_left_cb);}
function get_fulldata_right_cb(data)
{ document.getElementById('div_compare_right_id').innerHTML = data;}
function get_fulldata_right(submodel_id,engine_id)
{ x_a_get_fulldata(submodel_id, engine_id,'right',get_fulldata_right_cb);}
function get_prices_low()
{ var marka = document.getElementById('fmarka'); var model = document.getElementById('fmodel'); var kind = document.getElementById('car_kind_id').value; x_a_get_prices_low(marka.value,model.options[model.selectedIndex].value,kind,get_prices_low_cb);}
function get_prices_low_cb(data)
{ }
function get_prices_high()
{ var marka = document.getElementById('fmarka'); var model = document.getElementById('fmodel'); var kind = document.getElementById('car_kind_id').value; x_a_get_prices_high(marka.value,model.options[model.selectedIndex].value,kind,get_prices_high_cb);}
function get_prices_high_cb(data)
{ }
function get_fuel()
{ var model = document.getElementById('fmodel'); var kind = document.getElementById('car_kind_id').value; if (model.selectedIndex>=0)
x_a_get_fuel(model.options[model.selectedIndex].value,kind,get_fuel_cb);}
function get_fuel_cb(data)
{ document.getElementById('div_fuel_id').innerHTML = data;}
function get_gearbox()
{ x_a_get_gearbox('',get_gearbox_cb);}
function get_gearbox_cb(data)
{ document.getElementById('div_skrzynia_id').innerHTML = data;}
function get_power_low()
{ x_a_get_power_low('',get_power_low_cb);}
function get_power_low_cb(data)
{ document.getElementById('div_moc_od_id').innerHTML = data;}
function get_power_high()
{ x_a_get_power_high('',get_power_high_cb);}
function get_power_high_cb(data)
{ document.getElementById('div_moc_do_id').innerHTML = data;}
function get_capacity_low()
{ x_a_get_capacity_low('',get_capacity_low_cb);}
function get_capacity_low_cb(data)
{ document.getElementById('div_capacity_low_id').innerHTML = data;}
function get_capacity_high()
{ x_a_get_capacity_high('',get_capacity_high_cb);}
function get_capacity_high_cb(data)
{ document.getElementById('div_capacity_high_id').innerHTML = data;}
function get_drive()
{ x_a_get_drive('',get_drive_cb);}
function get_drive_cb(data)
{ document.getElementById('div_drive_id').innerHTML = data;}
function resetselect(what)
{ switch (what)
{ case 'fmarka':
document.getElementById(what).selectedIndex=0; document.getElementById('fmodel').options.length=0; document.getElementById('fmodel').options[0] = new Option('- wybierz markę -',' '); get_models(); show_reset_button_marki(false); show_reset_button('fresetmodel',false); break; case 'fmodel':
document.getElementById(what).selectedIndex=0; show_reset_button('fresetmodel',false); break;}
query();}
function query()
{ var marka = document.getElementById('fmarka'); var markaid = 0; markaid = marka.value; var model = document.getElementById('fmodel'); var modelid = 0; if (model!=null)
{ if (model.selectedIndex>=0)
modelid = model.options[model.selectedIndex].value
}
var price_low = 0; var price = document.getElementById('fadd1'); if (price.selectedIndex>=0)
price_low = price.options[price.selectedIndex].value; var price_high = 0; var priceh = document.getElementById('fadd2'); if (priceh.selectedIndex>=0)
price_high = priceh.options[priceh.selectedIndex].value; var fuel = ''; var fuelobj = document.getElementById('fpaliwo'); if (fuelobj.selectedIndex>=0)
fuel = fuelobj.options[fuelobj.selectedIndex].value; var gearbox = ''; var gearboxobj = document.getElementById('fskrzynia'); if (gearboxobj.selectedIndex>=0)
gearbox = gearboxobj.options[gearboxobj.selectedIndex].value; var drive = 0; var driveobj = document.getElementById('fnaped'); if (driveobj.selectedIndex>=0)
drive = driveobj.options[driveobj.selectedIndex].value; var kind = document.getElementById('car_kind_id').value; var params = new Array(); params[0] = markaid; params[1] = modelid=='' ? null : modelid; params[2] = price_low=='' ? null : price_low; params[3] = price_high=='' ? null : price_high; params[4] = fuel=='' ? null : fuel; params[5] = null; params[6] = null; params[7] = null; params[8] = null; params[9] = drive=='' ? null : drive; params[10] = gearbox=='' ? null : gearbox; params[11] = kind=='' ? null : kind; x_a_count_search_results(params,query_cb);}
function query_cb(data)
{ var obj_count = document.getElementById('s_count'); obj_count.innerHTML = data; var obj_count2 = document.getElementById('s_count2'); obj_count2.innerHTML = data;}
function download_wallapapers_cb(data)
{ var obj_count2 = document.getElementById('sb_content_id'); obj_count2.innerHTML = data;}
function download_wallapapers(id)
{ x_a_get_wallapapers(id,download_wallapapers_cb);}
function get_models_mp_cb(data)
{ var tab = (data.split("|")); var su_count_obj = document.getElementById('su_count'); su_count_obj.innerHTML = tab[0]+ " "; var sn_count_obj = document.getElementById('sn_count'); sn_count_obj.innerHTML = tab[1]+ " ";}
function get_models_mp()
{ var cena = document.getElementById('cena_id'); var model = document.getElementById('model_id'); x_a_count_submodels(model.options[model.selectedIndex].value,cena.options[cena.selectedIndex].value,get_models_mp_cb);}