Complete the form below to get pre-approved for your home loan. This will help you understand your budget and show sellers you're a serious buyer.
Get started on your pre-approval journey! Fill in your basic information below and we'll guide you through the process.
Password * (minimum 6 characters)
Continue with Pre-Approval
Already have an account? Login here
Hi there !
Your account has been created successfully. You're one step closer to getting pre-approved!
Here's what happens next:
1
📧 Verify Your Email
Check your inbox for a verification email from FSBO-PRO and click the link to verify your account.
2
💰 Submit Your Pre-Approval
Once verified, log in and complete your pre-approval application with your financial information.
3
📄 Upload Documents
Provide required documents (ID, bank statements, tax returns) for instant verification.
4
✅ Get Approved
Our team reviews your application and you'll receive your pre-approval decision within 24 hours.
Verification Email: Check your spam folder if you don't see it in 5 minutes
Fast Process: Most pre-approvals are completed within 24 hours
Check Your Email
I'll Do It Later
FOR SALE BY OWNER
Claim This Listing
Share
Save
Flyer
16259 W Caribbean Ln, Surprise, AZ 85379
16259 W Caribbean Ln, Surprise, AZ 85379
$368,000
$275/sq ft
Listed 1 month ago
•
FSBO-PRO #FSBO0004058
REQUEST MORE INFO
SCHEDULE A SHOWING
GET PRE-APPROVED
FSBO.PRO Protection
All inquiries and showings are handled securely through our platform.
DETAILS
FEATURES
LOCATION
OWNER
About This Property
Updated home + OWNED SOLAR + $368K (For Sale By Owner) MOTIVATED seller relocating across the country, no contingencies/no concessions Located in the desirable Legacy Parc neighborhood (Surprise, AZ 85379)
Looking for a move-in ready home where you don’t have to worry about utility bills or expensive AC repairs? This is it.
The Best Parts: FULLY OWNED SOLAR – 100% paid off. Zero lease transfers. Save hundreds every single month on your electric bill. BRAND NEW FLOORING (2025) – Beautiful LVP throughout all common areas and fresh, cozy carpet in the bedrooms. NEWER MECHANICALS – The AC unit and water heater are only 4 years old. No high-ticket desert repairs to worry about!
The Details: • Price: $368,000 (Firm) • Terms: Clean, hassle-free transaction. Sold "As-Is" with no buyer contingencies. • Quick & secure closing handled through a local, licensed Title Agency. • Viewings to be SCHEDULED by appointment only during the following days/times: Fridays: 5pm - 8pm Saturday/Sunday: 12pm - 4pm
DM me to schedule a private walkthrough!
Property Type
Single Family
Year Built
2002
Lot Size
5,405 sqft
Heating
Forced air; Other; Gas
Cooling
Refrigerator; Central
Features & Amenities
Interior Features
Carpet
Central
Forced air
Garage - Attached
Garbage disposal
Gas
Laminate
Microwave
None
Other
Range / Oven
Refrigerator
Tile Flooring
Wood
Kitchen & Appliances
Location
16259 W Caribbean Ln, Surprise, AZ 85379,
Surprise,
AZ
85379
Login Required
Please login to schedule a showing for this property.
Login to Continue
Claim This Listing
Verify your property ownership and
take control of your listing.
Mobile Number Not Matched
The mobile number you entered does not
match the phone number associated with
this property listing.
Please check your number
Make sure you are using the mobile
number registered with the property.
Try Again
Close
Estimated Monthly Payment
$2,427
Payment Breakdown
Principal & Interest
$1,959
Property Tax
$368
Home Insurance
$100
HOA Fees
$0
Loan Amount
$294,400
Total Interest Paid
$410,714
Total Cost
$705,114
// ============================================================
// Schedule Showing Modal + Seller Availability
// ============================================================
let sellerAvailabilitySlots = [];
let availabilityMode = 'flexible';
let availabilityLoaded = false;
let showingDatePicker = null;
/**
* Return local browser date as YYYY-MM-DD.
*/
function getLocalDateString(date = new Date()) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
/**
* Convert HH:MM or HH:MM:SS to total minutes.
*/
function timeToMinutes(time) {
if (!time) {
return 0;
}
const parts = time.split(':');
return (
parseInt(parts[0], 10) * 60 +
parseInt(parts[1], 10)
);
}
/**
* Convert 24-hour time to AM/PM display.
*/
function formatTime(time) {
if (!time) {
return '';
}
const parts = time.split(':');
let hour = parseInt(parts[0], 10);
const minute = parts[1] || '00';
const suffix = hour >= 12 ? 'PM' : 'AM';
hour = hour % 12;
if (hour === 0) {
hour = 12;
}
return `${hour}:${minute} ${suffix}`;
}
/**
* Display a seller availability slot as:
* 9:10 PM - 9:40 PM
*/
function formatSlotTime(startTime, endTime) {
return `${formatTime(startTime)} - ${formatTime(endTime)}`;
}
/**
* Open Schedule Showing Modal.
*/
function openShowingModal() {
document.getElementById('showingModal').classList.add('active');
document.body.style.overflow = 'hidden';
}
/**
* Close Schedule Showing Modal.
*/
function closeShowingModal() {
document.getElementById('showingModal').classList.remove('active');
document.body.style.overflow = 'auto';
}
/**
* Load future active seller availability for this listing.
*
* If future seller slots exist:
* - only seller dates are allowed
* - only seller times for selected date are shown
*
* If no future seller slots exist:
* - flexible date/time selection is enabled
*/
async function loadSellerAvailability() {
const dateInput = document.getElementById('showingDate');
const timeSelect = document.getElementById('showingTime');
const hint = document.getElementById('availabilityHint');
if (!dateInput || !timeSelect) {
return;
}
sellerAvailabilitySlots = [];
availabilityMode = 'flexible';
availabilityLoaded = false;
dateInput.disabled = true;
timeSelect.disabled = true;
dateInput.value = '';
timeSelect.innerHTML =
'
Loading available times... ';
if (hint) {
hint.textContent = 'Checking seller availability...';
}
try {
const formData = new FormData();
formData.append('action', 'get_available_slots');
formData.append('listing_id', '4058');
const response = await fetch(
'https://fsbo.pro/api/availability-handler.php',
{
method: 'POST',
body: formData
}
);
if (!response.ok) {
throw new Error('Availability request failed.');
}
const data = await response.json();
if (!data.success) {
throw new Error(
data.message || 'Unable to load seller availability.'
);
}
sellerAvailabilitySlots = Array.isArray(data.slots)
? data.slots
: [];
/*
* Remove any slot that has already started.
* This is especially important when the selected
* date is today.
*/
const now = new Date();
const today = getLocalDateString(now);
const currentMinutes =
now.getHours() * 60 + now.getMinutes();
sellerAvailabilitySlots = sellerAvailabilitySlots.filter(slot => {
if (slot.available_date > today) {
return true;
}
if (slot.available_date < today) {
return false;
}
return timeToMinutes(slot.start_time) > currentMinutes;
});
if (sellerAvailabilitySlots.length > 0) {
availabilityMode = 'seller';
setupSellerAvailability();
} else {
availabilityMode = 'flexible';
setupFlexibleAvailability();
}
availabilityLoaded = true;
} catch (error) {
console.error('Seller availability error:', error);
/*
* If the availability API cannot be reached, keep the
* form usable by falling back to flexible showing mode.
*/
availabilityMode = 'flexible';
sellerAvailabilitySlots = [];
setupFlexibleAvailability();
if (hint) {
hint.textContent =
'Seller availability could not be loaded. You may request a future date and time.';
}
}
}
/**
* Setup date selection when seller has future availability.
*/
function setupSellerAvailability() {
const dateInput = document.getElementById('showingDate');
const timeSelect = document.getElementById('showingTime');
const hint = document.getElementById('availabilityHint');
if (!dateInput || !timeSelect) {
return;
}
/*
* Build unique available dates. Only these dates will be
* enabled in the calendar. Every other date is disabled.
*/
const availableDates = [
...new Set(
sellerAvailabilitySlots
.map(slot => slot.available_date)
.filter(Boolean)
)
].sort();
if (availableDates.length === 0) {
setupFlexibleAvailability();
return;
}
dateInput.disabled = false;
/* Remove the native browser date picker and create our custom picker. */
if (showingDatePicker) {
showingDatePicker.destroy();
showingDatePicker = null;
}
/*
* IMPORTANT:
* Native
cannot disable arbitrary dates.
* Flatpickr can, so only sellerAvailability dates are enabled.
*/
if (typeof flatpickr !== 'undefined') {
showingDatePicker = flatpickr(dateInput, {
dateFormat: 'Y-m-d',
altInput: true,
altFormat: 'd-m-Y',
allowInput: false,
disableMobile: true,
enable: availableDates,
defaultDate: availableDates[0],
minDate: availableDates[0],
maxDate: availableDates[availableDates.length - 1],
onChange: function(selectedDates, dateStr) {
if (!availableDates.includes(dateStr)) {
this.setDate(availableDates[0], true);
return;
}
populateSellerTimes(dateStr);
}
});
} else {
/* Fallback if the Flatpickr library fails to load. */
dateInput.type = 'date';
dateInput.min = availableDates[0];
dateInput.max = availableDates[availableDates.length - 1];
dateInput.value = availableDates[0];
dateInput.onchange = function() {
if (!availableDates.includes(this.value)) {
alert('Please select one of the dates when the seller is available.');
this.value = availableDates[0];
}
populateSellerTimes(this.value);
};
}
if (hint) {
hint.innerHTML =
'
Seller availability: Only dates with seller availability are selectable. Please choose an available time slot.';
}
populateSellerTimes(availableDates[0]);
}
/**
* Populate seller time slots for the selected date.
*/
function populateSellerTimes(selectedDate) {
const timeSelect = document.getElementById('showingTime');
if (!timeSelect) {
return;
}
timeSelect.innerHTML = '';
timeSelect.disabled = true;
if (!selectedDate) {
timeSelect.innerHTML =
'
Select a date first ';
return;
}
let slots = sellerAvailabilitySlots.filter(slot =>
slot.available_date === selectedDate
);
/*
* On today's date, only slots whose START TIME is still
* in the future can be selected.
*/
const now = new Date();
const today = getLocalDateString(now);
const currentMinutes =
now.getHours() * 60 + now.getMinutes();
slots = slots.filter(slot => {
if (slot.available_date > today) {
return true;
}
if (slot.available_date < today) {
return false;
}
return timeToMinutes(slot.start_time) > currentMinutes;
});
if (slots.length === 0) {
timeSelect.innerHTML = `
No available time for this date
`;
return;
}
timeSelect.innerHTML =
'
Select a time ';
slots.forEach(slot => {
const option = document.createElement('option');
/*
* Submit the seller slot START TIME.
* Example:
* 21:10:00 - 21:40:00
* submitted value = 21:10
*/
option.value = slot.start_time.substring(0, 5);
option.textContent = formatSlotTime(
slot.start_time,
slot.end_time
);
option.dataset.slotId = slot.id || '';
timeSelect.appendChild(option);
});
timeSelect.disabled = false;
}
/**
* Setup flexible showing mode when there are no future
* active seller availability slots.
*/
function setupFlexibleAvailability() {
const dateInput = document.getElementById('showingDate');
const timeSelect = document.getElementById('showingTime');
const hint = document.getElementById('availabilityHint');
if (!dateInput || !timeSelect) {
return;
}
const today = getLocalDateString();
dateInput.disabled = false;
/* Destroy seller-only calendar before switching to flexible mode. */
if (showingDatePicker) {
showingDatePicker.destroy();
showingDatePicker = null;
}
if (typeof flatpickr !== 'undefined') {
showingDatePicker = flatpickr(dateInput, {
dateFormat: 'Y-m-d',
altInput: true,
altFormat: 'd-m-Y',
allowInput: false,
disableMobile: true,
minDate: today,
defaultDate: today,
onChange: function(selectedDates, dateStr) {
populateFlexibleTimes(dateStr);
}
});
} else {
/* Fallback to the native date input. */
dateInput.type = 'date';
dateInput.min = today;
dateInput.removeAttribute('max');
dateInput.value = today;
dateInput.onchange = function() {
populateFlexibleTimes(this.value);
};
}
if (hint) {
hint.innerHTML =
'
Flexible showing: The seller has no future availability scheduled. You may request any future date and time.';
}
populateFlexibleTimes(today);
}
/**
* Populate flexible showing times.
*
* Times are generated every 30 minutes.
* For today, only times after the current time are shown.
* For future dates, all 30-minute times are available.
*/
function populateFlexibleTimes(selectedDate) {
const timeSelect = document.getElementById('showingTime');
if (!timeSelect) {
return;
}
timeSelect.innerHTML =
'
Select a time ';
timeSelect.disabled = true;
if (!selectedDate) {
return;
}
const now = new Date();
const today = getLocalDateString(now);
const currentMinutes =
now.getHours() * 60 + now.getMinutes();
for (let minutes = 0; minutes < 24 * 60; minutes += 30) {
/*
* For today, do not offer a past/current time.
*/
if (
selectedDate === today &&
minutes <= currentMinutes
) {
continue;
}
const hour = Math.floor(minutes / 60);
const minute = minutes % 60;
const value =
String(hour).padStart(2, '0') + ':' +
String(minute).padStart(2, '0');
const option = document.createElement('option');
option.value = value;
option.textContent = formatTime(value);
timeSelect.appendChild(option);
}
timeSelect.disabled =
timeSelect.options.length <= 1;
}
/**
* Validate selected showing date/time before submission.
* This is frontend validation only. The API must ALSO validate
* the request server-side.
*/
function validateShowingSelection() {
const dateInput = document.getElementById('showingDate');
const timeSelect = document.getElementById('showingTime');
if (!dateInput || !timeSelect) {
return false;
}
const selectedDate = dateInput.value;
const selectedTime = timeSelect.value;
if (!selectedDate) {
alert('Please select a showing date.');
return false;
}
if (!selectedTime) {
alert('Please select a showing time.');
return false;
}
const now = new Date();
const today = getLocalDateString(now);
const currentMinutes =
now.getHours() * 60 + now.getMinutes();
/* Never allow a past date. */
if (selectedDate < today) {
alert('Please select today or a future date.');
return false;
}
/* Never allow current/past time today. */
if (
selectedDate === today &&
timeToMinutes(selectedTime) <= currentMinutes
) {
alert('Please select a time after the current time.');
return false;
}
/*
* Seller availability mode:
* the selected date/time must match a future seller slot.
*/
if (availabilityMode === 'seller') {
const matchingSlot = sellerAvailabilitySlots.find(slot => {
return (
slot.available_date === selectedDate &&
selectedTime === slot.start_time.substring(0, 5)
);
});
if (!matchingSlot) {
alert(
'The selected date/time is not available. Please choose one of the seller\'s available showing slots.'
);
return false;
}
}
return true;
}
// ============================================================
// Submit Showing Request
// ============================================================
function submitShowingRequest(e) {
e.preventDefault();
/*
* Validate before sending the request.
*/
if (!validateShowingSelection()) {
return;
}
const form = e.target;
const formData = new FormData(form);
formData.append('action', 'schedule_showing');
formData.append('listing_id', '4058');
formData.append(
'property_address',
'16259 W Caribbean Ln, Surprise, AZ 85379'
);
const btn = form.querySelector('button[type="submit"]');
const originalHTML = btn.innerHTML;
/* Show loader */
btn.disabled = true;
btn.classList.add('loading');
btn.innerHTML = `
Submitting...
`;
fetch('https://fsbo.pro/api/showing-handler.php', {
method: 'POST',
body: formData
})
.then(r => r.json())
.then(data => {
if (data.success) {
/* Show success message */
const successMsg = document.createElement('div');
successMsg.style.cssText =
'background: linear-gradient(135deg, #d4edda, #c3e6cb); color: #155724; padding: 20px; border-radius: 12px; margin-bottom: 20px; text-align: center; animation: slideDown 0.4s ease;';
successMsg.innerHTML = `
Showing Request Sent!
${data.message}
`;
form.parentNode.insertBefore(successMsg, form);
form.reset();
/*
* Restore showing controls after reset so that opening
* the modal again reloads current seller availability.
*/
const dateInput = document.getElementById('showingDate');
const timeSelect = document.getElementById('showingTime');
if (dateInput) {
if (showingDatePicker) {
showingDatePicker.clear();
} else {
dateInput.value = '';
}
}
if (timeSelect) {
timeSelect.innerHTML =
'
Select a time ';
timeSelect.disabled = true;
}
setTimeout(() => {
closeShowingModal();
setTimeout(() => successMsg.remove(), 300);
}, 3000);
} else {
alert(
data.message ||
'Error submitting request. Please try again.'
);
}
/* Restore button */
btn.disabled = false;
btn.classList.remove('loading');
btn.innerHTML = originalHTML;
})
.catch(() => {
alert('Error submitting request. Please try again.');
btn.disabled = false;
btn.classList.remove('loading');
btn.innerHTML = originalHTML;
});
}
// Calculator Modal
function openCalculatorModal() {
document.getElementById('calculatorModal').classList.add('active');
document.body.style.overflow = 'hidden';
calculatePayment(); // Recalculate on open
}
function closeCalculatorModal() {
document.getElementById('calculatorModal').classList.remove('active');
document.body.style.overflow = 'auto';
}
// Result Modal Function
//
// IMPORTANT:
// Build the modal with DOM elements instead of innerHTML/template strings.
// This prevents literal text such as "+ safeTitle +" or "${title}" from
// ever being displayed in the modal.
function showResultModal(type, title, message) {
// Remove any previous result modal.
const oldModal = document.getElementById('resultModal');
if (oldModal) {
oldModal.remove();
}
const isError = String(type).toLowerCase() === 'error';
const modal = document.createElement('div');
modal.className = 'custom-modal active';
modal.id = 'resultModal';
const overlay = document.createElement('div');
overlay.className = 'modal-overlay';
overlay.addEventListener('click', closeResultModal);
const container = document.createElement('div');
container.className = 'modal-container';
container.style.maxWidth = '450px';
const header = document.createElement('div');
header.className = 'modal-header';
header.style.background = isError
? 'linear-gradient(135deg, #dc3545, #c82333)'
: 'linear-gradient(135deg, #28a745, #218838)';
const heading = document.createElement('h3');
heading.textContent = title || 'Message';
const closeButton = document.createElement('button');
closeButton.type = 'button';
closeButton.className = 'modal-close';
closeButton.setAttribute('aria-label', 'Close');
closeButton.addEventListener('click', closeResultModal);
const closeSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
closeSvg.setAttribute('width', '24');
closeSvg.setAttribute('height', '24');
closeSvg.setAttribute('viewBox', '0 0 24 24');
closeSvg.setAttribute('fill', 'none');
const closePath = document.createElementNS('http://www.w3.org/2000/svg', 'path');
closePath.setAttribute('d', 'M18 6L6 18M6 6l12 12');
closePath.setAttribute('stroke', 'white');
closePath.setAttribute('stroke-width', '2');
closePath.setAttribute('stroke-linecap', 'round');
closeSvg.appendChild(closePath);
closeButton.appendChild(closeSvg);
header.appendChild(heading);
header.appendChild(closeButton);
const body = document.createElement('div');
body.className = 'modal-body';
body.style.textAlign = 'center';
body.style.padding = '40px 28px';
// Create success/error icon safely using DOM APIs.
const iconSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
iconSvg.setAttribute('width', '64');
iconSvg.setAttribute('height', '64');
iconSvg.setAttribute('viewBox', '0 0 64 64');
iconSvg.setAttribute('fill', 'none');
const iconCircle1 = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
iconCircle1.setAttribute('cx', '32');
iconCircle1.setAttribute('cy', '32');
iconCircle1.setAttribute('r', '30');
iconCircle1.setAttribute('fill', isError ? '#dc3545' : '#28a745');
iconCircle1.setAttribute('fill-opacity', '0.1');
const iconCircle2 = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
iconCircle2.setAttribute('cx', '32');
iconCircle2.setAttribute('cy', '32');
iconCircle2.setAttribute('r', '24');
iconCircle2.setAttribute('stroke', isError ? '#dc3545' : '#28a745');
iconCircle2.setAttribute('stroke-width', '3');
const iconPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');
if (isError) {
iconPath.setAttribute('d', 'M32 20v16M32 44h.02');
iconPath.setAttribute('stroke', '#dc3545');
iconPath.setAttribute('stroke-width', '3');
iconPath.setAttribute('stroke-linecap', 'round');
} else {
iconPath.setAttribute('d', 'M20 32l8 8 16-16');
iconPath.setAttribute('stroke', '#28a745');
iconPath.setAttribute('stroke-width', '3');
iconPath.setAttribute('stroke-linecap', 'round');
iconPath.setAttribute('stroke-linejoin', 'round');
}
iconSvg.appendChild(iconCircle1);
iconSvg.appendChild(iconCircle2);
iconSvg.appendChild(iconPath);
const messageParagraph = document.createElement('p');
messageParagraph.textContent = message || '';
messageParagraph.style.fontSize = '16px';
messageParagraph.style.color = '#333';
messageParagraph.style.margin = '20px 0 30px';
messageParagraph.style.lineHeight = '1.6';
const doneButton = document.createElement('button');
doneButton.type = 'button';
doneButton.className = 'btn-modal-submit';
doneButton.textContent = 'Close';
doneButton.style.background = isError
? 'linear-gradient(135deg, #dc3545, #c82333)'
: 'linear-gradient(135deg, #28a745, #218838)';
doneButton.addEventListener('click', closeResultModal);
body.appendChild(iconSvg);
body.appendChild(messageParagraph);
body.appendChild(doneButton);
container.appendChild(header);
container.appendChild(body);
modal.appendChild(overlay);
modal.appendChild(container);
document.body.appendChild(modal);
document.body.style.overflow = 'hidden';
}
function closeResultModal() {
const modal = document.getElementById('resultModal');
if (modal) {
modal.remove();
}
document.body.style.overflow = 'auto';
}
// Calculator functions
function calculatePayment() {
const price = parseFloat(document.getElementById('calcPrice').value) || 0;
const downPayment = parseFloat(document.getElementById('calcDownPayment').value) || 0;
const interestRate = parseFloat(document.getElementById('calcInterest').value) || 0;
const term = parseInt(document.getElementById('calcTerm').value) || 30;
const annualTax = parseFloat(document.getElementById('calcTax').value) || 0;
const annualInsurance = parseFloat(document.getElementById('calcInsurance').value) || 0;
const monthlyHOA = parseFloat(document.getElementById('calcHOA').value) || 0;
const loanAmount = price - downPayment;
const monthlyRate = (interestRate / 100) / 12;
const months = term * 12;
// Calculate monthly P&I
let monthlyPI = 0;
if (monthlyRate > 0) {
monthlyPI = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, months)) / (Math.pow(1 + monthlyRate, months) - 1);
} else {
monthlyPI = loanAmount / months;
}
const monthlyTax = annualTax / 12;
const monthlyInsurance = annualInsurance / 12;
const totalMonthly = monthlyPI + monthlyTax + monthlyInsurance + monthlyHOA;
// Update display
document.getElementById('calcTotalPayment').innerHTML = `$${Math.round(totalMonthly).toLocaleString()}
/mo `;
document.getElementById('calcPI').textContent = `$${Math.round(monthlyPI).toLocaleString()}`;
document.getElementById('calcTaxMonthly').textContent = `$${Math.round(monthlyTax).toLocaleString()}`;
document.getElementById('calcInsuranceMonthly').textContent = `$${Math.round(monthlyInsurance).toLocaleString()}`;
document.getElementById('calcHOAMonthly').textContent = `$${Math.round(monthlyHOA).toLocaleString()}`;
document.getElementById('calcLoanAmount').textContent = `$${Math.round(loanAmount).toLocaleString()}`;
document.getElementById('calcTotalInterest').textContent = `$${Math.round((monthlyPI * months) - loanAmount).toLocaleString()}`;
document.getElementById('calcTotalCost').textContent = `$${Math.round(monthlyPI * months).toLocaleString()}`;
// Update sidebar display
document.getElementById('totalPayment').innerHTML = `$${Math.round(totalMonthly).toLocaleString()}
/mo `;
document.getElementById('piAmount').textContent = `$${Math.round(monthlyPI).toLocaleString()}`;
document.getElementById('taxAmount').textContent = `$${Math.round(monthlyTax).toLocaleString()}`;
document.getElementById('insuranceAmount').textContent = `$${Math.round(monthlyInsurance).toLocaleString()}`;
}
function updateDownPaymentPercent() {
const price = parseFloat(document.getElementById('calcPrice').value) || 0;
const downPayment = parseFloat(document.getElementById('calcDownPayment').value) || 0;
const percent = (downPayment / price) * 100;
document.getElementById('calcDownPercent').value = Math.round(percent);
calculatePayment();
}
function updateDownPaymentAmount() {
const price = parseFloat(document.getElementById('calcPrice').value) || 0;
const percent = parseFloat(document.getElementById('calcDownPercent').value) || 0;
const downPayment = (price * percent) / 100;
document.getElementById('calcDownPayment').value = Math.round(downPayment);
calculatePayment();
}
// Close modals on escape key
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape') {
closeShowingModal();
closeCalculatorModal();
}
});
// Contact form submission
function submitContactForm(e) {
e.preventDefault();
const form = e.target;
const formData = new FormData(form);
formData.append('action', 'submit_contact');
formData.append('listing_id', 'bTc3bVZpSUhNaWdKVDY0VUcyZVpvZz09');
const btn = form.querySelector('button[type="submit"]');
const btnIcon = btn.querySelector('svg');
const btnText = btn.childNodes[btn.childNodes.length - 1];
// Save original state
const originalIcon = btnIcon.outerHTML;
const originalText = btnText.textContent;
// Show loader
btn.disabled = true;
btn.classList.add('loading');
btnIcon.outerHTML = `
`;
btnText.textContent = ' SENDING...';
fetch('https://fsbo.pro/api/messaging-handler.php', {
method: 'POST',
body: formData
})
.then(r => r.json())
.then(data => {
if (data.success) {
// Show success message
const successMsg = document.createElement('div');
successMsg.style.cssText = 'background: linear-gradient(135deg, #d4edda, #c3e6cb); color: #155724; padding: 16px 20px; border-radius: 12px; margin-bottom: 16px; border: 1px solid #c3e6cb; animation: slideDown 0.4s ease; box-shadow: 0 4px 12px rgba(21,87,36,0.15); display: flex; align-items: center; gap: 12px;';
successMsg.innerHTML = `
Message Sent Successfully!
${data.message}
`;
form.parentNode.insertBefore(successMsg, form);
form.reset();
setTimeout(() => {
successMsg.style.animation = 'slideUp 0.3s ease';
setTimeout(() => successMsg.remove(), 300);
}, 5000);
} else {
showResultModal('error', 'Error', data.message || 'Error sending message. Please try again.');
}
// Restore button
btn.disabled = false;
btn.classList.remove('loading');
btn.innerHTML = originalIcon + originalText;
})
.catch(() => {
showResultModal('error', 'Error', 'Error sending message. Please try again.');
btn.disabled = false;
btn.classList.remove('loading');
btn.innerHTML = originalIcon + originalText;
});
}
// Initialize Google Maps (if coordinates available)
function initMap() {
const propertyLocation = {
lat: 33.62340000,
lng: -112.40858500
};
const map = new google.maps.Map(document.getElementById('propertyMap'), {
zoom: 15,
center: propertyLocation,
mapTypeControl: false,
streetViewControl: false,
fullscreenControl: true
});
new google.maps.Marker({
position: propertyLocation,
map: map,
title: '16259 W Caribbean Ln, Surprise, AZ 85379'
});
}
// Load Google Maps API
const script = document.createElement('script');
script.src = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyAFkzYDINVUGTnNI4HK-ADcOAyQUgXD8Hw&callback=initMap';
script.async = true;
script.defer = true;
document.head.appendChild(script);
Share via Social Media
Facebook
LinkedIn
WhatsApp
Email
SMS