function openside($title, $collapse = false, $state = "on") {
global $panel_collapse; $panel_collapse = $collapse;
echo "<table cellpadding='0' cellspacing='0' width='211' class='border'>\n<tr>\n";
echo "<td background='".THEME."images/panel_01.png' height='37' class='scapmain'>".$title."</td>\n";
if ($collapse == true) {
$boxname = str_replace(" ", "", $title);
echo "<td class='scapmain' align='right'>".panelbutton($state,$boxname)."</td>\n";
echo "</tr>\n<tr>\n";
}
echo "</tr>\n<tr>\n";
echo "<td".($collapse == true ? " colspan='2'" : "")." background='".THEME."images/panel_02.png' class='side-body'>\n";
if ($collapse == true) { echo panelstate($state, $boxname); }
echo "</tr>\n<tr>\n";
echo"<td background='".THEME."images/panel_03.png' height='20'></td>\n";
echo "</td>\n</tr>\n</table>\n";
}