//-----Idaho Map - Fancybox settings
$('[data-fancybox="lg-modal"]').fancybox({
baseTpl:
'
' +
'
' +
'
' +
'
' +
'
{{arrows}}
' +
'
' +
'
' +
'
' +
'
',
animationDuration: 300,
transitionEffect: "slide",
transitionDuration: 550
});
//----- infographic slideshow
var slideIndex = 1;
showSlides(slideIndex);
function plusSlides(n) {
showSlides(slideIndex += n);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
var i;
var slides = document.getElementsByClassName("simple-slide");
if (n > slides.length) {slideIndex = 1}
if (n < 1) {slideIndex = slides.length}
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slides[slideIndex-1].style.display = "block";
}
//autoplay slideshow
var slideIndex = 0;
carousel();
function carousel() {
var i;
var x = document.getElementsByClassName("simple-slide");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
slideIndex++;
if (slideIndex > x.length) {slideIndex = 1}
x[slideIndex-1].style.display = "block";
setTimeout(carousel, 9000);
}
//-----Scroll to top Button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
var toTopBtn = document.getElementById("ttBtn");
if (document.body.scrollTop > 1500 || document.documentElement.scrollTop > 1500) {
toTopBtn.style.opacity = "1";
toTopBtn.style.visibility = "visible";
} else {
toTopBtn.style.opacity = "0";
toTopBtn.style.visibility = "hidden";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0; // For Safari
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
}