(function() { const adContent = '
'; const container = document.getElementById('list_videos_latest_videos_list_items'); if (container) { const children = Array.from(container.childNodes); const randomIndex = Math.floor(Math.random() * (children.length + 1)); if (children.length === 0 || randomIndex === children.length) { container.insertAdjacentHTML('beforeend', adContent); } else { const referenceNode = children[randomIndex]; container.insertBefore(document.createRange().createContextualFragment(adContent), referenceNode); } } })();