
function f_s_q11(obj)
{	if (obj.value=='搜索品牌，车型名称，关键字...'){obj.value='';}	}
function b_s_q11(obj)
{	if (obj.value==''){obj.value='搜索品牌，车型名称，关键字...';}	}	
function _w(str)
{
	document.write(str);
}

$ = function(id)
{
	return document.getElementById(id);
}

function _clear(field,_value)
{
	var ob= $(field);
	if(ob.value=_value)
	{
		ob.value='';
	}
}

function _fill(field,_value)
{
	var ob= $(field);
	if(ob.value=='')
	{
		ob.value=_value;
	}
}	
function Showarticle(id)
{
for (var i = 0;i < 2;i++)
{
var articlenav = document.getElementById("bott" + i);
var articlecontent = document.getElementById("articlecontent" + i);
if (i == id)
{
articlenav.className = "bott0";
articlecontent.style.display = "";
}
else
{
articlenav.className = "bott1";
articlecontent.style.display = "none";
}
}
}
function model_compare(model_id_name, target_php, para_str)
			{
				var history_ids = document.getElementsByName(model_id_name);
				var checked_history_ids = '';
				var len=history_ids.length;
				var has_data=false;
				for(i=0;i<len;i++)
				{
					if(history_ids[i].checked)
					{
						checked_history_ids = checked_history_ids+','+history_ids[i].value;
						has_data = true;
					}
				}
				if(!has_data)
				{
					alert('请至少选择一款车');
					return false;
				}else{
					checked_history_ids = checked_history_ids.substr(1);
					window.open(target_php+"?"+para_str+"="+checked_history_ids+'');
					//window.location=(target_php+"?"+para_str+"="+checked_history_ids+'');
					return true;
				}
}	


var waitInterval;
var MouseDelayTime=400;
function car_cy_yanshi(id) {
	clearTimeout(waitInterval);	 
	waitInterval = window.setTimeout(function(){coun_sea(id);},MouseDelayTime);
}
function sou_yanshi(id) {
	clearTimeout(waitInterval);	 
	waitInterval = window.setTimeout(function(){sou_sea(id);},MouseDelayTime);
}

function pbcar_yanshi(id) {
	clearTimeout(waitInterval);	 
	waitInterval = window.setTimeout(function(){pbcar(id);},MouseDelayTime);
}
function mouseOut(){
	clearTimeout(waitInterval);
}

//汽车搜索框2010 3-31
function sou_sea(id)
{
	var type = document.getElementById("type");
	for (var i = 0;i <7;i++)
	{
		var carnav = document.getElementById("sounav" + i);
		
		if (i == id)
		{
		carnav.className = "sou_btn1";
		switch(id){
		 case 0:type.value='product';break;case 1: type.value='article';break;case 2:type.value='all';break;case 3:type.value='price';break;case 4:type.value='pic';break;case 5:type.value='4s';break;case 6:type.value='2s';break;
		 }
		}
		else
		{
		carnav.className = "sou_btn2";
		}
		
	}
}

function check_form(theform) {

if (theform.email.value=="") {
		alert("请输入电子邮箱！");
		theform.email.focus();
		return false;
}

var strm = theform.email.value;  
var regm = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
if (!strm.match(regm) && strm!="")
{
    alert("邮箱地址格式错误或含有非法字符!\n请检查！");
    theform.email.focus();
    return false;
}  
}
function ask_submit()
{

var word=document.soform.q.value;

 document.soform.action="http://carschina.com/ask/ask.php?word="+word;
 document.soform.submit();
}
//综合搜索 
function searchq(){
	var q=document.getElementById('q').value;
	var type=document.getElementById('type').value;
	if(q==''||q=='搜索品牌，车型名称，关键字...') {
	  return false;	
	}

	if(type=='all'&&q!=''){
		window.location.href='http://carschina.com/tag/'+encodeURI(q);
	   return false;	
			//使用form机制新窗口跳转
		//var form=document.getElementById('soform');
		//	form.target='_bank';
		//	form.action='http://carschina.com/tag/'+encodeURI(q);
	}
}

function searchq1(){
	var q=document.getElementById('q1').value;
	var type=document.getElementById('type1').value;
	if(type=='all'&&q!=''){
	window.location.href='http://carschina.com/tag/'+encodeURI(q);
	return false;
	}
}


function changebrandmenu(id){
for(var i=1;i<=3;i++){
if(i==id){
	document.getElementById('showbrand'+i).className='select_r';
	document.getElementById('blist'+i).style.display='';
}else{
	document.getElementById('showbrand'+i).className='';
	document.getElementById('blist'+i).style.display='none';
}
}
}
function changeseriesmenu(id){
for(var i=1;i<=3;i++){
if(i==id){
	document.getElementById('showseries'+i).className='select_r';
	document.getElementById('slist'+i).style.display='';
}else{
	document.getElementById('showseries'+i).className='';
	document.getElementById('slist'+i).style.display='none';
}
}
}

function changeshow(i){
  
      var target=document.getElementById('cars_series_txt_'+i);
      var clickimg=document.getElementById('car_m_'+i);
            if (target.style.display=="block"){
                target.style.display="none";
                clickimg.src="http://carschina.com/images/new_search/pic_3.jpg";
            } else {
                target.style.display="block";
                clickimg.src="http://carschina.com/images/new_search/pic_2.jpg";
            }
  
}










