var timerMainSLider;function nextSlider(){if($('.big-banner > ol > li:animated').length==0){var slide=$('.big-banner > ol > li:visible').next();if(!slide.length){slide=$('.big-banner > ol > li:first-child');} changeSlide(slide);}} function prevSlider(){if($('.big-banner > ol > li:animated').length==0){var slide=$('.big-banner > ol > li:visible').prev();if(!slide.length){slide=$('.big-banner > ol > li:last-child');} changeSlide(slide);}} function changeSlide(slide,setTimer=true){$('.big-banner > ol > li:visible').fadeOut();slide.fadeIn(function(){if(setTimer){nextSliderAuto();} var indexCurr=$('.big-banner > ol > li').index($('.big-banner > ol > li:visible'));$('.slideshow li a').each(function(){$(this).removeClass('activeSlide');});$($('.slideshow li a')[parseInt(indexCurr)]).addClass('activeSlide');});} function nextSliderAuto(stop=false){if(timerMainSLider){clearTimeout(timerMainSLider);} if(!stop){timerMainSLider=setTimeout('nextSlider()',5000);}} $(document).ready(function(){if($('.big-banner > ol > li').length>1) {nextSliderAuto();if('ontouchstart'in window||(window.DocumentTouch&&document instanceof DocumentTouch)){$(document).on('touchstart','.big-banner',function(event){nextSliderAuto(true);});}else{$(document).on('mouseenter','.big-banner',function(event){nextSliderAuto(true);$('.big-banner-nav-btn-wrapper').fadeIn();$('.big-banner-nav-btn-wrapper').css('display','flex');}).on('mouseleave','.big-banner',function(){nextSliderAuto();$('.big-banner-nav-btn-wrapper').fadeOut();});} $('.big-banner .slideshow a').click(function(ev){ev.preventDefault();if($('.big-banner > ol > li:animated').length==0) {$(this).addClass('activeSlide');var nextItem=$('.big-banner > ol > li:eq('+$(this).parent().index()+')');if(!nextItem.length){nextItem=$('.big-banner > ol > li:first-child');} changeSlide(nextItem,false);}});$(document).on('click','.big-banner-wrapper-prev',function(e){prevSlider();}) $(document).on('click','.big-banner-wrapper-next',function(e){nextSlider();})}});