<!--#include file="conn.asp" -->
<%
'Response.Cookies("tree")="ftbbstree.asp"
'Response.Cookies("tree").Expires=date+30
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>论坛导航</title>
<script language=javascript src="inc/cookies.js"></script>
<script>
var stylecook = getCookie("STYLESHOW");
var style;
var strstyle;
if(stylecook=="")
{
 stylecook=1;//默认皮肤
}
else
{
 stylecook++;
}
style="style0"+stylecook+".css";
strstyle="<link href=\"css/"+style+"\"  rel=\"stylesheet\" type=\"text/css\"> ";
document.write(strstyle);
</script>

<script language="JavaScript">
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;

if (ver4) {
with (document) {
write("<STYLE TYPE='text/css'>");
if (NS4) {
write(".parent {position:absolute; visibility:visible}");
write(".child {position:absolute; visibility:visible}");
write(".regular {position:absolute; visibility:visible}")
}else {
write(".child {display:none}")
}
write("</STYLE>");
}}

function getIndex(el) {
ind = null;
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id == el) {
ind = i;
break;
}}
return ind;
}

function arrange() {
nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height;
for (i=firstInd+1; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.visibility != "hide") {
whichEl.pageY = nextY;
nextY += whichEl.document.height;
}}}

function initIt()
{
	if (!ver4) return;
	if (NS4)
	{
		for (i=0; i<document.layers.length; i++)
		{
			whichEl = document.layers[i];
			if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
		}
		arrange();
	}
	else
	{
		divColl = document.all.tags("DIV");
		for (i=0; i<divColl.length; i++)
		{
			whichEl = divColl(i);
			if (whichEl.className == "child") whichEl.style.display = "none";
		}
	}
}

function expandIt(el)
{
	if (!ver4) return;
	if (IE4)
	{
		whichEl = eval(el + "Child");
		if (whichEl.style.display == "none")
		{
			whichEl.style.display = "block";
			document.all("dir"+el.replace("KB","")).src="images/opentm.gif";
			document.all("fold"+el.replace("KB","")).src="images/openx.gif";
		}
		else
		{
			whichEl.style.display = "none";
			document.all("dir"+el.replace("KB","")).src="images/closetm.gif";
			document.all("fold"+el.replace("KB","")).src="images/close.gif";
		}
	}
	else
	{
		whichEl = eval("document." + el + "Child");
		if (whichEl.visibility == "hide")
		{
			whichEl.visibility = "show";
		}
		else
		{
			whichEl.visibility = "hide";
		}
		arrange();
	}
}
onload = initIt;
function popwin(path)
{ window.open(path,'',"height=150,width=200,resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no");
} 
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
		<center>
  <table width="122" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td height="3" class="treetdbg"> 
        <spacer height="3" type="block"></td>
    </tr>
    <tr>
      <td height="50"><div align="center"><img src="images/tmlogo.gif" width="112" height="50"></div></td>
    </tr>
    <tr> 
      <td height="3" class="treetdbg"> 
        <spacer height="3" type="block"></td>
    </tr>
    <!--<tr> 
      <td height=1 background="images/dotbg.gif"><spacer height="1" type="block"></td>
    </tr>
    <tr> 
      <td height=23><div align="center"><a class=head3 href="bbsleft.asp">&middot;默认</a><a class=head3 href="ftbbstree.asp">&middot;文件夹树型</a></div></td>
    </tr>
    <tr> 
      <td height=1 background="images/dotbg.gif"><spacer height="1" type="block"></td>
    </tr>-->
    <tr> 
      <td height=6><spacer height="6" type="block"></td>
    </tr>
  </table>
  <table width="120" border="0" cellpadding="0" cellspacing="0" class="text">
      <tr>
                <td><table width="120" border="0" cellpadding="0" cellspacing="0" class="text">
            <tr align="left" valign="middle">       
              
            <td width="15"><img src="images/opennotopline.gif" width="18" height="18"></td>   
            <td width="15"><img src="images/home.gif" width="18" height="18"></td>      
            <td> &nbsp;<a class=head3 href=main.asp target=main>论坛首页</a></td>
                    </tr>
                  </table></td>
              </tr>
			  </table>
<%
f=request("f")
sql="select BBS_ID,BBS_Cate_Name,BBS_Cate_ID,BBS_Cate_PID,BBS_Cate_Qs,treesign from BBS_Cate where BBS_Cate_PID='0' and deleted=0 order by totop asc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
if rs("treesign")=1 then
   openclose="opentm.gif"
   openclosex="openx.gif"
