VETERAN OWNED & OPERATED

You choose the car. We handle the dealership.

Founded by a Marine veteran with 20+ years running dealership sales. We help military families and our neighbors buy with confidence, at no cost to you and at your pace.

Field ops soon? We'll work around your timeline.

We Got Your 6

Vehicle sales provided through CARSTER, a licensed California dealer. Privacy Policy | Terms

Privacy PolicyEffective date: October 8, 2026Foxtrot Motors ("we," "us") respects your privacy. This policy explains what information we collect through this website and how we use it.Information we collect
When you submit our request form, we collect your name, email address, phone number, vehicle of interest, and any details you choose to share in your message.
How we use it
We use your information only to respond to your request and help you find and purchase a vehicle. To complete a purchase, we share your information with CARSTER, the licensed California dealer through which vehicle sales are provided, and with lenders only if you request financing.
What we don't do
We do not sell your personal information. We do not share your phone number or text messaging consent with third parties for their marketing purposes.
Text messages
If you agree to be contacted by text, message frequency varies based on your request. Message and data rates may apply. Reply STOP to opt out at any time, or HELP for help.
How long we keep it
We keep your information only as long as needed to assist you and meet legal or recordkeeping requirements.
Your choices
You can ask us to access, correct, or delete your information at any time by emailing [email protected].
Changes
We may update this policy from time to time. The effective date above shows when it was last updated.
Contact
Foxtrot Motors
[email protected]

Terms of UseEffective date: October 8, 2026By using this website, you agree to these terms.Our service
Focxtrot Motors helps customers find, negotiate, and purchase vehicles. Submitting a request does not create a contract or obligate you to buy anything.
Vehicle sales
All vehicle sales are provided through CARSTER, a licensed California dealer. The final terms of any purchase, lease, or financing are set out only in the signed sales documents.
No guarantees
We work to find the right vehicle at a fair price, but we cannot guarantee availability, pricing, trade-in values, or financing approval. Any information shared before signing is an estimate and subject to change.
Not legal or financial advice
Information on this website and in our communications is for general guidance only and is not legal, tax, or financial advice.
Fees
Our fee is paid by the dealership. There is no separate charge to you for our service.
Limitation of liability
To the fullest extent allowed by law, we are not liable for indirect or consequential damages arising from use of this website or our services.
Changes
We may update these terms from time to time. The effective date above shows when they were last updated.
Contact
Foxtrot Motors
[email protected]

