function CarComp(){}jQuery.fn.floatdiv=function(n){var r=!1,u={},e=navigator.userAgent.toLowerCase(),f,i,t;return(f=e.match(/msie ([\d.]+)/))?u.ie=f[1]:0,u.ie&&u.ie=="6.0"&&(r=!0),self.innerHeight?(i=self.innerWidth,t=self.innerHeight):document.documentElement&&document.documentElement.clientHeight?(i=document.documentElement.clientWidth,t=document.documentElement.clientHeight):document.body&&(i=document.body.clientWidth,t=document.body.clientHeight),this.each(function(){var u,t=$("
"),f=-1,i;if(n==undefined||n.constructor==String)switch(n){case"rightmiddle":u={right:"4px",bottom:"1px"};break;default:n="rightbottom",u={right:"0px",bottom:"0px"}}else u=n,i=u.top,typeof i!="undefined"&&(i=i.replace("px",""),f=i);r&&(t=f<0?$(''):$('')),$("body").append(t),t.css(u).css({position:"fixed","z-index":"999"}),r&&(t.css("position","absolute"),$("body").css("background-attachment","fixed").css("background-image","url(n1othing.txt)")),$(this).appendTo(t)})},CarComp.CCName="ccName",CarComp.isExistsCookie=function(){return GetCookie(this.CCName)!=null&&GetCookie(this.CCName)!="null"?!0:!1},CarComp.isExistsCid=function(n){var t=CarComp.getarray();t!=null;for(x in t)if(n==t[x])return!0;return!1},CarComp.url=function(){var n=GetCookie(this.CCName).replace(new RegExp("#","gm"),"_");n=n.replace(new RegExp("&","gm"),""),n=n!=null&&n!="null"&&n!=""?"/compare/"+n.substring(1,n.length)+".html":"/compare/result.html",$("#CompForm").attr("action",n).submit()},CarComp.remove=function(n){SetCookie(this.CCName,GetCookie(this.CCName).replace(new RegExp("#"+n+"&","gm"),""),null,"/",".webcars.com.cn")},CarComp.clear=function(){SetCookie(this.CCName,null,null,"/",".webcars.com.cn")},CarComp.getcount=function(){var n=CarComp.getarray();return n!=null?n.length:"0"},CarComp.state=function(){var n=GetCookie("compstate");n==1?($("#comp_btn").hide(),$("#comp_content").show(),$("#comp_Box").animate({width:"180px"})):($("#comp_btn").show(),$("#comp_Box").animate({width:"0px"}))},CarComp.setState=function(n){SetCookie("compstate",n,null,"/",".webcars.com.cn")},CarComp.getarray=function(){var t,n;return GetCookie(this.CCName)!=null&&GetCookie(this.CCName)!="null"?(n=GetCookie(this.CCName).replace(new RegExp("#","gm"),""),n.length>1&&(n.lastIndexOf("&")==n.length-1&&(n=n.substring(0,n.length-1)),t=n.indexOf("&")==-1?new Array(n):n.split("&")),t):null},CarComp.add=function(n){if(CarComp.isExistsCookie()){var t=GetCookie(this.CCName).replace(new RegExp("#"+n+"&","gm"),"")+"#"+n+"&";SetCookie(this.CCName,t,null,"/",".webcars.com.cn")}else SetCookie(this.CCName,"#"+n+"&",null,"/",".webcars.com.cn")},CarComp.addimg=function(n){$("#comp_empty").hide(),CarComp.add(n),$.get("/ashx/NCC2CGetTrimInfo.ashx?CityId=1&Phtype=1&CarId="+n,function(t){var i=t.split("\r\n"),r="/"+i[14]+"-"+i[15]+"-"+i[0]+"/";$("#comp_Box .duibiList").append("")})},CarComp.removeimg=function(n){CarComp.remove(n),$("#compul_"+n).remove(),$("#cpcar_"+n).attr("checked",!1),CarComp.getcount()==0&&CarComp.clearimg()},CarComp.onload=function(){var n=CarComp.getarray();if(n!=null&&n.length>0){$("#comp_empty").hide();for(i in n)CarComp.addimg(n[i]),$("#cpcar_"+n[i]).attr("checked",!0)}CarComp.state()},CarComp.onloadcheckbox=function(n){$("#cpcar_"+n).attr("checked",$("#cpcar_"+n).attr("checked"))},CarComp.clearimg=function(){CarComp.clear(),$("#comp_Box .duibiList").html('