<script>
    <!--
    function force_logrotate_oC() {
        document.getElementById('fid-logrotate_period').disabled =
            !document.getElementById('fid-logrotate_force').checked;
    }

    function check_num(element) {
        if (chk_uint(element.value) && (element.value != 0)) {
            return true;
        }

        alert('{INVALID_DIGIT}');
        element.focus();
        return false;
    }

    function update_oC(f) {
        if (!check_num(f.stat_ttl)) {
            return false;
        }

        if (f.logrotate_force.checked && (!check_num(f.logrotate_period))) {
            return false;
        }

        if (
            (f.include_logs.checked != f.include_logs.defaultChecked) ||
            (f.include_mysql_databases.checked != f.include_mysql_databases.defaultChecked) ||
            (f.include_mssql_databases.checked != f.include_mssql_databases.defaultChecked) ||
            (f.include_remote_databases.checked != f.include_remote_databases.defaultChecked) ||
            (f.include_mailboxes && f.include_mailboxes.checked != f.include_mailboxes.defaultChecked) ||
            (f.include_maillists && f.include_maillists.checked != f.include_maillists.defaultChecked)
        ) {
            alert("{STAT_WARNING}");
        }

        lsubmit(f);
        return false;
    }

    Jsw.onReady(function () {
        Jsw.Tooltip.init(document.getElementById('disable_ip_logging_label'), {text: '{DISABLE_IP_LOGGING_DESCRIPTION}'});
        force_logrotate_oC();
    });
    //-->
</script>

