<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css.css" rel="stylesheet">
<title>目录树</title>
</head>
<%
Dim ClassSql,RsClassObj,direct_f
ClassSql = "Select id,title,ParentID from catalogs where parentID=0"
Set RsClassObj = Conn.Execute(ClassSql)
direct_f=request("file")

%>

<script src="../js/PublicJS.js" language="JavaScript"></script>
<body topmargin="0" leftmargin="0">

<table width="100%"  border="0" cellspacing="0" cellpadding="0" style="border:1px solid #666666; ">  
  <tr>
    <td width="20" bgcolor="#F0EFEC">&nbsp;</td>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <tr>
        <td bgcolor="#FFFFFF">
          <table border="0" cellspacing="0" cellpadding="0">
            <tr onDblClick="DblClickClass(this);" ChildClassShowTF="true" id="SysRootClass" ParentID="0" ClassID="0" align="left" class="TempletItem">
              <td><img src="../Images/Folderk.gif" width="18" height="18"></td>
              <td><a href="<%=direct_f%>.asp?classid=0" target="child_main">系统根栏目</a></td>
            </tr>
        </table></td>
      </tr>
      <%
do while Not RsClassObj.Eof
%>
      <tr>
        <td bgcolor="#FFFFFF"><table border="0" cellspacing="0" cellpadding="0">
            <tr onDblClick="DblClickClass(this);" ChildClassShowTF="true" ParentID="<% = RsClassObj(2) %>" ClassID="<% = RsClassObj(0) %>" align="left" class="TempletItem">
              <td><img src="../Images/folder-.gif" width="18" height="18"><img src="../Images/Folder.gif"></td>
              <td><a href="<%=direct_f%>.asp?classid=<%=RsClassObj(0)%>" target="child_main"><% = RsClassObj(0) %>-<% = RsClassObj(1) %></a></td>
            </tr>
        </table></td>
      </tr>
      <%	
	RsClassObj.MoveNext
loop
%>
    </table></td>
  </tr>
</table>
</body>
</html>
<%
RsClassObj.close
Set RsClassObj = Nothing
%>

</body>
</html>
<script language="JavaScript">
var ParentID='0';
var ClassID='0';
function ClickClass(Obj)
{
	if ((Obj.ParentID==null)||(Obj.ClassID==null)) return;
	for (var i=0;i<document.all.length;i++) if (document.all(i).className=='TempletSelectItem') document.all(i).className='TempletItem';
	Obj.children(1).className='TempletSelectItem';
	ParentID=Obj.ParentID;
	ClassID=Obj.ClassID;	
	//parent.frames['OpreateWindow'].location='<%=direct_f%>.asp?classid='+ClassID;
}

function DblClickClass(Obj)
{
	if (Obj.ChildClassShowTF=='true')
	{
		HideChildClass(ClassID);
		Obj.ChildClassShowTF='false';		
	}
	else
	{
		ShowChildClass(ClassID);
		Obj.ChildClassShowTF='true';		
	}
}

function HideChildClass(ID)
{
	var CurrObj=null;
	for (var i=0;i<document.all.length;i++)
	{
		CurrObj=document.all(i);
		if ((CurrObj.ParentID==ID)&&(CurrObj.id!='SysRootClass'))
		{
			if (CurrObj.parentElement.parentElement.parentElement.parentElement.tagName.toLowerCase()=='tr')
			{
				CurrObj.parentElement.parentElement.parentElement.parentElement.style.display='none';
				HideChildClass(CurrObj.ClassID);
			}
		}
	}
}

function ShowChildClass(ID)
{
	var CurrObj=null;
	for (var i=0;i<document.all.length;i++)
	{
		CurrObj=document.all(i);
		if ((CurrObj.ParentID==ID)&&(CurrObj.id!='SysRootClass'))
		{
			if (CurrObj.parentElement.parentElement.parentElement.parentElement.tagName.toLowerCase()=='tr')
			{
				CurrObj.parentElement.parentElement.parentElement.parentElement.style.display='';
				ShowChildClass(CurrObj.ClassID);
			}
		}
	}
}
</script>
<%call connclose()%>