"; w = window.open("", "_blank"); if (!w) { window.print(); return; } w.document.open(); w.document.write(html); w.document.close(); try { w.focus(); } catch (e) { } setTimeout(function () { try { w.print(); } catch (e2) { } }, 400); } /* ===================================================== ACTIONS (what happens when the user does something) ===================================================== */ // Update everything that depends on state or vehicle function update() { var b = $$(".tl-seg-btn[data-veh]"), i, st, note = $("#tl-state-note"); for (i = 0; i < b.length; i++) { b[i].setAttribute("aria-pressed", b[i].getAttribute("data-veh") === S.veh ? "true" : "false"); } st = S.stateKey ? TINT_DATA.states[S.stateKey] : null; if (st) { if (st.warning) { note.textContent = st.warning; note.hidden = false; } else { note.hidden = true; } } else { note.hidden = true; } renderDetails(); renderCompare(); renderFacts(); updateTint(); } // Update everything that depends on the tint values function updateTint() { renderWinButtons(); renderSlider(); renderVerdict(); renderSummary(); renderCalc(); renderSee(); root.setAttribute("data-dn", S.dn); root.setAttribute("data-view", S.view); render3D(); renderFallback(); } function selectWin(w) { if (!has(WIN_NAMES, w)) { return; } S.win = w; updateTint(); goView(VIEWS[w]); } function setTint(v) { if (isNaN(v)) { return; } S.tint[S.win] = clamp(Math.round(v), 5, 90); updateTint(); } function setState(k) { S.stateKey = k; setLegalTints(); update(); } function setVeh(v) { S.veh = v; setLegalTints(); update(); } function bindEvents() { var split = $("#tl-split"), scene = $("#tl-scene"), dragging = false, fb = $("#tl-fallback"), i, el; // Pickers combos.a = makeCombo($("#tl-combo-a"), function (k) { setState(k); }); combos.b = makeCombo($("#tl-combo-b"), function (k) { S.stateB = k; renderCompare(); }); // One click listener for most buttons root.addEventListener("click", function (e) { var t = e.target, b; b = closest(t, ".tl-seg-btn[data-veh]"); if (b) { setVeh(b.getAttribute("data-veh")); return; } b = closest(t, ".tl-win-btn"); if (b) { selectWin(b.getAttribute("data-win")); return; } b = closest(t, ".tl-preset"); if (b) { setTint(parseInt(b.getAttribute("data-preset"), 10)); return; } b = closest(t, ".tl-seg-btn[data-dn]"); if (b) { S.dn = b.getAttribute("data-dn"); updateTint(); return; } b = closest(t, ".tl-seg-btn[data-view]"); if (b) { S.view = b.getAttribute("data-view"); updateTint(); return; } b = closest(t, ".tl-chip-btn[data-f]"); if (b) { S.factory = parseInt(b.getAttribute("data-f"), 10); $("#tl-factory").value = S.factory; renderCalc(); return; } }); bind("#tl-slider", "input", function (e) { setTint(parseInt(e.target.value, 10)); }); bind("#tl-set-legal", "click", function () { S.tint[S.win] = defaultTint(S.win); updateTint(); }); bind("#tl-apply-sides", "click", function () { var v = S.tint[S.win]; S.tint.frontSide = v; S.tint.backSide = v; updateTint(); }); bind("#tl-compare-toggle", "click", function () { S.compare = !S.compare; renderSee(); }); bind("#tl-reset-view", "click", function () { goView(DEFAULT_VIEW); }); bind("#tl-labels-toggle", "click", function (e) { S.labels = !S.labels; e.currentTarget.setAttribute("aria-pressed", S.labels ? "true" : "false"); $("#tl-labels").hidden = !S.labels; }); // Calculator bind("#tl-film", "input", function (e) { S.film = parseFloat(e.target.value); renderCalc(); }); bind("#tl-factory", "input", function (e) { S.factory = parseFloat(e.target.value); renderCalc(); }); bind("#tl-calc-apply", "click", function () { var f = S.film, g = S.factory; if (!isNum(f)) { return; } if (!isNum(g)) { return; } S.tint[S.win] = clamp(Math.round(f * g / 100), 5, 90); updateTint(); }); // Share and print bind("#tl-copy-link", "click", copyLink); bind("#tl-print-btn", "click", printSummary); // Compare line in the see-through panel (mouse, touch and keyboard) function splitFromX(x) { var r = scene.getBoundingClientRect(); S.split = clamp(Math.round((x - r.left) / r.width * 100), 5, 95); renderSee(); } split.addEventListener("pointerdown", function (e) { dragging = true; try { split.setPointerCapture(e.pointerId); } catch (x) { } e.preventDefault(); }); split.addEventListener("pointermove", function (e) { if (dragging) { splitFromX(e.clientX); } }); split.addEventListener("pointerup", function () { dragging = false; }); split.addEventListener("pointercancel", function () { dragging = false; }); split.addEventListener("keydown", function (e) { var k = e.key; if (k === "ArrowLeft") { S.split = clamp(S.split - 5, 5, 95); } else if (k === "ArrowRight") { S.split = clamp(S.split + 5, 5, 95); } else if (k === "Home") { S.split = 5; } else if (k === "End") { S.split = 95; } else { return; } e.preventDefault(); renderSee(); }); // Simple car picture (used if 3D fails) fb.addEventListener("click", function (e) { var p = closest(e.target, ".tl-fb-win"); if (p) { selectWin(p.getAttribute("data-win")); } }); fb.addEventListener("keydown", function (e) { var p = closest(e.target, ".tl-fb-win"); if (p) { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); selectWin(p.getAttribute("data-win")); } } }); // Make the four floating labels for (i = 0; i < WIN_KEYS.length; i++) { el = document.createElement("div"); el.className = "tl-label"; el.setAttribute("data-s", "none"); el.style.display = "none"; $("#tl-labels").appendChild(el); T.labelEls[WIN_KEYS[i]] = el; } } /* ===================================================== START-UP ===================================================== */ function init() { var fromLink, how; root = document.getElementById("tl-app"); if (!root) { return; } if (root.getAttribute("data-tl-ready") === "1") { return; } root.setAttribute("data-tl-ready", "1"); try { REDUCED = window.matchMedia("(prefers-reduced-motion: reduce)").matches; } catch (e) { REDUCED = false; } buildKeys(); bindEvents(); fromLink = readHash(); if (fromLink) { combos.a.set(S.stateKey); combos.b.set(S.stateB); T.pending = VIEWS[S.win]; } // The "How to use" box is open on the first visit only how = $("#tl-how"); try { if (fromLink) { how.removeAttribute("open"); } else if (window.localStorage.getItem("tl_how_seen") === "1") { how.removeAttribute("open"); } else { window.localStorage.setItem("tl_how_seen", "1"); } } catch (e2) { } update(); watchView(); if (fromLink) { setTimeout(function () { try { root.scrollIntoView(); } catch (e3) { } }, 300); } } // Wait for the page, then start (only once) if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", init); } else { init(); } })();
Questions to ask when buying a used car before making a purchase

Questions to Ask When Buying a Used Car

Buying a used car can save you thousands of dollars, but a good-looking vehicle can hide accident damage, neglected maintenance, title problems, or expensive mechanical issues. Asking the right questions before you buy helps uncover problems before they become your…

Car Amaze

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.