<fieldset>
    <legend>{SYSTEM_PREFERENCES_LEGEND}</legend>
    <table class="formFields" cellspacing="0" width="100%">
        <tr {FULL_HOSTNAME_ERROR}>
            <td class="name"><label for="fid-full_hostname">{FULL_HOSTNAME_TEXT}</label>&nbsp;{REQ}</td>
            <td><input type="text" name="full_hostname" id="fid-full_hostname" value="{FULL_HOSTNAME_VALUE}" maxlenght="254" size="22"></td>
        </tr>
        <tr>
            <td class="name"><label for="fid-stat_ttl">{KEEP_STATS_TEXT}&nbsp;{REQ}</td>
            <td><input type="text" name="stat_ttl" id="fid-stat_ttl" value="{STAT_TTL}" size=9 maxlength=6>&nbsp;{MONTHS}</td>
        </tr>
        <tr>
            <td class="name">{COUNT_DISK_SPACE_TEXT}</td>
            <td>
                <div class="option"><input type="checkbox" class="checkbox" name="include_logs" id="fid-include_logs" value="true" {INCLUDE_LOGS}>&nbsp;<label
                            for="fid-include_logs">{INCLUDE_LOGS_TEXT}</label></div>
                <div class="option"><input type="checkbox" class="checkbox" name="include_mysql_databases" id="fid-include_mysql_databases" value="true" {INCLUDE_MYSQL_DATABASES}>&nbsp;<label
                            for="fid-include_mysql_databases">{INCLUDE_MYSQL_DATABASES_TEXT}</label></div>
                <div class="option"><input type="checkbox" class="checkbox" name="include_mssql_databases" id="fid-include_mssql_databases" value="true" {INCLUDE_MSSQL_DATABASES}>&nbsp;<label
                            for="fid-include_mssql_databases">{INCLUDE_MSSQL_DATABASES_TEXT}</label></div>
                <div class="option"><input type="checkbox" class="checkbox" name="include_remote_databases" id="fid-include_remote_databases"
                                           value="true" {INCLUDE_REMOTE_DATABASES}>&nbsp;<label for="fid-include_remote_databases">{INCLUDE_REMOTE_DATABASES_TEXT}</label></div>
                <!-- BEGIN DYNAMIC BLOCK: mailboxes -->
                <div class="option"><input type="checkbox" class="checkbox" name="include_mailboxes" id="fid-include_mailboxes" value="true" {INCLUDE_MAILBOXES}>&nbsp;<label
                            for="fid-include_mailboxes">{INCLUDE_MAILBOXES_TEXT}</label></div>
                <!-- END DYNAMIC BLOCK: mailboxes -->
                <!-- BEGIN DYNAMIC BLOCK: maillists -->
                <div class="option"><input type="checkbox" class="checkbox" name="include_maillists" id="fid-include_maillists" value="true" {INCLUDE_MAILLISTS}>&nbsp;<label
                            for="fid-include_maillists">{INCLUDE_MAILLISTS_TEXT}</label></div>
                <!-- END DYNAMIC BLOCK: maillists -->
                <div class="option"><input type="checkbox" class="checkbox" name="include_domaindumps" id="fid-include_domaindumps" value="true" {INCLUDE_DOMAINDUMPS}>&nbsp;<label
                            for="fid-include_domaindumps">{INCLUDE_DOMAINDUMPS_TEXT}</label></div>
                <div class="option"><input type="checkbox" class="checkbox" name="include_admindumps" id="fid-include_admindumps" value="true" {INCLUDE_ADMINDUMPS}>&nbsp;<label
                            for="fid-include_admindumps">{INCLUDE_ADMINDUMPS_TEXT}</label></div>
            </td>
        </tr>
        <tr>
            <td class="name">{COUNT_TRAFFIC_TEXT}</td>
            <td>
                <div class="option"><input type="radio" class="radiobox" name="traffic_accounting" id="fid-traffic_accounting3" value="3" {INCLUDE_IN_OUT}>&nbsp;<label
                            for="fid-traffic_accounting3">{INCLUDE_IN_OUT_TEXT}</label></div>
                <div class="option"><input type="radio" class="radiobox" name="traffic_accounting" id="fid-traffic_accounting1" value="1" {INCLUDE_IN}>&nbsp;<label
                            for="fid-traffic_accounting1">{INCLUDE_IN_TEXT}</label></div>
                <div class="option"><input type="radio" class="radiobox" name="traffic_accounting" id="fid-traffic_accounting2" value="2" {INCLUDE_OUT}>&nbsp;<label
                            for="fid-traffic_accounting2">{INCLUDE_OUT_TEXT}</label></div>
            </td>
        </tr>
        <!-- BEGIN DYNAMIC BLOCK: dns -->
        <tr>
            <td class="name"><label for="fid-forbid_create_dns_subzone">{FORBID_CREATE_DNS_SUBZONE_TEXT}</label></td>
            <td><input type="checkbox" class="checkbox" name="forbid_create_dns_subzone" id="fid-forbid_create_dns_subzone" value="true" {FORBID_CREATE_DNS_SUBZONE_CHECKED}></td>
        </tr>
        <!-- END DYNAMIC BLOCK: dns -->
        <!-- BEGIN DYNAMIC BLOCK: webdeploy -->
        <tr>
            <td class="name"><label for="fid-webdeploy_include_password">{WEBDEPLOY_INCLUDE_PASSWORD_TEXT}</label></td>
            <td><input type="checkbox" class="checkbox" name="webdeploy_include_password" id="fid-webdeploy_include_password" value="true" {WEBDEPLOY_INCLUDE_PASSWORD_CHECKED}>
            </td>
        </tr>
        <!-- END DYNAMIC BLOCK: webdeploy -->
        <tr>
            <td class="name">{ALLOW_SYS_USER_RENAME_TEXT}</td>
            <td>
                <div class="option"><input type="radio" class="radiobox" name="forbid_ftp_user_rename" id="fid-forbid_ftp_user_rename_false"
                                           value="false" {ALLOW_SYS_USER_RENAME_FALSE_CHECKED}>&nbsp;<label
                            for="fid-forbid_ftp_user_rename_false">{ALLOW_SYS_USER_RENAME_FALSE}</label></div>
                <div class="option"><input type="radio" class="radiobox" name="forbid_ftp_user_rename" id="fid-forbid_ftp_user_rename_true"
                                           value="true" {ALLOW_SYS_USER_RENAME_TRUE_CHECKED}>&nbsp;<label for="fid-forbid_ftp_user_rename_true">{ALLOW_SYS_USER_RENAME_TRUE}</label>
                </div>
                <div class="option"><input type="radio" class="radiobox" name="forbid_ftp_user_rename" id="fid-forbid_ftp_user_rename_forced"
                                           value="forced" {ALLOW_SYS_USER_RENAME_FORCED_CHECKED}>&nbsp;<label
                            for="fid-forbid_ftp_user_rename_forced">{ALLOW_SYS_USER_RENAME_FORCED}</label></div>
            </td>
        </tr>
        <tr>
            <td class="name"><label for="fid-forbid_subscription_rename">{FORBID_SUBSCRIPTION_RENAME_TEXT}</label></td>
            <td><input type="checkbox" class="checkbox" name="forbid_subscription_rename" id="fid-forbid_subscription_rename" value="true" {FORBID_SUBSCRIPTION_RENAME_CHECKED}>
            </td>
        </tr>
        <tr>
            <td class="name">{PREFERRED_DOMAIN}</td>
            <td>
                <div class="option"><input type="radio" class="radiobox" name="preferred_domain" id="fid-preferred_domain_none"
                                           value="{PREFERRED_DOMAIN_NONE_VALUE}" {PREFERRED_DOMAIN_NONE_CHECKED}>&nbsp;<label
                            for="fid-preferred_domain_none">{PREFERRED_DOMAIN_NONE_TEXT}</label></div>
                <div class="option"><input type="radio" class="radiobox" name="preferred_domain" id="fid-preferred_domain_to_landing"
                                           value="{PREFERRED_DOMAIN_TO_LANDING_VALUE}" {PREFERRED_DOMAIN_TO_LANDING_CHECKED}>&nbsp;<label
                            for="fid-preferred_domain_to_landing">{PREFERRED_DOMAIN_TO_LANDING_TEXT}</label></div>
                <div class="option"><input type="radio" class="radiobox" name="preferred_domain" id="fid-preferred_domain_to_www"
                                           value="{PREFERRED_DOMAIN_TO_WWW_VALUE}" {PREFERRED_DOMAIN_TO_WWW_CHECKED}>&nbsp;<label
                            for="fid-preferred_domain_to_www">{PREFERRED_DOMAIN_TO_WWW_TEXT}</label></div>
            </td>
        </tr>
        <tr>
            <td class="name">{IP_LOGGING}</td>
            <td><label id="disable_ip_logging_label"><input type="checkbox" class="checkbox" name="disable_ip_logging" id="disable_ip_logging"
                                                            value="true" {DISABLE_IP_LOGGING_CHECKED}/> {DISABLE_IP_LOGGING}</label></td>
        </tr>
        <tr>
            <td class="name">{LOGROTATE}</td>
            <td>
                <div class="option">
                    <label for="fid-logrotate_force"><input type="checkbox" class="checkbox" name="logrotate_force" id="fid-logrotate_force" value="true" {LOGROTATE_FORCE_CHECKED}
                                                            onclick="force_logrotate_oC()"/> {LOGROTATE_FORCE_TEXT}</label>
                </div>
                <div class="suboption">
                    <label for="fid-logrotate_period">{LOGROTATE_PERIOD_TEXT}</label>
                    &nbsp;<input type="text" name="logrotate_period" id="fid-logrotate_period" value="{LOGROTATE_PERIOD}" size="6" maxlength="5">
                    &nbsp;<label for="fid-logrotate_period">{LOGROTATE_PERIOD_DAYS_TEXT}</label>
                </div>
            </td>
        </tr>
        <!-- BEGIN DYNAMIC BLOCK: auto_install_updates -->
        <tr>
            <td colspan="2">{AUTO_INSTALL_UPDATES_LINK}</td>
        </tr>
        <!-- END DYNAMIC BLOCK: auto_install_updates -->
    </table>
</fieldset>