window.FX_RATES="Alameda;Alameda=10.75,Albany=10.75,Berkeley=10.25,Dublin=10.25,Emeryville=10.5,Fremont=10.25,Hayward=10.75,Livermore=10.25,Newark=10.75,Oakland=10.75,Piedmont=10.25,Pleasanton=10.25,San Leandro=10.75,Union City=10.75,*=10.25\nAlpine;*=7.25\nAmador;Amador City=8,Ione=7.75,Jackson=7.75,Plymouth=7.75,Sutter Creek=8.75,*=7.75\nButte;Biggs=8.25,Chico=9.25,Gridley=8.25,Oroville=9.25,Paradise=8.75,*=8.25\nCalaveras;Angels Camp=8.75,*=8.25\nColusa;Colusa=8.75,Williams=8.25,*=7.75\nContra Costa;Antioch=9.75,Brentwood=8.75,Clayton=8.75,Concord=9.75,Danville=8.75,El Cerrito=10.25,Hercules=9.25,Lafayette=9.25,Martinez=9.75,Moraga=9.75,Oakley=8.75,Orinda=9.75,Pinole=10.25,Pittsburg=9.25,Pleasant Hill=9.25,Richmond=9.75,San Pablo=9.5,San Ramon=9.75,Walnut Creek=9.25,*=8.75\nDel Norte;Crescent City=8.25,*=8.25\nEl Dorado;Placerville=8.25,South Lake Tahoe=8.75,*=7.25\nFresno;Clovis=8.975,Coalinga=8.975,Firebaugh=7.975,Fowler=8.975,Fresno=8.35,Huron=8.975,Kerman=8.975,Kingsburg=8.975,Mendota=9.225,Orange Cove=7.975,Parlier=8.975,Reedley=9.225,San Joaquin=7.975,Sanger=8.725,Selma=8.475,*=7.975\nGlenn;Orland=8.25,Willows=8.75,*=7.25\nHumboldt;Arcata=10.25,Blue Lake=9.75,Eureka=10.25,Ferndale=9.5,Fortuna=9.5,Rio Dell=9.5,Trinidad=9.5,*=8.75\nImperial;Brawley=8.75,Calexico=8.25,Calipatria=7.75,El Centro=8.25,Holtville=7.75,Imperial=7.75,Westmorland=7.75,*=7.75\nInyo;Bishop=8.75,*=7.75\nKern;Arvin=8.25,Bakersfield=8.25,California City=8.25,Delano=8.25,Maricopa=8.25,McFarland=9.25,Ridgecrest=9.25,Shafter=7.25,Taft=8.25,Tehachapi=8.25,Wasco=8.25,*=8.25\nKings;Avenal=8.25,Corcoran=8.25,Hanford=8.25,Lemoore=8.25,*=7.25\nLake;Clearlake=8.75,Lakeport=8.75,*=7.25\nLassen;Susanville=8.25,*=7.25\nLos Angeles;Agoura Hills=10.25,Alhambra=11,Arcadia=11,Artesia=11,Avalon=10.75,Azusa=11.25,Baldwin Park=11,Bell=10.25,Bell Gardens=11.25,Bellflower=11,Beverly Hills=10.25,Bradbury=10.25,Burbank=11,Calabasas=11.25,Carson=11,Cerritos=10.25,Claremont=10.25,Commerce=11.25,Compton=11.25,Covina=11.25,Cudahy=11,Culver City=11.25,Diamond Bar=10.25,Downey=11,Duarte=11,El Monte=11,El Segundo=10.75,Gardena=11.25,Glendale=11,Glendora=11.25,Hawaiian Gardens=11,Hawthorne=11,Hermosa Beach=10.25,Hidden Hills=10.25,Huntington Park=11,Industry=10.25,Inglewood=10.75,Irwindale=11.25,La Ca\u00f1ada Flintridge=11,La Habra Heights=10.25,La Mirada=10.25,La Puente=10.75,La Verne=11,Lakewood=11,Lancaster=11.75,Lawndale=11,Lomita=11,Long Beach=11,Los Angeles=10.25,Lynwood=11.25,Malibu=10.75,Manhattan Beach=10.75,Maywood=10.25,Monrovia=11,Montebello=11,Monterey Park=11,Norwalk=11,Palmdale=11.75,Palos Verdes Estates=10.25,Paramount=11,Pasadena=11,Pico Rivera=11.25,Pomona=11,Rancho Palos Verdes=10.25,Redondo Beach=10.25,Rolling Hills=10.25,Rolling Hills Estates=10.25,Rosemead=10.25,San Dimas=10.25,San Fernando=11,San Gabriel=11,San Marino=11.25,Santa Clarita=10.25,Santa Fe Springs=11.5,Santa Monica=11.25,Sierra Madre=11,Signal Hill=11,South El Monte=11.25,South Gate=11.25,South Pasadena=11,Temple City=11,Torrance=10.75,Vernon=11,Walnut=10.25,West Covina=10.25,West Hollywood=11,Westlake Village=10.25,Whittier=11,*=10.25\nMadera;Chowchilla=8.75,Madera=8.25,*=7.75\nMarin;Belvedere=8.25,Corte Madera=9,Fairfax=9,Larkspur=9.25,Mill Valley=9.25,Novato=9.25,Ross=8.25,San Anselmo=9.25,San Rafael=9.25,Sausalito=9.25,Tiburon=8.25,*=8.25\nMariposa;*=8.25\nMendocino;Fort Bragg=9.25,Point Arena=9.25,Ukiah=8.875,Willits=9.125,*=7.875\nMerced;Atwater=8.75,Dos Palos=8.25,Gustine=8.25,Livingston=8.75,Los Banos=8.75,Merced=8.25,*=7.75\nModoc;Alturas=7.25,*=7.25\nMono;Mammoth Lakes=7.75,*=7.25\nMonterey;Carmel-by-the-Sea=9.25,Del Rey Oaks=9.25,Gonzales=8.75,Greenfield=9.5,King City=8.75,Marina=9.25,Monterey=9.25,Pacific Grove=9.25,Salinas=9.25,Sand City=9.25,Seaside=9.25,Soledad=9.25,*=8.75\nNapa;American Canyon=7.75,Calistoga=7.75,Napa=8.75,St. Helena=8.25,Yountville=7.75,*=7.75\nNevada;Grass Valley=8.875,Nevada City=8.875,Truckee=9,*=7.5\nOrange;Aliso Viejo=7.75,Anaheim=7.75,Brea=7.75,Buena Park=8.75,Costa Mesa=7.75,Cypress=7.75,Dana Point=7.75,Fountain Valley=8.75,Fullerton=7.75,Garden Grove=8.75,Huntington Beach=7.75,Irvine=7.75,La Habra=8.75,La Palma=8.75,Laguna Beach=7.75,Laguna Hills=7.75,Laguna Niguel=7.75,Laguna Woods=7.75,Lake Forest=7.75,Los Alamitos=9.25,Mission Viejo=7.75,Newport Beach=7.75,Orange=7.75,Placentia=8.75,Rancho Santa Margarita=7.75,San Clemente=7.75,San Juan Capistrano=7.75,Santa Ana=9.25,Seal Beach=9.25,Stanton=8.75,Tustin=7.75,Villa Park=7.75,Westminster=9.25,Yorba Linda=7.75,*=7.75\nPlacer;Auburn=7.25,Colfax=7.25,Lincoln=7.25,Loomis=7.5,Rocklin=7.25,Roseville=7.75,*=7.25\nPlumas;Portola=7.25,*=7.25\nRiverside;Banning=7.75,Beaumont=7.75,Blythe=8.75,Calimesa=7.75,Canyon Lake=7.75,Cathedral City=9.25,Coachella=8.75,Corona=8.75,Desert Hot Springs=8.75,Eastvale=7.75,Hemet=8.75,Indian Wells=7.75,Indio=8.75,Jurupa Valley=7.75,La Quinta=8.75,Lake Elsinore=8.75,Menifee=8.75,Moreno Valley=8.75,Murrieta=8.75,Norco=8.75,Palm Desert=8.75,Palm Springs=9.25,Perris=8.75,Rancho Mirage=7.75,Riverside=8.75,San Jacinto=8.75,Temecula=8.75,Wildomar=8.75,*=7.75\nSacramento;Citrus Heights=7.75,Elk Grove=8.75,Folsom=7.75,Galt=9.25,Isleton=8.75,Rancho Cordova=8.75,Sacramento=8.75,*=7.75\nSan Benito;Hollister=9.25,San Juan Bautista=9,*=8.25\nSan Bernardino;Adelanto=7.75,Apple Valley=8.75,Barstow=8.75,Big Bear Lake=7.75,Chino=8.75,Chino Hills=7.75,Colton=8.75,Fontana=8.75,Grand Terrace=7.75,Hesperia=7.75,Highland=7.75,Loma Linda=7.75,Montclair=9,Needles=7.75,Ontario=8.75,Rancho Cucamonga=7.75,Redlands=8.75,Rialto=7.75,San Bernardino=8.75,Twentynine Palms=7.75,Upland=7.75,Victorville=8.75,Yucaipa=8.75,Yucca Valley=8.75,*=7.75\nSan Diego;Carlsbad=7.75,Chula Vista=8.75,Coronado=7.75,Del Mar=8.75,El Cajon=8.25,Encinitas=7.75,Escondido=8.75,Imperial Beach=8.75,La Mesa=8.5,Lemon Grove=8.75,National City=8.75,Oceanside=8.25,Poway=7.75,San Diego=7.75,San Marcos=8.75,Santee=7.75,Solana Beach=8.75,Vista=8.25,*=7.75\nSan Francisco;San Francisco=8.625\nSan Joaquin;Escalon=8.75,Lathrop=8.75,Lodi=8.25,Manteca=9,Mountain House=7.75,Ripon=7.75,Stockton=9,Tracy=8.25,*=7.75\nSan Luis Obispo;Arroyo Grande=8.75,Atascadero=8.75,Grover Beach=8.75,Morro Bay=8.75,Paso Robles=8.75,Pismo Beach=8.25,San Luis Obispo=8.75,*=7.25\nSan Mateo;Atherton=9.375,Belmont=9.875,Brisbane=9.875,Burlingame=9.625,Colma=9.875,Daly City=9.875,East Palo Alto=9.875,Foster City=9.375,Half Moon Bay=9.875,Hillsborough=9.375,Menlo Park=9.375,Millbrae=9.375,Pacifica=9.875,Portola Valley=9.375,Redwood City=9.875,San Bruno=9.875,San Carlos=9.375,San Mateo=9.625,South San Francisco=9.875,Woodside=9.375,*=9.375\nSanta Barbara;Buellton=7.75,Carpinteria=9,Goleta=8.75,Guadalupe=8.75,Lompoc=8.75,Santa Barbara=9.25,Santa Maria=8.75,Solvang=8.75,*=7.75\nSanta Clara;Campbell=10.5,Cupertino=9.75,Gilroy=9.75,Los Altos=9.75,Los Altos Hills=9.75,Los Gatos=9.875,Milpitas=10,Monte Sereno=9.75,Morgan Hill=9.75,Mountain View=9.75,Palo Alto=9.75,San Jose=10,Santa Clara=9.75,Saratoga=9.75,Sunnyvale=9.75,*=9.75\nSanta Cruz;Capitola=9.25,Santa Cruz=9.75,Scotts Valley=9.75,Watsonville=9.75,*=9.5\nShasta;Anderson=7.75,Redding=7.25,Shasta Lake=7.25,*=7.25\nSierra;Loyalton=7.25,*=7.25\nSiskiyou;Dorris=7.25,Dunsmuir=8.25,Etna=7.25,Fort Jones=7.25,Montague=7.25,Mount Shasta=7.5,Tulelake=7.25,Weed=7.5,Yreka=8.75,*=7.25\nSolano;Benicia=9.625,Dixon=8.375,Fairfield=8.375,Rio Vista=9.125,Suisun City=9.125,Vacaville=8.125,Vallejo=9.25,*=7.375\nSonoma;Cloverdale=10,Cotati=10.25,Healdsburg=9.75,Petaluma=10.25,Rohnert Park=9.75,Santa Rosa=10,Sebastopol=10.5,Sonoma=10.25,Windsor=9.25,*=9.25\nStanislaus;Ceres=8.375,Hughson=7.875,Modesto=8.875,Newman=7.875,Oakdale=8.375,Patterson=7.875,Riverbank=7.875,Turlock=8.625,Waterford=7.875,*=7.875\nSutter;Live Oak=7.25,Yuba City=7.25,*=7.25\nTehama;Corning=7.75,Red Bluff=8.5,Tehama=7.25,*=7.25\nTrinity;*=7.25\nTulare;Dinuba=8.5,Exeter=8.75,Farmersville=8.75,Lindsay=8.75,Porterville=9.25,Tulare=8.25,Visalia=8.5,Woodlake=8.75,*=7.75\nTuolumne;Sonora=8.75,*=7.25\nVentura;Camarillo=7.25,Fillmore=7.25,Moorpark=7.25,Ojai=7.25,Oxnard=9.25,Port Hueneme=8.75,Santa Paula=9.25,Simi Valley=7.25,Thousand Oaks=7.25,Ventura=7.75,*=7.25\nYolo;Davis=9.25,West Sacramento=9.25,Winters=8.25,Woodland=8,*=7.25\nYuba;Marysville=8.25,Wheatland=7.75,*=8.25";

