<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<%
'==============================================================================
'软件名称：风讯网站信息管理系统
'当前版本：Foosun Content Manager System 2.0 
'最新更新：2004.12
'==============================================================================
'商业注册联系：028-85098980-601,602 技术支持：028-85098980-606、607,客户支持：608
'产品咨询QQ：159410,655071,66252421
'技术支持:所有程序使用问题，请提问到bbs.foosun.net我们将及时回答您
'程序开发：风讯开发组 & 风讯插件开发组
'论坛支持：风讯在线论坛(http://bbs.foosun.net)
'官方网站：www.Foosun.net  演示站点：test.cooin.com    
'网站建设专区：www.cooin.com
'==============================================================================
'免费版本请在新闻首页保留版权信息，并做上本站LOGO友情连接
'==============================================================================
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P0105") then Call ReturnError2()
Dim ClassSql,RsClassObj
ClassSql = "Select * from NewsClass where Contribution=1 and DelFlag=0 order by AddTime desc"
Set RsClassObj = Conn.Execute(ClassSql)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>栏目列表</title>
</head>
<link href="../../CSS/css.css" rel="stylesheet">
<script src="../JS/PublicJS.js" language="JavaScript"></script>
<body topmargin="0" leftmargin="0" ondragstart="return false;" onselectstart="return false;" oncontextmenu="ClickClass(event.srcElement.parentElement);return false;">
<table border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td> 
      <table border="0" cellspacing="0" cellpadding="0">
        <tr onDblClick="DblClickClass(this);" ChildClassShowTF="true" id="SysRootClass" ParentID="0" ClassID="0" align="left" onClick="ClickClass(this)" class="TempletItem">
          <td><img src="../Images/Folder.gif" width="18" height="18"></td>
          <td class="TempletSelectItem">全部稿件</td>
        </tr>
      </table></td>
  </tr>
  <%
do while Not RsClassObj.Eof
	if JudgePopedomTF(Session("Name"),"" & RsClassObj("ClassID") & "") = True then
%>
  <tr> 
    <td><table border="0" cellspacing="0" cellpadding="0">
        <tr onDblClick="DblClickClass(this);" ChildClassShowTF="true" ParentID="<% = RsClassObj("ParentID") %>" ClassID="<% = RsClassObj("ClassID") %>" align="left" onClick="ClickClass(this)" class="TempletItem">
          <td><img src="../Images/folder-.gif" width="18" height="18"><img src="../Images/Folder.gif"></td>
          <td><% = RsClassObj("ClassCName") %></td>
        </tr>
      </table></td>
  </tr>
  <%
  	end if
	RsClassObj.MoveNext
loop
%>
</table>
</body>
</html>
<%
Set RsClassObj = Nothing
Set Conn = Nothing
%>
<script language="JavaScript">
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.MoveOrCopyObjectClass=Obj.ClassID;
	parent.frames['OpreateWindow'].location='ContributionList.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);
			}
		}
	}
}

function CheckParentClassTF(SourceID,ObjectID)
{
	alert(SourceID+','+ObjectID);
	var CurrObj=null,TempID='';
	if (ObjectID=='0') return true;
	for (var i=0;i<document.all.length;i++)
	{
		CurrObj=document.all(i);
		if (CurrObj.ParentID==SourceID) {TempID=CurrObj.ParentID;alert(CurrObj.ParentID);return false;}
	}
	if (TempID=='') return true;
	if (TempID!='0') return CheckParentClassTF(SourceID,TempID);
	else return true;
}

</script>