if(!SearchNitroGallery) var SearchNitroGallery = {'api':'xaVs7I05SgCx'} SearchNitroGallery.template = {'list':'','in_stock':'','no_stock':''};SearchNitroGallery.template.list = ` `;SearchNitroGallery.template.in_stock = ` `;SearchNitroGallery.template.no_stock = ``;let async_load_low_price_counter = 0; async_load_low_price() async function async_load_low_price(){ if(typeof check_trigger_url !== 'function'){ console.log('Rescheduling async_load_low_price'); if(async_load_low_price_counter < 20){ setTimeout(async_load_low_price,2000); async_load_low_price_counter++; } return false; } if(!vinficient.dashboard.lowPrice) return false; if(!vinficient.dashboard.lowPrice.find(element => element.id == "lowest-price-page-selector")) return false; if(!vinficient.dashboard.lowPrice.find(element => element.id == "lowest-price-page-selector").value) return false; if(!vinficient.dashboard.lowPrice.find(element => element.id == "lowest-price-page-url")) return false; if(!check_trigger_url(vinficient.dashboard.lowPrice.find(element => element.id == "lowest-price-page-url").value)) return false; load_search_nitro_gallery = vinficient.dashboard.lowPrice.find(element => element.id == "lowest-price-page-url").value; function check_page_make(){ let page_url = decodeURI(window.location.href); if(page_url.match(/make=([\w\d-\%\s]+)/))return window.location.href.match(/make=([\w\d-]+)/)[1]; if(page_url.match(/pt=([\w\d\-\|\:\%\s]+)/)){ pt = page_url.replace(/\%7C/g,'|'); pt = pt.replace(/\%20/g,' '); pt = pt.match(/pt=([\w\d\-\|\:\%\s]+)/)[1]; if(pt.match(/make:([\w\d-\%\s]+)/)) return pt.match(/make:([\w\d-\%\s]+)/)[1]; } model = check_page_model(); if(model !== '' && typeof model !== undefined){ model = model.toLowerCase(); if(modelMatrix[model] !== undefined) return modelMatrix[model].toLowerCase(); } return ''; } function check_page_model(){ let page_url = decodeURI(window.location.href); if(page_url.match(/model=([\w\d-\%\s]+)/))return window.location.href.match(/model=([\w\d-]+)/)[1]; if(page_url.match(/pt=([\w\d\-\|\:\%\s]+)/)){ pt =page_url.replace(/\%7C/g,'|'); pt =pt.replace(/\%20/g,' '); pt = pt.match(/pt=([\w\d\-\|\:\%\s]+)/)[1]; if(pt.match(/model:([\w\d-\%\s]+)/)) return pt.match(/model:([\w\d-\%\s]+)/)[1]; } return ''; } function check_page_condition(){ let page_url = decodeURI(window.location.href); if(page_url.match(/condition=([\w]+)/))return page_url.match(/condition=([\w]+)/)[1]; if(page_url.match(/pt=([\w\d\-\|\:\%\s]+)/)){ pt = page_url.replace(/\%7C/g,'|'); pt = pt.match(/pt=([\w\d\-\|\:\%\s]+)/)[1]; if(pt.match(/condition:([\w\d-]+)/)) return pt.match(/condition:([\w\d-]+)/)[1]; } return ''; } let isSearchNitroLowPriceModelPage = false; let urlParams = new URLSearchParams(window.location.search); if(urlParams.get("pt")){ isSearchNitroLowPriceModelPage = true; } if(Array.isArray(vinficient.dashboard_feed)){ if(!SearchNitroGallery)SearchNitroGallery = {}; if(!SearchNitroGallery.container)SearchNitroGallery.container = {}; if(!SearchNitroGallery.container.selector)SearchNitroGallery.container.selector = false; SearchNitroGallery.container.selector = vinficient.dashboard.lowPrice.find(element => element.id == "lowest-price-page-selector").value; console.log('VINficient gallery loaded'); SearchNitroGallery.page = {}; SearchNitroGallery.page.model = check_page_model(); SearchNitroGallery.page.make = check_page_make(); SearchNitroGallery.page.condition = check_page_condition(); document.querySelector('h1').style.textAlign = 'center'; CssModule = document.createElement('link'); CssModule.rel = "stylesheet"; CssModule.charset = "UTF-8"; CssModule.href = "https://seo-app.vinficient.com/gallery/css/"; document.querySelector('head').appendChild(CssModule); SearchNitroGallery.feed = {}; for(let i = 0; i < vinficient.dashboard_feed.length; i++){ let vehicle = vinficient.dashboard_feed[i]; if(!vehicle.price_list)continue; if(parseInt(vehicle.price_list) == 0)continue; if(!vehicle.vdp_url)continue; let Condition = vehicle.vehicle_condition; let condition = vehicle.vehicle_condition.toLowerCase(); let make = vehicle.make; let model = vehicle.model ; if(!SearchNitroGallery.feed[condition])SearchNitroGallery.feed[condition] = {}; if(!SearchNitroGallery.feed[condition][make])SearchNitroGallery.feed[condition][make] = {}; if(!SearchNitroGallery.feed[condition][make][model])SearchNitroGallery.feed[condition][make][model] = {}; if(!SearchNitroGallery.feed[condition][make][model].price_list || parseInt(vehicle.price_list) < parseInt(SearchNitroGallery.feed[condition][make][model].price_list)){ SearchNitroGallery.feed[condition][make][model].price_list = vehicle.price_list; if(!vehicle.photo_urls){ SearchNitroGallery.feed[condition][make][model].photo_urls = `https://seo-app.vinficient.com/car-images/index.php?make=${make}&model=${model}`; } else if(Array.isArray(vehicle.photo_urls)){ SearchNitroGallery.feed[condition][make][model].photo_urls = vehicle.photo_urls.join('|'); } else if(typeof vehicle.photo_urls == 'string'){ if(vehicle.photo_urls.split('|').length < 3){ `https://seo-app.vinficient.com/car-images/index.php?make=${make}&model=${model}`; } else { SearchNitroGallery.feed[condition][make][model].photo_urls = vehicle.photo_urls; } } SearchNitroGallery.feed[condition][make][model].vin = vehicle.VIN; SearchNitroGallery.feed[condition][make][model].year = vehicle.year; SearchNitroGallery.feed[condition][make][model].trim_code = vehicle.trim; SearchNitroGallery.feed[condition][make][model].features = vehicle.features; SearchNitroGallery.feed[condition][make][model].description = vehicle.description; SearchNitroGallery.feed[condition][make][model].vdp_url = vehicle.vdp_url; } } } if(vinficient.dashboard_feed && !isSearchNitroLowPriceModelPage){ //alert('Load Model List: ' + SearchNitroGallery.page.model); let template = SearchNitroGallery.template.list; document.querySelector(SearchNitroGallery.container.selector).innerHTML = template; if(vinficient.dashboard.lowPrice.filter(element => element.id == 'lowest-price-header-background-url')[0]){ if(vinficient.dashboard.lowPrice.filter(element => element.id == 'lowest-price-header-background-url')[0].value !== ''){ document.querySelector(`#content-description`).style.backgroundImage = `url('${vinficient.dashboard.lowPrice.filter(element => element.id == 'lowest-price-header-background-url')[0].value}')`; } } if(SearchNitroGallery.feed['new'] || SearchNitroGallery.feed['New']){ if(SearchNitroGallery.feed['new']) obj = SearchNitroGallery.feed['new']; if(SearchNitroGallery.feed['New']) obj = SearchNitroGallery.feed['New']; let NewVehicleGrid = ''; let NewVehicleFeature = ''; let NewVehicleCounter = 0; for (let make in obj) { for (let model in obj[make]) { NewVehicleCounter++; //let url = load_search_nitro_gallery+"?condition=new&make="+make+"&model="+model; //if(vinficient.platform.name == 'DEALERON') url = load_search_nitro_gallery+"?pt=condition:new|make:"+make+"|model:"+model; let url = load_search_nitro_gallery+"?pt=condition:new|make:"+make+"|model:"+model; let year = obj[make][model]['year']; let image_url = ''; if(typeof obj[make][model]['photo_urls'] == "string"){image_url = obj[make][model]['photo_urls'].split('|')[0];} else if(Array.isArray(obj[make][model]['photo_urls'])){image_url = obj[make][model]['photo_urls'][0];} else {image_url = `https://seo-app.vinficient.com/car-images/index.php?make=${make}&model=${model}`} if(NewVehicleCounter == 1){ NewVehicleFeature = ` ${year} ${make} ${model}
`; } else { NewVehicleGrid += ` ${year} ${make} ${model}

New ${make} ${model}

`; } } } document.querySelector('#search-nitro-gallery .featured-wrap .featured-new').innerHTML = NewVehicleFeature; document.querySelector('#search-nitro-gallery .new-vehicles-wrap .vehicle-grid').innerHTML = NewVehicleGrid; } let UsedVehicleGrid = ''; let UsedVehicleList = ''; let UsedVehicleFeature = ''; let UsedVehicleCounter = 0; if(SearchNitroGallery.feed['cpo'] || SearchNitroGallery.feed['Certified']){ if(SearchNitroGallery.feed['cpo']) obj = SearchNitroGallery.feed['cpo']; if(SearchNitroGallery.feed['cpo']) obj = SearchNitroGallery.feed['CPO']; if(SearchNitroGallery.feed['certified']) obj = SearchNitroGallery.feed['certified']; if(SearchNitroGallery.feed['Certified']) obj = SearchNitroGallery.feed['Certified']; for (let make in obj) { for (let model in obj[make]) { //let url = load_search_nitro_gallery+"?condition=cpo&make="+make+"&model="+model; //if(vinficient.platform.name == 'DEALERON') url = load_search_nitro_gallery+"?pt=condition:cpo|make:"+make+"|model:"+model; let url = load_search_nitro_gallery+"?pt=condition:cpo|make:"+make+"|model:"+model; let year = obj[make][model]['year']; let image_url = ''; if(typeof obj[make][model]['photo_urls'] == "string"){image_url = obj[make][model]['photo_urls'].split('|')[0];} else if(Array.isArray(obj[make][model]['photo_urls'])){image_url = obj[make][model]['photo_urls'][0];} else {image_url = `https://seo-app.vinficient.com/car-images/index.php?make=${make}&model=${model}`} if(UsedVehicleCounter == 1){ UsedVehicleFeature = ` ${year} ${make} ${model}
`; } else if(UsedVehicleCounter <= 20) { UsedVehicleGrid += ` ${year} ${make} ${model}

Certified ${make} ${model}

`; } else { UsedVehicleList += ` Certified ${make} ${model} ,  `; } } } } if(SearchNitroGallery.feed['used'] || SearchNitroGallery.feed['Used']){ if(SearchNitroGallery.feed['used']) obj = SearchNitroGallery.feed['used']; if(SearchNitroGallery.feed['Used']) obj = SearchNitroGallery.feed['Used']; for (let make in obj) { for (let model in obj[make]) { UsedVehicleCounter++; //let url = load_search_nitro_gallery+"?condition=used&make="+make+"&model="+model; //if(vinficient.platform.name == 'DEALERON') url = load_search_nitro_gallery+"?pt=condition:used|make:"+make+"|model:"+model; let url = load_search_nitro_gallery+"?pt=condition:used|make:"+make+"|model:"+model; let year = obj[make][model]['year']; let image_url = ''; if(typeof obj[make][model]['photo_urls'] == "string"){image_url = obj[make][model]['photo_urls'].split('|')[0];} else if(Array.isArray(obj[make][model]['photo_urls'])){image_url = obj[make][model]['photo_urls'][0];} else {image_url = `https://seo-app.vinficient.com/car-images/index.php?make=${make}&model=${model}`} if(UsedVehicleFeature == ''){ UsedVehicleCounter = 0; UsedVehicleFeature = ` ${year} ${make} ${model}
`; } else if(UsedVehicleCounter <= 10){ UsedVehicleGrid += ` ${year} ${make} ${model}

Used ${make} ${model}

`; } else if(UsedVehicleCounter >= 20){ UsedVehicleList += ` Used ${make} ${model} ,  `; } } } } document.querySelector('#search-nitro-gallery .featured-wrap .featured-used').innerHTML = UsedVehicleFeature; document.querySelector('#search-nitro-gallery .used-vehicles-wrap .vehicle-grid').innerHTML = UsedVehicleGrid; document.querySelector('#search-nitro-gallery .used-vehicles-wrap .vehicle-list').innerHTML = UsedVehicleList; document.querySelector('link[rel="canonical"]').href = 'https://' + window.location.host + window.location.pathname; if(document.querySelector('meta[name="description"]')){ document.querySelector('meta[name="description"]').content = `Browse the lowest price car, truck and SUV deals at ${vinficient.name}!` ; } else { let metaDescription = document.createElement('meta'); metaDescription.name = "description"; metaDescription.content = `Browse the lowest price car, truck and SUV deals at ${vinficient.name}!` ; document.querySelector('head').appendChild(metaDescription); } document.querySelector('title').textContent = `Lowest Price Car, Truck, and SUV Deals at ${vinficient.name}`; } if(vinficient.dashboard_feed && isSearchNitroLowPriceModelPage){ //alert('Load Model Display: ' + SearchNitroGallery.page.model); let tempCondition = window.location.href.match(/condition:[\w\s\%\d\-]*/)[0].slice(10).replace('%20',' '); let tempMake = window.location.href.match(/make:[\w\s\%\d\-]*/)[0].slice(5).replace('%20',' '); let tempModel = window.location.href.match(/model:[\w\s\%\d\-]*/)[0].slice(6).replace('%20',' '); tempcondition = ''; tempmake = ''; tempmodel = ''; if(tempCondition) tempcondition = tempCondition.toLowerCase(); if(tempMake) tempmake = tempMake.toLowerCase(); if(tempModel) tempmodel = tempModel.toLowerCase(); title = ''; if(tempCondition) title += tempCondition; if(tempMake) title += ` ` + tempMake; if(tempModel) title += ` ` + tempModel; title += ' Deals'; title = title.trim(); if(SearchNitroGallery.city) title_city = title + ' | ' + SearchNitroGallery.name + ' in ' + SearchNitroGallery.city + ', ' + SearchNitroGallery.state; try{ if(typeof SearchNitroGallery.feed[tempcondition] !== 'undefined') obj = SearchNitroGallery.feed[tempcondition]; if(typeof SearchNitroGallery.feed[tempCondition] !== 'undefined') obj = SearchNitroGallery.feed[tempCondition]; let useMake = ''; let useModel = ''; if(obj[tempmake])useMake = tempmake; if(obj[tempMake])useMake = tempMake; if(obj[useMake][tempmodel])useModel = tempmodel; if(obj[useMake][tempModel])useModel = tempModel; if(obj[useMake][useModel]['price_list']){ SearchNitroGallery.page.lowest_price = obj[useMake][useModel]['price_list']; SearchNitroGallery.page.first_image = ''; if(typeof obj[useMake][useModel]['photo_urls'] == "string"){SearchNitroGallery.page.first_image = obj[useMake][useModel]['photo_urls'].split('|')[0];} else if(Array.isArray(obj[useMake][useModel]['photo_urls'])){SearchNitroGallery.page.first_image = obj[useMake][useModel]['photo_urls'][0];} else {SearchNitroGallery.page.first_image = `https://seo-app.vinficient.com/car-images/index.php?make=${useMake}&model=${useModel}`} SearchNitroGallery.page.description = obj[useMake][useModel]['description']; SearchNitroGallery.page.features = ''; if(obj[useMake][useModel]['features']) SearchNitroGallery.page.features = obj[useMake][useModel]['features'].split('|'); SearchNitroGallery.page.vehicle_url = obj[useMake][useModel]['url']; if(obj[useMake][useModel]['vdp_url'] !== '')SearchNitroGallery.page.vehicle_url = obj[useMake][useModel]['vdp_url']; SearchNitroGallery.page.vehicle_vin = obj[useMake][useModel]['vin']; SearchNitroGallery.page.year = obj[useMake][useModel]['year']; SearchNitroGallery.page.trim = obj[useMake][useModel]['trim_code']; } load_in_stock = true; } catch (err){ console.log(err); console.log('SearchNitroGallery.feed['+tempcondition+']['+tempmake+']['+tempmodel+']["price_list"]'); load_in_stock = false; } try{ if(modelMatrix[tempmodel] == tempMake){ load_no_stock = true; } else { console.log(`modelMatrix[tempmodel] !== tempMake [${tempmodel}][${tempMake}]`); load_no_stock = false; } } catch (err){ load_no_stock = false; } if(load_in_stock) load_in_stock_template(); if(!load_in_stock && load_no_stock) load_no_stock_template(); //if(!load_in_stock && !load_no_stock) load_stock_error_template(); } function load_in_stock_template(){ set_make_model_canonical(); /* h1 = document.querySelector(SearchNitroGallery.h1.selector); h1.innerText = title; h1.style.textAlign = 'center'; */ //document.querySelector(`head title`).innerText = title_city; let template = SearchNitroGallery.template.in_stock; if(SearchNitroGallery.page.year)template = replace_all(template,'{{year}}',capitalize(SearchNitroGallery.page.year)); if(SearchNitroGallery.page.year)template = replace_all(template,'{{ Year }}',capitalize(SearchNitroGallery.page.year)); if(!SearchNitroGallery.page.year)template = replace_all(template,'{{year}}',''); if(SearchNitroGallery.page.trim)template = replace_all(template,'{{trim}}',capitalize(SearchNitroGallery.page.trim)); if(!SearchNitroGallery.page.trim)template = replace_all(template,'{{trim}}',''); template = replace_all(template,'{{model}}',capitalize(SearchNitroGallery.page.model)); template = replace_all(template,'{{make}}',capitalize(SearchNitroGallery.page.make)); template = replace_all(template,'{{ Model }}',capitalize(SearchNitroGallery.page.model)); template = replace_all(template,'{{ Make }}',capitalize(SearchNitroGallery.page.make)); template = replace_all(template,'{{lowest_price}}','$' + CurrencyFormatted(SearchNitroGallery.page.lowest_price)); template = replace_all(template,'{{first_image}}', SearchNitroGallery.page.first_image); template = replace_all(template,'{{ Vehicle Image }}', SearchNitroGallery.page.first_image); template = replace_all(template,'{{description}}', SearchNitroGallery.page.description); template = replace_all(template,'{{vehicle_url}}', SearchNitroGallery.page.vehicle_url); template = replace_all(template,'{{ VIN URL }}', SearchNitroGallery.page.vehicle_url); //template = replace_all(template,'{{ Vehicle Stock Link }}', SearchNitroGallery.page.vehicle_url); template = replace_all(template,'{{vehicle_vin}}', SearchNitroGallery.page.vehicle_vin); template = replace_all(template,'{{ VIN }}', SearchNitroGallery.page.vehicle_vin); //Feature List if(SearchNitroGallery.page.features){ let featureScan = SearchNitroGallery.page.features.join().toLowerCase(); let featureList = []; if(featureScan.includes('sunroof')) featureList.push(`Sunroof`); if(featureScan.includes('navigation')) featureList.push(`Navigation`); if(featureScan.includes('wifi')) featureList.push(`WiFi`); for(let i = 0; i < SearchNitroGallery.page.features.length; i++){ if(featureList.length < 5)featureList.push(SearchNitroGallery.page.features[i]); } let featureListMarkup = ''; for(let i = 0; i < featureList.length; i++){ featureListMarkup += `
  • ${featureList[i]}
  • `; } template = replace_all(template,'{{ Feature List }}', featureListMarkup); //Premium Feature Icons let premiumFeaturesMarkup = ''; if(featureScan.includes('sunroof')) premiumFeaturesMarkup += `
  • Sunroof
  • `; if(featureScan.includes('navigation')) premiumFeaturesMarkup += `
  • Navigation
  • `; if(featureScan.includes('wifi')) premiumFeaturesMarkup += `
  • WiFi
  • `; template = replace_all(template,`{{ Premium Feature Icons }}`, premiumFeaturesMarkup); } else { template = replace_all(template,'{{ Feature List }}', ''); } template = replace_all(template,'{{return_url}}', load_search_nitro_gallery); template = replace_all(template,'{{ Return URL }}', load_search_nitro_gallery); //recommendation_url = return_url; recommendation_url = ''; if(SearchNitroGallery.page.condition == 'used') recommendation_url = `/searchused.aspx?Make=${SearchNitroGallery.page.make}&Model=${SearchNitroGallery.page.model}`; if(SearchNitroGallery.page.condition == 'new') recommendation_url = `/searchnew.aspx?Make=${SearchNitroGallery.page.make}&Model=${SearchNitroGallery.page.model}`; recommendation_make = 'Toyota'; recommendation_model = 'Camry'; recommendation_condition = 'used'; recommendation = `If you are interested in this ${SearchNitroGallery.page.make} ${SearchNitroGallery.page.model} special, `; recommendation += `you may be interested in all the ${SearchNitroGallery.page.make} ${SearchNitroGallery.page.model} vehicles in stock. `; recommendation += `
    `; //recommendation += `${recommendation_condition} ${recommendation_make} ${recommendation_model}. »`; recommendation += `Check them out here! »`; recommendation += ``; template = replace_all(template,'{{recommended_alternative}}', recommendation); SearchNitroGallery.page.priorities = priority_features(SearchNitroGallery.page.features); build_priority_features_html(); template = replace_all(template,'{{priorities_html}}', SearchNitroGallery.page.priorities_html); container = document.querySelector(SearchNitroGallery.container.selector); container.innerHTML = template; document.querySelector('link[rel="canonical"]').href = window.location.href; if(document.querySelector('meta[name="description"]')){ document.querySelector('meta[name="description"]').content = `Get one of our best deals on a ${SearchNitroGallery.page.condition} ${SearchNitroGallery.page.make} ${SearchNitroGallery.page.model}. See our lowest priced ${SearchNitroGallery.page.condition} ${SearchNitroGallery.page.model} now at ${vinficient.name}!` ; } else { let metaDescription = document.createElement('meta'); metaDescription.name = "description"; metaDescription.content = `Get one of our best deals on a ${SearchNitroGallery.page.condition} ${SearchNitroGallery.page.make} ${SearchNitroGallery.page.model}. See our lowest priced ${SearchNitroGallery.page.condition} ${SearchNitroGallery.page.model} now at ${vinficient.name}!` ; document.querySelector('head').appendChild(metaDescription); } document.querySelector('title').textContent = `Our Lowest Priced ${SearchNitroGallery.page.condition} ${SearchNitroGallery.page.make} ${SearchNitroGallery.page.model} | ${vinficient.name}`; document.querySelector(SearchNitroGallery.container.selector).innerHTML = template; if(vinficient.dashboard.lowPrice.filter(element => element.id == 'lowest-price-header-background-url')[0]){ if(vinficient.dashboard.lowPrice.filter(element => element.id == 'lowest-price-header-background-url')[0].value !== ''){ document.querySelector(`#content-description`).style.backgroundImage = `url('${vinficient.dashboard.lowPrice.filter(element => element.id == 'lowest-price-header-background-url')[0].value}')`; } } } } async function load_no_stock_template(){ set_make_model_canonical(); /*f h1 = document.querySelector(SearchNitroGallery.h1.selector); h1.innerText = title; */ //document.querySelector(`head title`).innerText = title; let template = SearchNitroGallery.template.no_stock; template = replace_all(template,'{{model}}',capitalize(SearchNitroGallery.page.model)); template = replace_all(template,'{{make}}',capitalize(SearchNitroGallery.page.make)); template = replace_all(template,'{{condition}}',SearchNitroGallery.page.condition); template = replace_all(template,'{{stock_image}}','https://seo-app.vinficient.com/gallery/stock_image_low_res.jpg'); return_url = SearchNitroGallery.domain; return_url += window.location.pathname; template = replace_all(template,'{{return_url}}', return_url); recommendation_url = return_url; recommendation_make = 'Toyota'; recommendation_model = 'Camry'; recommendation_condition = 'used'; recommendation = `If you are interested in a ${SearchNitroGallery.page.make} ${SearchNitroGallery.page.model}, `; recommendation += `then we recommend that you take a look at this `; recommendation += `
    `; recommendation += `${recommendation_condition} ${recommendation_make} ${recommendation_model}. »`; recommendation += ``; template = replace_all(template,'{{recommended_alternative}}', recommendation); /* i = 0; while(i < SearchNitroGallery.page.priorities.length){ i++; } */ container = document.querySelector(SearchNitroGallery.container.selector); container.innerHTML = template; } async function load_stock_error_template(){ console.log("Make:Model does not exist"); //alert('Pause'); set_error_canonical(); redirect = SearchNitroGallery.domain; redirect += window.location.pathname; window.location.replace(redirect); } async function set_make_model_canonical(){ canonical = SearchNitroGallery.domain; canonical += window.location.pathname + '?'; canonical += 'condition=' + SearchNitroGallery.page.condition; canonical += '&make=' + SearchNitroGallery.page.make; canonical += '&model=' + SearchNitroGallery.page.model; console.log('Canonical = ' + canonical); } async function set_error_canonical(){ canonical = SearchNitroGallery.domain; canonical += window.location.pathname; console.log('Error Canonical = ' + canonical); } function priority_features(features){ let priorities = {}; priorities.key = []; priorities.premium = []; priorities.packages = []; priorities.accessories = []; priorities.truck = []; priorities.callouts = []; i = 0; ii = 0; if(typeof features == 'object'){ while(i < features.length){ //////////////////////////////////////////////////////// // Check for Key Callouts //////////////////////////////////////////////////////// if(features[i].toLowerCase().includes('local trade')){ priorities.callouts.push('Local trade'); } if(features[i].toLowerCase().includes('clean carfax')){ priorities.callouts.push('Clean CARFAX'); } if(features[i].toLowerCase().includes('1-owner vehicle')){ if(!priorities.callouts.includes('Verified 1-Owner.')) priorities.callouts.push('Verified 1-Owner'); } if(features[i].toLowerCase().includes('carfax one-owner')){ if(!priorities.callouts.includes('Verified 1-Owner.')) priorities.callouts.push('Verified 1-Owner'); } if(features[i].toLowerCase().includes('v6 engine')){ priorities.callouts.push('V6 Engine'); } if(features[i].toLowerCase().includes('v8 engine')){ priorities.callouts.push('V8 Engine'); } if(features[i].toLowerCase().includes('factory warranty remaining')){ priorities.callouts.push('Factory Warranty Remaining'); } //////////////////////////////////////////////////////// // Check for Key Features //////////////////////////////////////////////////////// if(features[i].toLowerCase().includes('apple carplay')){ if(!priorities.key.includes('Apple Carplay')) priorities.key.push('Apple Carplay'); } if(features[i].toLowerCase().includes('android auto')){ if(!priorities.key.includes('Android Auto')) priorities.key.push('Android Auto'); } if(features[i].toLowerCase().includes('bluetooth')){ if(!priorities.key.includes('Bluetooth')) priorities.key.push('Bluetooth'); } if(features[i].toLowerCase().includes('audio jack input')){ if(!priorities.key.includes('Aux Audio Input')) priorities.key.push('Aux Audio Input'); } if(features[i].toLowerCase().includes('usb, aux')){ if(!priorities.key.includes('Aux Audio Input')) priorities.key.push('Aux Audio Input'); } if(features[i].toLowerCase().includes('aux input')){ if(!priorities.key.includes('Aux Audio Input')) priorities.key.push('Aux Audio Input'); } if(features[i].toLowerCase().includes('leather seat')){ if(!priorities.key.includes('Leather Seats')) priorities.key.push('Leather Seats'); } if(features[i].toLowerCase().includes('leather appointed seat')){ if(!priorities.key.includes('Leather Seats')) priorities.key.push('Leather Seats'); } if(features[i].toLowerCase().includes('sunroof')){ if(!priorities.key.includes('Sunroof')) priorities.key.push('Sunroof'); } if(features[i].toLowerCase().includes('moonroof')){ if(!priorities.key.includes('Sunroof')) priorities.key.push('Sunroof'); } if(features[i].toLowerCase().includes('back-up camera')){ if(!priorities.key.includes('Back-Up Camera')) priorities.key.push('Back-Up Camera'); } if(features[i].toLowerCase().includes('backup camera')){ if(!priorities.key.includes('Back-Up Camera')) priorities.key.push('Back-Up Camera'); } if(features[i].toLowerCase().includes('rear-view camera')){ if(!priorities.key.includes('Back-Up Camera')) priorities.key.push('Back-Up Camera'); } if(features[i].toLowerCase().includes('rearview camera')){ if(!priorities.key.includes('Back-Up Camera')) priorities.key.push('Back-Up Camera'); } if(features[i].toLowerCase().includes('rear view camera')){ if(!priorities.key.includes('Back-Up Camera')) priorities.key.push('Back-Up Camera'); } if(features[i].toLowerCase().includes('parking camera')){ if(!priorities.key.includes('Back-Up Camera')) priorities.key.push('Back-Up Camera'); } if(features[i].toLowerCase().includes('bluetooth')){ if(!priorities.key.includes('Bluetooth')) priorities.key.push('Bluetooth'); } if(features[i].toLowerCase().includes('navigation system')){ if(!priorities.key.includes('Navigation')) priorities.key.push('Navigation'); } if(features[i].toLowerCase().includes('gps navigation')){ if(!priorities.key.includes('Navigation')) priorities.key.push('Navigation'); } if(features[i].toLowerCase().includes('security alarm')){ if(!priorities.key.includes('Security System')) priorities.key.push('Security System'); } if(features[i].toLowerCase().includes('security system')){ if(!priorities.key.includes('Security System')) priorities.key.push('Security System'); } if(features[i].toLowerCase().includes('speed control')){ if(!priorities.key.includes('Cruise Control')) priorities.key.push('Cruise Control'); } if(features[i].toLowerCase().includes('cruise control')){ if(!priorities.key.includes('Cruise Control')) priorities.key.push('Cruise Control'); } if(features[i].toLowerCase().includes('premium audio')){ if(!priorities.key.includes('Premium Audio System')) priorities.key.push('Premium Audio System'); } if(features[i].toLowerCase().includes('harman/kardon')){ if(!priorities.key.includes('Premium Audio System')) priorities.key.push('Premium Audio System'); } if(features[i].toLowerCase().includes('harman radio')){ if(!priorities.key.includes('Premium Audio System')) priorities.key.push('Premium Audio System'); } if(features[i].toLowerCase().includes('pioneer radio')){ if(!priorities.key.includes('Premium Audio System')) priorities.key.push('Premium Audio System'); } if(features[i].toLowerCase().includes('pioneer speakers')){ if(!priorities.key.includes('Premium Audio System')) priorities.key.push('Premium Audio System'); } if(features[i].toLowerCase().includes('siriusxm')){ if(!priorities.key.includes('Sirius XM Radio')) priorities.key.push('Sirius XM Radio'); } if(features[i].toLowerCase().includes('sirius xm')){ if(!priorities.key.includes('Sirius XM Radio')) priorities.key.push('Sirius XM Radio'); } if(features[i].toLowerCase().includes('steering wheel') && features[i].toLowerCase().includes('control')){ if(!priorities.key.includes('Steering Wheel Audio Controls')) priorities.key.push('Steering Wheel Audio Controls'); } if(features[i].toLowerCase().includes('remote start')){ if(!priorities.key.includes('Remote Vehicle Start')) priorities.key.push('Remote Vehicle Start'); } if(features[i].toLowerCase().includes('dual zone a/c')){ if(!priorities.key.includes('Multi-Zone A/C')) priorities.key.push('Multi-Zone A/C'); } if(features[i].toLowerCase().includes('dual-zone a/c')){ if(!priorities.key.includes('Multi-Zone A/C')) priorities.key.push('Multi-Zone A/C'); } if(features[i].toLowerCase().includes('dual zone temperature control')){ if(!priorities.key.includes('Multi-Zone A/C')) priorities.key.push('Multi-Zone A/C'); } if(features[i].toLowerCase().includes('dual-zone temperature control')){ if(!priorities.key.includes('Multi-Zone A/C')) priorities.key.push('Multi-Zone A/C'); } if(features[i].toLowerCase().includes('dual zone automatic temperature control')){ if(!priorities.key.includes('Multi-Zone A/C')) priorities.key.push('Multi-Zone A/C'); } if(features[i].toLowerCase().includes('dual-zone automatic temperature control')){ if(!priorities.key.includes('Multi-Zone A/C')) priorities.key.push('Multi-Zone A/C'); } if(features[i].toLowerCase().includes('3-zone automatic temperature control')){ if(!priorities.key.includes('Multi-Zone A/C')) priorities.key.push('Multi-Zone A/C'); } if(features[i].toLowerCase().includes('3-zone temperature control')){ if(!priorities.key.includes('Multi-Zone A/C')) priorities.key.push('Multi-Zone A/C'); } ///////////////////////////////////////// // Check for Premium Features ///////////////////////////////////////// if(features[i].toLowerCase().includes('nissanconnect')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('uconnect')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('hd radio')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('fog lights')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('fog lamps')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('rain sens')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('heated washer nozzles')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('de-icer')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('removable sunroof')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('parking sensors')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('blind spot')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('keyless')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('motion activated')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('power liftgate')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('motion liftgate')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('programmable') && features[i].toLowerCase().includes('liftgate')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('universal home remote')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('universal garage door')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('power outlet')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('dual') && features[i].toLowerCase().includes('exhaust')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('heated') && features[i].toLowerCase().includes('mirror')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('traction control')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } if(features[i].toLowerCase().includes('hill descent control')){ if(!priorities.premium.includes(features[i])) priorities.premium.push(features[i]); } //////////////////////////////////////////////////////// // Check for Truck Features //////////////////////////////////////////////////////// if(features[i].toLowerCase().includes('receiver hitch')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('receiving hitch')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('trailer')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('off road suspension')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('off-road suspension')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('tonneau cover')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('tow')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('alternator')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('block heater')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('dual rear wheels')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('clearance lights')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('clearance lamps')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('engine cooling')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('exhaust brake')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('hooks')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('belt starter')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('anti-spin differential')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('heavy duty shock')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('heavy-duty shock')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('hd shock')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('underseat compartment')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('rambox')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('box light')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('spray') && features[i].toLowerCase().includes('liner')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('hd suspension')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('heavy-duty suspension')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('heavy duty suspension')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('wiring harness')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('oil cooler')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('step bumper')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } if(features[i].toLowerCase().includes('bedliner')){ if(!priorities.truck.includes(features[i])) priorities.truck.push(features[i]); } //////////////////////////////////////////////////////// // Check Accessories //////////////////////////////////////////////////////// if(features[i].toLowerCase().includes('weather') && features[i].toLowerCase().includes('mat')){ if(!priorities.accessories.includes(features[i])) priorities.accessories.push(features[i]); } if(features[i].toLowerCase().includes('rubber') && features[i].toLowerCase().includes('mat')){ if(!priorities.accessories.includes(features[i])) priorities.accessories.push(features[i]); } if(features[i].toLowerCase().includes('cargo cover')){ if(!priorities.accessories.includes(features[i])) priorities.accessories.push(features[i]); } if(features[i].toLowerCase().includes('cargo net')){ if(!priorities.accessories.includes(features[i])) priorities.accessories.push(features[i]); } if(features[i].toLowerCase().includes('cargo mat')){ if(!priorities.accessories.includes(features[i])) priorities.accessories.push(features[i]); } if(features[i].toLowerCase().includes('cargo tray')){ if(!priorities.accessories.includes(features[i])) priorities.accessories.push(features[i]); } if(features[i].toLowerCase().includes('roof') && features[i].toLowerCase().includes('rack') ){ if(!priorities.accessories.includes(features[i])) priorities.accessories.push(features[i]); } if(features[i].toLowerCase().includes('roof') && features[i].toLowerCase().includes('rail') ){ if(!priorities.accessories.includes(features[i])) priorities.accessories.push(features[i]); } if(features[i].toLowerCase().includes('guards') && features[i].toLowerCase().includes('mud') ){ if(!priorities.accessories.includes(features[i])) priorities.accessories.push(features[i]); } if(features[i].toLowerCase().includes('guards') && features[i].toLowerCase().includes('splash') ){ if(!priorities.accessories.includes(features[i])) priorities.accessories.push(features[i]); } if(features[i].toLowerCase().includes('spoiler')){ if(!priorities.accessories.includes(features[i])) priorities.accessories.push(features[i]); } //////////////////////////////////////////////////////// // Check Feature for Package //////////////////////////////////////////////////////// if(features[i].toLowerCase().includes('package')){ if(!priorities.packages.includes(features[i])) priorities.packages.push(features[i]); } if(features[i].toLowerCase().includes('group')){ if(!priorities.packages.includes(features[i])) priorities.packages.push(features[i]); } if(features[i].toLowerCase().includes('edition')){ if(!priorities.packages.includes(features[i])) priorities.packages.push(features[i]); } //////////////////////////////////////////////////////// // Increment Feature //////////////////////////////////////////////////////// i++; } } return priorities; } function build_priority_features_html(){ SearchNitroGallery.page.priorities_html = ''; ii = 0; if(SearchNitroGallery.page.priorities.callouts.length !== 0){ if(SearchNitroGallery.page.priorities_html !== '') SearchNitroGallery.page.priorities_html += '

    '; i = 0; SearchNitroGallery.page.priorities_html += ''; while(i < SearchNitroGallery.page.priorities.callouts.length){ SearchNitroGallery.page.priorities_html += SearchNitroGallery.page.priorities.callouts[i] + '! '; i++; } SearchNitroGallery.page.priorities_html += '
    '; } if(SearchNitroGallery.page.priorities.key.length !== 0 && ii < 10){ //if(SearchNitroGallery.page.priorities_html !== '') SearchNitroGallery.page.priorities_html += '

    '; SearchNitroGallery.page.priorities_html += 'Key Features:'; } if(SearchNitroGallery.page.priorities.premium.length !== 0 && ii < 10){ //if(SearchNitroGallery.page.priorities_html !== '') SearchNitroGallery.page.priorities_html += '

    '; SearchNitroGallery.page.priorities_html += 'Premium Features:'; } if(SearchNitroGallery.page.priorities.packages.length !== 0 && ii < 10){ //if(SearchNitroGallery.page.priorities_html !== '') SearchNitroGallery.page.priorities_html += '

    '; SearchNitroGallery.page.priorities_html += 'Packages:'; } if(SearchNitroGallery.page.priorities.accessories.length !== 0 && ii < 10){ //if(SearchNitroGallery.page.priorities_html !== '') SearchNitroGallery.page.priorities_html += '

    '; SearchNitroGallery.page.priorities_html += 'Accessories:'; } if(SearchNitroGallery.page.priorities.truck.length !== 0 && ii < 10){ //if(SearchNitroGallery.page.priorities_html !== '') SearchNitroGallery.page.priorities_html += '

    '; SearchNitroGallery.page.priorities_html += 'Truck Features:'; } }