<% Option Explicit %>
<!--#include file="../../../FS_Inc/Const.asp" -->
<!--#include file="../../../FS_Inc/Function.asp"-->
<!--#include file="../../../FS_InterFace/MF_Function.asp" -->
<%
'Copyright (c) 2006 Foosun Inc. Code by Terry Wen Time:2006.6
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.Charset="GB2312"
Server.ScriptTimeOut=999999999
Dim Conn
Dim ParentId,Str_Sql,Rs_Class,Str_ClassInfo
MF_Default_Conn
ParentId = NoSqlHack(Trim(Request.QueryString("ParentId")))
If ParentId = "" Then
	ParentId = "0"
End If
On Error Resume Next
Str_Sql = "Select ClassID,ClassName,NewsTemplet,(Select Count(id) from FS_NS_NewsClass where ParentID=a.ClassID and ReycleTF=0 and isUrl=0) as HasSub from FS_NS_NewsClass a where ParentID='"&ParentId&"' and ReycleTF=0 and isUrl=0 order by OrderID desc,id desc"
Set Rs_Class = Conn.Execute(Str_Sql)
Str_ClassInfo=""
While Not Rs_Class.Eof
	Dim Str_NewsTemplet
	If Rs_Class("NewsTemplet") = "" Or IsNull(Rs_Class("NewsTemplet")) Then
		Str_NewsTemplet = "/Templets/NewsClass/news.htm"
	Else
		Str_NewsTemplet = Trim(Rs_Class("NewsTemplet"))
	End If	
	If Rs_Class("HasSub")>0 Then
		Str_ClassInfo=Str_ClassInfo&"<div><img src=""../images/+.gif"" alt=""点击展开子栏目"" width=""15"" height=""15"" border=""0"" class=""LableItem"" onClick=""javascript:SwitchImg(this,'"&Rs_Class("ClassID")&"');"" /><span id="""&Rs_Class("ClassID")&""" onDblClick=""SubmitLable(this);"" class=""LableItem"" onClick=""SelectLable(this)"" value=""" & Str_NewsTemplet & """>"&Rs_Class("ClassName")&"</span>"&VbNewLine&_
			"<div id=""Parent"&Rs_Class("ClassID")&""" class=""SubItem"" HasSub=""True"" style=""display:none;""></div>"&VbNewLine&_
		"</div>"&VbNewLine
	Else
		Str_ClassInfo=Str_ClassInfo&"<div><img src=""../images/-.gif"" alt=""没有子栏目"" width=""15"" height=""15"" border=""0"" class=""LableItem"" /><span id="""&Rs_Class("ClassID")&""" onDblClick=""SubmitLable(this);"" class=""LableItem"" onClick=""SelectLable(this)"" value=""" & Str_NewsTemplet & """>"&Rs_Class("ClassName")&"</span>"&VbNewLine&_
		"</div>"&VbNewLine
	End If
	Rs_Class.MoveNext
Wend
If Err Then
	Str_ClassInfo="Fail|||"&ParentId&"|||"
Else
	Str_ClassInfo="Succee|||"&ParentId&"|||"&Str_ClassInfo
End If
Response.Write(Str_ClassInfo)
%>