function GetObj(objName){
	if(document.getElementById){
		return eval('document.getElementById("' + objName + '")');
	}else if(document.layers){
		return eval("document.layers['" + objName +"']");
	}else{
		return eval('document.all.' + objName);
	}
}

function s_chg(td_now, fn)
{

	if(td_now.value == "old")//二手车
	{
		fn.query.value = "多个条件中间加空格:上海 桑塔纳 2002年";
		fn.query.name = "query";
		fn.action = "http://china.hx2car.com/search.htm";
	}
	if(td_now.value == "new")//新车
	{
		fn.query.value = "多个条件中间加空格:桑塔纳 2002年";
		fn.query.name = "query";
		fn.action = "http://china.hx2car.com/new_car.htm";
	}
	if(td_now.value == "4s")//4S店
	{
		fn.query.value = "多个条件中间加空格:上海市 桑塔纳";
		fn.query.name = "query";
		fn.action = "http://china.hx2car.com/company.htm";
	}
	if(td_now.value == "photo")//图片
	{
		fn.query.value = "多个条件中间加空格:上海 桑塔纳 2002年";
		fn.query.name = "query";
		fn.action = "http://china.hx2car.com/photo.htm";
	}
	
}
function s_chg_channel(td_now, fn)
{

	if(td_now.value == "old")//二手车
	{
		fn.query.value = "上海 桑塔纳 2002年";
		fn.query.name = "query";
		fn.action = "http://china.hx2car.com/search.htm";
	}
	if(td_now.value == "new")//新车
	{
		fn.query.value = "桑塔纳 2002年";
		fn.query.name = "query";
		fn.action = "http://china.hx2car.com/new_car.htm";
	}
	if(td_now.value == "4s")//4S店
	{
		fn.query.value = "上海市 桑塔纳";
		fn.query.name = "query";
		fn.action = "http://china.hx2car.com/company.htm";
	}
	if(td_now.value == "photo")//图片
	{
		fn.query.value = "上海 桑塔纳 2002年";
		fn.query.name = "query";
		fn.action = "http://china.hx2car.com/photo.htm";
	}
	
}
function $(element) {
	if (arguments.length > 1) {
		for (var i = 0, elements = [], length = arguments.length; i < length; i++)
		  elements.push($(arguments[i]));
		return elements;
	}
	if (typeof element == 'string')
		element = document.getElementById(element);
	return element;
}
//结构化搜索
function SB_Click(){
	if($("query").value =="多个条件中间加空格:桑塔纳 2002年" || $("query").value ==""){
		$("query").value = "桑塔纳 2002年";
	}
	if($("query").value =="多个条件中间加空格:上海市 桑塔纳" || $("query").value ==""){
		$("query").value = "上海市 桑塔纳";
	}
	if($("query").value =="多个条件中间加空格:上海 桑塔纳 2002年" || $("query").value ==""){
		$("query").value = "上海 桑塔纳 2002年";
	}
}

function SB_Click_channel(){
	if( $("query").value ==""){
		$("query").value = "桑塔纳 2002年";
	}
	if($("query").value ==""){
		$("query").value = "上海市 桑塔纳";
	}
	if($("query").value ==""){
		$("query").value = "上海 桑塔纳 2002年";
	}
}
//光标进入,清空
function SB_Blur(){
	if($("query").value =="多个条件中间加空格:桑塔纳 2002年" || $("query").value ==""){
		$("query").value = "";
	}
	if($("query").value =="多个条件中间加空格:上海市 桑塔纳" || $("query").value ==""){
		$("query").value = "";
	}
	if($("query").value =="多个条件中间加空格:上海 桑塔纳 2002年" || $("query").value ==""){
		$("query").value = "";
	}
}
function SB_Blur_channel(){
	if($("query").value =="桑塔纳 2002年" || $("query").value ==""){
		$("query").value = "";
	}
	if($("query").value =="上海市 桑塔纳" || $("query").value ==""){
		$("query").value = "";
	}
	if($("query").value =="上海 桑塔纳 2002年" || $("query").value ==""){
		$("query").value = "";
	}
}

