<script type="text/javascript">
var show_permissions = <?php echo $show_permissions ? 'true' : 'false' ?>;
function ShowHidePermissions() {
    for (var i = 0; i <= 7; ++i) {
        if (document.getElementById("permission"+i)) {
            document.getElementById("permission"+i).style.display = show_permissions ? "none" : "";
        }
    }
    document.getElementById("permissions-button").value = show_permissions ? "<?php echo $this->lang('Show permissions'); ?>" : "<?php echo $this->lang('Hide permissions'); ?>";
    show_permissions = show_permissions ? false : true;
}
if (!show_permissions) {
    for (var i = 0; i <= 7; ++i) {
        if (document.getElementById("permission"+i)) {
            document.getElementById("permission"+i).style.display = "none";
        }
    }
}
</script>
