document.addEventListener("DOMContentLoaded", function() {
    // Retrieve the rowData from the session
    var rowData = sessionStorage.getItem('rowData');
    var rowDataObj = JSON.parse(rowData);
    // Log the rowDataObj to the console
    console.log(rowDataObj);
    // Unpack each variable
    const infoPersonaMoral = rowDataObj["Razón social"];
    document.getElementById("infoPersonaMoral").textContent = infoPersonaMoral;
    document.getElementById("personaMoral").textContent = infoPersonaMoral;
    document.getElementById("razonSocial2").textContent = infoPersonaMoral;
    document.getElementById("razonSocial3").textContent = infoPersonaMoral;
    const nombreRepresentante = rowDataObj["Nombre Representante"];
    document.getElementById("nombreRepresentante").textContent = nombreRepresentante;
    document.getElementById("nombreRepresentante2").textContent = nombreRepresentante;
    document.getElementById("nombreRepresentante3").textContent = nombreRepresentante;
    const direccionYEmailRepresentante = rowDataObj["Información Representante"];
    document.getElementById("direccion_email").textContent = direccionYEmailRepresentante;
    const infoFiscal = rowDataObj["Información fiscal"];
    document.getElementById("infoFiscal").textContent = infoFiscal;
    const domicilio = rowDataObj["Domicilio"];
    document.getElementById("domicilio").textContent = domicilio;
    const paginaWeb = rowDataObj["Página Web"];
    document.getElementById("webPage").textContent = paginaWeb;
    //const giro = rowDataObj["Giro"];
    //document.getElementById("giro").textContent = giro;
    //const rfcRepresentante = rowDataObj["RFC Representante"];
    //document.getElementById("rfcRepresentante").textContent = rfcRepresentante;
    const id = rowDataObj["id"];
    document.getElementById("contrato").textContent = id;
    });