';
}
if(catCount >=9){
catBlock2+='
';
}
catCount++
});
if(catCount > 9){mo='
Show More
';}
if(catCount > 0){e("#catCell").append('
Shop Related Categories
'+catBlock1+'
');}
e("#catCell").append('
'+mo+'
'+catBlock2+'
');
var year = getCookie("car_afg_year"), make = getCookie("car_afg_make"),urlMake=make.replace(/\+/g,"-"),model = getCookie("car_afg_model"),urlModel=model.replace(/\+/g,"-").replace(/%26/g,"&"),displayMake=make.replace(/\+/g," "),displayModel=model.replace(/\+/g," ").replace(/%26/g,"and");
if(year !=="" && make !=="" && model !==""){
e(".afg-selector").addClass("on");
var years = e(".formContainer .drop-down-container").eq(0).html();
e(".formContainer .drop-down-container").eq(0).detach();
pID = e("#yw0").attr("data-id");
e("#yw0").attr("action",'/item_'+pID+'_pla.html?afg%5Byear%5D='+year+'&afg%5Bmake%5D='+urlMake+'&afg%5Bmodel%5D='+urlModel+'');
e(".vehicleChoice .carselected").text(year+" "+displayModel);
e("button.ctaOrange").removeAttr("disabled");
e("#yw0").append('
');
}
e(".pagination_filter #manufacturer option").each(function(){
$this= e(this);
bid=$this.val();
brandName=$this.text();
if(brandCount >0 && brandCount < 9){
brandBlock1+='
';
}
if(brandCount >=9){
brandBlock2+='
';
}
brandCount ++
});
if(brandCount > 9){bo='
Show More
';}
if(brandCount > 0){e("#brandCell").append('
Brands
'+brandBlock1+'
');}
e("#brandCell").append('
'+bo+'
'+brandBlock2+'
');
if (!e(".ui-mobile").length) {
e(".hasTooltip").each(function() {
e(this).qtip({
content: e(this).next(".hidden-tooltip"),
hide: {
fixed: !0,
delay: 800
},
position: {
my: "top center",
at: "bottom center",
target: e(this).find(".selector"),
viewport: e(window)
},
style: {
def: !1,
width: 450,
classes: "thumbnailTip"
}
})
})
};
if(e("#yw1").length){
rr = e("#yw1").html();
e("#yw1").css("display","none");
pagerCon= rr.replace(/href="\//g,'data-ajax="false" href="/');
e("#noAjax").html(pagerCon);
}
e("#removeV").click(function(){
e(".afg-selector").removeClass("on");
pID = e("#yw0").attr("data-id");
e("#yw0").attr("action",'/item_'+pID+'_pla.html');
e(".formContainer").prepend('
'+years+'
');
e("button.ctaOrange").attr("disabled","disabled");
});
e(".showMoreCat").click(function(){
e(this).parent().parent().toggleClass("on");
});
var paged = QueryString.Product_page;
if(paged){
e("html, body").animate({
scrollTop: e("#Container").offset().top
}, 500);
}
}(jQuery);