// JavaScript Document
function mainOnLoad(){
	man_id = document.getElementById('man_id').options[document.getElementById('man_id').selectedIndex].value;
	randtail = getRandomTail();
	if (man_id!=0) doAjax("ajax/man_models.php?man_id="+man_id+"&randtail="+randtail,'man_model_id_group_div');
	
//	alert('asd');
	
	//document.getElementById('b_top_right').innerHTML=document.getElementById('h_b_top_right').value;
	//document.getElementById('b_top_right').HTML="<script language='JavaScript' type='text/javascript' src=';http://abc.boom.ge/adjs.php?n=123script>";
//	alert(document.getElementById('h_b_top_right').value);

}

function countresult(que)
{
document.getElementById("txtHint").innerHTML="მიმდინარეობს ძებნა...";
if (que=="")
  {
  document.getElementById("txtHint").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","getresult.php?"+que,true);
xmlhttp.send();
}

function countprice(que)
{
if (document.getElementById("man_id").value!='' && document.getElementById("man_model_id_group").value!='' && document.getElementById("year_from").value!='')
{
document.getElementById("txtHint").innerHTML="Loading...";
if (que=="")
  {
  document.getElementById("txtHint").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","getprice.php?"+que,true);
xmlhttp.send();
}
}

var que="search_tp=1&with_picture=0";
function manch(manid)
{
que = que + "&man_id="+manid;

}
function yearch(yearid)
{
que = que + "&year_from="+yearid;

}
function yeartoch(yeartoid)
{
que = que + "&year_to="+yeartoid;

}
function rightwheelch(rwheelid)
{

que = que + "&right_wheel="+rwheelid;

}
function manmodelch(manmodelid)
{
que = que + "&man_model_id_group="+manmodelid;

}
function pricech(priceid)
{
que = que + "&price_from="+priceid;

}
function priceto(pricetoid)
{
que = que + "&price_to="+pricetoid;

}
function customsch(custid)
{

que = que + "&customs_passed="+custid;

}
function categorych(categoryid)
{
que = que + "&category_id="+categoryid;

}
function gearch(gearid)
{
que = que + "&gear_type_id="+gearid;

}
function auctionch(auctid)
{

que = que + "&is_auction="+auctid;


}
function locationch(locid)
{
que = que + "&location_id_1="+locid;

}
function lastdch(lastdaysid)
{
que = que + "&last_days="+lastdaysid;

}
function fuelid(fuelid)
{
que = que + "&fuel_type_id="+fuelid;

}
function pricebyyear(pricebyyearid)
{
que = que + "&privebyyear="+pricebyyearid;

}

