function closed_panel($idx)
{
    //calculate the panel name
    $pvar = 's_' . strtolower($GLOBALS['s_page']) . '_panels';
    $GLOBALS[$pvar][$idx][2] = 'close';
    $icon = get_icon_path(DATAPATH, ICON_SIZE) . 'open.png';
    $html = get_closed_panel($GLOBALS[$pvar][$idx][1], $idx, $icon);
    set_customize_cookie($GLOBALS['s_cust']);
    header('Content-Type: text/html;charset=' . $GLOBALS['charset']);
    echo $html;
}
        // which carrying the instance nr in the panel name
        if (preg_match('/dt_(edit|delete)([0-9]+)/', $panel[0], $matches)) {
            $instance = $matches[2];
            if ($matches[1] == 'edit') {
                include './panels/dt_edit.php';
            } else {
                $subject = 'row';
                include './panels/confirm.php';
            }
        } else {
            include './panels/' . $panel[0] . '.php';
        }
        echo get_open_panel_end();
    } else {
        $open_icon = get_icon_path(DATAPATH, ICON_SIZE) . 'open.png';
        echo get_closed_panel($panel[1], $nr, $open_icon);
    }
    echo "</div>\n";
}
// close the db connection
if (isset($dbhandle) && is_resource($dbhandle)) {
    // fbird_close() chrashes the apache-process,
    // this was a bug in some revisions of the ibase-module
    //    fbird_close($dbhandle);
}
if (DEBUG === TRUE) {
    echo "<div align=\"left\">\n";
    show_time_consumption($start_time, microtime());
    //     echo 'cookie size: '.strlen($_COOKIE[get_customize_cookie_name()])."<br>\n";
    //     debug_var($_COOKIE[get_customize_cookie_name()]);
    // display links to display the session, post or get variables