function get_condition_of_vehicle() { var stars_value = ""; for (var i=0; i < document.lmenuform.condition_of_vehicle.length; i++) { if (document.lmenuform.condition_of_vehicle[i].checked) { stars_value = stars_value + document.lmenuform.condition_of_vehicle[i].value + '~'; } } var stars_value = stars_value.substring(0, stars_value.length-1); return stars_value; //alert(stars_value); } function Check_condition_of_vehicle(t) { chk = document.lmenuform.condition_of_vehicle; var s = t.value; if(s==''){ for (i = 0; i < chk.length; i++) chk[i].checked = false ; document.lmenuform.condition_of_vehicle_all.checked = true ; }else{ for (i = 0; i < chk.length; i++) document.lmenuform.condition_of_vehicle_all.checked = false ; } } function get_year() { var stars_value = document.lmenuform.year.value; return stars_value; //alert(stars_value); } function get_brands() { var stars_value = ""; for (var i=0; i < document.lmenuform.brands.length; i++) { if (document.lmenuform.brands[i].checked) { stars_value = stars_value + document.lmenuform.brands[i].value + '~'; } } var stars_value = stars_value.substring(0, stars_value.length-1); return stars_value; //alert(stars_value); } function Check_brands(t) { chk = document.lmenuform.brands; var s = t.value; if(s==''){ for (i = 0; i < chk.length; i++) chk[i].checked = false ; document.lmenuform.brands_all.checked = true ; }else{ for (i = 0; i < chk.length; i++) document.lmenuform.brands_all.checked = false ; } } function get_price() { var price_min = document.lmenuform.price_min.value; var price_max = document.lmenuform.price_max.value; var price = price_min+ '-' + price_max; return price; //alert(price); } function send_srg(t,p,o,a) { var req = null; if(window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject(Microsoft.XMLHTTP); req.onreadystatechange = function() { if(req.readyState == 4) { //document.getElementById('ajx').innerHTML="Please wait ....."; var ajaxDisplay = document.getElementById('middlewrap'); ajaxDisplay.innerHTML = req.responseText; } }; var condition_of_vehicle = get_condition_of_vehicle(); var year = get_year(); var brands = get_brands(); var price = get_price(); if(document.lmenuform.photo.checked == true){ var photo = 'yes'; }else{ var photo = 'none'; } var ext = "page=" + p + "&order=" + o + "&ats=" + a + "&"; var query = ext + "photo=" + photo + "&condition_of_vehicle=" + condition_of_vehicle + "&year=" + year + "&brands=" + brands + "&price=" + price + "&cat_id=182&cat=cars-suv&at=0&city=olney"; req.open("GET", "/marketplace/search_ajax_cat.php?" + query, true); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.setRequestHeader("Connection", "close"); req.send(null); //alert(query); } function send(p,o,a){ var d=new Date(); var t=d.getTime(); var as = document.getElementById('middlewrap'); as.innerHTML = '
'; send_srg(t,p,o,a); }