SELLER OFFER ANALYSIS TOOL

`); w.document.close(); }); closeEmailModal(); }function initializeApp() { loadAutoSavedData(); const propInputs = ['propAddress', 'propSqft', 'propCmaLow', 'propCmaHigh', 'propListingCommission', 'propMortgagePayoff']; propInputs.forEach(id => { document.getElementById(id).addEventListener('change', () => { updateProperty(false); autoSaveData(); }); document.getElementById(id).addEventListener('input', () => { updateProperty(false); autoSaveData(); }); }); document.getElementById('propTitle').addEventListener('change', () => { updateProperty(true); autoSaveData(); }); document.getElementById('propTitle').addEventListener('input', () => { updateProperty(true); autoSaveData(); }); if (!property.titleCostOverridden && offers.length > 0 && offers[0].salesPrice > 0 && !property.titleCost) { property.titleCost = calculateTitleCost(offers[0].salesPrice); document.getElementById('propTitle').value = property.titleCost; } renderOffers(); checkFirstTimeUser(); } function autoSaveData() { try { localStorage.setItem('atg_seller_tool_autosave', JSON.stringify({ property, offers, nextId, savedAt: new Date().toISOString() })); } catch(e) { console.log('Auto-save failed:', e); } } function loadAutoSavedData() { try { const saved = localStorage.getItem('atg_seller_tool_autosave'); if (saved) { const data = JSON.parse(saved); property = data.property; offers = data.offers; nextId = data.nextId || offers.length + 1; document.getElementById('propAddress').value = property.address || ''; document.getElementById('propSqft').value = property.sqft || ''; document.getElementById('propCmaLow').value = property.cmaLow || ''; document.getElementById('propCmaHigh').value = property.cmaHigh || ''; document.getElementById('propTitle').value = property.titleCost || ''; document.getElementById('propListingCommission').value = property.listingCommission || 3; document.getElementById('propMortgagePayoff').value = property.mortgagePayoff || ''; const titleIndicator = document.getElementById('titleCalcIndicator'); if (property.titleCostOverridden) { titleIndicator.textContent = '(custom)'; titleIndicator.classList.add('overridden'); } else { titleIndicator.textContent = '(auto-calculated)'; titleIndicator.classList.remove('overridden'); } document.getElementById('summaryRange').textContent = (property.cmaLow && property.cmaHigh) ? formatCurrency(property.cmaLow) + ' – ' + formatCurrency(property.cmaHigh) : '—'; } } catch(e) { console.log('Auto-load failed:', e); } } function clearAutoSavedData() { localStorage.removeItem('atg_seller_tool_autosave'); } function startNewAnalysis() { if (!confirm('Start a new analysis? This will clear all current data.')) return; clearAutoSavedData(); property = { address: '', sqft: 0, cmaLow: 0, cmaHigh: 0, titleCost: 0, titleCostOverridden: false, listingCommission: 3, mortgagePayoff: 0 }; offers = [{ id: 1, name: 'Offer 1', salesPrice: 0, buyerAgentCommission: 3, sellerCredits: 0, sellerCreditsPercent: 0, earnest: 0, earnestPercent: 1, optionFee: 500, optionDays: 5, homeWarranty: 550, titlePaidBy: 'seller', surveyPaidBy: 'none', repairCredit: 0, repairsRequired: '', nonRealtyItems: {}, nonRealtyOther: '', nonRealtyValue: 0, nonRealtyOffer: 0, closingDays: 30, closingDate: '', paymentType: 'loan', loanType: 'conventional', downPaymentPercent: 20, maxInterestRate: 0, maxLoanCosts: 0, notes: '', otherSellerCosts: 0 }]; nextId = 2; document.getElementById('propAddress').value = ''; document.getElementById('propSqft').value = ''; document.getElementById('propCmaLow').value = ''; document.getElementById('propCmaHigh').value = ''; document.getElementById('propTitle').value = ''; document.getElementById('propListingCommission').value = '3'; document.getElementById('propMortgagePayoff').value = ''; const titleIndicator = document.getElementById('titleCalcIndicator'); titleIndicator.textContent = '(auto-calculated)'; titleIndicator.classList.remove('overridden'); document.getElementById('summaryRange').textContent = '—'; renderOffers(); } function printAnalysis() { const calculations = offers.map(o => calculateOffer(o)); const address = property.address || 'Property Not Specified'; const now = new Date().toLocaleString();let printHtml = `Seller Offer Analysis - ${address}
Adam Timothy Group

