)
echo "<td width=16></td>";
echo "<td width=100%> </td></tr>\n";
$cnt=0;
while ($cnt<count($tree))
{
if ($visible[$cnt])
{
echo "<tr>";
$i=0;
while ($i<$tree[$cnt][0]-1)
{
if ($levels[$i]==1)
echo "<td><a name=''$cnt''></a><img src=\"".$img_line."\"></td>";
else
echo "<td><a name=''$cnt''></a><img src=\"".$img_spc."\"></td>";
$i++;
}
if ($tree[$cnt]==1)
{
echo "<td><img src=\"".$img_end."\"></td>";
$levels[$tree[$cnt][0]-1]=0;
}
else
{
echo "<td><img src=\"".$img_split."\"></td>";
$levels[$tree[$cnt][0]-1]=1;
}
if ($tree[$cnt+1][0]>$tree[$cnt][0])
{
$i=0; $params="?p=";
while($i<count($expand))
{
if ( ($expand[$i]==1) && ($cnt!=$i) || ($expand[$i]==0 && $cnt==$i))
{
$params=$params.$i;
$params=$params."|";
}
$i++;
}
if ($expand[$cnt]==0)
echo "<td><a href=\"".$script.$params."#$cnt\"><img src=\"".$img_expand."\" border=no></a></td>";
else
echo "<td><a href=\"".$script.$params."#$cnt\"><img src=\"".$img_collapse."\" border=no></a></td>";
}
else
echo "<td><img src=\"".$img_leaf."\"></td>";
if ($tree[$cnt]=="")
echo "<td colspan=".($maxlevel-$tree[$cnt][0]).">".$tree[$cnt]."</td>";
else
echo "<td colspan=".($maxlevel-$tree[$cnt][0])."><a href=\"".$tree[$cnt]."\" target=\"".$tree[$cnt]."\">".$tree[$cnt]."</a></td>";
echo "</tr>\n";
}
$cnt++;
}
echo "</table>\n";
?>