function getElementById(a){return document.getElementById(a)}
function popload(a){getElementById(a).style.display="block";pop_Box=document.createElement("div");pop_iframe=document.createElement("iframe");document.getElementsByTagName("body")[0].appendChild(pop_Box);pop_Box.id="popBox";pop_Box.appendChild(pop_iframe);pop_Box.style.display="block";pop_Box.style.height=Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight)+"px";pop_Box.style.width=document.documentElement.scrollWidth+"px";getElementById("popWin").style.display="block";
getElementById("popWin").style.top=document.documentElement.scrollTop+document.documentElement.clientHeight/2-getElementById("popWin").offsetHeight/2+"px";getElementById("popWin").style.left=document.documentElement.clientWidth/2-getElementById("popWin").offsetWidth/2+"px"}function closex(a){getElementById(a).style.display="none";getElementById("popWin").style.display="none";document.getElementsByTagName("body")[0].removeChild(document.getElementById("popBox"))}
function ShowOrHideSelectCondition(){var a=getElementById("showhide");if(a)a.onclick=function(){a.innerHTML=document.getElementById("showhide").innerHTML=="\u6536\u8d77"?"\u5c55\u5f00":"\u6536\u8d77";a.className=document.getElementById("showhide").className=="sq"?"zk":"sq";var b=getElementById("showhideCon");if(b)b.style.display=b.style.display=="none"?"":"none";if(b=getElementById("tempNoborder"))b.style.borderBottom=a.innerHTML=="\u5c55\u5f00"?"none":"1px solid #DEE3E7";return false}}
var conditionObj={Price:"",Level:0,LevelName:new Array("","\u5fae\u578b\u8f66","\u5c0f\u578b\u8f66","\u7d27\u51d1\u578b\u8f66","\u4e2d\u5927\u578b\u8f66","\u4e2d\u578b\u8f66","\u8c6a\u534e\u8f66","MPV","SUV","\u8dd1\u8f66","\u9762\u5305\u8f66"),Displacement:"",TransmissionType:0,TransmissionTypeName:{"1":"\u624b\u52a8","62":"\u81ea\u52a8"},MoreCondition:[],MoreConditionName:[],View:0,Sort:0,Brand:0,BrandName:new Array("\u4e0d\u9650","\u81ea\u4e3b","\u5408\u8d44","","\u8fdb\u53e3"),BodyForm:0,InitObject:function(){for(i=
0;i<21;i++)this.MoreCondition.push("0");this.MoreConditionName[0]="\u6da1\u8f6e\u589e\u538b";this.MoreConditionName[1]="\u56db\u8f6e\u9a71\u52a8";this.MoreConditionName[2]="\u56db\u8f6e\u789f\u5239";this.MoreConditionName[3]="\u5929\u7a97";this.MoreConditionName[4]="\u524d\u540e\u7535\u52a8\u8f66\u7a97";this.MoreConditionName[5]="\u76ae\u5ea7\u6905";this.MoreConditionName[6]="\u7535\u52a8\u5ea7\u6905";this.MoreConditionName[7]="\u5ea7\u6905\u52a0\u70ed";this.MoreConditionName[8]="\u81ea\u52a8\u7a7a\u8c03";
this.MoreConditionName[9]="\u7535\u52a8\u5916\u540e\u89c6\u955c";this.MoreConditionName[10]="ESP";this.MoreConditionName[11]="\u5012\u8f66\u5f71\u50cf";this.MoreConditionName[12]="\u5012\u8f66\u96f7\u8fbe";this.MoreConditionName[13]="GPS\u5bfc\u822a";this.MoreConditionName[14]="\u6cca\u8f66\u8f85\u52a9";this.MoreConditionName[15]="\u5b9a\u901f\u5de1\u822a";this.MoreConditionName[16]="\u65e0\u94a5\u5319\u542f\u52a8";this.MoreConditionName[17]="\u5b89\u5168\u5e26\u672a\u7cfb\u63d0\u793a";this.MoreConditionName[18]=
"\u4e3b\u52a8\u5b89\u5168\u5934\u6795";this.MoreConditionName[19]="\u513f\u7ae5\u9501";this.MoreConditionName[20]="\u513f\u7ae5\u5ea7\u6905\u56fa\u5b9a"},InitPageCondition:function(){this.InitPrice();this.InitLevel();this.InitDisplacement();this.InitTransmisstionType();this.InitMoreCondition();this.InitBrandType()},InitPrice:function(){switch(this.Price){case "0-5":getElementById("price1").className="current";break;case "5-8":getElementById("price2").className="current";break;case "8-12":getElementById("price3").className=
"current";break;case "12-18":getElementById("price4").className="current";break;case "18-25":getElementById("price5").className="current";break;case "25-40":getElementById("price6").className="current";break;case "40-80":getElementById("price7").className="current";break;case "80-9999":getElementById("price8").className="current";break;default:getElementById("price0").className="current";break}},InitLevel:function(){if(this.Level=="")this.Level="0";var a=getElementById("level"+this.Level);if(a)a.className=
"current";if(this.Level<=6&&this.Level>0||this.Level==63)if(a=getElementById("level63_1"))a.className="current";this.OpenOrCloseJiaocheBox()},InitDisplacement:function(){switch(this.Displacement){case "0-1.3":getElementById("dis1").className="current";break;case "1.3-1.6":getElementById("dis2").className="current";break;case "1.7-2.0":getElementById("dis3").className="current";break;case "2.1-3.0":getElementById("dis4").className="current";break;case "3.1-5.0":getElementById("dis5").className="current";
break;case "5.0-9":getElementById("dis6").className="current";break;default:getElementById("dis0").className="current";break}},InitTransmisstionType:function(){var a=getElementById("trans"+this.TransmissionType.toString());if(a)a.className="current";if(this.TransmissionType>=2)if(a=getElementById("trans62_1"))a.className="current";this.OpenOrCloseZidongBox()},OpenOrCloseZidongBox:function(){var a=getElementById("zidongBox");if(a)a.style.display=this.TransmissionType>=2?"block":"none"},OpenOrCloseJiaocheBox:function(){var a=
getElementById("jiaocheBox");if(a)a.style.display=this.Level>6&&this.Level!=63?"none":"block"},InitBrandType:function(){var a=getElementById("brandType"+this.Brand.toString());if(a)a.className="current"},InitMoreCondition:function(){var a=getElementById("moreConditionUL");for(i=0;i<21;i++)if(this.MoreCondition[i]=="1"){if(!a){var b=getElementById("moreCondition");if(!b)return;a=document.createElement("ul");a.id="moreConditionUL";a.className="gd";b.appendChild(a)}b=document.createElement("li");b.id=
"mcLi"+i.toString();b.innerHTML=this.MoreConditionName[i]+"<a href=\"javascript:DelMoreCondition('"+i+"');\">\u5220\u9664</a>";a.appendChild(b);if(b=getElementById("mcCheck"+i.toString()))b.checked=true}},SetMoreCondition:function(a){var b=a.length;if(b>21)b=21;for(i=0;i<b;i++){var c=a.charAt(i);if(c=="0"||c=="1")this.MoreCondition[i]=c}},GetMoreconditionDescription:function(a){var b=a.length;if(b>21)b=21;var c=[];for(i=0;i<b;i++)a.charAt(i)=="1"&&c.push(this.MoreConditionName[i]);return c.join(",")},
GetSearchQueryString:function(){var a=[];this.Price.length>0&&a.push("p="+this.Price);this.Level!=0&&a.push("l="+this.Level.toString());this.Displacement.length>0&&a.push("d="+this.Displacement);this.TransmissionType!=0&&a.push("t="+this.TransmissionType.toString());var b=this.MoreCondition.join("");b.indexOf("1")>=0&&a.push("m="+b);this.View!=0&&a.push("v="+this.View.toString());this.Sort!=0&&a.push("s="+this.Sort.toString());this.Brand!=0&&a.push("g="+this.Brand.toString());this.BodyForm!=0&&a.push("b="+
this.BodyForm.toString());return a.join("&")},HasSelectCondition:function(){return this.Price.length>0||this.Level!=0||this.Displacement.length>0||this.TransmissionType!=0||this.MoreCondition.toString().indexOf("1")>-1||this.Brand!=0},SaveConditionCookie:function(){if(typeof CookieHelper!="undefined")if(this.HasSelectCondition()){var a=this.GetSearchQueryString(),b={};b.expires=360;b.path="/";b.domain="car.bitauto.com";CookieHelper.setCookie("LastSelectCarCondition",a,b)}},GetConditionDescription:function(a){if(a==
null||typeof a=="undefined")return"";var b=[];a=a.split("&");for(i=0;i<a.length;i++){var c=a[i].split("=");if(c.length==2){c=this.GetConditionDescriptionByKeyValue(c[0],c[1]);b.push(c)}}return b.join(",")},GetConditionDescriptionByKeyValue:function(a,b){var c="";switch(a){case "p":c=b=="0-5"?"5\u4e07\u4ee5\u4e0b":b=="80-9999"?"80\u4e07\u4ee5\u4e0a":b+"\u4e07";break;case "d":c=b=="0-1.3"?"1.3L\u4ee5\u4e0b":b=="5.0-9"?"5.0L\u4ee5\u4e0a":b+"L";break;case "l":c=b=="63"?"\u8f7f\u8f66":this.LevelName[parseInt(b)];
break;case "t":c=this.TransmissionTypeName[b];break;case "g":c=this.BrandName[parseInt(b)];break;case "m":c=this.GetMoreconditionDescription(b);break}return c}};conditionObj.InitObject();function DelMoreCondition(a){var b=getElementById("mcLi"+a),c=getElementById("mcCheck"+a);b&&b.parentNode.removeChild(b);if(c)c.checked=false;a=parseInt(a);conditionObj.MoreCondition[a]="0";GotoPage("m")}
function SetMoreCondition(){for(i=0;i<21;i++){var a=getElementById("mcCheck"+i);conditionObj.MoreCondition[i]=a&&a.checked?"1":"0"}}
function GotoPage(a){if(a.length>=1){var b=a.charAt(0);a=a.substr(1);if(b=="p"||b=="l"||b=="d"||b=="t"||b=="m")conditionObj.BodyForm=0;switch(b){case "p":conditionObj.Price=a;break;case "l":conditionObj.Level=parseInt(a);break;case "d":conditionObj.Displacement=a;break;case "t":conditionObj.TransmissionType=parseInt(a);break;case "v":conditionObj.View=parseInt(a);break;case "s":conditionObj.Sort=parseInt(a);break;case "g":conditionObj.Brand=parseInt(a);break;case "b":conditionObj.BodyForm=parseInt(a);
break;case "m":SetMoreCondition();break}}b=conditionObj.GetSearchQueryString();a=_SearchUrl;if(b.length>0)a+="?"+b;location.href=a}function SelectFilterCondition(a){var b;if(a=="brandtype")b=getElementById("selBrandType");else if(a=="bodyform")b=getElementById("selBodyForm");if(b){b=b.options[b.options.selectedIndex].value;if(a=="brandtype")GotoPage("g"+b);else a=="bodyform"&&GotoPage("b"+b)}}
function SetLastSelectCarConditionLink(){var a=document.getElementById("lastSelectCar");if(a)if(!conditionObj.HasSelectCondition()){var b=CookieHelper.readCookie("LastSelectCarCondition"),c=conditionObj.GetConditionDescription(b);if(c.length>0){a.href="/xuanchegongju/?"+b;a.title=c;a.style.display=""}else a.style.display="none"}}function addLoadEvent(a){var b=window.onload;window.onload=typeof window.onload!="function"?a:function(){b();a()}}
function addClass(a,b){if(a.className){newClassName=a.className;newClassName+=" ";newClassName+=b;a.className=newClassName}else a.className=b}function removeClass(a,b){var c=a.className;c=c.replace(new RegExp("(^| )"+b+"( |$)"),"$1");c=c.replace(/ $/,"");a.className=c;return true}function hide(a){if(a=document.getElementById(a))a.style.display="none"}function show(a){if(a=document.getElementById(a))a.style.display="block"}
function tabsRemove(a,b,c,f){if(!document.getElementById(b))return false;if(b=document.getElementById(b)){b=b.getElementsByTagName("li");for(var d=0;d<b.length;d++){removeClass(b[d],"current");hide(c+"_"+d);f&&hide(f+"_"+d);d==a&&addClass(b[d],"current")}show(c+"_"+a);f&&show(f+"_"+a)}}
function tabs(a,b,c,f){if(!document.getElementById(a))return false;var d=document.getElementById(a);if(d){d=d.getElementsByTagName("li");for(var e=0;e<d.length;e++){d[e].num=e;if(f){d[e].onmouseover=function(){var g=this;thetabstime=setTimeout(function(){h(g)},150)};d[e].onmouseout=function(){clearTimeout(thetabstime)}}else d[e].onclick=function(){if(this.className=="current"||this.className=="last current"){h(this);return true}else{h(this);return false}};function h(g){tabsRemove(g.num,a,b,c)}}}}
function all_func(){try{tabs("sub_index","sub_index_con",null,false)}catch(a){}}addLoadEvent(all_func);