function get_head_text(){
	var host= window.location.host;
	var head_text = "";
	switch (host){
		case "www.hx2car.com":
			head_text = "总站 " ;
			break;
		case "hx2car.com":
			head_text = "总站";
			break;
		case "www.zj2car.com":
			head_text = "浙江站";
			break;
		case "zj2car.com":
			head_text = "浙江站";
			break;
		case "www.hz2car.com":
			head_text = "华中站";
			break;
		case "hz2car.com":
			head_text = "华中站";
			break;
		case "nf.hx2car.com":
			head_text = "南方站";
			break;
		case "www.nf2car.com":
			head_text = "广东站";
			break;
		case "nf2car.com":
			head_text = "广东站";
			break;
		case "www.nj2car.com":
			head_text = "江苏站";
			break;
		case "nj2car.com":
			head_text = "江苏站";
			break;
		case "www.hd2car.com":
			head_text = "上海站";
			break;
		case "hd2car.com":
			head_text = "上海站";
			break;
		case "bf.hx2car.com":
			head_text = "北方站";
			break;
		case "www.bf2car.com":
			head_text = "辽宁站";
			break;
		case "bf2car.com":
			head_text = "辽宁站";
			break;
		case "www.2carcn.com":
			head_text = "北京站";
			break;
		case "2carcn.com":
			head_text = "北京站";
			break;
		case "xb.hx2car.com":
			head_text = "西部站";
			break;
		case "www.xb2car.com":
			head_text = "四川站";
			break;
		case "xb2car.com":
			head_text = "四川站";
			break;
		case "sc.hx2car.com":
			head_text = "四川站";
			break;
		case "www.tj2car.com":
			head_text = "天津站";
			break;
		case "tj2car.com":
			head_text = "天津站";
			break;
		case "zj.hx2car.com":
			head_text = "浙江站";
			break;
		case "hd.hx2car.com":
			head_text = "华东站";
			break;
		case "hn.hx2car.com":
			head_text = "华南站";
			break;
		case "db.hx2car.com":
			head_text = "东北站";
			break;
		case "sd.hx2car.com":
			head_text = "山东站";
			break;
		case "anhui.hx2car.com":
			head_text = "安徽站";
			break;
		case "hebei.hx2car.com":
			head_text = "河北站";
			break;
		case "hubei.hx2car.com":
			head_text = "湖北站";
			break;
		case "henan.hx2car.com":
			head_text = "河南站";
			break;
		case "jiangxi.hx2car.com":
			head_text = "江西站";
			break;
		case "hunan.hx2car.com":
			head_text = "湖南站";
			break;
		case "heilongjiang.hx2car.com.cn":
			head_text = "黑龙江" ;
			break;
		case "guangxi.hx2car.com.cn":
			head_text = "广西站" ;
			break;
		case "jilin.hx2car.com.cn":
			head_text = "吉林站" ;
			break;
		case "shanxi.hx2car.com.cn":
			head_text = "陕西站";
			break;
		case "shanghai.hx2car.com":
			head_text = "上海站" ;
			break;
		case "guangdong.hx2car.com":
			head_text = "广东站";
			break;
		case "jiangsu.hx2car.com":
			head_text = "江苏站";
			break;
		case "tianjin.hx2car.com":
			head_text = "天津站" ;
			break;
		case "beijing.hx2car.com":
			head_text = "北京站";
			break;
		case "liaoning.hx2car.com":
			head_text = "辽宁站";
			break;
		case "fj.hx2car.com":
			head_text = "福建站" ;
			break;
		case "sx.hx2car.com":
			head_text = "山西站" ;
			break;
		case "cq.hx2car.com":
			head_text = "重庆站" ;
			break;
		case "gz.hx2car.com":
			head_text = "贵州站" ;
			break;
		case "yn.hx2car.com":
			head_text = "云南站" ;
			break;
		default:
			head_text = "总站";
	}
	document.writeln(head_text);
}