document.addEventListener('DOMContentLoaded', function() {
	const sliderWrappers = document.querySelectorAll('.slider-wrapper-simple2box');

	sliderWrappers.forEach(function(sliderWrapper) {
		const sliderImages = sliderWrapper.querySelectorAll('.slider-image-simple2box');
		const leftArrow = sliderWrapper.querySelector('.left-arrow-simple2box');
		const rightArrow = sliderWrapper.querySelector('.right-arrow-simple2box');
		let currentIndex = 0;

		function initializeSlider() {
			sliderImages.forEach(function(image, index) {
				image.style.display = (index === 0) ? 'block' : 'none';
			});
		}
		function updateSlider() {
			sliderImages.forEach(function(image, index) {
				image.style.display = (index === currentIndex) ? 'block' : 'none';
			});
		}
		if (leftArrow) {
			leftArrow.addEventListener('click', function() {
				currentIndex = (currentIndex > 0) ? currentIndex - 1 : sliderImages.length - 1;
				updateSlider();
			});
		}
		if (rightArrow) {
			rightArrow.addEventListener('click', function() {
				currentIndex = (currentIndex < sliderImages.length - 1) ? currentIndex + 1 : 0;
				updateSlider();
			});
		}
		initializeSlider();
	});
});