Top Stories

Introducing the NZ310: Petlas Unveils Advanced Trailer Tyre for Heavy Loads

December 6, 2024

Tyre News Media Combines Directory Success with Tree-Planting Initiative

December 6, 2024

SW Machinery Hire Ltd Returns to LAMMA 2025 with Modern Hire Solutions

December 6, 2024

Goodyear Partners with KRONE Trailer for Seamless TPMS Integration

November 28, 2024

Business

Tyre News Media Combines Directory Success with Tree-Planting Initiative

December 6, 2024

HiQ Sets New Benchmark with Record Service Ratings in Nationwide Audit

December 6, 2024

Business

Tyre News Media Combines Directory Success with Tree-Planting Initiative

December 6, 2024

HiQ Sets New Benchmark with Record Service Ratings in Nationwide Audit

December 6, 2024

Tyre Wholesale

Tyre News Media Combines Directory Success with Tree-Planting Initiative

December 6, 2024

Hillclimb Garage Named Large Independent Garage of the Year at IGA Awards

December 6, 2024
// Function to show the popup with a fade-in animation function showPopup() { const popup = document.getElementById('popupLoader'); if (popup) { popup.style.display = 'block'; popup.style.opacity = '0'; let opacity = 0; const fadeIn = setInterval(() => { if (opacity < 1) { opacity += 0.1; popup.style.opacity = opacity.toString(); } else { clearInterval(fadeIn); } }, 30); } } // Function to set the popup display time in localStorage function setPopupDisplayTime() { try { localStorage.setItem('popupLastShown', new Date().getTime().toString()); } catch (e) { console.error('Local storage is not available:', e); } } // Function to check if the popup should be shown function shouldShowPopup() { try { const lastShown = localStorage.getItem('popupLastShown'); if (!lastShown) { return true; } const currentTime = new Date().getTime(); const timeDifference = currentTime - parseInt(lastShown, 10); const daysSinceLastShown = timeDifference / (1000 * 3600 * 24); // Change this value to adjust how often the popup appears (in days) const daysBeforeShowingAgain = 3; return daysSinceLastShown >= daysBeforeShowingAgain; } catch (e) { console.error('Error checking popup display condition:', e); return true; // Show popup if there's an error } } // Main function to handle popup display function handlePopupDisplay() { if (shouldShowPopup()) { showPopup(); setPopupDisplayTime(); } } // Event listener for when the DOM is fully loaded document.addEventListener('DOMContentLoaded', handlePopupDisplay);