// Подбор по автомабилю
function get_model(id)
{
	$.post("request.php",{func:"get_model",id:id},get_model2);
	$("#auto_find").html('');
}
function get_model2(str)
{
	$("#auto_model").html(str);
	$("#auto_model").removeAttr("disabled");
	$("#year").attr("disabled","disabled");
	$("#year").html('<option value="">---</option>');
	$("#obj").attr("disabled","disabled");
	$("#obj").html('<option value="">---</option>');
}
function get_year(id)
{
	$.post("request.php",{func:"get_year",id:id},get_year2);

}
function get_year2(str)
{
	$("#year").html(str);
	$("#year").removeAttr("disabled");
	$("#obj").attr("disabled","disabled");
	$("#obj").html('<option value="">---</option>');
}
function get_obj(id)
{
	$.post("request.php",{func:"get_obj",id:id, model:$("#auto_model").val()},get_obj2);
}
function get_obj2(str)
{
	$("#obj").html(str);
	$("#obj").removeAttr("disabled");
}

function auto_find(id)
{
	var str='model='+$("#auto_model").val()+'&year='+$("#year").val()+'&obj='+$("#obj").val()+'&auto_find=1';
	self.location='model.php?'+str;
}

