window.addEventListener('DOMContentLoaded', (event) => {
document.addEventListener('click', (e)=>{
if(e.target.classList.contains('enlace-tabs_pagina')){
let elsChildren = e.target.offsetParent.offsetParent
let numero=0
for(i=0; i<elsChildren.childElementCount; i++){
elsChildren.children[i].classList.remove('activo')
let childrenId =elsChildren.children[i].firstChild.id
elsChildren.offsetParent.nextSibling.children[i].classList.remove('tab-activo')
elsChildren.offsetParent.offsetParent.previousSibling.children[i].classList.remove('tab-activo')
if(childrenId === e.target.id) numero = i
}
let txtActivo = elsChildren.offsetParent.nextSibling.children[numero].classList.add('tab-activo')
let imgActivo = elsChildren.offsetParent.offsetParent.previousSibling.children[numero].classList.add('tab-activo')
e.target.offsetParent.classList.add('activo')
}
})
})