<script language="javascript">

    function toggleRegisteredCanEdit(e)
    {
        if (e.checked)
            document.getElementById('permissionSetter.registeredCanEdit').disabled = false;
        else
        {
            document.getElementById('permissionSetter.registeredCanEdit').checked = false;
            document.getElementById('permissionSetter.registeredCanEdit').disabled = true;
        }
    }

    function toggleAnonymousCanEdit(e)
    {
        if (e.checked)
            document.getElementById('permissionSetter.anonymousCanEdit').disabled = false;
        else
        {
            document.getElementById('permissionSetter.anonymousCanEdit').checked = false;
            document.getElementById('permissionSetter.anonymousCanEdit').disabled = true;
         }
    }

</script>

<table width="100%">
    <tr>
        <td width="50%">
            <p>$action.getText("create.space.permissions.view.desc")</p>
            #tag( "Checkbox" "label='create.space.permissions.me'" "name=''" "value=true" "theme='notable'" "disabled='true'")<br/>
            #tag( "Checkbox" "label='create.space.permissions.registered'" "name='permissionSetter.registeredCanView'" "value=permissionSetter.registeredCanView" "theme='notable'" "onclick='toggleRegisteredCanEdit(this)'")<br/>
            #if ($permissionHelper.globalAnonymousAccessEnabled)
                #tag( "Checkbox" "label='create.space.permissions.anonymous'" "name='permissionSetter.anonymousCanView'" "value=permissionSetter.anonymousCanView" "theme='notable'" "onclick='toggleAnonymousCanEdit(this);'")
            #end
        </td>
        <td>&nbsp;&nbsp;</td>
        <td width="50%">
            <p>$action.getText("create.space.permissions.edit.desc")</p>
            #tag( "Checkbox" "label='create.space.permissions.me'" "name=''" "value=true" "theme='notable'" "disabled='true'")<br/>
            #tag( "Checkbox" "label='create.space.permissions.registered'" "name='permissionSetter.registeredCanEdit'" "value=permissionSetter.registeredCanEdit" "theme='notable'")<br/>
            #if ($permissionHelper.globalAnonymousAccessEnabled)
                #tag( "Checkbox" "label='create.space.permissions.anonymous'" "name='permissionSetter.anonymousCanEdit'" "value=permissionSetter.anonymousCanEdit" "theme='notable'" )
            #end
        </td>
    </tr>
</table>