else
   openclose="closetm.gif"
   openclosex="close.gif"
end if
%>				
    <table width="120" border="0" cellpadding="0" cellspacing="0" class="text">
      <tr align="left" valign="middle"> 
         <td width="40">
		   <table width="120" border="0" cellpadding="0" cellspacing="0" class="text">
           <tr align="left" valign="middle">
             <td width="15" ><a href="#" onClick="expandIt('KB<%=rs("bbs_id")%>'); return false" style="cursor: default;"><img id="dir<%=rs("bbs_id")%>" name="dir<%=rs("bbs_id")%>" src="images/<%=openclose%>" width="18" height="18" border=0></a></td>
              
            <td width="15"><a href="#" onClick="expandIt('KB<%=rs("bbs_id")%>'); return false" style="cursor: default;"><img id="fold<%=rs("bbs_id")%>" name="fold<%=rs("bbs_id")%>" src="images/<%=openclosex%>" width="16" height="15" border=0></a></td>
                <td>
				<div id="KB<%=rs("bbs_id")%>Parent" class="parent"> &nbsp;<a class=head3 href="#" onClick="parent.frames('main').location.href='main.asp?layer_1=<%=rs("bbs_cate_id")%>&qs=<%=rs("BBS_Cate_Qs")%>';expandIt('KB<%=rs("bbs_id")%>'); return false"><%=rs("BBS_Cate_Name")%></a> </div>
				</td>
                </tr>
            </table>
		</td>
       </tr>
<%
   sql15="select BBS_Cate_Name,BBS_Cate_ID,BBS_Cate_PID,BBS_Cate_Qs from BBS_Cate where BBS_Cate_PID='"&rs("BBS_Cate_ID")&"' and deleted=0 order by totop asc"
   set rs15=server.createobject("adodb.recordset")
   rs15.open sql15,conn,1,1
   if not rs15.eof then
%>					
		<tr align="left" valign="middle"> 
         
      <td > 
        <div id="KB<%=rs("bbs_id")%>Child" <%if rs("treesign")=0 then%> class="child" <%end if%>> 
                    <table width="120" border="0" cellpadding="0" cellspacing="0" class="text">				
   <%
   i=0
   do while not rs15.eof
     if i=rs15.recordcount-1 then
		line="<img src=""images/nodeend.gif"" width=""16"" height=""18"">"
	 else
	    line="<img src=""images/node.gif"" width=""16"" height=""18"">"
	 end if		  
   %>
					   <tr align="left" valign="middle"> 
                          <td width="15" class=" "><img src="images/treeline.gif" width="18" height="18"></td>       
                          <td width="15" align="center" valign="top"><%=line%></td>
						  <td>
						  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="text">
                              <tr>      
                              <td width="10"><img src="images/doc.gif" width="16" height="18"></td>
                              <td> <a class=head3 href="main.asp?layer_1=<%=rs15("BBS_Cate_PID")%>&layer_2=<%=rs15("BBS_Cate_ID")%>&qs=<%=rs15("BBS_Cate_Qs")%>" target="main"> <%=rs15("BBS_Cate_Name")%></a></td>
                              </tr>
                          </table>
						 </td>
						 </tr>
    <%
	i=i+1
    rs15.movenext
    loop
    rs15.close
    set rs15=nothing		  
   %>					 						
          </table>
          </div>	
        </td>
	 </tr>
  <%end if%>
   </table>
  <%
rs.movenext
loop
rs.close
set rs=nothing
%>
  <table width="120" border="0" cellpadding="0" cellspacing="0" class="text">
    <tr> 
      <td><table width="121" border="0" cellpadding="0" cellspacing="0" class="text">
          <tr align="left" valign="middle"> 
            <td width="18"><div align="right"><img src="images/nodeend.gif" width="16" height="18"></div></td>
            <td width="16"> <div align="center"><img src="images/openx.gif" width="16" height="15"></div></td>
            <td width="85"> &nbsp;<a class=head3 href=help.asp target=main>论坛指南</a></td>
          </tr>
        </table></td>
    </tr>
  </table>
  <table width="120" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td height=10><spacer height="10" type="block"></td>
    </tr>
</table>
</center>
<script language="JavaScript">
if (NS4) {
firstEl = "KB-2Parent";
firstInd = getIndex(firstEl);
arrange();
}
</script>
</body>
</html>
