<script type="text/javascript">
var show_permissions = <?php echo $show_permissions ? 'true' : 'false' ?>;
function ShowHidePermissions() {
    for (var i = 0; i <= 7; ++i) {
        if ($("permission"+i)) {
            $("permission"+i).style.display = show_permissions ? "none" : "";
        }
    }
    $("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 ($("permission"+i)) {
            $("permission"+i).style.display = "none";
        }
    }
}
</script>
