  }
        
        window.addEventListener('load', function() {
            const captchaImg = document.getElementById('captcha-image');
            if (!captchaImg || !captchaImg.getAttribute('src').trim()) {
                refreshCaptcha();
            }
        });
    </script>
{% endblock natural_content %}
