Open Mobile Menu
Open Search
'; } $('.comparePop__grid').html(newHTML); $('.filter__link').on('click', function(e) { e.preventDefault(); var thisThing = $(this); if (thisThing.hasClass('is-selected')) { var compareString = localStorage.getItem("compareString"); var model = thisThing.attr('compare'); var itemArray = localStorage.getItem("compareString").split(', '); let newarr = itemArray.filter(a => a !== model); var newString = newarr.join(', '); localStorage.setItem("compareString", newString); thisThing.removeClass('is-selected'); } else { var model = $(this).attr('compare'); if (localStorage.getItem("compareString")) { var compareString = localStorage.getItem("compareString"); var appendString = ', ' + model; compareString += appendString; localStorage.setItem("compareString", compareString); } else { var compareString = ''; var appendString = model; compareString += appendString; localStorage.setItem("compareString", compareString); } thisThing.addClass('is-selected'); } respondToStorage(); }); $('.link__close').on('click', function(e) { e.preventDefault(); var thisThing = $(this).parent().find('.filter__link'); var compareString = localStorage.getItem("compareString"); var model = thisThing.attr('compare'); var itemArray = localStorage.getItem("compareString").split(', '); let newarr = itemArray.filter(a => a !== model); var newString = newarr.join(', '); localStorage.setItem("compareString", newString); $(this).parent().fadeOut(); respondToStorage(); if (localStorage.getItem("compareString") == '') { $('.comparePop').slideUp(); } }); } }); })(jQuery);
Search by zip code to find dealers close to home.
View Dealers by State or Province
' + '
' + dataJson[i].Address.Address1 + '
' + '
' + dataJson[i].Address.City + ', ' + dataJson[i].Address.State + ' ' + dataJson[i].Address.PostalCode + '
'; const singleInfoWindow = new google.maps.InfoWindow({ content: contentString, maxWidth: 200 }); infoWindowLibrary.push(singleInfoWindow); singleMark.addListener('mouseover', function() { singleInfoWindow.open(singleMark.get('map'), singleMark); }); singleMark.addListener('mouseout', function() { singleInfoWindow.close(); }); const indexedCount = i + 1; var $parentDiv = $('.dealerLeft'); google.maps.event.addListener(singleMark, 'click', function() { var targetResult = $('.result' + indexedCount); console.log(indexedCount); console.log('.result' + indexedCount); console.log($('.result' + indexedCount)); $('.single__result').removeClass('mapClicked'); targetResult.addClass('mapClicked'); $parentDiv.scrollTop(targetResult.position().top + 288); }); } }; console.log($('.zip-search input').attr('value')); if ($('.zip-search input').attr('value')) { var newPos = { lat: dataJson[0].Latitude, lng: dataJson[0].Longitude }; map.setCenter(newPos); map.setZoom(6); } }; if (dataString != '') { renderNearestAPI(150); } brandLibrary = [{ 'name': 'Any Brands', 'code': '' }, { 'name': 'Big Country', 'code': 'BC' }, { 'name': 'Bighorn', 'code': 'BH' }, { 'name': 'Bighorn Traveler', 'code': 'BHTR' }, { 'name': 'Corterra', 'code': 'CT' }, { 'name': 'Cyclone', 'code': 'CYC' }, { 'name': 'Elkridge', 'code': 'ER' }, // { // 'name': 'Elkridge Xtreme Light', // 'code': 'EREX' // }, { 'name': 'Fuel', 'code': 'FUEL' }, { 'name': 'Fuel Travel Trailer', 'code': 'FUELTT' }, // { // 'name': 'Gateway', // 'code': 'GW' // }, { 'name': 'Gravity', 'code': 'GR' }, { 'name': 'Heartland', 'code': 'HRV' }, { 'name': 'Landmark 365', 'code': 'LM365' }, { 'name': 'Lithium', 'code': 'LI' }, { 'name': 'Mallard', 'code': 'MA' }, { 'name': 'Milestone', 'code': 'MI' }, { 'name': 'Milestone M-One', 'code': 'MM1' }, { 'name': 'North Trail', 'code': 'NT' }, { 'name': 'Eddie Bauer', 'code': 'CWES' }, { 'name': 'Pioneer', 'code': 'PI' }, // { // 'name': 'Pioneer Fifth Wheel', // 'code': 'PIFW' // }, { 'name': 'Prowler', 'code': 'PR' }, // { // 'name': 'Prowler Fifth Wheel', // 'code': 'PRFW' // }, { 'name': 'Road Warrior', 'code': 'RW' }, { 'name': 'Sundance', 'code': 'IDSDXLTTT' }, { 'name': 'Torque', 'code': 'TQ' }, { 'name': 'Torque Travel Trailer', 'code': 'TQTT' }, { 'name': 'Trail Runner', 'code': 'TR' }, { 'name': 'Wilderness', 'code': 'WD' } ] var brandAutoSelect = ''; var resultBrand = brandLibrary.filter(obj => { return obj.code === brandAutoSelect }) $('.radius select').find('option').each(function() { if ($(this).val() == 25) { $('.radius select').val(25); } }) $(".department select").find('option').each(function() { var thisThing = $(this); var thisText = $(this).text().trim(); console.log(thisText + ' vs ' + resultBrand[0].name); if (thisText == resultBrand[0].name) { $(".department select").val(thisThing.attr('value').trim()); } }); if (brandAutoSelect != '') { $('.result_select').each(function() { var thisDrop = $(this); $(this).find('option').each(function() { var thisThing = $(this); var thisVal = $(this).attr('value'); var valArray = thisVal.split(','); var score = 0; for (j = 0; j < valArray.length; j++) { if (brandAutoSelect == valArray[j]) { score++; } } if (score > 0) { thisDrop.val(thisVal); var _href = thisDrop.closest('.single__result').find('.result_contact').attr('href'); thisDrop.closest('.single__result').find('.result_contact').attr('href', _href + '&brand_name=' + thisVal); } }); }); } if ($('.result1').find('.result_name').text() == 'Default - HRV') { $('.result1').html( 'No dealers found near this location that carry this brand. Please try a different location or brand.'); } $('.result_select').on('change', function() { var thisDrop = $(this); var thisVal = $(this).val(); var _href = thisDrop.closest('.single__result').find('.result_contact').attr('href'); thisDrop.closest('.single__result').find('.result_contact').attr('href', _href + '&brand_name=' + thisVal); }) $('.result_contact').on('click', function(e) { e.preventDefault(); var dealerCode = $(this).attr('dealercode'); localStorage.setItem('dealerid', dealerCode); var brandPass = $(this).parent().parent().find('option:selected').text().trim(); localStorage.setItem('brandPass', brandPass); console.log(brandPass); setTimeout(function() { window.location.href = $('.result_contact').attr('href'); }, 50); //window.location.href = $('.result_contact').attr('href'); }); });})(jQuery);let map;function initMap() { map = new google.maps.Map(document.getElementById("map"), { center: { lat: 39.8283, lng: -98.5795 }, zoom: 3, });}