'+brandstr+'
'); initMoreInfo(); initFilterBtns(filters,from); if(filters.brand!==undefined){ checkFilterEls('brands',filters.brand); } if(filters.category!==undefined){ checkFilterEls('categories',filters.category); } } cc++; startPage=data.startPage; pageDifference=totalFilteredResults-startPage; for (var i = 0; i < data.html.length; i++) { productStr+=data.html[i]; } if(dataScroll){ scrollPage(); } if(from=='filter' || from=='init'){ jQuery('#productRow').html(productStr); jQuery('.productCol').removeClass('loading'); }else{ jQuery('#productRow').append(productStr); jQuery('.productCol').removeClass('loading'); } initCtaBtns(); //initMoreInfo(); if(pageDifference > 0){ if(pageDifference < pageSize){pageSize=pageDifference;}else{pageSize=pageSize} jQuery('#productCall').html('').css('display','block'); initMoreResultsBtn(startPage,category,brand); }else{ jQuery('#productCall').css('display','none'); // jQuery('
').insertAfter('#productCall'); //initNosto(); } //sortHolder=sort; } }); } function initCtaBtns(){ jQuery('.promoCta').click(function(e){ e.preventDefault(); elem=jQuery(this); elem.html('Adding '); id=elem.attr('data-ids'); ids=id.split(','); additems(elem,ids); }); } catParam=QueryString.category_id; brandParam=QueryString.brand_id; queryObj.offset=0; if(catParam!==undefined && brandParam!==undefined){ if(/\d+/g.test(catParam) && /\d+/g.test(brandParam)){ catArr=catParam.split(','); brandArr=brandParam.split(','); queryObj.category=catArr; queryObj.brand=brandArr; }else{ queryObj.category=[]; queryObj.brand=[]; } }else if(catParam!==undefined){ if(/\d+/g.test(catParam)){ //getCombos(0,catParam,'','init'); catArr=catParam.split(','); queryObj.category=catArr; queryObj.brand=[]; }else{ queryObj.category=[]; queryObj.brand=[]; } }else if(brandParam!==undefined){ if(/\d+/g.test(brandParam)){ //getCombos(0,'',brandParam,'init'); queryObj.category=[]; brandArr=brandParam.split(','); queryObj.brand=brandArr; }else{ queryObj.category=[]; queryObj.brand=[]; } }else{ queryObj.category=[]; queryObj.brand=[]; } getCombos(); jQuery('#removeV').click(function(){ jQuery('.afg-content').removeClass('on'); }); jQuery('#removeR').click(function(){ document.cookie = "car_afg_year=''; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/"; document.cookie = "car_afg_make=''; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/"; document.cookie = "car_afg_model=''; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/"; jQuery('.afg-content').removeClass('on'); }); function getOrdinalNum(n) { return n + (n > 0 ? ['th', 'st', 'nd', 'rd'][(n > 3 && n < 21) || n % 10 > 3 ? 0 : n % 10] : ''); } var d = new Date(); var month = new Array(); month[0] = "Jan."; month[1] = "Feb."; month[2] = "Mar."; month[3] = "Apr."; month[4] = "May"; month[5] = "June"; month[6] = "July"; month[7] = "Aug."; month[8] = "Sep."; month[9] = "Oct."; month[10] = "Nov."; month[11] = "Dec."; var n = month[d.getMonth()]; var date= d.getDate(); date=getOrdinalNum(date); var year=d.getFullYear(); document.getElementById("todaysDate").innerHTML=n+' '+date+', '+year;