"use strict"; /* ============================ CONFIG - EDIT ME ============================ */ var THT_CONFIG = { // Show the email gate under the results? Set false to show matches only. showEmailGate: false, // 1. Paste your ESP form endpoint here (ConvertKit, Mailchimp, etc.). // Leave empty until wired up; the gate will show a "not connected" note. formAction: "", formMethod: "POST", // Field names your ESP expects: fieldEmail: "email", fieldName: "first_name", // Hidden segmentation fields (map to your ESP's custom field names): fieldCommute: "commute", fieldBudget: "budget", fieldTimeline: "timeline", fieldTopTowns: "top_towns", fieldMudFlag: "mud_flag", fieldHotLead: "hot_lead", // 2. Verify each community guide URL and paste the real one: guides: { "Georgetown": "https://texashometalk.com/communities/georgetown/", "Round Rock": "https://texashometalk.com/communities/round-rock/", "Cedar Park": "https://texashometalk.com/communities/cedar-park/", "Leander": "https://texashometalk.com/communities/leander/", "Pflugerville": "https://texashometalk.com/communities/pflugerville/", "Dripping Springs":"https://texashometalk.com/communities/dripping-springs/", "Kyle": "https://texashometalk.com/communities/kyle/", "Buda": "https://texashometalk.com/communities/buda/", "San Marcos": "https://texashometalk.com/communities/san-marcos/", "New Braunfels": "https://texashometalk.com/communities/new-braunfels/", "Seguin": "https://texashometalk.com/communities/seguin/", "Boerne": "https://texashometalk.com/communities/boerne/", "Hutto": "https://texashometalk.com/communities/hutto/", "Schertz": "https://texashometalk.com/communities/schertz/", "Cibolo": "https://texashometalk.com/communities/cibolo/", "Converse": "https://texashometalk.com/communities/converse/", "Universal City": "https://texashometalk.com/communities/universal-city/", "Lockhart": "https://texashometalk.com/communities/lockhart/", "Bastrop": "https://texashometalk.com/communities/bastrop/", "Wimberley": "https://texashometalk.com/communities/wimberley/", "Fredericksburg": "https://texashometalk.com/communities/fredericksburg/", "Canyon Lake": "https://texashometalk.com/communities/canyon-lake/", "Johnson City": "https://texashometalk.com/communities/johnson-city/", "Marble Falls": "https://texashometalk.com/communities/marble-falls/", "Spring Branch": "https://texashometalk.com/communities/spring-branch/", "Bulverde": "https://texashometalk.com/communities/bulverde/", "Liberty Hill": "https://texashometalk.com/communities/liberty-hill/" } }; /* ========================== END CONFIG ==================================== */ var TOWNS = ["Georgetown","Round Rock","Cedar Park","Leander","Pflugerville", "Dripping Springs","Kyle","Buda","San Marcos","New Braunfels","Seguin","Boerne", "Hutto","Schertz","Cibolo","Converse","Universal City","Lockhart","Bastrop", "Wimberley","Fredericksburg","Canyon Lake","Johnson City","Marble Falls", "Spring Branch","Bulverde","Liberty Hill"]; // Tie-break: towns with the strongest Texas Home Talk guides win ties. // Ordered strongest to weakest; edit as the guide library grows. var GUIDE_STRENGTH = ["Georgetown","Dripping Springs","New Braunfels","Round Rock", "Cedar Park","Leander","San Marcos","Pflugerville","Kyle","Buda","Seguin","Boerne", "Schertz","Hutto","Cibolo","Fredericksburg","Wimberley","Converse","Universal City", "Bastrop","Lockhart","Bulverde","Liberty Hill","Canyon Lake","Marble Falls", "Johnson City","Spring Branch"]; // Towns with notably high MUD / special-district tax stacks (for Q8 penalty). var HIGH_MUD_TOWNS = ["Dripping Springs","Leander","Kyle","Buda","Pflugerville","Hutto"]; // Q8 "long commutes": closest/farthest towns per Q1 commute answer. var COMMUTE_EXTREMES = { downtown: { closest: ["Round Rock","Pflugerville"], farthest: ["New Braunfels","Seguin","San Marcos"] }, north: { closest: ["Round Rock","Pflugerville"], farthest: ["San Marcos","Seguin","New Braunfels"] }, sa: { closest: ["New Braunfels","Schertz"], farthest: ["Georgetown","Round Rock","Cedar Park"] }, split: { closest: ["Kyle","Buda","San Marcos"], farthest: ["Boerne","Georgetown"] } // remote: no adjustment (no commute to optimize) }; // One-line neutral "why" blurbs, shown under each match. var TOWN_BLURBS = { "Georgetown": "Established north-Austin town with Sun City, no-MUD neighborhoods, and the shortest San Antonio run of the northern towns.", "Round Rock": "Major-employer hub (Dell) with established neighborhoods and no special-district tax surprises in most areas.", "Cedar Park": "Top-rated Leander ISD schools, master-planned options, and a straight shot down 183A to North Austin.", "Leander": "New-construction capital with the fastest-growing amenity base. Check the MUD stack before you buy.", "Pflugerville": "Value play inside the Austin metro with its own school district and easy airport access.", "Dripping Springs": "Hill Country lifestyle and exemplary DSISD schools, with the highest tax stacks to match. Know the MUD map.", "Kyle": "The dual-commute town, one of the few with a reasonable drive to both Austin and San Antonio.", "Buda": "Fastest no-traffic run into Austin of the corridor towns, with small-town feel holding on.", "San Marcos": "College-town energy, the lowest price bands in the corridor, and outlet-mall traffic on weekends.", "New Braunfels": "River town with German roots, strong growth, and tourist-season traffic as the tradeoff.", "Seguin": "The affordability anchor: lowest price bands, Guadalupe County taxes, and a genuine small town.", "Boerne": "Hill Country prestige, top-rated schools, and San Antonio access without the city.", "Hutto": "Fast-growing small town east of Round Rock with new-construction value and an easy run up Toll 130.", "Schertz": "San Antonio-side suburb on I-35 with well-regarded Schertz-Cibolo schools and a straight shot into the city.", "Cibolo": "Master-planned growth next to Schertz, popular with San Antonio commuters wanting newer homes.", "Converse": "Affordable San Antonio-side suburb inside Loop 1604 with some of the lowest price bands in the metro.", "Universal City": "Established suburb by Randolph AFB with mid-century homes and quick San Antonio access.", "Lockhart": "Barbecue capital with a historic courthouse square, Caldwell County taxes, and genuinely low price bands.", "Bastrop": "Piney-woods river town with a historic main street, about 30 minutes from Austin.", "Wimberley": "Hill Country hideaway on the Blanco River, known for swimming holes and weekend visitors.", "Fredericksburg": "Wine-country destination town with German roots, strong schools, and premium prices.", "Canyon Lake": "Lake-life living between New Braunfels and San Antonio, with waterfront value and weekend boat traffic.", "Johnson City": "Small Blanco County town on the wine trail, about halfway between Austin and Fredericksburg.", "Marble Falls": "Highland Lakes town with a growing main street and lake access without the Austin price tag.", "Spring Branch": "Scenic hillside community between San Antonio and Canyon Lake, big on views and elbow room.", "Bulverde": "Hill Country suburb north of San Antonio with Smithson Valley schools and larger lots.", "Liberty Hill": "Booming Leander-ISD town on 183A, one of the fastest-growing spots in Williamson County." }; /* ------------------------- QUESTIONS & SCORING ------------------------- */ // pts: {3:[towns], 2:[towns], 1:[towns]}. "rest" = every town not listed in the // other tiers of this option. "scored" = every town with points > 0 so far // (used by "nice to have" / "either" answers). var QUESTIONS = [ { id: "q1", label: "Where will you (or your partner) commute to?", sub: "Commute is the number one regret factor for relocators. Be honest here.", weight: 3, single: true, options: [ { v: "downtown", t: "Downtown Austin", pts: {2:["Round Rock","Pflugerville"], 1:["Cedar Park","Georgetown","Buda","Kyle","Hutto"]} }, { v: "north", t: "North Austin / Domain area", pts: {3:["Round Rock","Pflugerville"], 2:["Cedar Park","Leander","Hutto"], 1:["Georgetown"]} }, { v: "sa", t: "San Antonio", pts: {3:["Boerne","Bulverde","Schertz","New Braunfels"], 2:["Spring Branch","Cibolo","Converse","Universal City","Seguin","Canyon Lake"], 1:["San Marcos"]} }, { v: "remote", t: "Remote / hybrid (1-2 days in office)", pts: {2:["Dripping Springs","Boerne","Georgetown","Wimberley","Fredericksburg"], 1:"rest"} }, { v: "split", t: "Splitting two commutes (Austin + SA)", pts: {3:["Kyle","Buda","San Marcos","Schertz"], 1:["New Braunfels"]} } ] }, { id: "q2", label: "What's your home budget?", sub: "Based on 2026 corridor pricing. Rechecked annually against the relocation guide.", weight: 2, single: true, options: [ { v: "under350", t: "Under $350K", pts: {3:["Seguin","San Marcos","Converse"], 2:["Kyle","Buda","Lockhart","Bastrop","Hutto","Universal City"], 1:["Pflugerville","Leander"]} }, { v: "350-500", t: "$350K - $500K", pts: {3:["Kyle","Buda","San Marcos"], 2:["Pflugerville","Leander","Round Rock","Hutto","Schertz","Cibolo","Canyon Lake","Universal City"], 1:["Cedar Park","Seguin","New Braunfels","Marble Falls","Johnson City"]} }, { v: "500-750", t: "$500K - $750K", pts: {3:["Cedar Park","Round Rock","Leander","Liberty Hill"], 2:["New Braunfels","Dripping Springs","Georgetown","Bulverde","Spring Branch"], 1:["Pflugerville","Buda","Boerne","Wimberley"]} }, { v: "750plus", t: "$750K+", pts: {3:["Dripping Springs","Boerne"], 2:["Georgetown","Cedar Park","Fredericksburg"], 1:["Leander","New Braunfels"]} } ] }, { id: "q3", label: "How much do schools matter?", sub: null, weight: 1, single: true, options: [ { v: "top", t: "Top priority, it is driving the move", pts: {3:["Dripping Springs","Leander"], 2:["Cedar Park","Georgetown","Schertz"], 1:["Round Rock","Boerne","Hutto","Bulverde"]} }, { v: "nice", t: "Nice to have, not the deciding factor", pts: {2:"scored"} }, { v: "none", t: "Don't need schools", pts: {} } ] }, { id: "q4", label: "How do you feel about HOAs, MUDs, and special tax districts?", explainer: "MUDs and WCIDs add extra property-tax layers on top of city, county, and school taxes, sometimes $3,000+/year on a $600K home.", sub: null, weight: 1, single: true, options: [ { v: "fine", t: "Fine, whatever it takes to get the house", pts: {3:["Dripping Springs","Leander"], 2:["Kyle","Buda","Pflugerville","Hutto"], 1:["Cedar Park","Schertz","Cibolo"]} }, { v: "avoid", t: "Prefer to avoid extra tax layers", pts: {3:["Georgetown","Round Rock","New Braunfels","Fredericksburg","Wimberley"], 2:["Seguin","San Marcos","Lockhart","Bastrop","Marble Falls","Johnson City"], 1:["Pflugerville"]} }, { v: "whatsmud", t: "Wait, what's a MUD?", pts: {}, flag: "mud" } ] }, { id: "q5", label: "New construction or established neighborhood?", sub: null, weight: 1, single: true, options: [ { v: "newbuild", t: "New build, I want the warranty and the floor plan", pts: {3:["Leander","Dripping Springs"], 2:["Kyle","Buda","Pflugerville","Hutto","Schertz","Cibolo","Liberty Hill"], 1:["Seguin","Converse"]} }, { v: "established", t: "Established, mature trees and known quantities", pts: {3:["Georgetown","Round Rock","New Braunfels"], 2:["San Marcos","Seguin","Fredericksburg","Lockhart","Bastrop","Wimberley","Marble Falls"], 1:["Cedar Park","Universal City"]} }, { v: "either", t: "Either, show me the best value", pts: {2:"scored"} } ] }, { id: "q6", label: "Vibe check: pick the one that sounds like home.", sub: "This one counts double. It is the tiebreaker for remote workers.", weight: 2, single: true, options: [ { v: "hillcountry", t: "Hill Country views and breathing room", pts: {3:["Dripping Springs","Boerne","Wimberley","Fredericksburg"], 2:["Bulverde","Spring Branch","Canyon Lake","Marble Falls"], 1:["Georgetown","Johnson City"]} }, { v: "masterplanned", t: "Master-planned amenities: pools, trails, events", pts: {3:["Leander","Dripping Springs"], 2:["Cedar Park","Schertz"], 1:["Pflugerville","Kyle","Hutto","Cibolo"]} }, { v: "smalltown", t: "Small-town main street, local flavor", pts: {3:["Georgetown","New Braunfels","Seguin","Lockhart"], 2:["San Marcos","Bastrop","Marble Falls"], 1:["Buda","Kyle","Johnson City"]} }, { v: "action", t: "Close to the action: restaurants, nightlife, airport", pts: {3:["Round Rock","Pflugerville"], 2:["Buda","Kyle","Schertz","Universal City"], 1:["Cedar Park"]} } ] }, { id: "q7", label: "How soon are you moving?", sub: "This does not change your matches. It tells us what to send you next.", weight: 0, single: true, segment: "timeline", options: [ { v: "within3", t: "Within 3 months", flag: "hot" }, { v: "3-12", t: "3 - 12 months" }, { v: "over1", t: "Over a year out" }, { v: "researching", t: "Just researching for now" } ] }, { id: "q8", label: "Anything you want to avoid? (pick up to 2)", sub: null, weight: 1, single: false, maxSelect: 2, explainer: null, options: [ { v: "longcommutes", t: "Long commutes" }, { v: "hightaxes", t: "High property taxes" }, { v: "tourist", t: "Tourist / weekend traffic" }, { v: "none", t: "None, show me everything", exclusive: true } ] } ]; // Theoretical max base score: Q1 9 + Q2 6 + Q3 3 + Q4 3 + Q5 3 + Q6 6 = 30, // plus up to +2 from Q8 adjustments. var MAX_SCORE = 32; function applyPts(scores, pts, weight, exclude) { exclude = exclude || []; ["3","2","1"].forEach(function(k){ var n = parseInt(k, 10); var list = pts[k]; if (list === "rest") list = TOWNS.filter(function(t){ return exclude.indexOf(t) === -1; }); else if (list === "scored") list = TOWNS.filter(function(t){ return (scores[t] || 0) > 0; }); (list || []).forEach(function(t){ scores[t] = (scores[t] || 0) + n * weight; }); }); } // answers: {q1:"downtown", ..., q8:["longcommutes","hightaxes"]} // Returns {scores, top3:[towns], flags:{mud, hot}, labels:{q1,q2,q7}} function scoreQuiz(answers) { var scores = {}; TOWNS.forEach(function(t){ scores[t] = 0; }); var flags = { mud: false, hot: false }; var labels = {}; QUESTIONS.forEach(function(q){ var ans = answers[q.id]; if (ans === undefined || ans === null) return; var picked = q.single ? [ans] : ans; picked.forEach(function(v){ var opt = null; q.options.forEach(function(o){ if (o.v === v) opt = o; }); if (!opt) return; if (q.id === "q1") labels.q1 = opt.t; if (q.id === "q2") labels.q2 = opt.t; if (q.id === "q7") labels.q7 = opt.t; if (opt.flag === "mud") flags.mud = true; if (opt.flag === "hot") flags.hot = true; if (opt.pts) { var exclude = []; ["3","2","1"].forEach(function(k){ var l = opt.pts[k]; if (Array.isArray(l)) exclude = exclude.concat(l); }); applyPts(scores, opt.pts, q.weight || 1, exclude); } }); }); // Commute-side gate: a one-metro commute should not surface towns on the far side of the corridor. var COMMUTE_WRONG_SIDE = { sa: ["Round Rock","Pflugerville","Cedar Park","Leander","Georgetown","Hutto","Liberty Hill","Dripping Springs","Bastrop","Marble Falls","Johnson City"], downtown: ["Boerne","Bulverde","Spring Branch","Schertz","Cibolo","Converse","Universal City","Canyon Lake","Seguin"], north: ["Boerne","Bulverde","Spring Branch","Schertz","Cibolo","Converse","Universal City","Canyon Lake","Seguin","New Braunfels","San Marcos"] }; (COMMUTE_WRONG_SIDE[answers.q1] || []).forEach(function(t){ if (scores[t] !== undefined) scores[t] -= 100; }); // Q8 adjustments (weight 1x, applied after the base sum) var q8 = answers.q8 || []; if (q8.indexOf("longcommutes") !== -1) { var ex = COMMUTE_EXTREMES[answers.q1]; if (ex) { ex.closest.forEach(function(t){ scores[t] += 2; }); ex.farthest.forEach(function(t){ scores[t] -= 2; }); } } if (q8.indexOf("tourist") !== -1) { ["New Braunfels","San Marcos","Dripping Springs","Boerne","Fredericksburg","Wimberley"].forEach(function(t){ scores[t] -= 2; }); } // Rank, then apply high-tax penalty to high-MUD towns in the top 3 var ranked = rankTowns(scores, answers.q1); if (q8.indexOf("hightaxes") !== -1) { ["Seguin","Georgetown","Round Rock","San Marcos","Lockhart","Bastrop"].forEach(function(t){ scores[t] += 2; }); ranked.slice(0, 3).forEach(function(t){ if (HIGH_MUD_TOWNS.indexOf(t) !== -1) scores[t] -= 2; }); ranked = rankTowns(scores, answers.q1); } return { scores: scores, top3: ranked.slice(0, 3), flags: flags, labels: labels }; } function rankTowns(scores, q1ans) { var q1towns = []; QUESTIONS[0].options.forEach(function(o){ if (o.v === q1ans && o.pts) { ["3","2","1"].forEach(function(k){ var l = o.pts[k]; if (Array.isArray(l)) q1towns = q1towns.concat(l); }); } }); return TOWNS.slice().sort(function(a, b){ if (scores[b] !== scores[a]) return scores[b] - scores[a]; var ga = GUIDE_STRENGTH.indexOf(a), gb = GUIDE_STRENGTH.indexOf(b); if (ga !== gb) return ga - gb; // stronger guide wins ties var ca = q1towns.indexOf(a), cb = q1towns.indexOf(b); // then Q1 commute match if (ca === -1) ca = 999; if (cb === -1) cb = 999; return ca - cb; }); } function fitLabel(score, isTop) { var pct = Math.min(100, Math.round(score / MAX_SCORE * 100)); var label; if (pct >= 75) label = "Excellent fit"; else if (pct >= 60) label = "Strong fit"; else if (pct >= 45) label = "Worth a look"; else label = "Possible fit"; // The algorithm's #1 match should never read weaker than "Worth a look". if (isTop && (label === "Possible fit")) label = "Worth a look"; return label; } /* ----------------------- END QUESTIONS & SCORING ----------------------- */ /* ----------------------- END QUESTIONS & SCORING ----------------------- */ /* ------------------------------- UI LOGIC ------------------------------ */ (function(){ var stage = document.getElementById("tht-stage"); var fill = document.getElementById("tht-progress-fill"); var step = 0; var answers = {}; function esc(s){ return String(s == null ? "" : s).replace(/[&<>"']/g, function(c){ return {"&":"&","<":"<",">":">",'"':""","'":"'"}[c]; }); } function render(){ fill.style.width = Math.round(step / QUESTIONS.length * 100) + "%"; if (step < QUESTIONS.length) renderQuestion(); else renderResults(); var quiz = document.getElementById("tht-quiz"); if (quiz && quiz.scrollIntoView) quiz.scrollIntoView({behavior:"smooth", block:"start"}); } function renderQuestion(){ var q = QUESTIONS[step]; var html = '
Question ' + (step+1) + ' of ' + QUESTIONS.length + '
'; html += '

' + esc(q.label) + '

'; if (q.sub) html += '

' + esc(q.sub) + '

'; if (q.explainer) html += '
' + esc(q.explainer) + '
'; if (!q.single) html += '

Pick up to ' + q.maxSelect + ', or choose "' + esc(q.options[q.options.length-1].t) + '".

'; html += '
'; q.options.forEach(function(o){ var sel = isSelected(q, o.v) ? " tht-selected" : ""; html += ''; }); html += '
'; html += '
'; if (step > 0) html += ''; html += '
'; stage.innerHTML = html; var opts = stage.querySelectorAll(".tht-q-opt"); for (var i = 0; i < opts.length; i++) { (function(btn){ btn.addEventListener("click", function(){ toggle(q, btn.getAttribute("data-v")); }); })(opts[i]); } var back = document.getElementById("tht-back"); if (back) back.addEventListener("click", function(){ step--; render(); }); document.getElementById("tht-next").addEventListener("click", function(){ if (!hasAnswer(QUESTIONS[step])) return; step++; render(); }); } function isSelected(q, v){ if (q.single) return answers[q.id] === v; return (answers[q.id] || []).indexOf(v) !== -1; } function hasAnswer(q){ if (q.single) return !!answers[q.id]; return (answers[q.id] || []).length > 0; } function isExclusive(q, v){ var found = false; q.options.forEach(function(o){ if (o.v === v && o.exclusive) found = true; }); return found; } function toggle(q, v){ if (q.single) { answers[q.id] = v; } else { var cur = answers[q.id] || []; var opt = null; q.options.forEach(function(o){ if (o.v === v) opt = o; }); if (opt && opt.exclusive) { cur = [v]; } else { cur = cur.filter(function(x){ return x !== v && !isExclusive(q, x); }); if (cur.indexOf(v) === -1) { if (cur.length >= q.maxSelect) cur.shift(); cur.push(v); } } answers[q.id] = cur; } renderQuestion(); fill.style.width = Math.round(step / QUESTIONS.length * 100) + "%"; } function renderResults(){ fill.style.width = "100%"; var r = scoreQuiz(answers); var html = '
Your results
'; html += '

Your top 3 town matches

'; html += '

Based on your commute, budget, and vibe. Read the full guide for any town to go deeper.

'; var ranks = ["#1 match", "#2 match", "#3 match"]; r.top3.forEach(function(t, i){ html += '
' + '
' + ranks[i] + '
' + '

' + esc(t) + '

' + '' + esc(fitLabel(r.scores[t], i === 0)) + '' + '

' + esc(TOWN_BLURBS[t]) + '

' + 'Read the full ' + esc(t) + ' guide →' + '
'; }); if (r.flags.mud) { html += '
Since you asked: a MUD (Municipal Utility District) is a special tax district that funds water, sewer, and roads in newer developments. It adds an extra property-tax layer, sometimes $3,000+/year on a $600K home. Worth checking the MUD map before you buy in a newer neighborhood.
'; } // Email gate (disabled via THT_CONFIG.showEmailGate until launch) if (THT_CONFIG.showEmailGate) { html += '

Get your full match report

' + 'Your top 3 towns with the numbers behind the match: 2025 tax stacks, drive times to both downtowns, school ratings, and price bands.' + (r.flags.mud ? ' Plus the MUD explainer, since you asked.' : '') + ' Free by email.

'; html += '' + '' + '' + '
No agent will call you. Unsubscribe in one click.
' + '
'; } html += ''; stage.innerHTML = html; document.getElementById("tht-retake").addEventListener("click", function(){ step = 0; answers = {}; render(); }); var gateBtn = document.getElementById("tht-gate-submit"); if (gateBtn) gateBtn.addEventListener("click", function(){ submitGate(r); }); } function submitGate(r){ var msg = document.getElementById("tht-gate-msg"); var name = document.getElementById("tht-name").value.trim(); var email = document.getElementById("tht-email").value.trim(); if (!email || email.indexOf("@") === -1) { msg.innerHTML = '
Please enter a valid email address.
'; return; } var fields = {}; fields[THT_CONFIG.fieldEmail] = email; fields[THT_CONFIG.fieldName] = name; fields[THT_CONFIG.fieldCommute] = r.labels.q1 || ""; fields[THT_CONFIG.fieldBudget] = r.labels.q2 || ""; fields[THT_CONFIG.fieldTimeline] = r.labels.q7 || ""; fields[THT_CONFIG.fieldTopTowns] = r.top3.join(", "); fields[THT_CONFIG.fieldMudFlag] = r.flags.mud ? "yes" : "no"; fields[THT_CONFIG.fieldHotLead] = r.flags.hot ? "yes" : "no"; if (!THT_CONFIG.formAction) { msg.innerHTML = '
Email capture is not connected yet. Your matches are shown above; the full report will be emailed once this is wired up.
'; return; } var iframe = document.createElement("iframe"); iframe.name = "tht-hidden-iframe"; iframe.style.display = "none"; document.body.appendChild(iframe); var form = document.createElement("form"); form.method = THT_CONFIG.formMethod; form.action = THT_CONFIG.formAction; form.target = "tht-hidden-iframe"; Object.keys(fields).forEach(function(k){ var input = document.createElement("input"); input.type = "hidden"; input.name = k; input.value = fields[k]; form.appendChild(input); }); document.body.appendChild(form); form.submit(); msg.innerHTML = '
Done. Your full match report is on its way to ' + esc(email) + '.
'; document.getElementById("tht-gate-submit").disabled = true; } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", render); } else { render(); } })();