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