
//高级搜索
var mySlide = new Fx.Slide('high_search_open1');
mySlide.hide();

$('high_search_open1').setStyle('margin', '-72px 0 0');
$('high_search_open1').getParent().setStyle('height','0');
$('high_search_open1').setStyle('display','block');
$('searchmorehack').setStyle('font-size', '1px');

var searchmoreControl=0;
$('clicksearchmore').addEvent('click', function(e){
	searchmoreControl++;
	if(searchmoreControl%2!=0) {
	 $('searchmorehack').setStyle('font-size', '12px'); 
	 $('price_filter').focus();
	 }
	e = new Event(e);
	mySlide.toggle();
	e.stop();
});
mySlide.addEvent('onComplete', function(){
			if(searchmoreControl%2==0) 
			{
			$('searchKey').focus();
			$('searchmorehack').setStyle('font-size', '1px');
			}
});
$('price_filter').addEvent('change', function(){$('priceFilter').setProperty('value', $('price_filter').getProperty('value')); });
$('miles_filter').addEvent('change', function(){$('milesFilter').setProperty('value', $('miles_filter').getProperty('value')); });
$('publishdate_filter').addEvent('change', function(){$('publishDateFilter').setProperty('value', $('publishdate_filter').getProperty('value')); });

function changecity(item)
{
	var x=document.getElementById('location_s');
	x.innerHTML="<h1>"+item+"</h1>";
	//selectcarhref();
	//selectwidget();
	document.getElementById('localcity').value=item;
	//document.getElementById('searchrepairlocal').value=item;
}

function showCities()
{
	//$('select-repair-make').style.display="none";
	document.getElementById('citiesDiv2').style.display="inline";
}
function hideCities()
{
	document.getElementById('citiesDiv2').style.display="none";
	//$('select-repair-make').style.display="inline";

}
//导航栏搜索类型按钮控制
function Show_CityNewcarMenu1(Cityadid_num,Cityadnum){
	searchmoreControl=0;
	mySlide.slideOut();
	var menu=new Array('newcar','usedcar','repair','widget','bbs','comment','news','pic');
	for(var i=0;i<8;i++){
		document.getElementById("searchli_"+Cityadid_num+i).className="n_n";
		}
	document.getElementById("searchli_"+Cityadid_num+Cityadnum).className="current";
	var id=document.getElementById("searchli_"+Cityadid_num+Cityadnum);
	document.getElementById("CityNewcarmenu").value=menu[Cityadnum];
	if(Cityadnum==0) 
	{
		$('hs_open_bottom').setStyle('display','block');
		$('miles_filter').setProperty('disabled','ture');
	}
	else if(Cityadnum==1)
	{
		$('hs_open_bottom').setStyle('display','block');
		$('miles_filter').setProperty('disabled','');
	}
	else
	{
		$('hs_open_bottom').setStyle('display','none');
	}
	if(Cityadnum==2)
	{
		document.getElementById('s_input1').style.display="none";
		document.getElementById('s_input2').style.display="block";
		//if($('citiesDiv2').style.display=="inline")
		//$('select-repair-province').focus();
		//else
		//document.getElementById('select-repair-make').focus();
	}
	else{
		document.getElementById('s_input1').style.display="block";
		document.getElementById('s_input2').style.display="none";
		//$('category_pinyin').setProperty('href','category_py.php?t='+id.getAttribute("name"));
		//$('category_index').setProperty('href','category.php?t='+id.getAttribute("name"));
		document.getElementById('searchKey').focus();
	}
}



//smartlist
$('select-repair-province').dependence = $('select-repair-city');

$('select-repair-province').addEvents({
	'change': function(e) {
		SmartListbox.disableDependence($('select-repair-province'));
		if($('select-repair-province').value!="")
		SmartListbox.request($('select-repair-city'), 'repair', 'GetCity', $('select-repair-province').value,'','城市');
	}
});
SmartListbox.request($('select-repair-make'), 'repair', 'GetMake', '','','制造商');
SmartListbox.request($('select-repair-province'), 'repair', 'GetProvince','', '','省份');

