Loading Your Vehicle Details
Preparing your experience...
2014 Toyota RAV4, Stock No: 11931 by Mirza Auto Sales, Rochester MN
At Mirza Auto Sales we offer top-quality pre-owned vehicles at wholesale prices, backed by honest, exceptional service.
`;
document.body.insertAdjacentHTML("beforeend",footerHTML);
/* set current year */
document.getElementById("year").textContent=new Date().getFullYear();
}
});
-->
* Please call for availability
Engine
2.5L L4 DOHC 16V
Transmission
6-Speed Automatic
Drive
FWD
VIN
JTMWFREV1EJ010104
Mileage
214,682
Exterior
Classic Silver Metallic
Interior
Latte
Stock NO
11931
Fuel economy
24 MPG CITY
/
31 MPG HWY
Backup Camera
Moonroof/Sunroof
Touch Screen Audio
4-Wheel ABS
Stability Control
Solar Tinted Glass
Remote Trunk Release
Power Side Mirror
Auxiliary Jack
Running Boards
Dual A/C Zones
Daytime Running Lights
Bluetooth
Alarm
Aluminum Alloy Wheels
Cruise Control
Automatic Delay Off Headlights
Integrated Side Mirror Turn Si
MP3
50 State Emissions
Cloth Seats
Front Fog Lights
CD Player
Latch System Child Seat Anchor
Traction Control
Rear Defogger
Rear Spoiler
Heated Side Mirrors
USB Audio Input
Cargo Floor Mat
Automatic Climate Control
SiriusXM Equipped
One-Touch Windows
Automatic Locking Power locks
Rear Privacy Glass
Remote Keyless Entry
Folding Side Mirror
iPod/iPhone Input
HD Radio
Disclaimer: All advertised prices exclude government fees and taxes, any finance charges, any dealer document preparation charge, and any emission testing charge. Vehicle availability is not guaranteed and subject to prior sale. All vehicle details advertised are true to our best knowledge, but not guaranteed. It is the customer's sole responsibility to verify the existence and condition of any equipment listed. The dealership is not responsible for misprints on prices or equipment. It is the customer's sole responsibility to verify the accuracy of the prices with the dealer. Pricing are subject to change without notice. Any advertised down, monthly, bi-weekly, and weekly payments are estimated examples and / or approximate payments only and subject to credit check and approvals.
Document
${data.imageUrls.map((url, i) => `
${i + 1}/${data.imageUrls.length}
`).join('')}
${data.imageUrls.length > 0 ? `
` : ''}
`;
// Create fullscreen modal
const fullscreenModal = document.createElement('div');
fullscreenModal.className = 'mirza-vd-fullscreen-modal';
fullscreenModal.innerHTML = `
1 of ${data.imageUrls.length}
`;
document.body.appendChild(fullscreenModal);
// Create main content
const content = document.createElement('div');
content.className = 'mirza-vd-content mirza-vd-slide-up';
content.innerHTML = `
Vehicle Specifications
${Object.entries(data.specs).map(([category, specs]) =>
Object.keys(specs).length > 0 ? `
` : ''
).join('')}
Features & Options
${categorizeFeatures(data.features).map(category => `
${category.name}
${category.features.map(feature => `
${feature}
`).join('')}
`).join('')}
`;
// Create footer CTAs
const footerCTAs = document.createElement('div');
footerCTAs.className = 'mirza-vd-footer-ctas';
footerCTAs.innerHTML = `
`;
// Append everything
container.appendChild(hero);
container.appendChild(content);
container.appendChild(footerCTAs);
// Add footer disclaimer
const footerDisclaimer = document.createElement('div');
footerDisclaimer.className = 'mirza-vd-footer-disclaimer';
footerDisclaimer.innerHTML = `
All vehicle information presented on this site is offered strictly for general guidance. While we make every effort to keep our inventory details current, prices, equipment lists, mileage, and other specifications may contain errors or be subject to change without notice. Vehicle availability is not guaranteed and each unit is offered on a first-come, first-served basis.
Any payment calculators, APRs, or monthly-payment figures shown are illustrative estimates only . Final financing terms—including rate, down-payment, and length of contract—depend on lender approval, creditworthiness, and other factors beyond the dealership's control.
Advertised prices exclude sales tax, title and registration fees, documentary/service fees, lender-imposed charges, optional protection products, and any out-of-state delivery costs. Images may be stock photos; actual condition and accessories can differ. Prospective purchasers are encouraged to inspect the vehicle in person, inspect by a certified mechanic within Rochester, MN, test drive the vehicle, verify all information independently, and request a written buyers' order before committing to a transaction.
By using this site you acknowledge that the dealership shall not be liable for any direct or indirect loss arising from reliance on the information provided herein.
`;
container.appendChild(footerDisclaimer);
return container;
}
// Helper function to get spec category icons
function getSpecCategoryIcon(category) {
const icons = {
'Vehicle Details': 'fa-info-circle',
'Performance': 'fa-tachometer-alt',
'Other': 'fa-ellipsis-h'
};
return icons[category] || 'fa-info-circle';
}
// Helper function to categorize features
function categorizeFeatures(features) {
const categories = {
'Comfort & Convenience': [],
'Technology & Entertainment': [],
'Safety & Security': [],
'Performance & Handling': [],
'Interior Styling': [],
'Exterior Features': [],
'Climate Control': [],
'Seating Options': [],
'Additional Features': []
};
const keywordMapping = {
'Comfort & Convenience': ['heated', 'cooled', 'steering', 'windows', 'locks', 'cruise', 'remote', 'keyless', 'automatic', 'power', 'push-button'],
'Technology & Entertainment': ['bluetooth', 'navigation', 'audio', 'screen', 'touch', 'usb', 'aux', 'amazon', 'google', 'siriusxm', 'ipod', 'iphone', 'hd radio', 'points of interest', 'wifi', 'connected', 'alexa'],
'Safety & Security': ['alarm', 'camera', 'sensor', 'abs', 'stability', 'lane', 'collision', 'blind spot', 'parking', 'traction', 'hill', 'emergency', 'airbag', 'brake', 'assist', 'perimeter'],
'Performance & Handling': ['engine', 'transmission', 'drive', 'turbo', 'suspension', 'exhaust', 'differential', 'gear', 'performance', 'sport', 'tip'],
'Interior Styling': ['leather', 'fabric', 'perforated', 'memory', 'lumbar', 'ventilated', 'dash', 'trimmed', 'instrument'],
'Exterior Features': ['lights', 'fog', 'spoiler', 'wheels', 'alloy', 'tint', 'running', 'exterior', 'daytime', 'mirror', 'wiper', 'side mirror', 'automatic delay'],
'Climate Control': ['climate', 'air', 'conditioning', 'zones', 'dual', 'a/c', 'defogger'],
'Seating Options': ['seat', 'driver', 'passenger', 'front', 'rear', 'heated seat', 'power seat'],
};
features.forEach(feature => {
let categorized = false;
const featureLower = feature.toLowerCase();
for (const [category, keywords] of Object.entries(keywordMapping)) {
if (keywords.some(keyword => featureLower.includes(keyword))) {
categories[category].push(feature);
categorized = true;
break;
}
}
if (!categorized) {
categories['Additional Features'].push(feature);
}
});
// Return only non-empty categories
return Object.entries(categories)
.filter(([_, features]) => features.length > 0)
.map(([name, features]) => ({ name, features }));
}
// Helper function to calculate monthly payment
function calculateMonthlyPayment(priceString) {
const price = parseFloat(priceString.replace(/[^0-9.]/g, ''));
if (isNaN(price) || price <= 0) return 'Call';
const loanAmount = price * 0.9; // Assuming 10% down
const monthlyRate = 0.079 / 12; // 7.9% APR
const months = 72;
const payment = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, months)) / (Math.pow(1 + monthlyRate, months) - 1);
return Math.round(payment).toLocaleString();
}
// Extract data and create new layout
const vehicleData = extractVehicleData();
const modernLayout = createModernLayout(vehicleData);
// Replace old content with new layout
const main = document.querySelector('.main');
if (main) {
main.innerHTML = '';
main.appendChild(modernLayout);
}
// Mark product sections as modernized to prevent hiding
const productHead = document.querySelector('.product__head');
const productBody = document.querySelector('.product__body');
if (productHead) productHead.classList.add('modernized');
if (productBody) productBody.classList.add('modernized');
// Add global functions with namespace
window.mirzaVdChangeImage = function(index) {
const mainImage = document.querySelector('.mirza-vd-main-image');
const contactSlide = document.querySelector('.mirza-vd-contact-slide');
const thumbnails = document.querySelectorAll('.mirza-vd-thumbnail');
const imageUrls = vehicleData.imageUrls;
const fullscreenCounter = document.querySelector('.mirza-vd-fullscreen-counter');
// Add transition effect
if (mainImage) {
mainImage.classList.add('transitioning');
setTimeout(() => {
if (index === imageUrls.length) {
// Show contact slide
mainImage.style.display = 'none';
contactSlide.style.display = 'flex';
} else {
// Show regular image
contactSlide.style.display = 'none';
mainImage.style.display = 'block';
mainImage.src = imageUrls[index];
}
thumbnails.forEach((thumb, i) => {
thumb.classList.toggle('active', i === index);
});
window.mirzaVdCurrentImageIndex = index;
if (fullscreenCounter) {
fullscreenCounter.textContent = `${Math.min(index + 1, imageUrls.length)} of ${imageUrls.length}`;
}
// Remove transition effect
setTimeout(() => {
mainImage.classList.remove('transitioning');
}, 50);
}, 250);
}
};
window.mirzaVdOpenFullscreen = function(index) {
const modal = document.querySelector('.mirza-vd-fullscreen-modal');
const fullscreenImage = document.querySelector('.mirza-vd-fullscreen-image');
const imageUrls = vehicleData.imageUrls;
if (modal && fullscreenImage && imageUrls[index]) {
fullscreenImage.src = imageUrls[index];
fullscreenImage.alt = vehicleData.title + ' - Image ' + (index + 1);
modal.style.display = 'flex';
setTimeout(() => modal.classList.add('open'), 10);
document.body.style.overflow = 'hidden';
window.mirzaVdUpdateFullscreenCounter(index);
}
};
window.mirzaVdCloseFullscreen = function() {
const modal = document.querySelector('.mirza-vd-fullscreen-modal');
if (modal) {
modal.classList.remove('open');
setTimeout(() => modal.style.display = 'none', 300);
document.body.style.overflow = '';
}
};
window.mirzaVdUpdateFullscreenCounter = function(index) {
const counter = document.querySelector('.mirza-vd-fullscreen-counter');
if (counter) {
counter.textContent = `${index + 1} of ${vehicleData.imageUrls.length}`;
}
};
window.mirzaVdToggleSpecCategory = function(element) {
element.classList.toggle('collapsed');
};
window.mirzaVdToggleFeatureCategory = function(element) {
element.classList.toggle('collapsed');
};
window.mirzaVdPrevFullscreenImage = function() {
const currentIndex = window.mirzaVdCurrentImageIndex || 0;
const totalImages = vehicleData.imageUrls.length + 1; // +1 for contact slide
const newIndex = (currentIndex - 1 + totalImages) % totalImages;
window.mirzaVdChangeImage(newIndex);
if (newIndex < vehicleData.imageUrls.length) {
window.mirzaVdOpenFullscreen(newIndex);
}
};
window.mirzaVdNextFullscreenImage = function() {
const currentIndex = window.mirzaVdCurrentImageIndex || 0;
const totalImages = vehicleData.imageUrls.length + 1; // +1 for contact slide
const newIndex = (currentIndex + 1) % totalImages;
window.mirzaVdChangeImage(newIndex);
if (newIndex < vehicleData.imageUrls.length) {
window.mirzaVdOpenFullscreen(newIndex);
}
};
// Enhanced Financing Calculator Functions
let selectedTerm = 72;
let currentDownPayment = 0;
let currentAPR = 7; // Default Super Prime rate
let isAdvancedMode = false;
const vehiclePrice = parseFloat(vehicleData.price.replace(/[^0-9.]/g, ''));
// Initialize financing calculator
function initializeFinancingCalculator() {
// Set 10% down payment as default
const recommendedDown = Math.floor(vehiclePrice * 0.1);
currentDownPayment = recommendedDown;
const downPaymentSlider = document.getElementById('mirza-vd-down-payment-slider');
const downPaymentValue = document.getElementById('mirza-vd-down-payment-value');
if (downPaymentSlider && !isNaN(vehiclePrice)) {
downPaymentSlider.max = Math.floor(vehiclePrice);
downPaymentSlider.value = recommendedDown;
downPaymentValue.textContent = recommendedDown.toLocaleString();
}
// Set up credit tier selection
const creditTiers = document.querySelectorAll('.mirza-vd-credit-tier');
creditTiers.forEach(tier => {
tier.addEventListener('click', () => {
creditTiers.forEach(t => t.classList.remove('active'));
tier.classList.add('active');
currentAPR = parseFloat(tier.dataset.apr);
updatePaymentCalculation();
});
});
// Set up term selection
const financingTerms = document.querySelectorAll('.mirza-vd-financing-term');
financingTerms.forEach(term => {
term.addEventListener('click', () => {
financingTerms.forEach(t => t.classList.remove('active'));
term.classList.add('active');
selectedTerm = parseInt(term.dataset.term);
updatePaymentCalculation();
});
});
// Down payment slider
if (downPaymentSlider && downPaymentValue) {
downPaymentSlider.addEventListener('input', (e) => {
currentDownPayment = parseInt(e.target.value);
downPaymentValue.textContent = currentDownPayment.toLocaleString();
updatePaymentCalculation();
});
}
// Custom APR input
const customAPRSlider = document.getElementById('mirza-vd-custom-apr-slider');
const customAPRText = document.getElementById('mirza-vd-custom-apr-text');
if (customAPRSlider && customAPRText) {
customAPRSlider.addEventListener('input', (e) => {
currentAPR = parseFloat(e.target.value);
customAPRText.value = currentAPR.toFixed(1);
updatePaymentCalculation();
});
customAPRText.addEventListener('input', (e) => {
const value = parseFloat(e.target.value);
if (!isNaN(value) && value >= 1 && value <= 25) {
currentAPR = value;
customAPRSlider.value = value;
updatePaymentCalculation();
}
});
}
// Initial calculation
updatePaymentCalculation();
}
// Toggle advanced mode
window.mirzaVdToggleAdvancedMode = function() {
isAdvancedMode = !isAdvancedMode;
const creditTiers = document.querySelector('.mirza-vd-credit-tiers');
const advancedMode = document.querySelector('.mirza-vd-advanced-mode');
const toggleButton = document.querySelector('.mirza-vd-advanced-toggle');
if (isAdvancedMode) {
creditTiers.style.display = 'none';
advancedMode.style.display = 'block';
toggleButton.innerHTML = ' Basic Mode';
} else {
creditTiers.style.display = 'grid';
advancedMode.style.display = 'none';
toggleButton.innerHTML = ' Advanced Mode';
}
};
// Set down payment presets
window.mirzaVdSetDownPayment = function(option) {
const downPaymentSlider = document.getElementById('mirza-vd-down-payment-slider');
const downPaymentValue = document.getElementById('mirza-vd-down-payment-value');
if (option === 'recommended') {
currentDownPayment = Math.floor(vehiclePrice * 0.1);
} else if (typeof option === 'number') {
currentDownPayment = Math.floor(vehiclePrice * (option / 100));
}
if (downPaymentSlider && downPaymentValue) {
downPaymentSlider.value = currentDownPayment;
downPaymentValue.textContent = currentDownPayment.toLocaleString();
}
updatePaymentCalculation();
};
// Update payment calculation
function updatePaymentCalculation() {
if (isNaN(vehiclePrice) || vehiclePrice <= 0) return;
const loanAmount = vehiclePrice - currentDownPayment;
const monthlyRate = currentAPR / 100 / 12;
const payment = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, selectedTerm)) / (Math.pow(1 + monthlyRate, selectedTerm) - 1);
// Update DOM elements
const elements = {
monthlyAmount: document.getElementById('mirza-vd-monthly-amount'),
currentTerm: document.getElementById('mirza-vd-current-term'),
currentAPR: document.getElementById('mirza-vd-current-apr'),
vehiclePrice: document.getElementById('mirza-vd-vehicle-price'),
displayDown: document.getElementById('mirza-vd-display-down'),
financedAmount: document.getElementById('mirza-vd-financed-amount')
};
if (elements.monthlyAmount) elements.monthlyAmount.textContent = Math.round(payment).toLocaleString();
if (elements.currentTerm) elements.currentTerm.textContent = selectedTerm;
if (elements.currentAPR) elements.currentAPR.textContent = currentAPR.toFixed(1);
if (elements.vehiclePrice) elements.vehiclePrice.textContent = vehiclePrice.toLocaleString();
if (elements.displayDown) elements.displayDown.textContent = currentDownPayment.toLocaleString();
if (elements.financedAmount) elements.financedAmount.textContent = loanAmount.toLocaleString();
}
// Gallery navigation
let mirzaVdCurrentImageIndex = 0;
window.mirzaVdCurrentImageIndex = 0;
const galleryPrev = document.querySelector('.mirza-vd-gallery-arrow.prev');
const galleryNext = document.querySelector('.mirza-vd-gallery-arrow.next');
if (galleryPrev && galleryNext) {
galleryPrev.addEventListener('click', () => {
const totalImages = vehicleData.imageUrls.length + 1; // +1 for contact slide
mirzaVdCurrentImageIndex = (mirzaVdCurrentImageIndex - 1 + totalImages) % totalImages;
window.mirzaVdChangeImage(mirzaVdCurrentImageIndex);
});
galleryNext.addEventListener('click', () => {
const totalImages = vehicleData.imageUrls.length + 1; // +1 for contact slide
mirzaVdCurrentImageIndex = (mirzaVdCurrentImageIndex + 1) % totalImages;
window.mirzaVdChangeImage(mirzaVdCurrentImageIndex);
});
}
// Fullscreen modal close on escape or click outside
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
window.mirzaVdCloseFullscreen();
} else if (e.key === 'ArrowLeft') {
galleryPrev?.click();
} else if (e.key === 'ArrowRight') {
galleryNext?.click();
}
});
const fullscreenModal = document.querySelector('.mirza-vd-fullscreen-modal');
if (fullscreenModal) {
fullscreenModal.addEventListener('click', (e) => {
if (e.target === fullscreenModal) {
window.mirzaVdCloseFullscreen();
}
});
}
// Smart navigation scroll handler
window.addEventListener('scroll', () => {
const smartNav = document.querySelector('.mirza-vd-smart-nav');
const scrollProgress = document.querySelector('.mirza-vd-scroll-progress');
if (smartNav) {
if (window.scrollY > 300) {
smartNav.classList.add('visible');
} else {
smartNav.classList.remove('visible');
}
}
if (scrollProgress) {
const winScroll = document.body.scrollTop || document.documentElement.scrollTop;
const height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
const scrolled = (winScroll / height) * 100;
scrollProgress.style.width = scrolled + "%";
}
});
// Initialize financing calculator after DOM is ready
setTimeout(initializeFinancingCalculator, 500);
// Touch gestures for mobile
let touchStart = 0;
let touchEnd = 0;
const mainImageWrapper = document.querySelector('.mirza-vd-main-image-wrapper');
if (mainImageWrapper) {
mainImageWrapper.addEventListener('touchstart', (e) => {
touchStart = e.changedTouches[0].screenX;
});
mainImageWrapper.addEventListener('touchend', (e) => {
touchEnd = e.changedTouches[0].screenX;
handleSwipe();
});
}
function handleSwipe() {
const swipeThreshold = 50;
const diff = touchStart - touchEnd;
if (Math.abs(diff) > swipeThreshold) {
if (diff > 0) {
galleryNext?.click();
} else {
galleryPrev?.click();
}
}
}
// Add smooth scrolling behavior
document.documentElement.style.scrollBehavior = 'smooth';
// Add Google Fonts
if (!document.querySelector('link[href*="fonts.googleapis.com"]')) {
const fontLink = document.createElement('link');
fontLink.rel = 'stylesheet';
fontLink.href = 'https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap';
document.head.appendChild(fontLink);
}
// Add Font Awesome if not present
if (!document.querySelector('link[href*="fontawesome"]')) {
const faLink = document.createElement('link');
faLink.rel = 'stylesheet';
faLink.href = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css';
document.head.appendChild(faLink);
}
// Add haptic feedback for mobile
if ('vibrate' in navigator) {
document.querySelectorAll('.mirza-vd-header-cta, .mirza-vd-contact-option').forEach(button => {
button.addEventListener('click', () => {
navigator.vibrate(10);
});
});
}
})();
// At the very end of your modernization script - after all transformations are complete
if (typeof window.mirzaRemoveLoader === 'function') {
console.log('🚗 Vehicle page transformation complete - removing loader...');
window.mirzaRemoveLoader();
}
-->