            if (chatWindow.style.display === 'none' || chatWindow.style.display === '') {
                chatWindow.style.display = 'flex';
            } else {
                chatWindow.style.display = 'none';
            }
        });

        document.getElementById('closeButton').addEventListener('click', function() {
            document.getElementById('chatWindow').style.display = 'none';
        });

        document.getElementById('sendButton').addEventListener('click', sendMessage);
        docum