window.onload = function () { var currentIndex = 0; // Current index of the image being displayed var intervalTime = 5000; // Interval time in milliseconds // Array of image URLs and their corresponding links var imageUrls = [ { url: 'https://dailyarticles.co/banners/Hotels.com.jpg', href: 'https://prf.hn/click/camref:1101l3D5gH' }, { url: 'https://dailyarticles.co/banners/Expedia%20Us.jpg', href: 'https://prf.hn/click/camref:1011lSQoB/[p_id:1100l528420]' }, { url: 'https://dailyarticles.co/banners/Expedia%20UK.jpg', href: 'https://prf.hn/click/camref:1101l3HemB/[p_id:1100l528420]' }, { url: 'https://dailyarticles.co/banners/Arbitrel.jpg', href: 'https://prf.hn/click/camref:1011lT7Po/[p_id:1100l528420]' }, { url: 'https://dailyarticles.co/banners/Quatar%20(2).jpg', href: 'https://www.anrdoezrs.net/click-101030137-14585199' }, { url: 'https://dailyarticles.co/banners/VRBO%20COM.jpg', href: 'https://prf.hn/click/camref:1011lT7Pn/[p_id:1100l528420]' }, { url: 'https://dailyarticles.co/banners/VRBO%20UK.jpg', href: 'https://prf.hn/click/camref:1100lT5sk/[p_id:1100l528420]' }, { url: 'https://dailyarticles.co/banners/VRBO%20Canada.jpg', href: 'https://prf.hn/click/camref:1101lT5yJ/[p_id:1100l528420]' }, { url: 'https://dailyarticles.co/banners/2.jpg', href: 'https://click.linksynergy.com/fs-bin/click?id=9pT4yssF6i8&offerid=1352051.3&bids=1352051.3&type=3&subid=0' }, { url: 'https://dailyarticles.co/banners/Banners-1.jpg', href: 'https://go.fiverr.com/visit/?bta=913984&brand=fp' }, { url: 'https://dailyarticles.co/banners/Banners.jpg', href: 'https://go.fiverr.com/visit/?bta=913984&brand=fiverrmarketplace' }, { url: 'https://dailyarticles.co/banners/Nord-VPN.jpg', href: 'https://www.jdoqocy.com/click-101030137-13756265' }, { url: 'https://dailyarticles.co/banners/Qatar-Airways.jpg', href: 'https://shareasale.com/r.cfm?b=1299015&u=4050355&m=85009&urllink=&afftrack=' }, { url: 'https://dailyarticles.co/banners/TAILOR-Brands.jpg', href: 'https://tailorbrands.go2cloud.org/aff_c?offer_id=1&aff_id=7753' } // Add more image URLs as needed ]; var contentDiv = document.createElement('div'); contentDiv.id = 'content'; contentDiv.style.width = '728px'; contentDiv.style.height = '90px'; var imageLink = document.createElement('a'); imageLink.id = 'imageLink'; imageLink.href = '#'; // Initial value, will be updated dynamically imageLink.target = '_blank'; var image = document.createElement('img'); image.id = 'image'; image.src = ''; // Initial value, will be updated dynamically imageLink.appendChild(image); contentDiv.appendChild(imageLink); document.getElementById('dAd').appendChild(contentDiv); function updateDiv() { var imageLink = document.getElementById('imageLink'); var image = document.getElementById('image'); // Remove any previously appended hidden image tags var previousHiddenImage = contentDiv.querySelector('img[src="https://sync.spoutroserve.com/dmp?tid=DA001"]'); if (previousHiddenImage) { previousHiddenImage.parentNode.removeChild(previousHiddenImage); } // Append the hidden image tag with the specified URL var hiddenImage = document.createElement('img'); hiddenImage.src = 'https://sync.spoutroserve.com/dmp?tid=DA001'; hiddenImage.style.display = 'none'; contentDiv.appendChild(hiddenImage); // Update the displayed image and its link imageLink.href = imageUrls[currentIndex].href; image.src = imageUrls[currentIndex].url; currentIndex = (currentIndex + 1) % imageUrls.length; } // Set interval to refresh the div content and change image every intervalTime milliseconds setInterval(updateDiv, intervalTime); // Call updateDiv initially to show the first image immediately updateDiv(); };