AirNow is beta testing a Spanish language translation of our entire web site.
`,
allowHTML: true,
placement: 'bottom',
zIndex: 9999,
offset: [-75, 100],
theme: "marquee",
animation: "shift-toward", // shift toward; scale
delay: [300, 100],
interactiveBorder: 5,
arrow: true,
});
// For Mobile Hamburger menu ONLY cw 2025-01-27
// Check if the viewport width is less than 767 pixels
if (window.innerWidth alows the normal button styles to be used cw 2025-01-28
globeLanguageSwitcher.style.border = '';
// Reposition the search icon
var searchIcon = document.getElementById('search-btn');
if (searchIcon) {
searchIcon.style.paddingRight = '6px';
searchIcon.style.paddingLeft = '6px';
}
// Add event listener to handle the mobile drop down menu cw 2025-012-28
document.getElementById('globeIcon').addEventListener('click', function() {
// hide menu on second click cw 2025-01-28
if (globeLanguageSwitcher.style.display === 'none') {
globeLanguageSwitcher.style.display = 'block';
} else {
globeLanguageSwitcher.style.display = 'none';
}
if (window.location.href.includes('espanol.airnow.gov')) {
globeLanguageSwitcher.textContent = 'English'; // Display English
} else {
globeLanguageSwitcher.textContent = 'Español'; // Display Espanol
}
});
// Add event listener to handle the actual language change cw 2025-012-23
document.getElementById('globeLanguageSwitcher').addEventListener('click', function() {
if (window.location.href.includes('espanol.airnow.gov')) { // send to English
window.location.href = 'https://www.airnow.gov/' + displayPath; // switch to English cw 2025-01-16
} else {
window.location.href = 'https://espanol.airnow.gov/' + displayPath; // switch to Spanish cw 2025-01-16
}
});
} else { // For Desktop
// Set the "switcher" to display the opposite of the current language cw 2025-01-10
if (window.location.href.includes('espanol.airnow.gov')) { // then set to Spanish
globeLanguageSwitcher.textContent = 'English';
espanolBetaLabel.style.display = 'none';
globeLanguageSwitcher.style.display = 'block';
} else { // then set to English
globeLanguageSwitcher.textContent = 'Español';
espanolBetaLabel.style.display = 'block';
globeLanguageSwitcher.style.display = 'none';
}
// Add event listener to handle the actual language change cw 2025-012-23
document.getElementById('globeIcon').addEventListener('click', function() {
if (window.location.href.includes('espanol.airnow.gov')) { // send to English
window.location.href = 'https://www.airnow.gov/' + displayPath; // switch to English cw 2025-01-16
} else {
window.location.href = 'https://espanol.airnow.gov/' + displayPath; // switch to Spanish cw 2025-01-16
}
});
// Add event listener to toggle dropdown visibility when "Espanol Beta" is clicked
document.getElementById('espanolBetaLabel').addEventListener('click', function() {
// go straight to spanish
window.location.href = 'https://espanol.airnow.gov/' + displayPath; // switch to Spanish cw 2025-01-16
});
// Add event listener to handle the actual language change
document.getElementById('globeLanguageSwitcher').addEventListener('click', function() {
if (window.location.href.includes('espanol.airnow.gov')) { // send to English
window.location.href = 'https://www.airnow.gov/' + displayPath; // switch to English cw 2025-01-16
} else {
window.location.href = 'https://espanol.airnow.gov/' + displayPath; // switch to Spanish cw 2025-01-16
}
});
} // end of Desktop
var element = document.getElementById('recursos-en-español-btn');
element.style.display = 'block'; // Make the element visible again
}
<div class="tippy-close-holder">
<div onmousedown="document.activeElement.style.visibility='hidden';">
<div class="fa fa-times" id="close-box" style="position: absolute; left: 5px; top: 5px; z-index: -1;"> </div>
</div>
</div>
<div id="Map Info Icon Content from Home Current AQ Band" style="padding-top: 5px;">
<p>This map shows current air quality (<a href="/aqi/aqi-basics/using-air-quality-index#nowcast" target="_blank">NowCast AQI</a>) for ozone or PM, whichever is highest. The area is approximate.</p>
<p>Due to processing time, this map may take longer to update than the dial.</p>
</div>