The car

$
$

Your trade and down payment

$
$
$

Where you'll register it

Financing

Credit (example rates)
%
Estimated payment
$0

What's included

(function(){ function boot(){ var root=document.getElementById('fxpc'); if(!root||root.__fx||!window.FX_RATES) return; root.__fx=true; var q=function(s){return root.querySelector(s)}; var RATES=window.FX_RATES; var DMV={2026:{reg:76,chp:34,title:28,tif:[[5000,33],[25000,66],[35000,132],[60000,198],[1e15,231]]}, 2027:{reg:79,chp:35,title:29,tif:[[5000,35],[25000,69],[35000,138],[60000,208],[1e15,242]]}}; var FEES={doc:85,efile:35,tires:4,tireFee:1.75,county:30,smogAbate:20,transfer:15,smogTransfer:8}; var sel=q('#fx-city'), map={}; RATES.split('\n').forEach(function(line){ var parts=line.split(';'), county=parts[0]; var g=document.createElement('optgroup'); g.label=county+' County'; parts[1].split(',').forEach(function(p){ var kv=p.split('='), name=kv[0]==='*'?'Unincorporated '+county+' County':kv[0], key=county+'|'+name; map[key]={name:name,county:county,rate:parseFloat(kv[1])}; var o=document.createElement('option'); o.value=key; o.textContent=name+' ('+parseFloat(kv[1]).toFixed(2)+'%)'; g.appendChild(o); }); sel.appendChild(g); }); sel.value='Riverside|Temecula'; function num(id){var v=parseFloat(q('#'+id).value);return isFinite(v)?v:0} function pick(n){var r=root.querySelector('input[name='+n+']:checked');return r?r.value:''} function money(v,c){if(c===undefined)c=true;return (0>v?'-$':'$')+Math.abs(v).toLocaleString('en-US',{minimumFractionDigits:c?2:0,maximumFractionDigits:c?2:0})} function r2(v){return Math.round(v*100)/100} function pmt(P,apr,n){var r=apr/1200;return r===0?P/n:P*r/(1-Math.pow(1+r,-n))} function render(){ var mode=pick('fx-mode'), cond=pick('fx-cond'), fuel=pick('fx-fuel'); var c=map[sel.value], rate=c.rate/100; var year=new Date().getFullYear()>=2027?2027:2026, S=DMV[year]; var price=num('fx-price'), rebate=num('fx-rebate'), equity=num('fx-trade')-num('fx-payoff'), down=num('fx-down'); var gl=[]; if(cond==='new'){ var tif=S.tif.filter(function(t){return t[0]>price})[0][1]; gl.push(['Registration and CHP',S.reg+S.chp],['Vehicle license fee',Math.round(price*0.0065)],['Transportation fee',tif],['County fees (est.)',FEES.county],['Title',S.title]); if(fuel==='gas') gl.push(['Smog abatement',FEES.smogAbate]); } else { gl.push(['Title transfer',FEES.transfer]); if(fuel==='gas') gl.push(['Smog transfer',FEES.smogTransfer]); } var gov=gl.reduce(function(a,l){return a+l[1]},0); var taxable=price+FEES.doc, tax=r2(taxable*rate), dealer=r2(FEES.doc+FEES.efile+FEES.tires*FEES.tireFee); var otd=r2(price+tax+gov+dealer-rebate-equity); var rows=[['Vehicle price',price],['Sales tax ('+c.rate.toFixed(2)+'%)',tax],['DMV fees',gov,gl],['Dealer doc and filing fees',dealer]]; if(rebate) rows.push(['Rebates',-rebate]); if(equity) rows.push([equity>0?'Trade equity':'Owed beyond trade value',-equity]); rows.push(['Out-the-door total',otd,null,'tot']); root.querySelectorAll('[data-fx-finance]').forEach(function(el){el.hidden=(mode!=='finance')}); if(mode==='finance'){ var apr=num('fx-apr'), term=parseInt(q('#fx-term').value,10), fin=r2(otd-down), p=r2(pmt(fin,apr,term)); if(down) rows.push(['Cash down',-down]); rows.push(['Amount financed',fin,null,'tot']); q('#fx-k').textContent='Estimated payment'; q('#fx-big').innerHTML=money(p)+'\u003csmall> /mo\u003c/small>'; q('#fx-meta').textContent=term+' months at '+apr.toFixed(2)+'% APR, registered in '+c.name; } else { q('#fx-k').textContent='Estimated out the door'; q('#fx-big').textContent=money(otd); q('#fx-meta').textContent='Registered in '+c.name; } q('#fx-ledger').innerHTML=rows.map(function(r){ var h='\u003ctr class="'+(r[3]==='tot'?'fx-tot ':'')+(0>r[1]?'fx-neg':'')+'">\u003ctd>'+r[0]+'\u003c/td>\u003ctd>'+money(r[1])+'\u003c/td>\u003c/tr>'; if(r[2]) h+=r[2].map(function(s){return '\u003ctr class="fx-sub">\u003ctd>'+s[0]+'\u003c/td>\u003ctd>'+money(s[1])+'\u003c/td>\u003c/tr>'}).join(''); return h; }).join(''); } root.addEventListener('change',function(e){ if(e.target.name==='fx-credit'){ q('#fx-apr').value=e.target.value; } render(); }); root.addEventListener('input',function(e){ if(e.target.id==='fx-apr'){ root.querySelectorAll('input[name=fx-credit]').forEach(function(r){r.checked=(r.value===e.target.value)}); } render(); }); render(); root.querySelector('.fx-cta').addEventListener('click',function(e){ e.preventDefault(); e.stopPropagation(); var t=document.getElementById('contact'), sec=root.closest('section')||document; if(!t){ var f=sec.querySelectorAll('form'); t=f.length?f[0]:null; } if(t){ try{t.scrollIntoView({behavior:'smooth',block:'start'});}catch(x){} setTimeout(function(){ if(Math.abs(t.getBoundingClientRect().top)>60) t.scrollIntoView(); },800); } }); } boot(); document.addEventListener('DOMContentLoaded',boot); window.addEventListener('load',boot); })();
(function(){ var touched=false; var CREDIT={excellent:'6.49',good:'8.49',fair:'11.99',rebuilding:'16.99'}; function root(){return document.getElementById('fxpc');} function byPh(ph){ ph=ph.toLowerCase(); var els=document.querySelectorAll('input,textarea'); for(var i=0;els.length>i;i++){ if((els[i].getAttribute('placeholder')||'').trim().toLowerCase()===ph) return els[i]; } return null; } function txt(r,s){var e=r.querySelector(s);return e?e.textContent.replace(/\s+/g,' ').trim():'';} function fire(el,type){el.dispatchEvent(new Event(type,{bubbles:true}));} function val(r,s){var e=r.querySelector(s);var v=e?parseFloat(e.value):0;return isFinite(v)?v:0;} function money(v){return (0>v?'-$':'$')+Math.abs(v).toLocaleString('en-US',{minimumFractionDigits:2,maximumFractionDigits:2});} function picked(r,n){var x=r.querySelector('input[name='+n+']:checked');return x?x.parentNode.textContent.trim():'';} function summary(){ var r=root(); if(!r) return []; var L=[picked(r,'fx-mode')+', '+picked(r,'fx-cond')+', '+picked(r,'fx-fuel'), txt(r,'#fx-k')+': '+txt(r,'#fx-big'), txt(r,'#fx-meta')]; var tv=val(r,'#fx-trade'), po=val(r,'#fx-payoff'), tradeDone=false; function tradeLines(){ if(tradeDone||!(tv||po)) return; tradeDone=true; L.push('Trade value: '+money(tv)); L.push('Trade payoff: '+money(po)); } var rows=r.querySelectorAll('#fx-ledger tr'); for(var i=0;rows.length>i;i++){ if(rows[i].className.indexOf('fx-sub')>-1) continue; var td=rows[i].querySelectorAll('td'); if(td.length!==2) continue; var lab=td[0].textContent; if(lab==='Trade equity'||lab==='Owed beyond trade value'){ tradeLines(); L.push((lab==='Trade equity'?'Net trade equity':'Negative equity')+': '+td[1].textContent); continue; } if(lab==='Out-the-door total') tradeLines(); L.push(lab+': '+td[1].textContent); } return L; } function fillEstimate(){ var f=byPh('your estimate'); if(!root()||!f) return; var L=summary(); if(!touched) L.push('(Customer did not change the starting numbers)'); f.value=L.join('\n'); f.readOnly=true; } function setNum(id,v){ if(v===undefined||v===null||v==='') return; var n=parseFloat(String(v).replace(/[$,\s%]/g,'')); if(!isFinite(n)) return; var el=root().querySelector('#'+id); if(!el) return; el.value=n; fire(el,'input'); } function setRadio(name,val){ if(!val) return; var el=root().querySelector('input[name='+name+'][value="'+String(val).toLowerCase()+'"]'); if(el){el.checked=true; fire(el,'change');} } function setCity(city){ if(!city) return true; var c=String(city).toLowerCase().replace(/,?\s*(ca|california)\.?$/,'').trim(); var sel=root().querySelector('#fx-city'), opts=sel.options, best=null, i, nm; var tries=[function(n){return n===c;},function(n){return n==='unincorporated '+c+' county'||n==='unincorporated '+c;},function(n){return n.indexOf(c)===0;}]; for(var t=0;tries.length>t&&!best;t++){ for(i=0;opts.length>i;i++){ nm=opts[i].value.split('|')[1].toLowerCase(); if(tries[t](nm)){best=opts[i];break;} } } if(!best) return false; sel.value=best.value; fire(sel,'change'); return true; } function setTerm(t){ var n=parseInt(t,10); if(!isFinite(n)) return; var opts=[36,48,60,72,84], b=opts[0]; opts.forEach(function(o){ if(Math.abs(b-n)>Math.abs(o-n)) b=o; }); var sel=root().querySelector('#fx-term'); sel.value=String(b); fire(sel,'change'); } var tools={ estimate_payment:function(p){ p=p||{}; var r=root(); if(!r) return 'The calculator is not on this page.'; setRadio('fx-mode',p.payment_type); setRadio('fx-cond',p.condition); setRadio('fx-fuel',p.fuel); setNum('fx-price',p.price); setNum('fx-rebate',p.rebates); setNum('fx-trade',p.trade_value); setNum('fx-payoff',p.trade_payoff); setNum('fx-down',p.down_payment); var found=setCity(p.city); if(p.credit) setRadio('fx-credit',CREDIT[String(p.credit).toLowerCase()]); if(p.apr) setNum('fx-apr',p.apr); if(p.term_months) setTerm(p.term_months); touched=true; fillEstimate(); try{r.scrollIntoView({behavior:'smooth',block:'start'});}catch(e){} var out=summary().join('\n'); if(!found) out='City "'+p.city+'" was not found in the California list, so the tax rate shown is for a different city. Ask the customer for the nearest incorporated city.\n'+out; return out; }, fill_lead_form:function(p){ p=p||{}; var done=[], missing=[]; [['name',['Name']],['phone',['Phone Number','Phone']],['email',['Email']],['vehicle',['Vehicle of interest','Car you want']]].forEach(function(k){ if(!p[k[0]]) return; var f=null; for(var j=0;k[1].length>j&&!f;j++) f=byPh(k[1][j]); if(f){ f.value=p[k[0]]; fire(f,'input'); done.push(k[1][0]); } else missing.push(k[1][0]); }); fillEstimate(); var est=byPh('your estimate')||byPh('name'); if(est){ try{est.scrollIntoView({behavior:'smooth',block:'center'});}catch(e){} } return 'Filled: '+(done.join(', ')||'nothing')+(missing.length?'. These fields are not on the form: '+missing.join(', '):'')+'. Ask the customer to check the form below the calculator and tap Submit.'; } }; function attach(el){ if(el.__fxTools) return; el.__fxTools=true; el.addEventListener('elevenlabs-convai:call',function(e){ var cfg=e.detail.config, cur=cfg.clientTools||{}; for(var k in tools) cur[k]=tools[k]; cfg.clientTools=cur; }); } function scan(){ var w=document.querySelectorAll('elevenlabs-convai'); for(var i=0;w.length>i;i++) attach(w[i]); } scan(); new MutationObserver(scan).observe(document.documentElement,{childList:true,subtree:true}); function inCalc(e){return e.target&&e.target.closest&&e.target.closest('#fxpc');} document.addEventListener('input',function(e){ if(inCalc(e)){touched=true; fillEstimate();} }); document.addEventListener('change',function(e){ if(inCalc(e)){touched=true; fillEstimate();} }); document.addEventListener('click',function(e){ if(e.target.closest&&e.target.closest('.fx-cta')) fillEstimate(); }); })();