Seller Offer Analysis

Generated: ${now}
`;// Property details printHtml += `

Property Details

Address
${address}
Square Feet
${property.sqft ? property.sqft.toLocaleString() : '—'}
CMA Range
${formatCurrency(property.cmaLow)} – ${formatCurrency(property.cmaHigh)}
Mortgage Payoff
${property.mortgagePayoff > 0 ? formatCurrency(property.mortgagePayoff) : '—'}
CMA Midpoint
${formatCurrency((property.cmaLow + property.cmaHigh) / 2)}
`;// Submitter info const submitterName = document.getElementById('submitterName')?.value || ''; const submitterEmail = document.getElementById('submitterEmail')?.value || ''; if (submitterName || submitterEmail) { printHtml += `
Prepared by: ${submitterName}${submitterEmail ? ' (' + submitterEmail + ')' : ''}
`; }// Offer cards printHtml += `
`;offers.forEach((offer, index) => { const calc = calculations[index]; const isBaseline = index === 0; const cmaMid = (property.cmaLow + property.cmaHigh) / 2; const diffSign = calc.diffFromCmaMid >= 0 ? '+' : '';const cmaBadgeLabel = calc.cmaStatus === 'above' ? 'NET PRICE ABOVE CMA — EXCELLENT' : calc.cmaStatus === 'below' ? 'NET PRICE BELOW CMA — LOW' : calc.cmaStatus === 'within-high' ? 'NET PRICE WITHIN CMA — UPPER RANGE' : 'NET PRICE WITHIN CMA — LOWER RANGE';printHtml += `
${offer.name}${isBaseline ? 'Primary' : ''}
${cmaBadgeLabel}
Net Price (vs CMA)
${formatCurrency(calc.netPrice)}
${diffSign}${formatCurrency(calc.diffFromCmaMid)} vs CMA midpoint
Net Price
${formatCurrency(calc.netPrice)}
Net to Seller
${formatCurrency(calc.netToSeller)}
Net Proceeds ${property.mortgagePayoff > 0 ? '' : '(before mortgage)'}
${property.mortgagePayoff > 0 ? formatCurrency(calc.estimatedProceeds) : formatCurrency(calc.netToSeller) + '*'}

Cost Breakdown

