function detail_view($type, $name, $title)
{
    $url = fold_detail_url($type, 'open', $name, $title);
    $comment_url = "javascript:requestCommentArea('" . $type . "', '" . $name . "');";
    $comment_div = detail_div_prefix($type) . 'c_' . $name;
    switch ($type) {
        case 'table':
            if ($GLOBALS['s_tables_def'] == TRUE) {
                $GLOBALS['s_fields'] = get_table_defaults_sources($name, $GLOBALS['s_fields']);
            }
            $html = get_opened_table($name, $title, $url, $comment_url, $comment_div);
            $GLOBALS['s_tables'][$name]['status'] = 'open';
            break;
        case 'view':
            include '../inc/views.inc.php';
            $html = get_opened_view($name, $title, $url);
            $GLOBALS['s_tables'][$name]['status'] = 'open';
            break;
        case 'trigger':
            include '../inc/triggers.inc.php';
            if (empty($GLOBALS['s_triggers'][$name]['source'])) {
                $GLOBALS['s_triggers'][$name]['source'] = get_trigger_source($name);
            }
            $html = get_opened_trigger($name, $GLOBALS['s_triggers'][$name], $url);
            $GLOBALS['s_triggers'][$name]['display'] = 'open';
            break;
        case 'procedure':
            include '../inc/procedures.inc.php';
            include '../inc/firebird.inc.php';
            if (empty($GLOBALS['s_procedures'][$name]['source'])) {
                $GLOBALS['s_procedures'][$name]['source'] = get_procedure_source($name);
                list($in, $out) = get_procedure_parameters($name);
                $GLOBALS['s_procedures'][$name]['in'] = $in;
                $GLOBALS['s_procedures'][$name]['out'] = $out;
            }
            $html = get_opened_procedure($name, $GLOBALS['s_procedures'][$name], $url);
            $GLOBALS['s_procedures'][$name]['status'] = 'open';
            break;
    }
    header('Content-Type: text/html;charset=' . $GLOBALS['charset']);
    echo $html;
}
//                published under the terms of the GNU General Public Licence v.2,
//                see file LICENCE for details
$tcnt = 0;
if ($s_connected == TRUE && is_array($s_tables)) {
    foreach ($s_tables as $tablename => $properties) {
        if ($properties['is_view'] == TRUE) {
            continue;
        }
        $tcnt++;
        $title = $tablename;
        if ($s_tables_counts == TRUE && isset($properties['count'])) {
            $title .= ' [' . $properties['count'] . ']';
        }
        $fold_url = fold_detail_url('table', $properties['status'], $tablename, $title);
        $comment_url = "javascript:requestCommentArea('table', '" . $tablename . "');";
        echo '      <div id="' . 't_' . $tablename . "\" class=\"det\">\n";
        if ($properties['status'] == 'open') {
            echo get_opened_table($tablename, $title, $fold_url, $comment_url, 'tc_' . $tablename);
        } else {
            // $properties['status'] == 'close'
            echo get_closed_detail($title, $fold_url, $comment_url, 'tc_' . $tablename);
        }
        echo "      </div>\n";
    }
    // foreach $s_tables
    echo '<form method="post" action="' . url_session($_SERVER['PHP_SELF']) . "#tb_show\" name=\"tb_show_form\">\n" . get_checkbox('tb_show_counts', '1', $s_tables_counts) . ' ' . $tb_strings['DispCounts'] . "&nbsp;&nbsp;&nbsp;\n" . get_checkbox('tb_show_cnames', '1', $s_tables_cnames) . ' ' . $tb_strings['DispCNames'] . "&nbsp;&nbsp;&nbsp;\n" . get_checkbox('tb_show_def', '1', $s_tables_def) . ' ' . $tb_strings['DispDef'] . "&nbsp;&nbsp;&nbsp;\n" . get_checkbox('tb_show_comp', '1', $s_tables_comp) . ' ' . $tb_strings['DispComp'] . "&nbsp;&nbsp;&nbsp;\n" . get_checkbox('tb_show_comments', '1', $s_tables_comment) . ' ' . $tb_strings['DispComm'] . "<br />\n" . '  <input type="submit" name="tb_show_reload" value="' . $button_strings['Reload'] . "\" class=\"bgrp\">\n";
    if ($tcnt > 1) {
        echo '  <input type="submit" name="tb_table_open" value="' . $button_strings['OpenAll'] . "\" class=\"bgrp\">\n" . '  <input type="submit" name="tb_table_close" value="' . $button_strings['CloseAll'] . "\" class=\"bgrp\">\n";
    }
    echo "</form>\n";
}