DOT checker: add business close-out mode + sell-your-trucks routing

- Intent toggle: 'staying in business' (compliance) vs 'closing my business'
- Closing mode shows a green, personalized wind-down checklist from FMCSA data
  (final MCS-150/USDOT deactivation, MC revoke, UCR, IFTA/IRP, state permits,
  insurance, entity dissolution) + 'let us handle the shutdown' lead capture
- Sell-your-trucks box: quick cash -> ByeTruck referral lead + handoff;
  marketplace -> email capture for follow-up guide
- Deep link via ?intent=closing for the email CTAs

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
justin 2026-05-30 23:57:44 -05:00
parent df48ef786d
commit c0021c3cd6

View file

@ -13,7 +13,10 @@ Client Portal
Sign out
</button> </div> </div> </div> <!-- Mobile menu button --> <button type="button" class="md:hidden text-gray-600 hover:text-gray-900" id="mobile-menu-btn"> <svg class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16"></path></svg> </button> </div> </div> <!-- Mobile menu --> <div id="mobile-menu" class="md:hidden hidden border-t border-gray-200 bg-white"> <div class="px-4 py-3 space-y-1"> <p class="text-xs font-semibold text-blue-500 uppercase tracking-wider px-2 pt-1">Telecom</p> <a href="/services/telecom/fcc-499a" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">FCC 499A Filing</a> <a href="/services/telecom/stir-shaken" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">STIR/SHAKEN</a> <a href="/services/telecom/ipes-isp" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">FCC Carrier / ISP Registration</a> <a href="/services/telecom/database-management" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">Telecom Databases</a> <a href="/services/telecom/state-puc" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">State PUC/PSC</a> <a href="/services/telecom/canada-crtc" class="block px-2 py-2 text-sm font-medium text-blue-600 hover:bg-blue-50 rounded">Canada CRTC Package <span class="inline-flex items-center px-1.5 py-0.5 rounded-full text-[9px] font-bold bg-red-500 text-white ml-1 animate-pulse">HOT</span></a> <p class="text-xs font-semibold text-orange-500 uppercase tracking-wider px-2 pt-3">Trucking / DOT</p> <a href="/services/trucking" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">DOT Compliance Services</a> <a href="/order/dot-compliance" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">MCS-150 / BOC-3 / UCR</a> <a href="/order/trucking-new-carrier" class="block px-2 py-2 text-sm font-medium text-orange-600 hover:bg-orange-50 rounded">New Carrier Setup</a> <a href="/tools/dot-compliance-check" class="block px-2 py-2 text-sm font-medium text-orange-600 hover:bg-orange-50 rounded">DOT Compliance Check <span class="inline-flex items-center px-1.5 py-0.5 rounded-full text-[9px] font-bold bg-orange-500 text-white ml-1">FREE</span></a> <p class="text-xs font-semibold text-purple-500 uppercase tracking-wider px-2 pt-3">Data Privacy</p> <a href="/services/privacy/ccpa-audit" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">CCPA/CPRA Audit</a> <a href="/services/privacy/privacy-policy" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">Privacy Policy Review</a> <a href="/services/privacy/data-mapping" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">Data Mapping</a> <a href="/services/privacy/breach-response" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">Breach Response Plan</a> <p class="text-xs font-semibold text-green-500 uppercase tracking-wider px-2 pt-3">TCPA</p> <a href="/services/tcpa/consent-audit" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">Consent Audit</a> <a href="/services/tcpa/dnc-compliance" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">DNC Compliance</a> <a href="/services/tcpa/campaign-review" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">Campaign Review</a> <p class="text-xs font-semibold text-slate-500 uppercase tracking-wider px-2 pt-3">Corporate</p> <a href="/services/corporate/formation" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">Business Formation</a> <a href="/services/corporate/state-registration" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">State Registration</a> <a href="/services/corporate/annual-reports" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">Annual Reports</a> <a href="/services/corporate/registered-agent" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">Registered Agent</a> <div class="border-t border-gray-100 my-2"></div> <a href="/services" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">All Services</a> <a href="/pricing" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">Pricing</a> <a href="/tools/contractor-quiz" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">Free Tools</a> <a href="/contact" class="block px-2 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded">Contact</a> <a href="/order/formation" class="block mx-2 mt-2 px-4 py-2.5 text-sm font-medium text-white bg-pw-700 hover:bg-pw-800 rounded-lg text-center transition-colors">Form a Business</a> </div> </div> </nav> <main class="flex-1"> <section class="py-16"> <div class="max-w-3xl mx-auto px-4"> <!-- Breadcrumb --> <nav class="text-sm text-gray-500 mb-6"> <a href="/" class="hover:text-gray-700">Home</a> /
<a href="/tools" class="hover:text-gray-700">Free Tools</a> /
<span class="text-gray-900">DOT Compliance Check</span> </nav> <!-- Header --> <h1 class="text-3xl font-bold text-gray-900 mb-3">DOT / FMCSA Compliance Check</h1> <p class="text-lg text-gray-600 mb-4">Look up any motor carrier by USDOT number or name to instantly check MCS-150 status, insurance, operating authority, and safety rating.</p> <!-- Disclaimer --> <div class="bg-orange-50 border border-orange-200 rounded-lg p-4 mb-8"> <p class="text-xs text-gray-500"><strong>Disclaimer:</strong> This tool queries publicly available FMCSA data. While we strive for accuracy, always confirm critical compliance matters directly with FMCSA. This is not legal advice.</p> </div> <!-- Search Box --> <div class="bg-white border border-gray-200 rounded-xl p-6 shadow-sm mb-8"> <!-- Tabs --> <div class="flex gap-0 mb-5 border-b-2 border-gray-200"> <button type="button" class="dot-tab px-4 py-2 text-sm font-semibold text-orange-600 border-b-2 border-orange-500 -mb-[2px] cursor-pointer" data-tab="dot">Search by DOT #</button> <button type="button" class="dot-tab px-4 py-2 text-sm font-semibold text-gray-500 border-b-2 border-transparent -mb-[2px] cursor-pointer hover:text-gray-700" data-tab="name">Search by Name</button> </div>
<span class="text-gray-900">DOT Compliance Check</span> </nav> <!-- Header --> <h1 class="text-3xl font-bold text-gray-900 mb-3">DOT / FMCSA Compliance Check</h1> <p class="text-lg text-gray-600 mb-4">Look up any motor carrier by USDOT number or name to instantly check MCS-150 status, insurance, operating authority, and safety rating.</p> <!-- Disclaimer --> <div class="bg-orange-50 border border-orange-200 rounded-lg p-4 mb-8"> <p class="text-xs text-gray-500"><strong>Disclaimer:</strong> This tool queries publicly available FMCSA data. While we strive for accuracy, always confirm critical compliance matters directly with FMCSA. This is not legal advice.</p> </div> <!-- Intent selector --> <div class="mb-6"> <p class="text-sm font-semibold text-gray-900 mb-2">What brings you here?</p> <div style="display:flex;gap:10px;flex-wrap:wrap">
<button type="button" class="intent-btn" data-intent="compliance" style="flex:1;min-width:210px;padding:12px 16px;border-radius:10px;border:2px solid #f97316;background:#fff7ed;color:#9a3412;font-weight:700;font-size:14px;cursor:pointer;text-align:left;line-height:1.4">&#9989; I'm staying in business<br><span style="font-weight:400;font-size:12px;color:#9a3412">Check my DOT compliance status</span></button>
<button type="button" class="intent-btn" data-intent="closing" style="flex:1;min-width:210px;padding:12px 16px;border-radius:10px;border:2px solid #e2e8f0;background:#fff;color:#64748b;font-weight:700;font-size:14px;cursor:pointer;text-align:left;line-height:1.4">&#128230; I'm closing my business<br><span style="font-weight:400;font-size:12px;color:#94a3b8">See what to wrap up + sell my trucks</span></button>
</div> </div> <!-- Search Box --> <div class="bg-white border border-gray-200 rounded-xl p-6 shadow-sm mb-8"> <!-- Tabs --> <div class="flex gap-0 mb-5 border-b-2 border-gray-200"> <button type="button" class="dot-tab px-4 py-2 text-sm font-semibold text-orange-600 border-b-2 border-orange-500 -mb-[2px] cursor-pointer" data-tab="dot">Search by DOT #</button> <button type="button" class="dot-tab px-4 py-2 text-sm font-semibold text-gray-500 border-b-2 border-transparent -mb-[2px] cursor-pointer hover:text-gray-700" data-tab="name">Search by Name</button> </div>
<!-- DOT number search --> <div id="tab-dot"> <label for="dot-input" class="block text-sm font-semibold text-gray-900 mb-2">USDOT Number</label> <div class="flex gap-3"> <input type="text" id="dot-input" placeholder="Enter USDOT number (e.g. 1234567)" maxlength="10" class="flex-1 border border-gray-300 rounded-lg px-4 py-3 text-lg font-mono text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-orange-400 focus:border-orange-400"> <button type="button" id="dot-btn" style="padding:12px 24px;background:#f97316;color:#fff;font-weight:600;border-radius:8px;border:none;cursor:pointer;white-space:nowrap;font-size:15px">Check Compliance</button> </div> <p class="text-xs text-gray-500 mt-2">Your USDOT number is assigned by the Federal Motor Carrier Safety Administration. Don't know it? Use the name search tab.</p> </div>
@ -113,6 +116,25 @@ Send reset link
dotBtn.addEventListener("click", runDotCheck);
dotInput.addEventListener("keydown", function(e) { if (e.key === "Enter") runDotCheck(); });
// --- Intent selector (staying in business vs closing) ---
var pwIntent = "compliance";
var intentBtns = document.querySelectorAll(".intent-btn");
function setIntent(intent) {
pwIntent = intent;
intentBtns.forEach(function(b) {
var on = b.dataset.intent === intent;
var closing = b.dataset.intent === "closing";
b.style.borderColor = on ? (closing ? "#16a34a" : "#f97316") : "#e2e8f0";
b.style.background = on ? (closing ? "#f0fdf4" : "#fff7ed") : "#fff";
b.style.color = on ? (closing ? "#166534" : "#9a3412") : "#64748b";
var sub = b.querySelector("span");
if (sub) sub.style.color = on ? (closing ? "#166534" : "#9a3412") : "#94a3b8";
});
// Re-render if a result is already on screen so the mode swaps live
if (!resultsEl.classList.contains("hidden") && window.__pwLastData) renderResults(window.__pwLastData);
}
intentBtns.forEach(function(b) { b.addEventListener("click", function() { setIntent(b.dataset.intent); }); });
function markStep(stepId, status) {
var el = document.getElementById(stepId);
if (!el) return;
@ -252,11 +274,190 @@ Send reset link
var checkBg = { green: "bg-green-50 border border-green-200", yellow: "bg-yellow-50 border border-yellow-200", red: "bg-red-50 border border-red-200", unknown: "bg-gray-50 border border-gray-200" };
var labelColor = { green: "text-green-800", yellow: "text-yellow-800", red: "text-red-800", unknown: "text-gray-700" };
// ── Business close-out (winding down) ──────────────────────────────
var STATE_CLOSEOUT = {
CA: "Cancel your California Motor Carrier Permit (MCP) and CA# with the DMV / CHP.",
OR: "Close your Oregon Weight-Mile Tax account with ODOT and file a final mileage return.",
NY: "Cancel your New York HUT registration and destroy your HUT decals.",
KY: "Cancel your Kentucky KYU number so you stop accruing quarterly filings.",
NM: "Close your New Mexico Weight-Distance Tax account.",
CT: "Close your Connecticut Highway Use Fee account."
};
function buildCloseoutHtml(data) {
var state = data.phy_state || "";
var steps = [];
steps.push("<strong>File a final MCS-150</strong> marking your carrier &ldquo;Out of Business.&rdquo; This deactivates USDOT&nbsp;" + data.dot_number + " so biennial-update obligations and $1,000/day late penalties stop accruing.");
steps.push("<strong>Voluntarily revoke your operating authority (MC)</strong> with FMCSA so it isn&rsquo;t left active and billable after you stop running.");
steps.push("<strong>Cancel your UCR registration</strong> &mdash; don&rsquo;t just skip renewal; confirm you&rsquo;re marked inactive so you aren&rsquo;t billed next year.");
steps.push("<strong>Close your IFTA account</strong>, file a final quarterly return, and return or destroy your IFTA decals.");
steps.push("<strong>Return your IRP apportioned plates</strong>" + (state ? " to your base state (" + state + ")" : "") + " and close the account so registration fees stop.");
if (STATE_CLOSEOUT[state]) steps.push("<strong>State requirement:</strong> " + STATE_CLOSEOUT[state]);
steps.push("<strong>Cancel your insurance</strong> &mdash; but only <em>after</em> your authority is revoked, so FMCSA doesn&rsquo;t flag an insurance lapse on an active carrier.");
steps.push("<strong>Dissolve your LLC / corporation</strong> with the state and file a final tax return so you stop owing annual-report fees and franchise tax.");
var h = '';
// Intro
h += '<div style="background:#f0fdf4;border:2px solid #86efac;border-radius:12px;padding:24px;margin-top:8px">';
h += '<h3 style="font-size:18px;font-weight:700;color:#166534;margin:0 0 6px">Winding down ' + data.legal_name + '? Here&rsquo;s your exit checklist.</h3>';
h += '<p style="font-size:14px;color:#374151;margin:0 0 16px">Closing a trucking business is more than parking the truck. Skip a step and the bills &mdash; UCR, IRP, state permits, annual reports &mdash; keep coming. Here&rsquo;s what to wrap up, based on your FMCSA record:</p>';
h += '<ol style="margin:0;padding:0;list-style:none;counter-reset:step">';
steps.forEach(function(s) {
h += '<li style="display:flex;gap:12px;padding:10px 0;border-bottom:1px solid #dcfce7;font-size:14px;color:#374151;line-height:1.6">';
h += '<span style="flex-shrink:0;width:24px;height:24px;border-radius:50%;background:#16a34a;color:#fff;font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:center;margin-top:1px">&#10003;</span>';
h += '<span>' + s + '</span></li>';
});
h += '</ol></div>';
// "Let us handle it" lead capture (green)
h += '<div style="background:#fff;border:2px solid #16a34a;border-radius:12px;padding:24px;margin-top:8px">';
h += '<h3 style="font-size:17px;font-weight:700;color:#166534;margin:0 0 4px">Let us handle the shutdown paperwork</h3>';
h += '<p style="font-size:14px;color:#374151;margin:0 0 14px">We&rsquo;ll deactivate your USDOT, revoke your authority, cancel UCR, and close your state accounts &mdash; so nothing keeps billing you after you&rsquo;re out. No Login.gov, no government portals.</p>';
h += '<input type="text" id="co-name" placeholder="Your name" value="' + (data.legal_name || '') + '" style="width:100%;padding:9px 12px;font-size:13px;border:1px solid #bbf7d0;border-radius:8px;outline:none;margin-bottom:8px;box-sizing:border-box">';
h += '<input type="email" id="co-email" placeholder="Email address" style="width:100%;padding:9px 12px;font-size:13px;border:1px solid #bbf7d0;border-radius:8px;outline:none;margin-bottom:8px;box-sizing:border-box">';
h += '<input type="tel" id="co-phone" placeholder="Phone number" value="' + (data.telephone || '') + '" style="width:100%;padding:9px 12px;font-size:13px;border:1px solid #bbf7d0;border-radius:8px;outline:none;margin-bottom:10px;box-sizing:border-box">';
h += '<button type="button" id="co-submit" style="padding:11px 28px;background:#16a34a;color:#fff;font-weight:700;border-radius:8px;font-size:14px;border:none;cursor:pointer">Get My Shutdown Handled &rarr;</button>';
h += '<p id="co-status" class="text-xs hidden" style="margin-top:8px"></p>';
h += '</div>';
// Sell-your-trucks box (green)
h += '<div style="background:#f0fdf4;border:2px solid #86efac;border-radius:12px;padding:24px;margin-top:8px">';
h += '<h3 style="font-size:17px;font-weight:700;color:#166534;margin:0 0 4px">Looking to sell your trucks?</h3>';
h += '<p style="font-size:14px;color:#374151;margin:0 0 14px">Two ways to go &mdash; pick what fits your timeline:</p>';
h += '<div style="display:flex;gap:10px;flex-wrap:wrap;margin-bottom:4px">';
h += '<button type="button" class="sell-opt" data-opt="quickcash" style="flex:1;min-width:200px;padding:14px;border-radius:10px;border:2px solid #16a34a;background:#fff;color:#166534;font-weight:700;font-size:14px;cursor:pointer;text-align:left;line-height:1.4">&#128176; Quick cash now<br><span style="font-weight:400;font-size:12px;color:#15803d">Instant offer, pickup in 48&ndash;72 hrs</span></button>';
h += '<button type="button" class="sell-opt" data-opt="marketplace" style="flex:1;min-width:200px;padding:14px;border-radius:10px;border:2px solid #86efac;background:#fff;color:#166534;font-weight:700;font-size:14px;cursor:pointer;text-align:left;line-height:1.4">&#127991;&#65039; List it &amp; wait for top dollar<br><span style="font-weight:400;font-size:12px;color:#15803d">We&rsquo;ll send you the best marketplaces</span></button>';
h += '</div>';
// Quick-cash form (hidden until chosen)
h += '<div id="sell-quickcash" style="display:none;margin-top:14px;padding-top:14px;border-top:1px solid #dcfce7">';
h += '<p style="font-size:13px;color:#374151;margin:0 0 10px">We&rsquo;ll send your details to <strong>ByeTruck</strong> for a no-obligation cash offer. Tell us what you&rsquo;re selling:</p>';
h += '<input type="text" id="qc-name" placeholder="Your name" value="' + (data.legal_name || '') + '" style="width:100%;padding:9px 12px;font-size:13px;border:1px solid #bbf7d0;border-radius:8px;outline:none;margin-bottom:8px;box-sizing:border-box">';
h += '<input type="tel" id="qc-phone" placeholder="Phone number" value="' + (data.telephone || '') + '" style="width:100%;padding:9px 12px;font-size:13px;border:1px solid #bbf7d0;border-radius:8px;outline:none;margin-bottom:8px;box-sizing:border-box">';
h += '<input type="email" id="qc-email" placeholder="Email address" style="width:100%;padding:9px 12px;font-size:13px;border:1px solid #bbf7d0;border-radius:8px;outline:none;margin-bottom:8px;box-sizing:border-box">';
h += '<textarea id="qc-truck" rows="2" placeholder="Year / make / model / mileage / condition" style="width:100%;padding:9px 12px;font-size:13px;border:1px solid #bbf7d0;border-radius:8px;outline:none;margin-bottom:10px;box-sizing:border-box;resize:vertical"></textarea>';
h += '<button type="button" id="qc-submit" style="padding:11px 28px;background:#16a34a;color:#fff;font-weight:700;border-radius:8px;font-size:14px;border:none;cursor:pointer">Get My Cash Offer &rarr;</button>';
h += '<p id="qc-status" class="text-xs hidden" style="margin-top:8px"></p>';
h += '</div>';
// Marketplace form (hidden until chosen)
h += '<div id="sell-marketplace" style="display:none;margin-top:14px;padding-top:14px;border-top:1px solid #dcfce7">';
h += '<p style="font-size:13px;color:#374151;margin:0 0 10px">Smart move &mdash; a private/marketplace sale usually nets more than a quick buyout. Drop your email and we&rsquo;ll send you our guide to the top truck marketplaces and how to list for the best price.</p>';
h += '<input type="email" id="mp-email" placeholder="Email address" style="width:100%;padding:9px 12px;font-size:13px;border:1px solid #bbf7d0;border-radius:8px;outline:none;margin-bottom:10px;box-sizing:border-box">';
h += '<button type="button" id="mp-submit" style="padding:11px 28px;background:#16a34a;color:#fff;font-weight:700;border-radius:8px;font-size:14px;border:none;cursor:pointer">Email Me the Marketplace Guide &rarr;</button>';
h += '<p id="mp-status" class="text-xs hidden" style="margin-top:8px"></p>';
h += '</div>';
h += '</div>';
return h;
}
// Shared lead submitter — mirrors the insurance lead flow
function pwSubmitLead(o) {
o.statusEl.classList.add("hidden");
if (o.requireEmail && !o.email) {
o.statusEl.textContent = "Please enter your email.";
o.statusEl.className = "text-xs text-red-600";
o.statusEl.classList.remove("hidden");
return;
}
o.btn.disabled = true;
var origText = o.btn.textContent;
o.btn.textContent = "Submitting...";
fetch(API + "/api/v1/tickets", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ category: o.category, subject: o.subject, message: o.message, email: o.email, name: o.name })
}).then(function(r) {
if (!r.ok) throw new Error("Failed");
o.statusEl.textContent = o.okMsg;
o.statusEl.className = "text-xs text-green-700";
o.statusEl.classList.remove("hidden");
o.btn.textContent = "Submitted";
if (o.onOk) o.onOk();
}).catch(function() {
o.statusEl.textContent = "Something went wrong. Email info@performancewest.net instead.";
o.statusEl.className = "text-xs text-red-600";
o.statusEl.classList.remove("hidden");
o.btn.disabled = false;
o.btn.textContent = origText;
});
}
function wireCloseout(data) {
var loc = (data.phy_city || "") + ", " + (data.phy_state || "");
var fleet = data.fleet ? (data.fleet.power_units + " trucks, " + data.fleet.drivers + " drivers") : "unknown";
// "Handle my shutdown" lead
var coBtn = document.getElementById("co-submit");
if (coBtn) coBtn.addEventListener("click", function() {
var name = document.getElementById("co-name").value.trim();
var email = document.getElementById("co-email").value.trim();
var phone = document.getElementById("co-phone").value.trim();
pwSubmitLead({
category: "business_closeout", requireEmail: true, email: email, name: name,
btn: coBtn, statusEl: document.getElementById("co-status"),
okMsg: "Got it! We'll reach out within 1 business day to start your wind-down.",
subject: "Business Close-Out — " + data.legal_name + " (DOT " + data.dot_number + ")",
message: ["Business close-out / wind-down request from DOT Compliance Checker.", "",
"Carrier: " + data.legal_name, "DOT#: " + data.dot_number, "Location: " + loc, "Fleet: " + fleet,
"", "Contact: " + name, "Email: " + email, "Phone: " + (phone || data.telephone || "not provided")].join("\n")
});
});
// Sell-trucks option reveal
document.querySelectorAll(".sell-opt").forEach(function(b) {
b.addEventListener("click", function() {
var qc = document.getElementById("sell-quickcash");
var mp = document.getElementById("sell-marketplace");
qc.style.display = b.dataset.opt === "quickcash" ? "block" : "none";
mp.style.display = b.dataset.opt === "marketplace" ? "block" : "none";
document.querySelectorAll(".sell-opt").forEach(function(x) {
x.style.background = x === b ? "#dcfce7" : "#fff";
});
});
});
// Quick-cash → ByeTruck referral lead
var qcBtn = document.getElementById("qc-submit");
if (qcBtn) qcBtn.addEventListener("click", function() {
var name = document.getElementById("qc-name").value.trim();
var phone = document.getElementById("qc-phone").value.trim();
var email = document.getElementById("qc-email").value.trim();
var truck = document.getElementById("qc-truck").value.trim();
pwSubmitLead({
category: "truck_sale_quickcash", requireEmail: false, email: email, name: name,
btn: qcBtn, statusEl: document.getElementById("qc-status"),
okMsg: "Sent to ByeTruck — they'll contact you with a cash offer. Opening ByeTruck in a new tab...",
subject: "Truck Sale (Quick Cash / ByeTruck) — " + data.legal_name + " (DOT " + data.dot_number + ")",
message: ["Quick-cash truck sale lead from DOT Compliance Checker — route to ByeTruck.", "",
"Carrier: " + data.legal_name, "DOT#: " + data.dot_number, "Location: " + loc, "Fleet: " + fleet,
"Vehicle(s): " + (truck || "not specified"), "",
"Contact: " + name, "Email: " + email, "Phone: " + (phone || data.telephone || "not provided")].join("\n"),
onOk: function() { setTimeout(function() { window.open("https://www.byetruck.com/", "_blank"); }, 1200); }
});
});
// Marketplace → guide follow-up lead
var mpBtn = document.getElementById("mp-submit");
if (mpBtn) mpBtn.addEventListener("click", function() {
var email = document.getElementById("mp-email").value.trim();
pwSubmitLead({
category: "truck_sale_marketplace", requireEmail: true, email: email, name: data.legal_name,
btn: mpBtn, statusEl: document.getElementById("mp-status"),
okMsg: "Done! Watch your inbox for our truck-marketplace guide.",
subject: "Truck Sale (Marketplace guide) — " + data.legal_name + " (DOT " + data.dot_number + ")",
message: ["Marketplace truck-sale lead from DOT Compliance Checker — send marketplace guide follow-up.", "",
"Carrier: " + data.legal_name, "DOT#: " + data.dot_number, "Location: " + loc, "Fleet: " + fleet,
"", "Email: " + email].join("\n")
});
});
}
function renderResults(data) {
if (!data || !data.legal_name) {
showError("No data returned. The carrier may not exist or the lookup timed out.");
return;
}
window.__pwLastData = data;
var html = '';
// Entity header card
@ -297,6 +498,9 @@ Send reset link
html += '</div></div>';
});
if (pwIntent === "closing") {
html += buildCloseoutHtml(data);
} else {
// Insurance lead capture — auto-checked if insurance issue found
var hasInsuranceIssue = (data.checks || []).some(function(c) {
return (c.id === "insurance" || c.id === "insurance_bipd" || c.id === "insurance_cargo" || c.id === "insurance_bond") && c.status === "red";
@ -389,6 +593,8 @@ Send reset link
html += '</div>';
}
} // end compliance-mode block
// Recent update notice + disclaimer
html += '<div style="background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:16px;margin-top:12px">';
html += '<p style="font-size:14px;color:#475569;margin:0 0 8px"><strong>Think something is wrong?</strong> If you recently filed an update, it may take 5-10 business days for FMCSA to reflect changes in their system. If you believe this report is in error, contact FMCSA directly at <a href="tel:8008325660" style="color:#2563eb;font-weight:600">(800) 832-5660</a>.</p>';
@ -398,6 +604,8 @@ Send reset link
resultsEl.innerHTML = html;
resultsEl.classList.remove("hidden");
if (pwIntent === "closing") { wireCloseout(data); return; }
// Insurance lead checkbox toggle
var insCheck = document.getElementById("ins-lead-check");
var insForm = document.getElementById("ins-lead-form");
@ -466,6 +674,9 @@ Send reset link
// Auto-fill from URL
(function() {
var params = new URLSearchParams(window.location.search);
if (params.get("intent") === "closing" || params.get("closing") === "1") {
setIntent("closing");
}
var dot = params.get("dot");
if (dot) {
dotInput.value = dot;