<?php
// Copyright 1999-2022. Plesk International GmbH. All rights reserved.
?>
<script>
Jsw.onReady(function() {
    if (document.getElementById('<?php echo $this->generalPrefix ?>sslSettings-certificateId') && document.getElementById('<?php echo $this->generalPrefix ?>sslSettings-ssl')) {
        var updateCertificateSelector = function () {
            if (document.getElementById('<?php echo $this->generalPrefix ?>sslSettings-ssl').checked) {
                document.getElementById('<?php echo $this->generalPrefix ?>sslSettings-certificateId').disabled = false;
            } else {
                document.getElementById('<?php echo $this->generalPrefix ?>sslSettings-certificateId').disabled = true;
            }
        }
        updateCertificateSelector();
        document.getElementById('<?php echo $this->generalPrefix ?>sslSettings-ssl').addEventListener('click', updateCertificateSelector);
    }
});
</script>
