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 sou_yanshis(id) {
	clearTimeout(waitInterval);	 
	waitInterval = window.setTimeout(function(){sou_seas(id);},MouseDelayTime);
}
function sou_yanship(id) {
	clearTimeout(waitInterval);	 
	waitInterval = window.setTimeout(function(){sou_seap(id);},MouseDelayTime);
}
function pbcar_yanshi(id) {
	clearTimeout(waitInterval);	 
	waitInterval = window.setTimeout(function(){pbcar(id);},MouseDelayTime);
}
function mouseOut(){
	clearTimeout(waitInterval);
}

//汽车搜索框 新
function sou_sea(id)
{
for (var i = 0;i <5;i++)
{
var carnav = document.getElementById("sounav" + i);
var carcontent = document.getElementById("souent" + i);
if (i == id)
{
carnav.className = "sou_btn1";
carcontent.style.display = "block";
}
else
{
carnav.className = "sou_btn2";
carcontent.style.display = "none";
}
}
}
//汽车搜索框 首页
function sou_seas(id)
{
for (var i = 0;i <5;i++)
{
var carnav = document.getElementById("sounav" + i);
var carcontent = document.getElementById("souent" + i);
if (i == id)
{
carnav.className = "12bluebs";
carcontent.style.display = "block";
}
else
{
carnav.className = "12blues02";
carcontent.style.display = "none";
}
}
}
//汽车价格区间 首页
function sou_seap(id)
{
for (var i = 0;i <8;i++)
{
var carnav = document.getElementById("price" + i);
var carcontent = document.getElementById("prient" + i);
if (i == id)
{
carnav.className = "price01";
carcontent.style.display = "block";
}
else
{
carnav.className = "price02";
carcontent.style.display = "none";
}
}
}
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;
}  
}