Offer Price${formatCurrency(offer.salesPrice)}
`;if ((offer.sellerCredits || 0) > 0) printHtml += `
Seller Credits-${formatCurrency(offer.sellerCredits)}
`; if ((offer.homeWarranty || 0) > 0) printHtml += `
Home Warranty-${formatCurrency(offer.homeWarranty)}
`; if (calc.titlePaidBySeller > 0) printHtml += `
Title Policy (Seller)-${formatCurrency(calc.titlePaidBySeller)}
`; if (calc.surveyPaidBySeller > 0) printHtml += `
Survey (Seller)-${formatCurrency(calc.surveyPaidBySeller)}
`; if (calc.repairCredit > 0) printHtml += `
Repair Credit-${formatCurrency(calc.repairCredit)}
`; if ((offer.otherSellerCosts || 0) > 0) printHtml += `
Other Seller Costs-${formatCurrency(offer.otherSellerCosts)}
`; if (calc.excessBAC > 0) printHtml += `
Excess BAC (above 3%)-${formatCurrency(calc.excessBAC)}
`; if (calc.nonRealtyNetImpact !== 0) printHtml += `
Personal Property (Net)${calc.nonRealtyNetImpact >= 0 ? '+' : ''}${formatCurrency(calc.nonRealtyNetImpact)}
`;printHtml += `
NET PRICE${formatCurrency(calc.netPrice)}
Listing Commission (${property.listingCommission || 3}%)-${formatCurrency(calc.listingCommission)}
Buyer Agent Commission (${offer.buyerAgentCommission || 3}%)-${formatCurrency(calc.buyerAgentCommission)}
`; if (calc.estimatedAdditionalClosingCosts > 0) printHtml += `
Est. Additional Closing Costs-${formatCurrency(calc.estimatedAdditionalClosingCosts)}
`; printHtml += `
Net to Seller${formatCurrency(calc.netToSeller)}
Mortgage Payoff${property.mortgagePayoff > 0 ? '-' + formatCurrency(property.mortgagePayoff) : 'Not provided'}
Estimated Proceeds${property.mortgagePayoff > 0 ? formatCurrency(calc.estimatedProceeds) : formatCurrency(calc.netToSeller) + '*'}
`; if (!(property.mortgagePayoff > 0)) printHtml += `
*Before mortgage payoff
`;printHtml += `
`;// Offer terms printHtml += `
Earnest Money${formatCurrency(offer.earnest)}${offer.earnestPercent ? ' (' + offer.earnestPercent + '%)' : ''}
Option Fee / Days${formatCurrency(offer.optionFee)} / ${offer.optionDays} days
Closing${offer.closingDate || offer.closingDays + ' days'}
Financing${offer.paymentType === 'cash' ? 'CASH' : (offer.loanType || 'Conventional').charAt(0).toUpperCase() + (offer.loanType || 'conventional').slice(1) + (offer.downPaymentPercent ? ' (' + offer.downPaymentPercent + '% down)' : '')}
`;if ((offer.homeWarranty || 0) > 0) printHtml += `
Home Warranty${formatCurrency(offer.homeWarranty)}
`; printHtml += `
Title Policy${offer.titlePaidBy === 'seller' ? 'Seller Pays' : 'Buyer Pays'}
`; if (offer.surveyPaidBy && offer.surveyPaidBy !== 'none') printHtml += `
Survey${offer.surveyPaidBy === 'seller' ? 'Seller Pays' : 'Buyer Pays'}
`; if ((offer.repairCredit || 0) > 0) printHtml += `
Repair Credit${formatCurrency(offer.repairCredit)}
`; if ((offer.otherSellerCosts || 0) > 0) printHtml += `
Other Seller Costs${formatCurrency(offer.otherSellerCosts)}
`; if ((offer.sellerCredits || 0) > 0) printHtml += `
Seller Concessions${formatCurrency(offer.sellerCredits)}
`;const nonRealtyChecked = []; if (offer.nonRealtyItems?.washer) nonRealtyChecked.push('Washer'); if (offer.nonRealtyItems?.dryer) nonRealtyChecked.push('Dryer'); if (offer.nonRealtyItems?.refrigerator) nonRealtyChecked.push('Refrigerator'); if (offer.nonRealtyItems?.other) nonRealtyChecked.push(offer.nonRealtyOther || 'Other'); if (nonRealtyChecked.length > 0) { printHtml += `
Personal Property Included${nonRealtyChecked.join(', ')}
`; if ((offer.nonRealtyValue || 0) > 0 || (offer.nonRealtyOffer || 0) > 0) printHtml += `
Personal Property Value / Buyer Offer${formatCurrency(offer.nonRealtyValue || 0)} / ${formatCurrency(offer.nonRealtyOffer || 0)} (Net: ${((offer.nonRealtyOffer || 0) - (offer.nonRealtyValue || 0)) >= 0 ? '+' : ''}${formatCurrency((offer.nonRealtyOffer || 0) - (offer.nonRealtyValue || 0))})
`; }if (offer.paymentType !== 'cash' && offer.maxInterestRate > 0) printHtml += `
Max Interest Rate${offer.maxInterestRate}%
`; if (offer.paymentType !== 'cash' && offer.maxLoanCosts > 0) printHtml += `
Max Loan Costs${offer.maxLoanCosts}%
`;if (offer.repairsRequired) printHtml += `
Repairs Required${offer.repairsRequired}
`; if (offer.notes) printHtml += `
Notes${offer.notes}
`;printHtml += `
`; });printHtml += `
`;printHtml += `
Disclaimer: The values presented in this offer analysis are provided for informational purposes only and are based on current market conditions and standard fee structures. These figures are estimates and may be subject to change. Actual amounts may vary. We recommend consulting with your title company, attorney, and tax professionals for accurate figures. Adam Timothy Group is not responsible for any discrepancies between these estimates and final amounts at closing.
`;const printWindow = window.open('', '_blank'); printWindow.document.write(printHtml); printWindow.document.close(); printWindow.focus(); setTimeout(() => { printWindow.print(); }, 300); }