Sunset Motel
IN
Shamrock Motel
IN
Budget Motel
IN
Henderson Downtown Motel
IN
Budget Lodge
IN
Cassidy
IN
Shamrock Motel
IN
HiWay Motel
IN
Clover-Leaf Motel
IN
Mr. K's Motel
IN
Doll's Motel
IN
Blackhawk Motel
IN
Flamingo Motel
IN
Northgate Motel
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
${esc(d.description.slice(0,320))}${d.description.length>320?'โฆ':''}
${esc(d.category_label)} ยท ${esc(d.city||'')}${d.city?', ':''}${esc(d.state||'')}
${d.address ? `${esc(d.address)}
`:''}Not found.
'; } else renderDetail(d); panel.classList.remove('loading'); }).catch(()=>{ dpBody.innerHTML = 'Could not load.
'; panel.classList.remove('loading'); }); return false; } function closeDetail(push) { activeDetailId = null; panel.classList.remove('open'); panel.setAttribute('aria-hidden','true'); document.querySelectorAll('.prop-card.active').forEach(c => c.classList.remove('active')); if (push !== false) { const url = new URL(window.location); url.searchParams.delete('selected'); history.pushState({}, '', url); } } // back/forward window.addEventListener('popstate', (e) => { const sel = new URL(window.location).searchParams.get('selected'); if (sel) openDetailFromHistory(parseInt(sel)); else closeDetail(false); }); function openDetailFromHistory(id) { activeDetailId = id; panel.classList.add('open','loading'); panel.setAttribute('aria-hidden','false'); document.querySelectorAll('.prop-card').forEach(c => c.classList.toggle('active', c.dataset.id == id)); fetch(`/api/property/${id}/detail`).then(r=>r.json()).then(d => { if (activeDetailId != id) return; if (d && d.id) renderDetail(d); panel.classList.remove('loading'); }); } // Esc closes document.addEventListener('keydown', e => { if (e.key === 'Escape' && panel.classList.contains('open')) closeDetail(); }); // Open on load if ?selected= present (shared URL) (function(){ const sel = new URL(window.location).searchParams.get('selected'); if (sel) openDetailFromHistory(parseInt(sel)); })();