<!--#include file="ACT.Search.asp" -->
<!--#include file="ACT.FreeLabel.asp" -->
<%
Class ACT_Code
	Private Domain,ASys
	Private Sub Class_Initialize()
		Domain = AcTCMS.ActCMSDM
		ASys = Actcms.ActSys
		End Sub
        Private Sub Class_Terminate()
		End Sub
		Public Function LabelReplaceAll(TemplateContent)
				  TemplateContent = LableFlag(AllLabel(TemplateContent))
				 ' TemplateContent =ReplaceIf(TemplateContent)'if 判断标签
				  TemplateContent =ReplaceAllLabel(TemplateContent)
				  TemplateContent = GeneralLabel(TemplateContent)   
				  LabelReplaceAll = TemplateContent
	    End Function
	Public Function ArticleContent(ModeID,RefreshArticle)
		on error resume next
		Dim TempletContent,ArticleContents,ArticleContentArr,TotalPage,I,CurrPage,ArticlePageStr,FileName
		Dim fext,n,FilePathName,StrContent,ContentText,FilePath
		Application(AcTCMSN & "ClassID")=RefreshArticle("ClassID")
		Application(AcTCMSN & "ACTCMS_TCJ_Type")="ARTICLECONTENT"
		Application(AcTCMSN & "ModeID")=ModeID
		Application(AcTCMSN & "ID")=RefreshArticle("ID")
		TempletContent = LoadTemplate(RefreshArticle("TemplateUrl"))'读取模板路径
		TempletContent = AllLabel(TempletContent)'标签转换
		StrContent = LableFlag(GeneralLabel(TempletContent))'通用标签转换
		ArticleContents = RefreshArticle("Content")
		If ArticleContents="" Then ArticleContents = " "
		FilePath=ASys&ACTCMS.ACT_C(ModeID,6)&RefreshArticle("FileName")
		If Right(ACTCMS.ACT_C(ModeID,10),1)<>"/" Then 
			 FilePathName= FilePath&ACTCMS.ACT_C(ModeID,11)'文件路径加扩展名,下,截取/字符.以便生成相应文件夹
			 FilePath=Replace(FilePathName, Mid(FilePathName, InStrRev(FilePathName, "/")), "")
		 Else
		 	 FilePathName= FilePath&"/Index"&ACTCMS.ACT_C(ModeID,11)
		End If 
		If InStr(ArticleContents, "[NextPage]") > 0 Then 
			FExt = Mid(Trim(FilePathName), InStrRev(Trim(FilePathName), "."))
			FileName = Replace(Trim(FilePathName), FExt, "")
		End If 
			   Call Actcms.CreateFolder(FilePath)
			   ArticleContentArr = Split(ArticleContents, "[NextPage]")
			   TotalPage = UBound(ArticleContentArr) + 1
			 For I = 0 To UBound(ArticleContentArr)
			   CurrPage = I + 1
			   If TotalPage > 1 Then
					   If I = 0 Then
						 ArticlePageStr = "<p><div align=center><a href=" &  FileName & "_" & (CurrPage + 1) & FExt & ">下一页</a><br>"
					   ElseIf I = 1 And I <> TotalPage - 1 Then
						 ArticlePageStr = "<p><div align=center><a href=" &  FilePathName & ">上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=" &  FileName & "_" & (CurrPage + 1) & FExt & ">下一页</a><br>"
					   ElseIf I = 1 And I = TotalPage - 1 Then
						 ArticlePageStr = "<p><div align=center><a href=" &  FilePathName & ">上一页</a><br>"
					   ElseIf I = TotalPage - 1 Then
						 ArticlePageStr = "<p><div align=center><a href=" &  FileName & "_" & (CurrPage - 1) & FExt & ">上一页</a><br>"
					   Else
						ArticlePageStr = "<p><div align=center><a href=" &  FileName & "_" & (CurrPage - 1) & FExt & ">上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=" &  FileName & "_" & (CurrPage + 1) & FExt & ">下一页</a><br>"
					   End If
					   ArticlePageStr = ArticlePageStr & "本文共<font color=red> " & TotalPage & " </font>页,第&nbsp;&nbsp;"
				   For N = 1 To TotalPage
					  If N = 1 Then
						 If CurrPage = N Then
						  ArticlePageStr = ArticlePageStr & "<font color=red>[" & N & "]</font>&nbsp;&nbsp;"
						 Else
						  ArticlePageStr = ArticlePageStr & "<a href=" &  FileName&ACTCMS.ACT_C(ModeID,11) & ">[" & N & "]</a>&nbsp;&nbsp;"
						 End If
					   Else
						 If CurrPage = N Then
						   ArticlePageStr = ArticlePageStr & "<font color=red>[" & N & "]</font>&nbsp;&nbsp;"
						 Else
						   ArticlePageStr = ArticlePageStr & "<a href=" &  FileName & "_" & N & FExt & ">[" & N & "]</a>&nbsp;&nbsp;"
						End If
					  End If
					  
					  If TotalPage > 10 Then
					   If N Mod 10 = 0 Then ArticlePageStr = ArticlePageStr & "<br>"
					  End If
					Next
					ArticlePageStr = ArticlePageStr & "页</div></p>"
				 Else
				  ArticlePageStr = ""
				 End If
		 If CurrPage <> 1 Then FilePathName =  FileName & "_" & CurrPage & FExt
		ContentText=StrContent
		TempletContent = ReplaceArticleContent(ModeID,RefreshArticle,ContentText,ArticleContentArr(I) & ArticlePageStr)
		Call FSOSaveFile(ContentText,FilePathName)
		Next
	End Function


	Function  LoadTemplate(TempString) 
		on error resume next
		Dim  Str,A_W
		set A_W=server.CreateObject("adodb.Stream")
		A_W.Type=2 
		A_W.mode=3 
		A_W.charset="gb2312"
		A_W.open
		A_W.loadfromfile server.MapPath(TempString)
		If Err.Number<>0 Then Err.Clear:LoadTemplate="当前模板路径:<font color=red>"&TempString&"</font><br>模板没有找到 <br> by ACTCMS":Exit Function
		Str=A_W.readtext
		A_W.Close
		Set  A_W=nothing
		LoadTemplate=Str
	End  function

 	Public Function GeneralLabel(FileContent)
		on error resume next
		 FileContent = ReplaceChannel(FileContent)'栏目标签
		 FileContent = ReplaceMode(FileContent)'栏目标签
		 Dim HtmlLabel,HtmlLabelArr, Param,I,Act_S
		 Set Act_S = New ACT_Search
		 FileContent = Act_S.ACT_SearchCls(FileContent,Application(AcTCMSN & "ModeID"))
		 Set Act_S=Nothing
		 FileContent = Replace(FileContent, "{$SiteName}",AcTCMS.ActCMS_Sys(0))
		 FileContent = Replace(FileContent, "{$SiteTitle}", AcTCMS.ActCMS_Sys(1))
		 FileContent = Replace(FileContent, "{$Keywords}", AcTCMS.ActCMS_Other(1))
		 FileContent = Replace(FileContent, "{$Description}", AcTCMS.ActCMS_Other(2))
		 FileContent = Replace(FileContent, "{$CopyRight}", AcTCMS.ActCMS_Other(0))
		 FileContent = Replace(FileContent, "{$InstallDir}", AcTCMS.ActCMS_Sys(3))
		 FileContent = Replace(FileContent, "{$Logo}", AcTCMS.ActCMS_Sys(5))
		 FileContent = Replace(FileContent, "{$AdminName}", AcTCMS.ActCMS_Sys(6))
		 FileContent = Replace(FileContent, "{$AdminMail}", AcTCMS.ActCMS_Sys(7))
		 FileContent = Replace(FileContent, "{$AdminDir}", AcTCMS.ActCMS_Sys(8))
		 FileContent = Replace(FileContent, "{$actcms}", "Powered by <A href=""http://www.actcms.com"" target=""_blank""> ACTCMS</a>")

		 If InStr(FileContent, "{=GetTags") <> 0 Then
			 HtmlLabel = SelectLabelParameter(FileContent, "{=GetTags")
			 HtmlLabelArr=Split(HtmlLabel,"$$$")
			 For I=0 To Ubound(HtmlLabelArr)
				 Param = Split(FunctionLabelParam(HtmlLabelArr(I), "{=GetTags"),",")
				 FileContent = Replace(FileContent, HtmlLabelArr(I), GetTags(Param(0),Param(1)))
			 Next
		 End If

		 If InStr(FileContent, "{=TodayRenewal") <> 0 Then
			 HtmlLabel = SelectLabelParameter(FileContent, "{=TodayRenewal")
			 HtmlLabelArr=Split(HtmlLabel,"$$$")
			 For I=0 To Ubound(HtmlLabelArr)
				 Param = Split(FunctionLabelParam(HtmlLabelArr(I), "{=TodayRenewal"),",")
				 FileContent = Replace(FileContent, HtmlLabelArr(I), AcTCMS.TodayRenewal(Param(0)))
			 Next
		 End If

		 If InStr(FileContent, "{=CountClass") <> 0 Then
			 HtmlLabel = SelectLabelParameter(FileContent, "{=CountClass")
			 HtmlLabelArr=Split(HtmlLabel,"$$$")
			 For I=0 To Ubound(HtmlLabelArr)
				 Param = Split(FunctionLabelParam(HtmlLabelArr(I), "{=CountClass"),",")
				 FileContent = Replace(FileContent, HtmlLabelArr(I), AcTCMS.CountClass(Param(0)))
			 Next
		 End If

		 If InStr(FileContent, "{=SysCount") <> 0 Then
			 HtmlLabel = SelectLabelParameter(FileContent, "{=SysCount")
			 HtmlLabelArr=Split(HtmlLabel,"$$$")
			 For I=0 To Ubound(HtmlLabelArr)
				 Param = Split(FunctionLabelParam(HtmlLabelArr(I), "{=SysCount"),",")
				 FileContent = Replace(FileContent, HtmlLabelArr(I), AcTCMS.SysCount(Param(0)))
			 Next
		 End If

		If InStr(FileContent, "{=UserLogin") <> 0 Then
		 HtmlLabel = SelectLabelParameter(FileContent, "{=UserLogin")
		 HtmlLabelArr=Split(HtmlLabel,"@@@")
		 For I=0 To Ubound(HtmlLabelArr)
			 Param = Split(FunctionLabelParam(HtmlLabelArr(I), "{=UserLogin"),",")
			 FileContent = Replace(FileContent, HtmlLabelArr(I), "<iframe width="&Param(0)&" height="&Param(1)&" id=""loginframe"" name=""loginframe"" src=""" & Domain & "User/Userlogin.asp"" frameBorder=""0"" scrolling=""no"" allowtransparency=""true""></iframe>")
	  	 Next
	    End If
		 GeneralLabel = FileContent
    End Function

	Function ReplaceChannel(FileContent)
		 on error resume next
		 If Application(AcTCMSN & "ACTCMS_TCJ_Type")<>"Folder"   Then ReplaceChannel=FileContent:Exit Function
		 FileContent = Replace(FileContent, "{$ClassID}",Actcms.ACT_L(Application(AcTCMSN & "ClassID"),0))
		 FileContent = Replace(FileContent, "{$ClassName}",Actcms.ACT_L(Application(AcTCMSN & "ClassID"),2))
		 FileContent = Replace(FileContent, "{$ClassKeywords}", Actcms.ACT_L(Application(AcTCMSN & "ClassID"),8))
		 FileContent = Replace(FileContent, "{$ClassDescription}", Actcms.ACT_L(Application(AcTCMSN & "ClassID"),9))
		 ReplaceChannel = FileContent
	End Function 

	Function ReplaceMode(FileContent)
		 on error resume next
		 If Application(AcTCMSN & "ACTCMS_TCJ_Type")<>"ACTCMSMODE"   Then ReplaceMode=FileContent:Exit Function
		 FileContent = Replace(FileContent, "{$ModeName}",ACTCMS.ACT_C(Application(AcTCMSN & "ModeID"),1))
		 FileContent = Replace(FileContent, "{$Modekeywords}",ACTCMS.ACT_C(Application(AcTCMSN & "ModeID"),17))
		 FileContent = Replace(FileContent, "{$Modedescription}",ACTCMS.ACT_C(Application(AcTCMSN & "ModeID"),18))
		 ReplaceMode = FileContent
	End Function 


	Function GetTags(Num,TagType)
	  on error resume next
	  if not isnumeric(num) then exit function
	  dim sqlstr,sql,i,n,str
	  select case cint(tagtype)
	   case 1:sqlstr="select top "&Num&" TagsChar,ModeID from Tags_ACT order by hits desc"
	   case 2:sqlstr="select top "&Num&" TagsChar,ModeID from Tags_ACT order by ClicksTime desc,id desc"
	   case 3:sqlstr="select top "&Num&" TagsChar,ModeID from Tags_ACT order by AddTime desc,id desc"
	   Case Else : sqlstr="select top "&Num&" TagsChar,ModeID from Tags_ACT order by hits desc"
	  end Select
	  dim rs:set rs=ACTCMS.ActExe(sqlstr)
	  if rs.eof then rs.close:set rs=nothing:exit function
	  sql=rs.getrows(-1)
	  rs.close:set rs=Nothing
	  for i=0 to ubound(sql,2)
	   if Actcms.FoundInArr(str,sql(0,i),",")=false Then
		n=n+1
		str=str & "," & sql(0,i)
		gettags=gettags & "&nbsp;&nbsp; <a href=""" & Domain & "plus/search/search.asp?searchtype=5&ModeID=" & sql(1,i) & "&tags=" & sql(0,i)& """ target=""_blank"">" & sql(0,i) & "</a> "
	   end if
	   if n>=cint(num) then exit for
	  next
	End Function
		'将标签名称转换成对应标签内容 
		Function AllLabel(Content)
			Dim LabelRS
			Set LabelRS =ACTCMS.ActExe("Select LabelType,LabelName,LabelContent from Label_Act")
			Dim i,SQL:SQL=LabelRS.getrows(-1)
			Set LabelRS = Nothing 
			For i=0 To UBound(SQL,2)
				If SQL(0,i) = 2 Then 
					Content = Replace(Content, SQL(1,i), FreeLabel(SQL(2,i)))
				Else 
				    Content = Replace(Content, SQL(1,i), SQL(2,i))
				End If 
			Next
			AllLabel = Content
		End Function

		Function ReplaceAllLabel(Content)
			Dim D:Set D=New ACTFreeLabel
			Content=D.ReplaceReeLabel(Content) '替换自定义函数标签 
			Set D=nothing
			ReplaceAllLabel =Content
		End Function



		'替换自由标签为内容
		Function FreeLabel(Content)
			Dim LabelRS
			Set LabelRS =ACTCMS.ActExe("Select LabelName,LabelContent from Label_Act")
			Dim i,SQL:SQL=LabelRS.getrows(-1)
			Set LabelRS = Nothing
			For i=0 To UBound(SQL,2)
				Content = Replace(Content, SQL(0,i),SQL(1,i))
			Next
			FreeLabel = Content
		End Function

		Function LableFlag(Content)
			Dim regEx, Matches, Match, TempStr
			Set regEx = New RegExp
			regEx.Pattern = "{\$[^{\$}]*}"
			regEx.IgnoreCase = True
			regEx.Global = True
			Set Matches = regEx.Execute(Content)
			LableFlag = Content
			For Each Match In Matches
				on error resume next
				TempStr = Match.Value
				TempStr = Replace(TempStr, Chr(13) & Chr(10), "")
				TempStr = Replace(TempStr, "{$", "")
				TempStr = Replace(TempStr, "}", "")
				TempStr = Left(TempStr, InStr(TempStr, "(") - 1) & "§" & Mid(TempStr, InStr(TempStr, "(") + 1)
				TempStr = Left(TempStr, InStrRev(TempStr, ")") - 1)
				TempStr = Replace(TempStr, """", "")
				If Err.Number = 0 Then
					LableFlag = Replace(LableFlag, Match.Value, MakeLablelFunction(TempStr))'转换标签
				End If
			Next
		End Function	



		Function MakeLablelFunction(LabelContent)
		   Dim LabelArr:LabelArr = Split(LabelContent, "§")
			If LabelArr(0) = "" Then
				  MakeLablelFunction = ""
				  Exit Function
			End If
			Select Case UCase(LabelArr(0))
				 Case "GETARTICLELIST"
							MakeLablelFunction = ACT_A_List(LabelArr(1), LabelArr(2), LabelArr(3), LabelArr(4), LabelArr(5), LabelArr(6), LabelArr(7), LabelArr(8), LabelArr(9), LabelArr(10), LabelArr(11), LabelArr(12), LabelArr(13),LabelArr(14),LabelArr(15),LabelArr(16),LabelArr(17),LabelArr(18),LabelArr(19),LabelArr(20),LabelArr(21),LabelArr(22),LabelArr(23),LabelArr(24),LabelArr(25),LabelArr(26),LabelArr(27),LabelArr(28))'函数调用并执行SQL返回结果
				 Case "GETNAVIGATION"
							  MakeLablelFunction =GetNavigation(LabelArr(1), LabelArr(2), LabelArr(3), LabelArr(4), LabelArr(5))
				 Case "GETLINKLIST"
					   MakeLablelFunction = GetLinkList(LabelArr(1), LabelArr(2), LabelArr(3), LabelArr(4), LabelArr(5), LabelArr(6), LabelArr(7), LabelArr(8))
				Case "GETARTICLEPIC"'图文混排
							 MakeLablelFunction =ACT_P(LabelArr(1), LabelArr(2), LabelArr(3), LabelArr(4), LabelArr(5), LabelArr(6), LabelArr(7), LabelArr(8), LabelArr(9), LabelArr(10), LabelArr(11), LabelArr(12),LabelArr(13),LabelArr(14),LabelArr(15),LabelArr(16),LabelArr(17),LabelArr(18),LabelArr(19),LabelArr(20),LabelArr(21),LabelArr(22),LabelArr(23))
				 Case "GETSLIDE" '幻灯片
							 MakeLablelFunction = ACTCMS_GetSlide(LabelArr(1), LabelArr(2), LabelArr(3), LabelArr(4), LabelArr(5), LabelArr(6), LabelArr(7), LabelArr(8), LabelArr(9), LabelArr(10), LabelArr(11))
				 Case "GETLASTARTICLELIST"  '文章分页列表函数
						If 	 AcTCMS.ACT_C(Application(AcTCMSN & "ModeID"),3) = "0" Or Application(AcTCMSN & "Make")="No" Then 
								MakeLablelFunction=LabelContent
								Application("PageParam")=LabelContent
								Application(AcTCMSN & "Make")="Yes"
						Else 
								MakeLablelFunction = GetLastArticleList(LabelArr(1), LabelArr(2), LabelArr(3), LabelArr(4), LabelArr(5), LabelArr(6), LabelArr(7), LabelArr(8), LabelArr(9), LabelArr(10), LabelArr(11), LabelArr(12), LabelArr(13),LabelArr(14),LabelArr(15),LabelArr(16),LabelArr(17),LabelArr(18),LabelArr(19),LabelArr(20),LabelArr(21),LabelArr(22),LabelArr(23),LabelArr(24))
						End If 
				Case "GETCLASSNAVIGATION"'总导航和栏目导航
							 MakeLablelFunction = GetClassNavigation(LabelArr(1), LabelArr(2), LabelArr(3), LabelArr(4), LabelArr(5), LabelArr(6), LabelArr(7), LabelArr(8), LabelArr(9), LabelArr(10), LabelArr(11), LabelArr(12), LabelArr(13), LabelArr(14), LabelArr(15))
				Case "CORRELATIONARTICLELIST"
							 MakeLablelFunction = ACT_Correlation_Article(LabelArr(1), LabelArr(2), LabelArr(3), LabelArr(4), LabelArr(5), LabelArr(6), LabelArr(7), LabelArr(8), LabelArr(9), LabelArr(10), LabelArr(11), LabelArr(12), LabelArr(13),LabelArr(14),LabelArr(15),LabelArr(16),LabelArr(17),LabelArr(18),LabelArr(19),LabelArr(20),LabelArr(21),LabelArr(22))
				Case "GETCLASSFORARTICLELIST"
							 MakeLablelFunction = GetClassForArticleList(LabelArr(1), LabelArr(2), LabelArr(3), LabelArr(4), LabelArr(5), LabelArr(6), LabelArr(7), LabelArr(8), LabelArr(9), LabelArr(10), LabelArr(11), LabelArr(12), LabelArr(13),LabelArr(14),LabelArr(15),LabelArr(16),LabelArr(17),LabelArr(18),LabelArr(19),LabelArr(20),LabelArr(21),LabelArr(22),LabelArr(23),LabelArr(24),LabelArr(25),LabelArr(26),LabelArr(27),LabelArr(28),LabelArr(29),LabelArr(30))'函数调用并执行SQL返回结果
				Case Else
					   MakeLablelFunction = LabelArr(0)&"标签执行错误"
					   Exit Function
				 End Select
		End Function


		Function FSOSaveFile(Templetcontent,FileName)
			on error resume next 
			Dim FileFSO,FileType
			 Set FileFSO = Server.CreateObject("ADODB.Stream")
				With FileFSO
				.Type = 2
				.Mode = 3
				.Open
				.Charset = "gb2312"
				.Position = FileFSO.Size
				.WriteText  Templetcontent&vbcrlf & "<!-- Created Page at " & Now() & " ,By ActCMS.Com ,ACT Content Management System(ActCMS)  -->" & vbCrLf
				.SaveToFile Server.MapPath(FileName),2
				If Err.Number<>0 Then 
					Err.Clear 
					Call actcms.InsertLog(actcms.rsql(Request.Cookies(AcTCMSN)("AdminName")),0,2,"生成错误")
					Exit Function 
				End If 
				.Close
				End With
			Set FileType = nothing
			Set FileFSO = nothing
		End Function

		 Function ReplaceArticleContent(ModeID,RefreshArticle,TempletContent,ArticleContents)
				Dim TempStr
				on error resume next 
			   ArticleContents=ACTCMS.ReplaceSitelink(ArticleContents)
			   If InStr(TempletContent, "{$ArticleSize}") <> 0 Then
				   ArticleContents = "<span id=""ContentArea"">" & ArticleContents & "</span>"
				   TempStr = "<script Language=Javascript>" & _
					  "function ContentSize(size)" & _
					  "{document.all.ContentArea.style.fontSize=size+""px"";}" & _
					  "</script>"
				  TempStr = TempStr & "【字体：<A href=""javascript:ContentSize(16)"">大</A> <A href=""javascript:ContentSize(14)"">中</A> <A href=""javascript:ContentSize(12)"">小</A>】"
				  TempletContent = Replace(TempletContent, "{$ArticleSize}", TempStr)
			  End If
			TempletContent=ReplaceMX(ModeID,TempletContent,RefreshArticle)
			'TempletContent = Replace(TempletContent,"{$ArticleContent}",FormatImg(ArticleContents))
			TempletContent = Replace(TempletContent,"{$ArticleContent}",ArticleContents)
			TempletContent = Replace(TempletContent,"{$ArticleTitle}",ACTCMS.CloseHtml(RefreshArticle("Title")))
		
			If InStr(TempletContent, "{$KeyTags}") > 0  Then
				TempletContent = Replace(TempletContent, "{$KeyTags}",ReplaceKeyTags(1,RefreshArticle("Keywords")))
			End if
			
			If Not IsNull(RefreshArticle("Author")) And Trim(RefreshArticle("Author")) <> "" Then
			   TempletContent = Replace(TempletContent, "{$ArticleAuthor}", ACTCMS.Author(RefreshArticle("Author")))
			Else
			   TempletContent = Replace(TempletContent, "{$ArticleAuthor}", "佚名")
			End If

			If Not IsNull(RefreshArticle("CopyFrom")) And Trim(RefreshArticle("CopyFrom")) <> "" Then
			   TempletContent = Replace(TempletContent, "{$ArticleCopyFrom}", ACTCMS.CopyFrom(RefreshArticle("CopyFrom")))
			Else
			   TempletContent = Replace(TempletContent, "{$ArticleCopyFrom}", "本站原创")
			End If

			If Not IsNull(RefreshArticle("ArticleInput")) And Trim(RefreshArticle("ArticleInput")) <> "" Then
			   TempletContent = Replace(TempletContent, "{$ArticleInput}", RefreshArticle("ArticleInput"))
			Else
			   TempletContent = Replace(TempletContent, "{$ArticleInput}", "ActCMS.com")
			End If

			If InStr(TempletContent, "{$IntactTitle}") <> 0 And Trim(RefreshArticle("IntactTitle")) <> ""  Then
				TempletContent = Replace(TempletContent, "{$IntactTitle}", RefreshArticle("IntactTitle"))
			Else
				TempletContent = Replace(TempletContent, "{$IntactTitle}", RefreshArticle("Title"))
			End If 

			If InStr(TempletContent, "{$ArticleKeyWord}") > 0  Then
				TempletContent = Replace(TempletContent, "{$ArticleKeyWord}", RefreshArticle("KeyWords"))
			End If 
			If InStr(TempletContent, "{$ID}") > 0  Then
				TempletContent = Replace(TempletContent, "{$ID}", RefreshArticle("ID"))
			End If 

			If InStr(TempletContent, "{$ClassID}") > 0  Then
				TempletContent = Replace(TempletContent, "{$ClassID}", Application(AcTCMSN & "ClassID"))
			End If 
			If InStr(TempletContent, "{$ModeID}") > 0  Then
				TempletContent = Replace(TempletContent, "{$ModeID}", ModeID)
			End If 

			If InStr(TempletContent, "{$ArticleHits}") <> 0 Then
			 TempletContent = Replace(TempletContent, "{$ArticleHits}", "<Script Language=""Javascript"" Src=""" & Domain & "act_inc/ACT.Hits.asp?ModeID="&ModeID&"&ID=" & RefreshArticle("ID") & """></Script>")
			End If
			If InStr(TempletContent, "{$ArticleDate}") <> 0 Then
			   TempletContent = Replace(TempletContent, "{$ArticleDate}", Year(RefreshArticle("UpdateTime")) & "年" & Right("0" & Month(RefreshArticle("UpdateTime")), 2) & "月" & Right("0" & Day(RefreshArticle("UpdateTime")), 2))
			End If
			If InStr(TempletContent, "{$ArticleIntro}") <> 0 And Trim(RefreshArticle("Intro")) <> ""  Then
				TempletContent = Replace(TempletContent, "{$ArticleIntro}", RefreshArticle("Intro"))
			Else
				TempletContent = Replace(TempletContent, "{$ArticleIntro}", "")
			End If 

		   If InStr(TempletContent, "{$TypeComment}")  Then
			 TempletContent = Replace(TempletContent, "{$TypeComment}", "<Script Language=""Javascript"" Src=""" & Domain & "Comment.asp?Action=Get&ModeID="&ModeID&"&ClassID=" & RefreshArticle("ClassID") & "&ID=" & RefreshArticle("ID") & """></Script>")
		   Else
			TempletContent = Replace(TempletContent, "{$TypeComment}", "")
		   End If
		   If InStr(TempletContent, "{$WriteComment}") <> 0 And RefreshArticle("rev") = 1 Then
			 TempletContent = Replace(TempletContent, "{$WriteComment}", "<Script Language=""Javascript"" Src=""" & Domain & "Comment.asp?Action=Write&ModeID="&ModeID&"&ClassID=" & RefreshArticle("ClassID") & "&ID=" & RefreshArticle("ID") & """></Script>")
		   Else
			 TempletContent = Replace(TempletContent, "{$WriteComment}", "")
		   End If
			 TempletContent = Replace(TempletContent, "{$PrevArticle}", NextArticle(RefreshArticle("ID"), RefreshArticle("Classid"), "Prev",ModeID))
			 TempletContent = Replace(TempletContent, "{$NextArticle}", NextArticle(RefreshArticle("ID"), RefreshArticle("Classid"), "Next",ModeID))
			ReplaceArticleContent = TempletContent
		 End Function

		Function ReplaceMX(ModeID,TempletContent,RefreshArticle)
			Dim MX_Arr,K
			MX_Arr=ACTCMS.Act_MX_Arr(ModeID)
			If IsArray(MX_Arr) Then
			  For K=0 To Ubound(MX_Arr,2)
				 If Not IsNull(RefreshArticle("" &MX_Arr(0,K) & "")) Then
				  TempletContent = Replace(TempletContent,"{$" & MX_Arr(0,K) & "}",RefreshArticle("" &MX_Arr(0,K) & ""))
				 Else
				  TempletContent = Replace(TempletContent,"{$" & MX_Arr(0,K) & "}","")
				 End If
			  Next
			End If
			ReplaceMX=TempletContent
		End Function

		Function ReplaceKeyTags(ModeID,KeyStr)
		  on error resume next 
		  If Trim(KeyStr)="" Then Exit Function
		  Dim I,ActArr:ActArr=Split(KeyStr,",")
		  For I=0 To Ubound(ActArr)
		    ReplaceKeyTags=ReplaceKeyTags & "<a href=""" & Domain & "plus/search/search.asp?SearchType=5&ModeID=" & ModeID & "&tags=" & ActArr(i) & """ target=""_blank"">" & ActArr(i) & "</a> "
		  Next
		End Function 
		'上一篇、下一篇
		Function NextArticle(NowID, classid, TypeStr,ModeID)
			Dim SqlStr
			If Trim(TypeStr) = "Prev" Then
				   SqlStr = " SELECT Top 1 ClassID,ID,ChangesLink,FileName,GroupID_ACT,Score_ACT,title From  "&ACTCMS.ACT_C(ModeID,2)&"  Where classid='" & Trim(classid) & "' And ID<" & NowID & "  And isAccept=0 AND delif=0  Order By ID Desc"
			ElseIf Trim(TypeStr) = "Next" Then
				   SqlStr = " SELECT Top 1 ClassID,ID,ChangesLink,FileName,GroupID_ACT,Score_ACT,title From  "&ACTCMS.ACT_C(ModeID,2)&"  Where classid='" & Trim(classid) & "' And ID>" & NowID & "  And isAccept=0 AND delif=0  Order By ID"
			Else
				NextArticle = "":Exit Function
			End If
			 Dim RS:Set RS=Server.CreateObject("ADODB.Recordset")
			 RS.Open SqlStr, Conn, 1, 1
			 If RS.EOF And RS.BOF Then
				NextArticle = "没有了"
			 Else
				NextArticle = "<a href=""" &ACTCMS.GetInfoUrl(ModeID,Rs(0),Rs(1),Rs(2),Rs(3),Rs(4),Rs(5)) & """ title=""" & ACTCMS.CloseHtml(RS("title")) & """>" & RS("title") & "</a>"
			 End If
			 RS.Close:Set RS = Nothing
		End Function

		Function CreateArticleList(ModeID,FolderRs)
			Dim TemplateContent,FilePath,IndexHtml,FolderDir
			Application(AcTCMSN & "ACTCMS_TCJ_Type")="Folder"
			Application(AcTCMSN & "ModeID")=FolderRs("ModeID")
			Application(AcTCMSN & "ClassID")=FolderRs("ClassID")
			If Trim(FolderRs("ParentID")) = "0" Then Application(AcTCMSN & "ModeHome")= True	Else Application(AcTCMSN & "ModeHome") = False
			TemplateContent = LoadTemplate(FolderRs("FolderTemplate"))'模版
			If TemplateContent = "" Then TemplateContent ="模板文件丢失"
			TemplateContent = AllLabel(TemplateContent)'标签转换
			TemplateContent = LableFlag(GeneralLabel(TemplateContent))'通用标签转换
			TemplateContent =ReplaceAllLabel(TemplateContent)
			IndexHtml = FolderRs("Extension")
			FilePath = ASys & Actcms.ACT_C(ModeID,6)& FolderRs("ClassEName")
			Call Actcms.CreateFolder(FilePath)
			If (Application(Cstr(AcTCMSN & "PageList")) <> "")   Then
			  Call GetPageStr(Application(Cstr(AcTCMSN & "PageList")), IndexHtml, TemplateContent,FilePath,  True)
			  Application.Contents.Remove (AcTCMSN & "PageList")
			Else
			  TemplateContent = Replace(TemplateContent, "{PageListStr}", "")
			  Call FSOSaveFile(TemplateContent,FilePath & IndexHtml)
			 End If
		End Function
		Sub GetPageStr(PageContent, Index, FileContent,FilePath,  TypeSelect)
			Dim CurrPage, PageStr, TempFileContent, I, PageContentArr, J, SelectStr
			Dim TotalPage
			Dim HomeLink     
			Dim LinkUrlFileName 
			Dim FileName       
			Dim FExt         
			  HomeLink = Index
			  FExt = Mid(Trim(Index), InStrRev(Trim(Index), ".")) 
			  FileName = Replace(Trim(Index), FExt, "") 
			  LinkUrlFileName = FileName
			  PageContentArr = Split(PageContent, "{$PageList}")
			  TotalPage = UBound(PageContentArr)
			  For I = LBound(PageContentArr) To TotalPage - 1
			   CurrPage = I + 1
			   Select Case Application(AcTCMSN & "PageStyle")
			    Case 1   
				   If CurrPage = 1 And CurrPage <> TotalPage Then
					PageStr = "首页  上一页 <a href=""" & LinkUrlFileName & "_" & CurrPage + 1 & FExt & """>下一页</a>  <a href= """ & LinkUrlFileName & "_" & TotalPage & FExt & """>尾页</a>"
				   ElseIf CurrPage = 1 And CurrPage = TotalPage Then
					PageStr = "首页  上一页 下一页 尾页"
				   ElseIf CurrPage = TotalPage And CurrPage <> 2 Then
					 PageStr = "<a href=""" & HomeLink & """>首页</a>  <a href=""" & LinkUrlFileName & "_" & CurrPage - 1 & FExt & """>上一页</a> 下一页  尾页"
				   ElseIf CurrPage = TotalPage And CurrPage = 2 Then
					 PageStr = "<a href=""" & HomeLink & """>首页</a>  <a href=""" & HomeLink & """>上一页</a> 下一页  尾页"
				   ElseIf CurrPage = 2 Then
					PageStr = "<a href=""" & HomeLink & """>首页</a>  <a href=""" & HomeLink & """>上一页</a> <a href=""" & LinkUrlFileName & "_" & CurrPage + 1 & FExt & """>下一页</a>  <a href= """ & LinkUrlFileName & "_" & (TotalPage & FExt) & """>尾页</a>"
				   Else
					PageStr = "<a href=""" & HomeLink & """>首页</a>  <a href=""" & LinkUrlFileName & "_" & CurrPage - 1 & FExt & """>上一页</a> <a href=""" & LinkUrlFileName & "_" & CurrPage + 1 & FExt & """>下一页</a>  <a href= """ & LinkUrlFileName & "_" & (TotalPage & FExt) & """>尾页</a>"
				   End If
			  Case 2
			    If CurrPage=1 Then
			     PageStr="<font face=webdings>9</font> <font face=webdings>7</font>"
				ElseIf CurrPage=2 Then
			     PageStr="<a href=""" & HomeLink & """ title=""首页""><font face=webdings>9</font></a> <a href=""" & HomeLink & """ title=""上一页""><font face=webdings>7</font></a>"
				Else
				 PageStr="<a href=""" & HomeLink & """ title=""首页""><font face=webdings>9</font></a> <a href=""" & LinkUrlFileName & "_" & CurrPage - 1 & FExt & """ title=""上一页""><font face=webdings>7</font></a> "
				End If
				 For J=CurrPage To CurrPage+9
				    If J>TotalPage Then Exit For
				    If J= CurrPage Then
				     PageStr=PageStr & " <font color=red>[" & J &"]</font>"
				    Else
				     PageStr=PageStr & " <a href=""" & LinkUrlFileName & "_" & J & FExt & """>[" & J &"]</a>"
					End If
				 Next
				 If CurrPage=TotalPage Then
				  PageStr=PageStr & " <font face=webdings>8</font> <font face=webdings>:</font>"
				 Else
				  PageStr=PageStr & " <a href=""" & LinkUrlFileName & "_" & CurrPage + 1 & FExt & """ title=""上一页""><font face=webdings>8</font></a> <a href=""" & LinkUrlFileName & "_" & TotalPage & FExt & """><font face=webdings>:</font></a> "
				 End If
			  Case 3
			    If CurrPage=1 Then
			     PageStr="<font face=webdings>9</font> <font face=webdings>7</font>"
				ElseIf CurrPage=2 Then
			     PageStr="<a href=""" & HomeLink & """ title=""首页""><font face=webdings>9</font></a> <a href=""" & HomeLink & """ title=""上一页""><font face=webdings>7</font></a>"
				Else
				 PageStr="<a href=""" & HomeLink & """ title=""首页""><font face=webdings>9</font></a> <a href=""" & LinkUrlFileName & "_" & CurrPage - 1 & FExt & """ title=""上一页""><font face=webdings>7</font></a> "
				End If			
				 If CurrPage=TotalPage Then
				  PageStr=PageStr & " <font face=webdings>8</font> <font face=webdings>:</font>"
				 Else
				  PageStr=PageStr & " <a href=""" & LinkUrlFileName & "_" & CurrPage + 1 & FExt & """ title=""上一页""><font face=webdings>8</font></a> <a href=""" & LinkUrlFileName & "_" & TotalPage & FExt & """><font face=webdings>:</font></a> "
				 End If
			  End Select	   
				 If CBool(TypeSelect) = True Then
				  PageStr = PageStr & " 转到：<select name=""page"" size=""1"" onchange=""javascript:window.location=this.options[this.selectedIndex].value;"">"
				  For J = 1 To TotalPage
					   If J = CurrPage Then
						 SelectStr = " selected"
					   Else
						 SelectStr = ""
					   End If
					   If J = 1 Then
						 PageStr = PageStr & "<option value=""" & HomeLink & """" & SelectStr & ">第" & J & "页</option>"
					   Else
						 PageStr = PageStr & "<option value=""" & LinkUrlFileName & "_" & J & FExt & """" & SelectStr & ">第" & J & "页</option>"
					   End If
				   Next
					  PageStr = PageStr & "</select>"
				   End If
			   TempFileContent = Replace(FileContent, "{PageListStr}", PageContentArr(I) & PageStr & "</div></div>")
			   Dim TempFilePath
			   If CurrPage = 1 Then
				  TempFilePath =FilePath&Index
			   Else
				 TempFilePath = FilePath&FileName & "_" & CurrPage & FExt
			   End If
			  Call FSOSaveFile( TempFileContent, TempFilePath)
			  Next
		End Sub

		Function FormatImg(content)
           dim re
           Set re=new RegExp
           re.IgnoreCase =true
           re.Global=True
           re.Pattern="(script)"
           Content=re.Replace(Content,"script")
           re.Pattern="<img.[^>]*src(=| )(.[^>]*)>"
         Content=re.replace(Content,"<img src=$2  style=""cursor: pointer""  onmousewheel=""return bbimg(this)"" onload=""javascript:resizepic(this)"" onclick=""javascript:window.open(this.src);""  border=""0""/>")
		  set re = nothing
          FormatImg = content
		End   Function   

		Function ACT_A_List(ClassID,ActF,ATT,ArticleSort,OpenTypeStr,ListNumber,RowHeight,TitleLen,ColNumber,TypeClassName,TypeNew,ACTIF,NavType,Nav,MoreLinkType,MoreLink,Division,DateForm,DateAlign,TitleCss,DateCss,divid,divclass,ulid,ulclass,liid,liclass,ModeID) 
		 Dim SqlStr, Parameter,OpenType,MoreLinkStr,ACT_IF,ACTCMS_ATT
			Select Case ClassID 
			    Case "","0":Parameter=""
				Case "1":Parameter="ClassID='" & Application(AcTCMSN & "ClassID") & "' And" 
			    Case Else
					If InStr(ClassID, ",") > 0 Then
						 Parameter="ClassID In (" & ClassID & ") And"
					Else
						 Parameter="ClassID='" & Replace(ClassID,"'","") & "' And"
					End If 
			End Select
			OpenType = Gopen(OpenTypeStr)
			If ACTIF<>"" Then ACT_IF = " And "&ACTIF
			If ATT="0" Then  ACTCMS_ATT="" Else ACTCMS_ATT = " And ATT="&ATT
			If MoreLink <> "" And InStr(ClassID, ",") = 0 And ClassID <> "0"  Then MoreLinkStr=MLink(ColNumber,RowHeight,MoreLinkType, MoreLink, AcTCMS.MoreName(ClassID),OpenTypeStr)
		    If Lcase(Left(Trim(ArticleSort),2))<>"id" Then  ArticleSort=ArticleSort & ",ID Desc"
			Sqlstr="Select TOP " & ListNumber & " ID,Classid,Title,UpdateTime,ChangesLink,FileName,GroupID_ACT,Score_ACT From "&ACTCMS.ACT_C(ModeID,2)&" Where " & Parameter & " isAccept=0 AND delif=0 " & ACTCMS_ATT &ACT_IF& " ORDER BY IsTop Desc," & ArticleSort
			ACT_A_List = ACTCMS_A_SQL(SqlStr,OpenType,RowHeight,TitleLen,ColNumber,TypeClassname,TypeNew,NavType,Nav,MoreLinkStr,Division,DateForm,DateAlign,TitleCss,DateCss,ACTF,DivID,DivClass,UlID,UlClass,LiID,LiClass,ModeID) 
		End Function
		Function ACTCMS_A_SQL(SqlStr,OpenType,RowHeight,TitleLen,ColNumber,TypeClassname,TypeNew,NavType,Nav,MoreLinkStr,Division,DateForm,DateAlign,TitleCss,DateCss,ACTF,DivID,DivClass,UlID,UlClass,LiID,LiClass,ModeID) 
			 on error resume next
			 Dim RS,I,K,N,DateStr,TitleCssName,ColSpanNum,TypeNews,TempTitle,NaviStr,DateCssStr,ACTSQL
			 Set RS=ACTCMS.ActExe(SqlStr)
			 If RS.EOF Then	 ACTCMS_A_SQL="<li>暂无内容</li>":RS.Close:Set RS=Nothing:Exit Function
			 ACTSQL=RS.GetRows(-1):Set RS = Nothing
			 Dim ActNum:ActNum=Ubound(ACTSQL,2)
			 Dim Title,ClassnameLink
			 TitleCssName = GCss(TitleCss):DateCssStr = GCss(DateCss):RowHeight = GRowHeight(RowHeight):NaviStr = GNavi(NavType,Nav)
			 If ActF=2 Then 
			  		  If DivID<>"0" Then ACTCMS_A_SQL = "<div"&GCssID(DivID)&GCss(DivClass) &">" & vbCrLf 
					  If UlID <>"0" Then ACTCMS_A_SQL=ACTCMS_A_SQL& " <ul"&GCssID(UlID)&GCss(UlClass) &">" & vbCrLf
				For K=0 To ActNum
					  If CBool(TypeClassname) = True Then ClassnameLink = "<span>[" & AcTCMS.GainClassName(ACTSQL(1,N),OpenType,TitleCssName) & "]</span>"			
					  If Cbool(TypeNew)=True And (Year(ACTSQL(3,N))&Month(ACTSQL(3,N))&Day(ACTSQL(3,N)) =Year(Now)&Month(Now)&Day(Now)) Then TypeNews="<img src=""" & Domain&"ACT_inc/share/new.gif"" border=""0""/>" Else TypeNews=""
					  DateStr=GDDateStr(ACTSQL(3,N),DateForm,DateCssStr)
					  TempTitle = "<a "  & TitleCssName &  " href=""" &AcTCMS.GetInfoUrl(ModeID,ACTSQL(1,N),ACTSQL(0,N),ACTSQL(4,N),ACTSQL(5,N),ACTSQL(6,N),ACTSQL(7,N)) &  """"  & Gopen(OpenType) & " title=""" & AcTCMS.CloseHtml(ACTSQL(2,N)) & """>" &ACTCMS.GetStrValue(ACTSQL(2,N),TitleLen) & "</a>" 
					  ACTCMS_A_SQL = ACTCMS_A_SQL & ("  <li"&GCssID(LIID)&GCss(LiClass)&">" &NaviStr&ClassnameLink&TempTitle&TypeNews&DateStr & "</li>" & vbCrLf)
					  N=N+1 
			    Next
					  ACTCMS_A_SQL = MoreLinkStr& vbCrLf&ACTCMS_A_SQL 
					 If UlID<>"0" Then ACTCMS_A_SQL =ACTCMS_A_SQL&"</ul>" & vbCrLf 
					 If DivID<>"0" Then ACTCMS_A_SQL =ACTCMS_A_SQL&"</div>"
			  Else
					  ACTCMS_A_SQL = "<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">" & vbCrLf
				For K=0 To ActNum
					 ACTCMS_A_SQL = ACTCMS_A_SQL & "<tr>" & vbCrLf
					 For I = 1 To ColNumber
					  If CBool(TypeClassname) = True Then ClassnameLink = "[" & AcTCMS.GainClassName(ACTSQL(1,N),OpenType,TitleCssName) & "]"			
					  If Cbool(TypeNew)=True And (Year(ACTSQL(3,N))&Month(ACTSQL(3,N))&Day(ACTSQL(3,N)) =Year(Now)&Month(Now)&Day(Now)) Then TypeNews="<img src=""" & Domain&"ACT_inc/share/new.gif"" border=""0""/>" Else TypeNews=""
					  DateStr=GDateStr(ACTSQL(3,N),DateForm,DateAlign,DateCssStr,ColNumber,ColSpanNum)
					  TempTitle = "<a " & TitleCssName &  " href=""" &AcTCMS.GetInfoUrl(ModeID,ACTSQL(1,N),ACTSQL(0,N),ACTSQL(4,N),ACTSQL(5,N),ACTSQL(6,N),ACTSQL(7,N)) &  """"  & Gopen(OpenType) & " title=""" & AcTCMS.CloseHtml(ACTSQL(2,N)) & """>" &ACTCMS.GetStrValue(ACTSQL(2,N),TitleLen) & "</a>" 
						  If ColNumber=1 Then
							  ACTCMS_A_SQL = ACTCMS_A_SQL & ("  <td height=""" & RowHeight & """>"  &NaviStr&ClassnameLink&TempTitle&TypeNews&DateStr& "</td>" & vbCrLf)
						  Else
							  ACTCMS_A_SQL = ACTCMS_A_SQL & ("  <td  width=""" & CInt(100 / CInt(ColNumber)) & "%"" height=""" &RowHeight&  """>" & vbCrLf)
							  ACTCMS_A_SQL = ACTCMS_A_SQL & ("    <table width=""90%"" height=""100%"" cellpadding=""0"" cellspacing=""0"" border=""0"">" & vbCrLf)
							  ACTCMS_A_SQL = ACTCMS_A_SQL & ("     <tr><td> " &NaviStr&ClassnameLink&TempTitle&TypeNews &DateStr )
							  ACTCMS_A_SQL = ACTCMS_A_SQL & ("      </td></tr>" & vbcrlf &"   </table>" & vbCrLf & "  </td>" & vbCrLf)
						  End if
						  N=N+1
					      If N>=ActNum+1 Then Exit For
					 Next
					 ACTCMS_A_SQL = ACTCMS_A_SQL & "</tr>" & vbCrLf
					 ACTCMS_A_SQL = ACTCMS_A_SQL & (GbgPic(Division,ColSpanNum) & vbCrLf)
					 If N>=ActNum+1 Then Exit For
				Next
					 ACTCMS_A_SQL = ACTCMS_A_SQL & MoreLinkStr& ("</table>" & vbCrLf)
			End If 
		End Function




	

		Function ACT_P(ClassID,ActF,ATT,ArticleSort,OpenType,ListNumber,ColNumber,TitleLen,Titlecss,PiCcss,PicWidth,PicHeight,ContentLen,PicStyle,TypeTitle,ACTIF,DivID,DivCss,UlID,UlCss,LiID,LiCss,ModeID)     
			Dim SqlStr, ACT_IF,Parameter,ACTCMS_ATT
			Select Case ClassID 
			    Case "","0":Parameter=""
				Case "1":Parameter="ClassID='" & Application(AcTCMSN & "ClassID") & "' And" 
			    Case Else
					If InStr(ClassID, ",") > 0 Then
						 Parameter="ClassID In (" & ClassID & ") And"
					Else
						 Parameter="ClassID='" & ClassID & "' And"
					End If 
			End Select
			If ACTIF<>"" Then ACT_IF = " And "&ACTIF
			If ATT="0" Then  ACTCMS_ATT="" Else ACTCMS_ATT = " And ATT="&ATT
			OpenType = Gopen(OpenType)
			If Lcase(Left(Trim(ArticleSort),2))<>"id" Then  ArticleSort=ArticleSort & ",ID Desc"
			Sqlstr="Select TOP " & ListNumber & " ID,Classid,Title,UpdateTime,ChangesLink,FileName,PicUrl,Content,Intro,GroupID_ACT,Score_ACT From  "&ACTCMS.ACT_C(ModeID,2)&"  Where " & Parameter & " isAccept=0 AND delif=0 AND ArticlePic=1 " & ACTCMS_ATT &ACT_IF& " ORDER BY IsTop Desc," & ArticleSort
			ACT_P = ACT_P_SQL(SqlStr,OpenType,ColNumber,TitleLen,Titlecss,PiCcss,PicWidth,PicHeight,ContentLen,PicStyle,TypeTitle,ACTF,DivID,DivCss,UlID,UlCss,LiID,LiCss,ModeID)
		End Function


		Function ACT_P_SQL(SqlStr,OpenType,ColNumber,TitleLen,Titlecss,PiCcss,PicWidth,PicHeight,ContentLen,PicStyle,TypeTitle,ACTF,DivID,DivCss,UlID,UlCss,LiID,LiCss,ModeID)
			 on error resume next
			 Dim PicStr,I,TempPicStr,ActCMSURL,K,N,TempTitle,AcTSQL,RS,ArticleC
			 Set RS=ACTCMS.ActExe(SqlStr)
			 If RS.EOF Then	 ACT_P_SQL="还没有图片数据":RS.Close:Set RS=Nothing:Exit Function
			 AcTSQL=RS.GetRows(-1):RS.Close:Set RS = Nothing
			 Dim ActNum:ActNum=Ubound(AcTSQL,2)
				TitleCss = GCss(TitleCss):PicCss = GCss(PicCss)
				If ActF=2 Then 
			  		  If DivID<>"0" Then PicStr = "<div"&GCssID(DivID)&GCss(DivCss) &">" & vbCrLf 
					  If UlID <>"0" Then PicStr=PicStr& " <ul"&GCssID(UlID)&GCss(UlCss) &">" & vbCrLf
					For K=0 To ActNum
						ActCMSURL=AcTCMS.GetInfoUrl(ModeID,AcTSQL(1,N),AcTSQL(0,N),AcTSQL(4,N),AcTSQL(5,N),AcTSQL(9,N),AcTSQL(10,N))
						TempPicStr = "<a href=""" &ActCMSURL & """" & OpenType & " title=""" & AcTCMS.CloseHtml(AcTSQL(2,N)) & """><Img "& PicCss &" Src=""" & AcTSQL(6,N) & """ border=""0"" width=""" & PicWidth & """ height=""" & PicHeight & """ align=""absmiddle""/></a>"
						TempTitle = "<a " & TitleCss & " href=""" &ActCMSURL & """" & OpenType & " title=""" & AcTCMS.CloseHtml(AcTSQL(2,N)) & """>" & ACTCMS.GetStrValue(ACTSQL(2,N),TitleLen) & "</a>"
						If AcTSQL(8,N)="" Or IsNull(AcTSQL(8,N)) Then ArticleC=AcTSQL(7,N) Else ArticleC=AcTSQL(7,N)
						Select Case PicStyle
						  Case "1":PicStr = PicStr & (" <li"&GCssID(LIID)&GCss(LICss)&">" & TempPicStr & "</li>" & vbCrLf)
						  Case "2":PicStr = PicStr & ("<li"&GCssID(LIID)&GCss(LICss)&">" & TempPicStr & "<br/>" & TempTitle & "</li>" & vbCrLf)
						  Case "3"
							PicStr = PicStr & ("    <li"&GCssID(liID)&GCss(LICss) &">" & TempPicStr)
							If Cbool(TypeTitle) = True Then	PicStr = PicStr & ("<h2>" & TempTitle &"</h2>")
							PicStr = PicStr & ("<p>" & ACTCMS.GetStrValue(Replace(Replace(Replace(AcTCMS.CloseHtml(ArticleC), vbCrLf, ""), "[NextPage]", ""), "&nbsp;", ""), ContentLen) &"...[<a href=""" & ActCMSURL & """" & OpenType & """>全文</a>]</p></li>"& vbCrLf)
						  Case "4"
							PicStr = PicStr & ("    <li"&GCssID(liID)&GCss(LICss) &">")
							If Cbool(TypeTitle) = True Then	PicStr = PicStr & ("<h2>" & TempTitle &"</h2>")
							PicStr = PicStr & ("<p>" & ACTCMS.GetStrValue(Replace(Replace(Replace(AcTCMS.CloseHtml(ArticleC), vbCrLf, ""), "[NextPage]", ""), "&nbsp;", ""), ContentLen) &"...[<a href=""" & ActCMSURL & """" & OpenType & """>全文</a>]</p>"  & TempPicStr & "</li>"& vbCrLf)
						  Case Else
							PicStr=PicStr&ACT_W(PicStyle)
						End Select 
						N=N+1
					Next 
					ACT_P_SQL = PicStr 
					 If UlID<>"0" Then ACT_P_SQL =ACT_P_SQL&"</ul>" & vbCrLf 
					 If DivID<>"0" Then ACT_P_SQL =ACT_P_SQL&"</div>"
				Else
					PicStr="<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">"
					For K=0 To ActNum
						 PicStr = PicStr & "<tr>" & vbCrLf
						 For I = 1 To ColNumber
							ActCMSURL=AcTCMS.GetInfoUrl(ModeID,AcTSQL(1,N),AcTSQL(0,N),AcTSQL(4,N),AcTSQL(5,N),AcTSQL(9,N),AcTSQL(10,N))
							TempPicStr = "<a href=""" &ActCMSURL & """" & OpenType & " title=""" & AcTCMS.CloseHtml(AcTSQL(2,N)) & """><Img "& PicCss &" Src=""" & AcTSQL(6,N) & """ border=""0"" width=""" & PicWidth & """ height=""" & PicHeight & """ align=""absmiddle""/></a>"
							TempTitle = "<a " & TitleCss & " href=""" &ActCMSURL  & """" & OpenType & " title=""" & AcTCMS.CloseHtml(AcTSQL(2,N)) & """>" & ACTCMS.GetStrValue(ACTSQL(2,N),TitleLen) & "</a>"
							PicStr = PicStr & ("<td width=""" & CInt(100 / CInt(ColNumber)) & "%"">" & vbCrLf)
							If AcTSQL(8,N)="" Or IsNull(AcTSQL(8,N)) Then ArticleC=AcTSQL(7,N) Else ArticleC=AcTSQL(7,N)
							Select Case PicStyle
								Case "1"
									 PicStr = PicStr & ("<span align=center><p>" & TempPicStr & "</p></span>" & vbCrLf)
								Case "2"
									 PicStr = PicStr & ("<table border=""0"" cellspacing=""0"" cellpadding=""0"" width=""100%""> ")
									 PicStr = PicStr & ("<tr><td align=center>" & TempPicStr & "</td></tr>" & vbCrLf)
									 If CBool(TypeTitle) = True Then
									  PicStr = PicStr & ("<tr><td align=center>" & TempTitle  & "</td></tr>" & vbCrLf)
									 End If
									 PicStr = PicStr & ("</table>")
								Case "3"
									 PicStr = PicStr & "<table cellSpacing=""0"" cellPadding=""0"" width=""100%"" border=""0"">" & vbCrLf
									 PicStr = PicStr & " <TR>" & vbCrLf
									 PicStr = PicStr & " <TD align=center>" & vbCrLf
									 PicStr = PicStr & "  <TABLE align=center cellSpacing=0 cellPadding=0 border=0>" & vbCrLf
									 PicStr = PicStr & "  <TBODY><TR><TD width=110 align=center>" & TempPicStr & "</TD></TR></TBODY>" & vbCrLf
									 PicStr = PicStr & " </TABLE></TD>" & vbCrLf
									 PicStr = PicStr & "<TD> <TABLE width=""100%"" border=""0"">" & vbCrLf
									 PicStr = PicStr & "<TBODY>"
									 If CBool(TypeTitle) = True Then
										PicStr = PicStr & "<TR><TD>" & TempTitle & "</TD></TR>" & vbCrLf
									 End If
									 PicStr = PicStr & "<TR><TD>"&ACTCMS.GetStrValue(Replace(Replace(Replace(AcTCMS.CloseHtml(ArticleC), vbCrLf, ""), "[NextPage]", ""), "&nbsp;", ""), ContentLen) & "...[<a href=""" & ActCMSURL & """" & OpenType & ">全文</a>]</TD></TR>" & vbCrLf
									 PicStr = PicStr & "</TBODY>" & vbCrLf
									 PicStr = PicStr & "</TABLE></TD>" & vbCrLf
									 PicStr = PicStr & " </TR>" & vbCrLf
									 PicStr = PicStr & "</TABLE>" & vbCrLf
								Case "4"
									 PicStr = PicStr & "<TABLE cellSpacing=""0"" cellPadding=""0"" width=""100%"" border=""0"">" & vbCrLf
									 PicStr = PicStr & " <TBODY>" & vbCrLf
									 PicStr = PicStr & " <TR>" & vbCrLf
									 PicStr = PicStr & "<TD> <TABLE width=""100%"" border=""0"">" & vbCrLf
									 PicStr = PicStr & "<TBODY>"
									 If CBool(TypeTitle) = True Then
										PicStr = PicStr & "<TR><TD>" & TempTitle & "</TD></TR>" & vbCrLf
									 End If
									 PicStr = PicStr & "<TR><TD>"&ACTCMS.GetStrValue(Replace(Replace(Replace(AcTCMS.CloseHtml(ArticleC), vbCrLf, ""), "[NextPage]", ""), "&nbsp;", ""), ContentLen) & "...[<a href=""" & ActCMSURL & """" & OpenType & ">全文</a>]</TD></TR>" & vbCrLf
									 PicStr = PicStr & "</TBODY>" & vbCrLf
									 PicStr = PicStr & "</TABLE></TD>" & vbCrLf
									 PicStr = PicStr & " <TD align=center>" & vbCrLf
									 PicStr = PicStr & "<TABLE align=center cellSpacing=0 cellPadding=0 border=0>" & vbCrLf
									 PicStr = PicStr & "<TBODY><TR><TD width=110 align=center>" & TempPicStr & "</TD></TR></TBODY>" & vbCrLf
									 PicStr = PicStr & "</TABLE></TD>" & vbCrLf
									 PicStr = PicStr & " </TR>" & vbCrLf
									 PicStr = PicStr & "</TBODY></TABLE>" & vbCrLf
								Case Else
									 PicStr=PicStr&ACT_W(PicStyle)
								End Select
									 PicStr = PicStr & ("</td>" & vbCrLf)
									 N=N+1
									 If N>=ActNum+1 Then Exit For
							 Next
						 PicStr = PicStr & ("</tr>" & vbCrLf)
						 PicStr = PicStr & ("<tr><td colspan=""" & ColNumber & """ height=""5""></td></tr>")
						 IF N>=ActNum+1 Then Exit For
					Next
						 ACT_P_SQL = PicStr & ("</table>" & vbCrLf)
				End If 
		End Function



		Function ACTCMS_GetSlide(ClassID,ListNumber,OpenType,TitleLen,Titlecss,TypeTitle,TypeSlide,PicWidth,PicHeight,ChangeTime,ModeID)
			Dim SqlStr, Parameter
			Select Case ClassID 
			    Case "","0":Parameter=""
				Case "1":Parameter="ClassID='" & Application(AcTCMSN & "ClassID") & "' And" 
			    Case Else
					If InStr(ClassID, ",") > 0 Then
						 Parameter="ClassID In (" & ClassID & ") And"
					Else
						 Parameter="ClassID='" & ClassID & "' And"
					End If 
			End Select
			 Sqlstr= "Select TOP " & ListNumber & " ID,PicUrl,ClassID,Title,ChangesLink,FileName,GroupID_ACT,Score_ACT From "&ACTCMS.ACT_C(ModeID,2)&" Where " & Parameter & " isAccept=0 AND delif=0 AND picurl<>'' AND Slide=1  ORDER BY ID Desc "
		     ACTCMS_GetSlide = ACT_SlideSQL(SqlStr,OpenType = Gopen(OpenType),TitleLen,Titlecss,TypeTitle,TypeSlide,PicWidth,PicHeight,ChangeTime,ModeID)
		End Function
		Function ACT_SlideSQL(SqlStr,OpenType ,TitleLen,Titlecss,TypeTitle,TypeSlide,PicWidth,PicHeight,ChangeTime,ModeID)
			 Dim PicUrl, TempTitle,TitleCssStr,ACTSQL,K
			 Dim RS:Set RS=ACTCMS.ActExe(SqlStr)
			 If RS.EOF Then	 ACT_SlideSQL="暂时没有幻灯片":RS.Close:Set RS=Nothing:Exit Function
			 ACTSQL=RS.GetRows(-1):RS.Close:Set RS = Nothing
			 IF Cint(TypeSlide)=2 Then 
					 Dim ImgArrStr,LinkArrStr,TextArrStr
					 Dim N:N=0
				     For K=0 To Ubound(ACTSQL,2)
					      PicUrl = ACTSQL(1,N)				
					      TempTitle = ACTSQL(3,N)
                          if N=0 Then
						    ImgArrStr=PicUrl
							LinkArrStr=AcTCMS.GetInfoUrl(ModeID,ACTSQL(2,N),ACTSQL(0,N),ACTSQL(4,N),ACTSQL(5,N),ACTSQL(6,N),ACTSQL(7,N))
						    TextArrStr=TempTitle
					      Else
						   ImgArrStr=ImgArrStr & "$$$" & PicUrl
						   LinkArrStr=LinkArrStr & "$$$" & AcTCMS.GetInfoUrl(ModeID,ACTSQL(2,N),ACTSQL(0,N),ACTSQL(4,N),ACTSQL(5,N),ACTSQL(6,N),ACTSQL(7,N))
						   TextArrStr=TextArrStr & "$$$" & TempTitle
						  End if
						  N=N+1
                    Next
					ACT_SlideSQL="<script src=""" & Domain &"ACT_inc/loadflash.js"" type=""text/javascript"" language=""javascript""></script>"&vbcrlf
					ACT_SlideSQL=ACT_SlideSQL & "<SCRIPT language=JavaScript>" & vbcrlf
					ACT_SlideSQL=ACT_SlideSQL & "var focus_width=" & PicWidth & ";" & vbcrlf
					ACT_SlideSQL=ACT_SlideSQL & "var focus_height=" & PicHeight & ";" & vbcrlf
					If Cbool(TypeTitle)=True Then
					ACT_SlideSQL=ACT_SlideSQL & "var text_height=25;" & vbcrlf
					Else
					ACT_SlideSQL=ACT_SlideSQL & "var text_height=0;" & vbcrlf
					End If
					 Dim ImgArr:ImgArr=Split(ImgArrStr,"$$$")
					 Dim LinkArr:LinkArr=Split(LinkArrStr,"$$$")
					 Dim TextArr:TextArr=Split(TextArrStr,"$$$")
					 Dim ArrLength:ArrLength=Ubound(ImgArr)
					 If ArrLength>5 Then ArrLength=5
					 Dim I,PicStr,LinkStr,TextStr
					 For I=0 To ArrLength
					   If I=0 Then
						 PicStr="var pics='" & ImgArr(0)
						 LinkArr(0)=replace(LinkArr(0),"&","%26")
						 LinkStr="var links='" & LinkArr(0)
						 TextStr="var texts='" & actcms.CloseHtml(TextArr(0)) &""
					  Else
					   PicStr=PicStr & "|" & ImgArr(I)
					   LinkArr(I)=replace(LinkArr(I),"&","%26")
					   LinkStr=LinkStr&"|"&LinkArr(I)
					   TextStr=TextStr &"|" &actcms.CloseHtml(TextArr(I))
					  End IF
					 Next
					ACT_SlideSQL=ACT_SlideSQL &PicStr &"';"&vbcrlf&LinkStr&"';" &vbcrlf & TextStr &"';"&vbcrlf
					ACT_SlideSQL=ACT_SlideSQL & "LoadFlash('" & Domain & "ACT_inc/slide.swf','transparent',focus_width,focus_height+text_height,'pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height)" & vbcrlf
					ACT_SlideSQL=ACT_SlideSQL & "</SCRIPT>" & vbcrlf
			 Else
				   ACT_SlideSQL = "<Script Language=""JavaScript"">" & vbCrLf
				   ACT_SlideSQL = ACT_SlideSQL & ("<!--" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("function SlidePic1(ID) {this.ID=ID; this.Width=0;this.Height=0; this.TimeOut=5000; this.Effect=23; this.TitleLen=0; this.PicNum=-1; this.Img=null; this.Url=null; this.Title=null; this.AllPic=new Array(); this.Add=AddSlidePic1; this.Show=ShowSlidePic1; this.LoopShow=LoopShowSlidePic1;}" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("function NewSlide1() {this.ImgUrl=""""; this.LinkUrl=""""; this.Title="""";}" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("function AddSlidePic1(SP) {this.AllPic[this.AllPic.length] = SP;}" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("function ShowSlidePic1() {" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("if(this.AllPic[0] == null) return false;" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("document.write('<div align=""center""><a id=""Url' + this.ID + '"" href=""""" & OpenType & "><img id=""Img' + this.ID + '"" width=' + this.Width + '  height=' + this.Height + ' style=""filter: revealTrans(duration=2,transition=23);"" src=""javascript:null"" border=""0""></a>');" & vbCrLf) 
				   ACT_SlideSQL = ACT_SlideSQL & ("if(this.TitleLen != 0) document.write(""<br><Div id='Title"" + this.ID + ""'></Div></div>"");" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("this.Img = document.getElementById(""Img"" + this.ID);" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("this.Url = document.getElementById(""Url"" + this.ID);" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("this.Title = document.getElementById(""Title"" + this.ID);" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("this.LoopShow();" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("}" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("function LoopShowSlidePic1() {" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("if(this.PicNum<this.AllPic.length-1) this.PicNum++ ;" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("else this.PicNum=0;" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("this.Img.filters.revealTrans.Transition=this.Effect;" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("this.Img.filters.revealTrans.apply();" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("this.Img.src=this.AllPic[this.PicNum].ImgUrl;" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("this.Img.filters.revealTrans.play();" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("this.Url.href=this.AllPic[this.PicNum].LinkUrl;" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("if(this.Title) this.Title.innerHTML='<a href=""'+this.AllPic[this.PicNum].LinkUrl+'"" " & OpenType & ">'+this.AllPic[this.PicNum].Title+'</a>';" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("this.Img.timer=setTimeout(this.ID+"".LoopShow()"",this.TimeOut);" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("}" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("var SlidePic1 = new SlidePic1(""SlidePic1"");" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("SlidePic1.Width    = " & PicWidth & ";" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("SlidePic1.Height   = " & PicHeight & ";" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("SlidePic1.TimeOut  = " & ChangeTime & ";" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("SlidePic1.Effect   = 23;" & vbCrLf)
				   If CBool(TypeTitle) = False Then
					 ACT_SlideSQL = ACT_SlideSQL & ("SlidePic1.TitleLen = 0;" & vbCrLf)
				   Else
					 ACT_SlideSQL = ACT_SlideSQL & ("SlidePic1.TitleLen = 1;" & vbCrLf)
				   End If
					TitleCssStr = GCss(TitleCss)
				 For K=0 To Ubound(ACTSQL,2)
					  PicUrl = ACTSQL(1,N)				
					 TempTitle = "<span" & TitleCssStr & ">" &ACTCMS.GetStrValue(ACTSQL(3,N),TitleLen)& "</span>"
					 ACT_SlideSQL = ACT_SlideSQL & "var NewItem = new NewSlide1();" & vbCrLf
					 ACT_SlideSQL = ACT_SlideSQL & "NewItem.ImgUrl = '" & PicUrl & "';" & vbCrLf
					 ACT_SlideSQL = ACT_SlideSQL & "NewItem.LinkUrl= '" & AcTCMS.GetInfoUrl(ModeID,ACTSQL(2,N),ACTSQL(0,N),ACTSQL(4,N),ACTSQL(5,N),ACTSQL(6,N),ACTSQL(7,N)) & "';" & vbCrLf
					 ACT_SlideSQL = ACT_SlideSQL & "NewItem.Title = '" & TempTitle & "';" & vbCrLf
					 ACT_SlideSQL = ACT_SlideSQL & "SlidePic1.Add(NewItem);" & vbCrLf
				   Next				
				   ACT_SlideSQL = ACT_SlideSQL & ("SlidePic1.Show();" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("//-->" & vbCrLf)
				   ACT_SlideSQL = ACT_SlideSQL & ("</Script>" & vbCrLf)
				End if
		End Function

		Function GetLastArticleList(ActF,ClassID,PageStyle,ArticleSort,OpenType,PageNumber,RowHeight,TitleLen,ColNumber,TypeClassName,TypeNew,NavType,Nav,Division,DateForm,DateAlign,TitleCss,DateCss,divid,divclass,ulid,ulclass,liid,liclass) 
		 Dim Parameter,SqlStr,ACTSQL
		 If Application(AcTCMSN & "ACTCMS_TCJ_Type") = "Folder" Then
			Select Case ClassID 
				Case "1":Parameter="ClassID='" & Application(AcTCMSN & "ClassID") & "' And" 
			    Case Else
					If InStr(ClassID, ",") > 0 Then
						 Parameter="ClassID In (" & ClassID & ") And"
					Else
						 Parameter="ClassID='" & ClassID & "' And"
					End If 
			End Select
			   SqlStr = "SELECT ID FROM "&ACTCMS.ACT_C(Application(AcTCMSN & "ModeID"),2)&" Where " & Parameter & " isAccept=0 AND delif=0  order by IsTop Desc," &ArticleSort &" ,ID Desc"
			   Dim RS,N
			   Set RS=ACTCMS.ACTEXE(SqlStr)
			   If RS.EOF Then	GetLastArticleList = "<p>此栏目下没有数据</p>":Application(Cstr(AcTCMSN & "PageList")) = "":RS.Close:Set RS = Nothing:Exit Function
			   ACTSQL=RS.GetRows(-1):Set RS = Nothing
			   TotalPut=Ubound(ACTSQL,2)+1
			   PageNum=cint(PageNumber)
			   Dim PageNum, I, J, k, TempStr, OpenTypeStr,FolderNameAndLinkStr, TempTitle, NaviStr, ColSpanNum,AddDate,totalput,TempIDArrStr
				OpenTypeStr = Gopen(OpenType)
						if (TotalPut mod PageNumber)=0 then
							PageNum = TotalPut \ PageNumber
						Else 
							PageNum = TotalPut \ PageNumber + 1
						End  If 
					  For I = 1 To PageNum
						 TempIDArrStr = ""
						 For J = 1 To PageNumber
						   TempIDArrStr = TempIDArrStr &ACTSQL(0,N) & ","
						   N=N+1
						   If N>=TotalPut Then Exit For
						 Next
						  TempIDArrStr = Left(TempIDArrStr, Len(TempIDArrStr) - 1)				
						  SqlStr = "SELECT ID,Classid,Title,UpdateTime,ChangesLink,FileName,GroupID_ACT,Score_ACT FROM "&ACTCMS.ACT_C(Application(AcTCMSN & "ModeID"),2)&"   Where ID in (" & TempIDArrStr & ") AND isAccept=0 AND delif=0  order by IsTop Desc," &ArticleSort &" ,ID Desc"
						  TempStr = TempStr & ACTCMS_Page_SQL(SqlStr,OpenType,RowHeight,TitleLen,ColNumber,TypeClassname,TypeNew,NavType,Nav,Division,DateForm,DateAlign,TitleCss,DateCss,ACTF,DivID,DivClass,UlID,UlClass,LiID,LiClass)
						  TempStr = TempStr & AcTCMS.GetPageList(PageStyle,""&ACTCMS.ACT_C(Application(AcTCMSN & "ModeID"),5)&"",PageNum,I,TotalPut,PageNumber)
						  TempStr = TempStr & "{$PageList}" '加上分页符
					
						  If N>=TotalPut Then Exit For
					 Next
						 Application(AcTCMSN & "PageList") = TempStr
						 Application(AcTCMSN & "PageStyle")= PageStyle
		Else
			Application(AcTCMSN & "PageList") = ""
		End If
			GetLastArticleList = "{PageListStr}"
		End Function





		Function ACTCMS_Page_SQL(SqlStr,OpenType,RowHeight,TitleLen,ColNumber,TypeClassname,TypeNew,NavType,Nav,Division,DateForm,DateAlign,TitleCss,DateCss,ACTF,DivID,DivClass,UlID,UlClass,LiID,LiClass) '21
			 Dim RS,I,K,N,DateStr,TitleCssName,ColSpanNum,TypeNews,TempTitle,NaviStr,DateCssStr,ACTSQL
			 Set RS=ACTCMS.ACTEXE(SqlStr)
			 If RS.EOF Then	 ACTCMS_Page_SQL="暂无内容":RS.Close:Set RS=Nothing:Exit Function
			 ACTSQL=RS.GetRows(-1):Set RS = Nothing
			 Dim ActNum:ActNum=Ubound(ACTSQL,2)
			 Dim Title,ClassnameLink
			 TitleCssName = GCss(TitleCss):DateCssStr = GCss(DateCss):RowHeight = GRowHeight(RowHeight):NaviStr = GNavi(NavType,Nav)
			 If ActF=2 Then 
			  		  If DivID<>"0" Then ACTCMS_Page_SQL = "<div"&GCssID(DivID)&GCss(DivClass) &">" & vbCrLf 
					  If UlID <>"0" Then ACTCMS_Page_SQL=ACTCMS_Page_SQL& " <ul"&GCssID(UlID)&GCss(UlClass) &">" & vbCrLf
				For K=0 To ActNum
					  If CBool(TypeClassname) = True Then ClassnameLink = "<span>[" & AcTCMS.GainClassName(ACTSQL(1,N),OpenType,TitleCssName) & "]</span>"			
					  If Cbool(TypeNew)=True And (Year(ACTSQL(3,N))&Month(ACTSQL(3,N))&Day(ACTSQL(3,N)) =Year(Now)&Month(Now)&Day(Now)) Then TypeNews="<img src=""" & Domain&"ACT_inc/share/new.gif"" border=""0""/>" Else TypeNews=""
					  DateStr=GDDateStr(ACTSQL(3,N),DateForm,DateCssStr)
					  TempTitle = "<a "  & TitleCssName &  " href=""" &AcTCMS.GetInfoUrl(Application(AcTCMSN & "ModeID"),ACTSQL(1,N),ACTSQL(0,N),ACTSQL(4,N),ACTSQL(5,N),ACTSQL(6,N),ACTSQL(7,N)) &  """"  & Gopen(OpenType) & " title=""" & AcTCMS.CloseHtml(ACTSQL(2,N)) & """>" &ACTCMS.GetStrValue(ACTSQL(2,N),TitleLen) & "</a>" 
					  ACTCMS_Page_SQL = ACTCMS_Page_SQL & ("  <li"&GCssID(LIID)&GCss(LiClass)&">" &NaviStr&ClassnameLink&TempTitle&TypeNews&DateStr & "</li>" & vbCrLf)
					  N=N+1 
			   Next
					  If UlID<>"0" Then ACTCMS_Page_SQL =ACTCMS_Page_SQL&"</ul>" & vbCrLf 
					  If DivID<>"0" Then ACTCMS_Page_SQL =ACTCMS_Page_SQL&"</div>"
			  Else
					  ACTCMS_Page_SQL = "<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"">" & vbCrLf
				For K=0 To ActNum
					 ACTCMS_Page_SQL = ACTCMS_Page_SQL & "<tr>" & vbCrLf
					 For I = 1 To ColNumber
					  If CBool(TypeClassname) = True Then ClassnameLink = "[" & AcTCMS.GainClassName(ACTSQL(1,N),OpenType,TitleCssName) & "]"			
					  If Cbool(TypeNew)=True And (Year(ACTSQL(3,N))&Month(ACTSQL(3,N))&Day(ACTSQL(3,N)) =Year(Now)&Month(Now)&Day(Now)) Then TypeNews="<img src=""" & Domain&"ACT_inc/share/new.gif"" border=""0""/>" Else TypeNews=""
					  DateStr=GDateStr(ACTSQL(3,N),DateForm,DateAlign,DateCssStr,ColNumber,ColSpanNum)
					  TempTitle = "<a " & TitleCssName &  " href=""" &AcTCMS.GetInfoUrl(Application(AcTCMSN & "ModeID"),ACTSQL(1,N),ACTSQL(0,N),ACTSQL(4,N),ACTSQL(5,N),ACTSQL(6,N),ACTSQL(7,N)) &  """"  & OpenType & " title=""" & AcTCMS.CloseHtml(ACTSQL(2,N)) & """>" &ACTCMS.GetStrValue(ACTSQL(2,N),TitleLen) & "</a>" 
						  If ColNumber=1 Then
							  ACTCMS_Page_SQL = ACTCMS_Page_SQL & ("  <td height=""" & RowHeight & """>"  &NaviStr&ClassnameLink&TempTitle&TypeNews&DateStr& "</td>" & vbCrLf)
						  Else
							  ACTCMS_Page_SQL = ACTCMS_Page_SQL & ("  <td  width=""" & CInt(100 / CInt(ColNumber)) & "%"" height=""" &RowHeight&  """>" & vbCrLf)
							  ACTCMS_Page_SQL = ACTCMS_Page_SQL & ("    <table width=""90%"" height=""100%"" cellpadding=""0"" cellspacing=""0"" border=""0"">" & vbCrLf)
							  ACTCMS_Page_SQL = ACTCMS_Page_SQL & ("     <tr><td> " &NaviStr&ClassnameLink&TempTitle&TypeNews &DateStr )
							  ACTCMS_Page_SQL = ACTCMS_Page_SQL & ("      </td></tr>" & vbcrlf &"   </table>" & vbCrLf & "  </td>" & vbCrLf)
						  End if
						  N=N+1
					      If N>=ActNum+1 Then Exit For
					 Next
					 ACTCMS_Page_SQL = ACTCMS_Page_SQL & "</tr>" & vbCrLf
					 ACTCMS_Page_SQL = ACTCMS_Page_SQL & (GbgPic(Division,ColSpanNum) & vbCrLf)
					 If N>=ActNum+1 Then Exit For
				Next
					 ACTCMS_Page_SQL = ACTCMS_Page_SQL &  ("</table>" & vbCrLf)
			End If 
		End Function

	Function GetClassNavigation(ModeID, OpenType, ColNumber, NavHeight, TitleCss, Division,NavType,Nav,ACTF,DivID,DivCss,UlID,UlCss,LiID,LiCss)
			Dim I,SqlStr,RS
			Dim TempTitle,NaviStr,ColSpanNum,ACTSQL,K,N
			If ModeID ="0" Then 
				  SqlStr = "Select ClassID,ClasseName,ClassName,ParentID From Class_Act Where  ParentID='0' AND dh=1 Order By OrderID"
			ElseIf  IsNumeric(ModeID) And ModeID<"20" Then 
				  SqlStr = "Select ClassID,ClasseName,ClassName From Class_Act where ParentID='0' And ModeID=" & ModeID & " AND dh=1 and ChangesLinkUrl=''  Order BY OrderID"
			ElseIf ModeID ="888" Then 
				  SqlStr = "Select ClassID,ClasseName,ClassName From Class_Act  Where  ParentID='" & Application(AcTCMSN & "ClassID") & "' AND dh=1  and ChangesLinkUrl=''   Order BY OrderID"
			Else
				If InStr(ModeID,",") > 0 Then
				    SqlStr = "Select ClassID,ClasseName,ClassName From Class_Act  Where  ClassID IN (" & ModeID & ")  AND dh=1 Order BY OrderID"
				Else
				    SqlStr = "Select ClassID,ClasseName,ClassName From Class_Act  Where   ClassID = '" & ModeID & "'  AND dh=1  Order BY OrderID"
				End If 
			End If 
			 Set RS=ACTCMS.ActExe(SqlStr)
			 If RS.EOF Then	 GetClassNavigation="当前还没有栏目":RS.Close:Set RS=Nothing:Exit Function
			 ACTSQL=RS.GetRows(-1):Set RS = Nothing
			 Dim ActNum:ActNum=Ubound(ACTSQL,2)
			 TitleCss = GCss(TitleCss):OpenType = Gopen(OpenType)
			 If ActF=2 Then 
			  		  If DivID<>"0" Then GetClassNavigation = "<div"&GCssID(DivID)&GCss(DivCss) &">" & vbCrLf 
					  If UlID <>"0" Then GetClassNavigation=GetClassNavigation& " <ul"&GCssID(UlID)&GCss(UlCss) &">" & vbCrLf
				 For K=0 To ActNum
					 GetClassNavigation = GetClassNavigation & ("  <li"&GCssID(LIID)&GCss(LICss)&">" &AcTCMS.GainClassName(ACTSQL(0,N),OpenType,TitleCss)& "</li>" & vbCrLf)
					 N=N+1 
				 Next
					  If UlID<>"0" Then GetClassNavigation =GetClassNavigation&"</ul>" & vbCrLf 
					  If DivID<>"0" Then GetClassNavigation =GetClassNavigation&"</div>"
			 Else
				GetClassNavigation = "<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" align=""center"">" & vbCrLf
				  NavHeight = GRowHeight(NavHeight):NaviStr = GNavi(NavType, Nav)&"&nbsp;"
				   For K=0 To ActNum
						GetClassNavigation = GetClassNavigation & "<tr>" & vbCrLf
						For I = 1 To ColNumber
						If ColNumber>=2 Then ColSpanNum = ColNumber
						TempTitle =AcTCMS.GainClassName(ACTSQL(0,N),OpenType,TitleCss) 
						 Select Case  ColNumber
							 Case 1
							 GetClassNavigation=  GetClassNavigation & ("  <td height=""" & NavHeight & """>" &NaviStr&TempTitle & "</td>" & vbCrLf)
							 Case 989
							  GetClassNavigation = GetClassNavigation & ("  <td   height=""" &NavHeight&  """>" & vbCrLf)
							  GetClassNavigation = GetClassNavigation & ("    <table width=""90%"" height=""100%"" cellpadding=""0"" align=""center"" cellspacing=""0"" border=""0"">" & vbCrLf)
							  GetClassNavigation = GetClassNavigation & ("     <tr><td> " &NaviStr&TempTitle)
							  GetClassNavigation = GetClassNavigation & ("      </td></tr>" & vbcrlf &"   </table>" & vbCrLf & "  </td>" & vbCrLf)
							Case Else 
							  GetClassNavigation = GetClassNavigation & ("  <td  width=""" & CInt(100 / CInt(ColNumber)) & "%"" height=""" &NavHeight&  """>" & vbCrLf)
							  GetClassNavigation = GetClassNavigation & ("    <table width=""90%"" height=""100%"" align=""center"" cellpadding=""0"" cellspacing=""0"" border=""0"">" & vbCrLf)
							  GetClassNavigation = GetClassNavigation & ("     <tr><td> " &NaviStr&TempTitle)
							  GetClassNavigation = GetClassNavigation & ("      </td></tr>" & vbcrlf &"   </table>" & vbCrLf & "  </td>" & vbCrLf)
							End Select 
						  N=N+1
					      If N>=ActNum+1 Then Exit For
						Next 
				  If N>=ActNum+1 Then Exit For 
				  GetClassNavigation = GetClassNavigation & "</tr>" & vbCrLf
				  GetClassNavigation = GetClassNavigation & (GbgPic(Division,ColSpanNum) & vbCrLf)
				 Next 
				 GetClassNavigation = GetClassNavigation & ("</table>" & vbCrLf)
			 End If 
		End Function

		Function GetClassForArticleList(ClassID,ActF,ATT,ArticleSort,OpenTypeStr,ListNumber,RowHeight,TitleLen,ColNumber,TypeClassName,TypeNew,ACTIF,NavType,Nav,MoreLinkType,MoreLink,Division,DateForm,DateAlign,TitleCss,DateCss,TypeMenuBg,menubg,SubColNumber,divid,divclass,ulid,ulclass,liid,liclass) 
			If Application(AcTCMSN & "ACTCMS_TCJ_Type") = "Folder" Or Application(AcTCMSN & "ACTCMS_TCJ_Type") = "Index"  Or Application(AcTCMSN & "ACTCMS_TCJ_Type") = "ACTCMSMODE" Then
				 Dim  SqlStr,RS,ACTSQL,n,k,Sqlstrs
				 Dim  Parameter,MoreLinkStr,ACT_IF,ACTCMS_ATT,RSs,ACT_SQL,ACT
					If  ClassID ="0" Then '查询所有
						SqlStr = "Select ClassID,ModeID,ParentID From Class_act Where  ParentID='0' and ChangesLinkUrl = ''  Order By ParentID asc,OrderID asc "
					ElseIf ClassID ="1" Then 
						SqlStr = "Select classID,ModeID,ParentID From Class_act Where  ParentID='" & Application(AcTCMSN & "ClassID") & "'  and ChangesLinkUrl = ''  ORDER BY ParentID asc,OrderID asc "
					Else
						If InStr(ClassID, ",") > 0 Then
							SqlStr = "Select classID,ModeID,ParentID From Class_act Where   ClassID IN (" & ClassID & ")  and ChangesLinkUrl = ''  ORDER BY ParentID asc,OrderID asc "
						Else
							SqlStr = "Select classID,ModeID,ParentID From Class_act Where  ClassID = '" & ClassID & "'   and ChangesLinkUrl = '' ORDER BY ParentID asc,OrderID asc "
						End If 
					End If  
				 Set RS=ACTCMS.ActExe(SqlStr)
				 If RS.EOF Then	 GetClassForArticleList="":RS.Close:Set RS=Nothing:Exit Function
				 ACTSQL=RS.GetRows(-1):Set RS = Nothing
				 Dim ActNum:ActNum=Ubound(ACTSQL,2)
					Dim TempStr, I, Act_MenuBg, ACT_ArticleList, OpenType
					If ActF=2 Then 
					N=0
						 For K=0 To ActNum
							If ClassID="0" Or ClassID="1" Or ACTSQL(2,N)="0" Then 
								Parameter="ClassID In (" & ACTCMS.TempClassID(ACTSQL(0,N)) & ") And"
							Else 
								Parameter="ClassID='" & Trim(ACTSQL(0,N)) & "' And"
							End If 
							OpenType = Gopen(OpenTypeStr)
							If ACTIF<>"" Then ACT_IF = " And "&ACTIF
							If ATT="0" Then  ACTCMS_ATT="" Else ACTCMS_ATT = " And ATT="&ATT
							If MoreLink <> "" And InStr(ClassID, ",") = 0 And ClassID <> "0"  Then MoreLinkStr=MLink(ColNumber,RowHeight,MoreLinkType, MoreLink, AcTCMS.MoreName(ClassID),OpenTypeStr)
							If Lcase(Left(Trim(ArticleSort),2))<>"id" Then  ArticleSort=ArticleSort & ",ID Desc"
							Sqlstrs="Select TOP " & ListNumber & " ID,Classid,Title,UpdateTime,ChangesLink,FileName,GroupID_ACT,Score_ACT From "&ACTCMS.ACT_C(ACTSQL(1,N),2)&"  Where " & Parameter & " isAccept=0 AND delif=0 " & ACTCMS_ATT &ACT_IF& " ORDER BY IsTop Desc," & ArticleSort
							 Set RSs=ACTCMS.ActExe(SqlStrs)
							 If RSs.EOF Then	 
								TempStr = "<div"&GCssID(DivID)&GCss(DivClass) &">" & vbCrLf &"<h3>"&AcTCMS.GainClassName(ACTSQL(0,N),OpenType,TitleCssName)&"</h3>" & vbCrLf
								TempStr =TempStr & " <ul"&GCssID(UlID)&GCss(UlClass) &">"& vbCrLf
								TempStr=TempStr &"<li>暂无内容</li>"& vbCrLf
								ACT_ArticleList = MoreLinkStr& vbCrLf&TempStr & ("</ul>" & vbCrLf &"</div>")& vbCrLf&ACT_ArticleList
								RSs.Close:Set RSs=Nothing
							Else
								 ACT_SQL=RSs.GetRows(-1):Set RSs = Nothing
								 Dim ActNums:ActNums=Ubound(ACT_SQL,2)
								 ACT=0
								 Dim Title,ClassnameLink,TitleCssName,DateCssStr,NaviStr,ACTS,TypeNews,ColSpanNum,DateStr,TempTitle
								   TitleCssName = GCss(TitleCss):DateCssStr = GCss(DateCss):RowHeight = GRowHeight(RowHeight):NaviStr = GNavi(NavType,Nav)
									TempStr = "<div"&GCssID(DivID)&GCss(DivClass) &">" & vbCrLf &"<h3>"&AcTCMS.GainClassName(ACT_SQL(1,ACT),OpenType,TitleCssName)&"</h3>" & vbCrLf
									TempStr =TempStr & " <ul"&GCssID(UlID)&GCss(UlClass) &">"& vbCrLf
									For ACTS=0 To ActNums
										  If CBool(TypeClassname) = True Then ClassnameLink = "[" & AcTCMS.GainClassName(ACT_SQL(1,ACT),OpenType,TitleCssName) & "]"			
										  If Cbool(TypeNew)=True And (Year(ACT_SQL(3,ACT))&Month(ACT_SQL(3,ACT))&Day(ACT_SQL(3,ACT)) =Year(Now)&Month(Now)&Day(Now)) Then TypeNews="<img src=""" & Domain&"ACT_inc/share/new.gif"" border=""0""/>" Else TypeNews=""
										  DateStr=GDDateStr(ACT_SQL(3,ACT),DateForm,DateCssStr)
										  TempTitle = "<a "  & TitleCssName &  " href=""" &AcTCMS.GetInfoUrl(ACTSQL(1,N),ACT_SQL(1,ACT),ACT_SQL(0,ACT),ACT_SQL(4,ACT),ACT_SQL(5,ACT),ACT_SQL(6,ACT),ACT_SQL(7,ACT)) &  """"  & OpenType & " title=""" & AcTCMS.CloseHtml(ACT_SQL(2,ACT)) & """>" &ACTCMS.GetStrValue(ACT_SQL(2,ACT),TitleLen) & "</a>" 
										  TempStr = TempStr & ("  <li"&GCssID(LIID)&GCss(LiClass)&">" &NaviStr&ClassnameLink&TempTitle&TypeNews&DateStr & "</li>" & vbCrLf)
										  ACT=ACT+1 
								   Next
										  ACT_ArticleList = MoreLinkStr& vbCrLf&TempStr & ("</ul>" & vbCrLf &"</div>")&ACT_ArticleList
						 	 End If 
							 N=N+1 
						 Next 
						GetClassForArticleList=ACT_ArticleList
					Else
					  TempStr = "<TABLE BORDER=""0"" Cellpadding=""0"" Cellspacing=""2"" Width=""100%"">" & vbCrLf
					  Act_MenuBg = Act_HS_MenuBg(TypeMenuBg, MenuBg, ColNumber):OpenType = Gopen(OpenTypeStr)
					  For K=0 To ActNum
							TempStr = TempStr & "<TR>" & vbCrLf
							For I = 1 To ColNumber							
								If ClassID="0" Or ClassID="1" Or ACTSQL(2,N)="0" Then 
								   ClassID=ACTCMS.TempClassID(ACTSQL(0,N))
								Else 
								'   ClassID=Trim(Replace(ClassID,"'",""))
									ClassID=ACTSQL(0,N)
								End If 
								TempStr = TempStr & "<TD Width=""" & CInt(100 / CInt(ColNumber)) & "%"" height=""100%"" Valign=""top"">" & vbCrLf
								TempStr = TempStr & "<table height=""100%"" width=""100%"" border=""0"" align=""center"" cellPadding=""0"" cellSpacing=""0"">" & vbCrLf
								TempStr = TempStr & "<tr><td class=""main_title""" & Act_MenuBg & ">"
								TempStr = TempStr & AcTCMS.GainClassName(ACTSQL(0,N), OpenTypeStr, "class=""main_link""") & "</td></tr>" & vbCrLf
								TempStr = TempStr & "<tr><td class=""main_tdbg"" Valign=""top"">" & vbCrLf
								ACT_ArticleList = ACT_A_List(ClassID,ActF,ATT,ArticleSort,OpenTypeStr,ListNumber,RowHeight,TitleLen,SubColNumber,TypeClassName,TypeNew,ACTIF,NavType,Nav,MoreLinkType,MoreLink,Division,DateForm,DateAlign,TitleCss,DateCss,divid,divclass,ulid,ulclass,liid,liclass,ACTSQL(1,N)) 
								If Trim(ACT_ArticleList) = "" Then ACT_ArticleList = "<li>此栏目下还没有文章</li>"
								TempStr = TempStr & ACT_ArticleList
								TempStr = TempStr & "</div>" & vbCrLf
								TempStr = TempStr & "</td></tr></table></td>" & vbCrLf
								N=N+1
								If N>=ActNum+1 Then Exit For
							Next
							TempStr = TempStr & "</tr>" & vbCrLf
						If N>=ActNum+1 Then Exit For
					 Next
					   TempStr = TempStr & "</TABLE>" & vbCrLf
					   GetClassForArticleList = TempStr
				 End If
				End If 
		End function

		Function ACT_Correlation_Article(ACTF,ArticleSort,ListNumber,OpenType,RowHeight,TitleLen,ColNumber,TypeClassname,TypeNew,NavType,Nav,Division,DateForm,DateAlign,TitleCss,DateCss,DivID,DivClass,UlID,UlClass,LiID,LiClass)
			 If Application(AcTCMSN & "ACTCMS_TCJ_Type") = "ARTICLECONTENT"  Then
				 Dim RS,SqlStr:SqlStr = "Select KeyWords From "&ACTCMS.ACT_C(Application(AcTCMSN & "ModeID"),2)&" Where ID=" & ACTCMS.RSQL(Application(AcTCMSN & "ID")) & ""
				 Set RS=ACTCMS.ActExe(SqlStr)
				 If RS.EOF Then	 ACT_Correlation_Article="<li>暂无相关链接":RS.Close:Set RS=Nothing:Exit Function
					 If Trim(RS(0)) <> "" And IsNull(RS(0)) = False Then
						Dim KeyWordsArr, I, SqlKeyWordStr
						KeyWordsArr = Split(Trim(RS(0)), ",")
						 For I = 0 To UBound(KeyWordsArr)
							If SqlKeyWordStr = "" Then
								SqlKeyWordStr = "KeyWords like '%" & KeyWordsArr(I) & "%' "
							Else
								SqlKeyWordStr = SqlKeyWordStr & "or KeyWords like '%" & KeyWordsArr(I) & "%' "
							End If
						Next
					  Dim  OpenTypeStr
					  If Lcase(Left(Trim(ArticleSort),2))<>"id" Then  ArticleSort=ArticleSort & ",ID Desc"
					  SqlStr = "Select TOP " & ListNumber & " ID,Classid,Title,UpdateTime,ChangesLink,FileName,GroupID_ACT,Score_ACT FROM "&ACTCMS.ACT_C(Application(AcTCMSN & "ModeID"),2)&"  Where  (" & SqlKeyWordStr & ")   AND isAccept=0 AND delif=0 order by IsTop Desc," & ArticleSort
						OpenTypeStr = Gopen(OpenType)
						ACT_Correlation_Article=ACTCMS_A_SQL(SqlStr,OpenTypeStr,RowHeight,TitleLen,ColNumber,TypeClassname,TypeNew,NavType,Nav,"",Division,DateForm,DateAlign,TitleCss,DateCss,ACTF,DivID,DivClass,UlID,UlClass,LiID,LiClass,Application(AcTCMSN & "ModeID")) 
					Else
					 ACT_Correlation_Article = "<li>暂无相关链接"
				   End If
				 Else
					ACT_Correlation_Article = "<li>暂无相关链接"
				 End If
		End Function


		 Function GetNavigation(TitleCss,OpenType,NavType,Nav,TypeMode)
		 Dim StrNav:StrNav = GetNavLocation(NavType,Nav)
			 OpenType = Gopen(OpenType):TitleCss = GCss(TitleCss)
			Select Case UCase(Application(AcTCMSN & "ACTCMS_TCJ_Type"))
				 Case "INDEX" 
					GetNavigation = ACTCMS.GetIndexNavigation(TitleCss,OpenType,StrNav)
				 Case "FOLDER"        '栏目的位置导航
					GetNavigation = ACTCMS.GetClassNavigation(TitleCss,OpenType,StrNav, Application(AcTCMSN & "ClassID"),TypeMode)
				 Case "ARTICLECONTENT"     '内容页的位置导航
					GetNavigation = ACTCMS.GetContentNavigation(TitleCss,OpenType,StrNav, Application(AcTCMSN & "ClassID"),TypeMode)
				 Case "ACTCMSMODE"
					GetNavigation = ACTCMS.TypeModeName(TitleCss,OpenType,Application(AcTCMSN & "ModeID"),StrNav)&"首页"
				 Case "OTHER"'插件导航
					GetNavigation =   "<a "& TitleCss &" href=""" & Application(AcTCMSN & "link") & """" &OpenType& ">" & Application(AcTCMSN & "ACTCMSTCJ") & "</a>"
				 Case Else
					GetNavigation = ""
			End Select
		 End Function
		Function GetNavLocation(NavType, Nav)
			If CStr(NavType) = "0" Then
			  If Nav = "" Then
			   GetNavLocation = " >> "
			  Else
			   GetNavLocation = Nav
			  End If
			Else
			  If Nav = "" Then
				GetNavLocation = " >> "
			  Else
				If Left(Nav, 1) = "/" Or Left(Nav, 1) = "\" Then Nav = Right(Nav, Len(Nav) - 1)
				GetNavLocation = "<img src=""" & ASys & Nav & """ border=""0"" align=""absmiddle"">"
			  End If
			End If
		End Function


		Function GetLinkList(ClassLinkID, LinkType, TypeStyle, LogoWidth, LogoHeight, ListNumber, TitleLen, ColNumber)
			 on error resume next
			 Dim SqlStr, Para, SiteName, TitleStr, WidthStr, LinkRegStr
			 Dim LinkRs:Set LinkRs=Server.CreateObject("ADODB.RECORDSET")
			 Dim k, I, NoLinkRowNumber
			 LinkRegStr = Domain & "Link/LinkReg.asp" '注册链接
			 WidthStr = CInt(100 / CInt(ColNumber)) & "%"
			 ClassLinkID = CInt(ClassLinkID):LinkType = CInt(LinkType)
			 Para = " Where Locked=0 And sh=1"
			 If ClassLinkID <> 0 Then
			   Para = Para & " And ClassLinkID=" & ClassLinkID
			 End If
			 If LinkType = 2 Then
			   Para = Para & " Order BY LinkType Desc,Rec Desc,AddDate Desc"
			 Else
			   Para = Para & " And LinkType=" & LinkType & " Order BY Rec desc,AddDate Desc"
			 End If
			 If ListNumber = 0 Then                     '列出所有友情链接站点
			   SqlStr = "Select ID,LinkType,SiteName,Description,Logo,AddDate,ClassLinkID,Url From Link_ACT" & Para
			 Else
			   SqlStr = "Select TOP " & ListNumber & " ID,LinkType,SiteName,Description ,Logo,AddDate,ClassLinkID,Url From Link_ACT" & Para
			 End If
			 Set LinkRs=ACTCMS.ActExe(SqlStr)
			 Select Case (CInt(TypeStyle))
				Case 0                '向上滚动
			    GetLinkList = "<div id=rolllinkArea style=""overflow:hidden;height:100%;width:100%"">"& vbCrLf
				 GetLinkList = GetLinkList & "<div id=rolllinkArea1>" & vbCrLf
				 GetLinkList = GetLinkList & " <table width=""100%"" cellSpacing=""2""> " & vbCrLf
				  If LinkRs.EOF And LinkRs.BOF Then
					 If ClassLinkID = 0 Then                  '当显示所有类别的友情链接时,显示点击申请
					   For I = 1 To ListNumber
						 GetLinkList = GetLinkList & "<tr align=""center"" height=""22"">" & vbCrLf
						 If LinkType = 0 Then
						   GetLinkList = GetLinkList & "<td><a href=""" & LinkRegStr & """ target=""_blank"" title=""点击申请"">点击申请</a></td>"
						 Else
						   GetLinkList = GetLinkList & "<td><a href=""" & LinkRegStr & """ target=""_blank"" title=""点击申请""><Img src=""" & Domain & "ACT_inc/share/nologo.gif"" border=""0""/></a></td>"
						 End If
						GetLinkList = GetLinkList & "</tr>" & vbCrLf
					  Next
					End If
				  Else
				   Do While Not LinkRs.EOF
					 GetLinkList = GetLinkList & "<tr align=""center"" height=""22"">" & vbCrLf
					 SiteName = LinkRs(2)
					 TitleStr = " title=""网站名称:" & SiteName & "&#13;&#10;添加日期:" & LinkRs(5) & "&#13;&#10;网站描述:" & LinkRs(3) & """"
						If LinkType = 2 Then
						  If LinkRs(1) = 0 Then
						   GetLinkList = GetLinkList & "<td><a href=""" & LinkRs("Url") & """ target=""_blank""" & TitleStr & ">" & ACTCMS.GetStrValue(SiteName, TitleLen) & "</a></td>"
						  Else
						   GetLinkList = GetLinkList & "<td><a href=""" & LinkRs("Url") & """ target=""_blank""><img src=""" & LinkRs(4) & """" & TitleStr & " alt=""" & SiteName & """  width=""" & LogoWidth & """ height=""" & LogoHeight & """ border=""0""/></a></td>"
						  End If
						ElseIf LinkType = 0 Then
						  GetLinkList = GetLinkList & "<td><a href=""" & LinkRs("Url") & """ target=""_blank""" & TitleStr & ">" & ACTCMS.GetStrValue(SiteName, TitleLen) & "</a></td>"
						ElseIf LinkType = 1 Then
						  GetLinkList = GetLinkList & "<td><a href=""" & LinkRs("Url") & """ target=""_blank""><img src=""" & LinkRs(4) & """" & TitleStr & " alt=""" & SiteName & """  width=""" & LogoWidth & """ height=""" & LogoHeight & """  border=""0""/></a></td>"
						End If
						GetLinkList = GetLinkList & "</tr>" & vbCrLf
						LinkRs.MoveNext
						I = I + 1
					Loop
					If ClassLinkID = 0 Then
					 Do While I < CLng(ListNumber)
					   GetLinkList = GetLinkList & "<tr align=""center"" height=""22"">" & vbCrLf
					  If LinkType = 0 Then
					   GetLinkList = GetLinkList & "<td><a href=""" & LinkRegStr & """ target=""_blank"" title=""点击申请"">点击申请</a></td>"
					  Else
					   GetLinkList = GetLinkList & "<td><a href=""" & LinkRegStr & """ target=""_blank""  title=""点击申请""><Img src=""" & Domain & "ACT_inc/share/nologo.gif"" alt=""点击申请"" border=""0""/></a></td>"
					  End If
					   GetLinkList = GetLinkList & "</tr>" & vbCrLf
					  I = I + 1
					Loop
				   End If
				  End If
				GetLinkList = GetLinkList & "</table>"
				LinkRs.Close
				Set LinkRs = Nothing
				 GetLinkList = GetLinkList & "</div>" & vbCrLf
				 GetLinkList = GetLinkList & "<div id=rolllinkArea2></div>" & vbCrLf
				 GetLinkList = GetLinkList & "</div>" & vbCrLf
				 GetLinkList = GetLinkList & "<script>" & vbCrLf
				 GetLinkList = GetLinkList & "var rollspeed = 20" & vbCrLf
				 GetLinkList = GetLinkList & "rolllinkArea2.innerHTML = rolllinkArea1.innerHTML" & vbCrLf
				 GetLinkList = GetLinkList & "function Marquee(){" & vbCrLf
				 GetLinkList = GetLinkList & "if(rolllinkArea2.offsetTop-rolllinkArea.scrollTop<=0)" & vbCrLf
				 GetLinkList = GetLinkList & "rolllinkArea.scrollTop-=rolllinkArea1.offsetHeight" & vbCrLf
				 GetLinkList = GetLinkList & "else{" & vbCrLf
				 GetLinkList = GetLinkList & "rolllinkArea.scrollTop++" & vbCrLf
				 GetLinkList = GetLinkList & "}}" & vbCrLf
				 GetLinkList = GetLinkList & "var MyMar = setInterval(Marquee, rollspeed)" & vbCrLf
				 GetLinkList = GetLinkList & "rolllinkArea.onmouseover=function() {clearInterval(MyMar)}" & vbCrLf
				 GetLinkList = GetLinkList & "rolllinkArea.onmouseout=function() {MyMar=setInterval(Marquee,rollspeed)}" & vbCrLf
				 GetLinkList = GetLinkList & "</script>" & vbCrLf
				
				Case 1                '横向列表
				  GetLinkList = " <table width=""100%"" cellSpacing=""2""> " & vbCrLf
				  If LinkRs.EOF And LinkRs.BOF Then
					If ClassLinkID = 0 Then
					   If ListNumber = 0 Then
						  NoLinkRowNumber = 1
					   Else
						  NoLinkRowNumber = ListNumber \ ColNumber
					   End If

					   For I = 1 To NoLinkRowNumber
						  GetLinkList = GetLinkList & "<tr align=""center"">" & vbCrLf
						  For k = 1 To ColNumber
							If LinkType = 1 Then
							  GetLinkList = GetLinkList & "<td width=""" & WidthStr & """><a href=""" & LinkRegStr & """ target=""_blank"" title=""点击申请""><Img src=""" & Domain & "ACT_inc/share/nologo.gif"" alt=""点击申请"" border=""0""/></a></td>"
							Else
							  GetLinkList = GetLinkList & "<td width=""" & WidthStr & """ nowrap><a href=""" & LinkRegStr & """ target=""_blank"" title=""点击申请"">点击申请</a></td>"
							End If
						  Next
						  GetLinkList = GetLinkList & "</tr>" & vbCrLf
					   Next
					End If
				  Else
				   Do While Not LinkRs.EOF
					 If ColNumber = 1 Then
					   GetLinkList = GetLinkList & "<tr align=""center"">" & vbCrLf
					 Else
					   GetLinkList = GetLinkList & "<tr>" & vbCrLf
					 End If
					 For k = 1 To ColNumber
					 	 SiteName = LinkRs(2)
					 TitleStr = " title=""网站名称:" & SiteName & "&#13;&#10;添加日期:" & LinkRs(5) & "&#13;&#10;网站描述:" & LinkRs(3) & """"
						
						If LinkType = 2 Then
							  If LinkRs(1) = 0 Then
							   GetLinkList = GetLinkList & "<td width=""" & WidthStr & """ nowrap><a href=""" & LinkRs("Url") & """ target=""_blank""" & TitleStr & ">" & ACTCMS.GetStrValue(SiteName, TitleLen) & "</a></td>"
							  Else
							   GetLinkList = GetLinkList & "<td width=""" & WidthStr & """><a href=""" & LinkRs("Url") & """ target=""_blank""><img src=""" & LinkRs(4) & """" & TitleStr & " alt=""" & SiteName & """ width=""" & LogoWidth & """ height=""" & LogoHeight & """ border=""0""/></a></td>"
							  End If
						ElseIf LinkType = 0 Then
							  GetLinkList = GetLinkList & "<td width=""" & WidthStr & """ nowrap><a href=""" & LinkRs("Url") & """ target=""_blank""" & TitleStr & ">" & ACTCMS.GetStrValue(SiteName, TitleLen) & "</a></td>"
						ElseIf LinkType = 1 Then
							  GetLinkList = GetLinkList & "<td width=""" & WidthStr & """><a href=""" & LinkRs("Url") & """ target=""_blank""><img src=""" & LinkRs(4) & """" & TitleStr & " alt=""" & SiteName & """ width=""" & LogoWidth & """ height=""" & LogoHeight & """  border=""0""/></a></td>"
						End If
						LinkRs.MoveNext
						If LinkRs.EOF Then Exit For
					  Next

						 for  k=k+1 to ColNumber
							If LinkType = 1 Then
								   GetLinkList = GetLinkList & "<td width=""" & WidthStr & """><a href=""" & LinkRegStr & """ target=""_blank""  title=""点击申请""><Img src=""" & Domain & "ACT_inc/share/nologo.gif"" alt=""点击申请"" border=""0""/></a></td>"
								  Else
								   GetLinkList = GetLinkList & "<td width=""" & WidthStr & """ nowrap><a href=""" & LinkRegStr & """ target=""_blank"" title=""点击申请"">点击申请</a></td>"
							End If
						 next
					 GetLinkList = GetLinkList & "</tr>" & vbCrLf
					Loop
					
				  End If
				GetLinkList = GetLinkList & "</table>"
				LinkRs.Close:Set LinkRs = Nothing
				Case 2                '下拉列表
				  GetLinkList = "<select name=""Link"" onchange=""if(this.options[this.selectedIndex].value!=''){window.open(this.options[this.selectedIndex].value,'_blank');}"">" & vbCrLf
				 If LinkRs.EOF And LinkRs.BOF Then
				 GetLinkList = GetLinkList &  "<option value=''>---没有任何链接---</option>"
				 Else
				 GetLinkList = GetLinkList &  "<option value=''>---" & ACTCMS.ActExe("Select ClassLinkName From ClassLink_Act Where ID=" & LinkRs("ClassLinkID"))(0) & "---</option>"
				 End If
				 Do While Not LinkRs.EOF
				   GetLinkList = GetLinkList & "<option value='" & LinkRs("Url") & "'>" & GetStrValue(LinkRs(2), TitleLen) & "</option>" & vbCrLf
				   LinkRs.MoveNext
				 Loop
				  GetLinkList = GetLinkList & "</select>" & vbCrLf
				  LinkRs.Close:Set LinkRs = Nothing
			 End Select
		End Function

		Function Act_HS_MenuBg(TypeMenuBg, MenuBg, ColNumber)
		  If TypeMenuBg = 0 Then
			 If MenuBg = "" Then Act_HS_MenuBg = "" Else Act_HS_MenuBg = " bgcolor=""" & MenuBg & """"
		  Else
			 If MenuBg = "" Then
			   Act_HS_MenuBg = " background=""" & Domain & "Images/Share/MenuBg" & ColNumber & ".Gif"""
			 Else
			   If Left(MenuBg, 1) = "/" Or Left(MenuBg, 1) = "\" Then MenuBg = Right(MenuBg, Len(MenuBg) - 1)
			   If LCase(Left(MenuBg, 4)) = "http" Then MenuBg = MenuBg Else MenuBg = ASys & MenuBg
			   Act_HS_MenuBg = " background=""" & MenuBg & """"
			 End If
		  End If
		End Function
		Function Gopen(OpenType)
			  If OpenType = "" Or OpenType = False Then
				Gopen = ""
			  ElseIf OpenType = True Then
				Gopen = " target=""_blank"""
			  Else
				Gopen = " target=""" & OpenType & """"
			  End If
		End Function
		Function GRowHeight(RowHeight)
			If IsNumeric(RowHeight) Then GRowHeight = RowHeight Else GRowHeight = 20
		End Function
		
		Function MLink(ColNumber,RowHeight,MoreLinkType, LinkNameStr, LinkUrl,OpenTypeStr)
		   If LinkNameStr = "" Then GetMoreLink = "":Exit Function
		   LinkNameStr = Trim(LinkNameStr):LinkUrl = Trim(LinkUrl)
		   If CStr(MoreLinkType) = "0" Then
			  MLink = "<tr><td colspan= """ & ColNumber+1 & """ height=""" & RowHeight & """ align=""right""><a href=""" & LinkUrl & """" & OpenTypeStr & " > " & LinkNameStr & "</a></td></tr>"
		   ElseIf CStr(MoreLinkType) = "1" Then
				MLink = "<tr><td colspan= """ & ColNumber+1 & """ height=""" & RowHeight & """ align=""right""><a href=""" & LinkUrl & """" & OpenTypeStr & " > <img src=""" & LinkNameStr & """ border=""0"" align=""absmiddle""/></a></td></tr>"
		   Else
			 MLink = ""
		   End If
		End Function	
		
		Function GbgPic(Division, ColSpanNum)
			 Dim ColStr
			 If Division = "" Then
			   GbgPic = ""
			 Else
			   If ColSpanNum>=2 Then ColStr=" colspan=" & ColSpanNum 
			   GbgPic = "<tr><td Height=1"  & ColStr & " background=" & Division & " ></td></tr>"
			 End If
		End Function

		Function GCssID(ID)
		  If ID="" Then GCssID="" Else GCssID=" id=""" & ID & """"
		End Function  

		Function GCss(CssName)
			 If CssName = "" Then  GCss = "" Else GCss = " class=""" & CssName & """"
		End Function

		Function GNavi(NaviType, NaviStr)
		 If CStr(NaviType) = "0" Then
			 If NaviStr = "" Then GNavi = "" Else GNavi = NaviStr
		 ElseIf CStr(NaviType) = "1" Then
		     If NaviStr <> "" Then  GNavi = "<img src=""" & NaviStr & """ border=""0""/>"
		 Else
			 GNavi = ""
		 End If
		End Function

		Function GDateStr(UpdateTime,DateForm,DateAlign,DateCss,ByVal ColNumber,ByRef ColSpanNum)
			   If CStr(DateForm) <> "0" And CStr("DateForm") <> "" Then
					Dim NowDate,NowFormatStr
					NowDate=Now
					If (Year(NowDate) & Month(NowDate) & Day(NowDate)) = (Year(UpdateTime) & Month(UpdateTime) & Day(UpdateTime)) Then
					 NowFormatStr=" style=""color:red"""
					Else
					 NowFormatStr=""
					End If
					If Lcase(DateAlign)="left" Then
						GDateStr="&nbsp;<span " & NowFormatStr & DateCss &">" & DateFormat(UpdateTime, DateForm) & "</span>"
						ColSpanNum = 1
					Else
						GDateStr="</td><td width=""*"" nowrap align=" & DateAlign & "><span " & NowFormatStr & DateCss & " >" & DateFormat(UpdateTime, DateForm) & "</span>&nbsp;"
						ColSpanNum = 2
					End If
				Else
				GDateStr="":ColSpanNum = 1
				End If
				If ColNumber>=2 Then ColSpanNum = ColNumber
		End Function


		Function GDDateStr(UpdateTime,DateForm,DateCss)
			   If CStr(DateForm) <> "0" And CStr("DateForm") <> "" Then
					Dim NowDate,NowFormatStr
					NowDate=Now
					If (Year(NowDate) & Month(NowDate) & Day(NowDate)) = (Year(UpdateTime) & Month(UpdateTime) & Day(UpdateTime)) Then
					 NowFormatStr=" style=""color:red"""
					Else
					 NowFormatStr=""
					End If
				GDDateStr="&nbsp;<span" & NowFormatStr & DateCss &">" & DateFormat(UpdateTime, DateForm)& "</span>"
			  Else
				GDDateStr=""
			  End If
		End Function

		Function DateFormat(DateStr, Types)
			Dim DateString
			If IsDate(DateStr) = False Then
				DateFormat = "":Exit Function
			End If
			Select Case CStr(Types)
			  Case "0"
				DateFormat = ""
				Exit Function
			  Case 1,21,41
			      DateString=Year(DateStr) & "-" & Right("0" & Month(DateStr), 2) & "-" & Right("0" & Day(DateStr), 2)
			      if Types=21 then
				   DateString = "(" & DateString &")"
				  elseIf Types=41 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 2,22,42
			      DateString=Year(DateStr) & "." & Right("0" & Month(DateStr), 2) & "." & Right("0" & Day(DateStr), 2)
			      if Types=22 then
				   DateString = "(" & DateString &")"
				  elseIf Types=42 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 3,23,43
			      DateString=Year(DateStr) & "/" & Right("0" & Month(DateStr), 2) & "/" & Right("0" & Day(DateStr), 2)
			      if Types=23 then
				   DateString = "(" & DateString &")"
				  elseIf Types=43 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 4,24,44
			      DateString=Right("0" & Month(DateStr), 2) & "/" & Right("0" & Day(DateStr), 2) & "/" & Year(DateStr)
			      if Types=24 then
				   DateString = "(" & DateString &")"
				  elseIf Types=44 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 5,25,45
				  DateString = Year(DateStr) & "年" & Right("0" & Month(DateStr), 2) & "月"
			      if Types=25 then
				   DateString = "(" & DateString &")"
				  elseIf Types=45 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 6,26,46
				  DateString = Year(DateStr) & "年" & Right("0" & Month(DateStr), 2) & "月" & Right("0" & Day(DateStr), 2) & "日"
			      if Types=26 then
				   DateString = "(" & DateString &")"
				  elseIf Types=46 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 7,27,47
				  DateString = Right("0" & Month(DateStr), 2) & "." & Right("0" & Day(DateStr), 2) & "." & Year(DateStr)
			      if Types=27 then
				   DateString = "(" & DateString &")"
				  elseIf Types=47 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 8,28,48
				  DateString = Right("0" & Month(DateStr), 2) & "-" & Right("0" & Day(DateStr), 2) & "-" & Year(DateStr)
				  if Types=28 then
				   DateString = "(" & DateString &")"
				  elseIf Types=48 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 9,29,49
				  DateString = Right("0" & Month(DateStr), 2) & "/" & Right("0" & Day(DateStr), 2)
				  if Types=29 then
				   DateString = "(" & DateString &")"
				  elseIf Types=49 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 10,30,50
				  DateString = Right("0" & Month(DateStr), 2) & "." & Right("0" & Day(DateStr), 2)
			      if Types=30 then
				   DateString = "(" & DateString &")"
				  elseIf Types=50 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 11,31,51
				  DateString = Right("0" & Month(DateStr), 2) & "月" & Right("0" & Day(DateStr), 2) & "日"
			      if Types=31 then
				   DateString = "(" & DateString &")"
				  elseIf Types=51 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 12,32,52
				  DateString = Right("0" & Day(DateStr), 2) & "日" & Right("0" & Hour(DateStr), 2) & "时"
				  if Types=32 then
				   DateString = "(" & DateString &")"
				  elseIf Types=52 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 13,33,53
				  DateString = Right("0" & Day(DateStr), 2) & "日" & Right("0" & Hour(DateStr), 2) & "点"
			      if Types=33 then
				   DateString = "(" & DateString &")"
				  elseIf Types=53 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 14,34,54
				  DateString = Right("0" & Hour(DateStr), 2) & "时" & Minute(DateStr) & "分"
				  if Types=34 then
				   DateString = "(" & DateString &")"
				  elseIf Types=54 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 15,35,55
				  DateString = Right("0" & Hour(DateStr), 2) & ":" & Right("0" & Minute(DateStr), 2)
			      if Types=35 then
				   DateString = "(" & DateString &")"
				  elseIf Types=55 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 16,36,56
				  DateString = Right("0" & Month(DateStr), 2) & "-" & Right("0" & Day(DateStr), 2)
				 if Types=36 then
				   DateString = "(" & DateString &")"
				  elseIf Types=56 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case 17,37,57
				  DateString = Right("0" & Month(DateStr), 2) & "/" & Right("0" & Day(DateStr), 2) &" " &Right("0" & Hour(DateStr), 2)&":"&Right("0" & Minute(DateStr), 2)
				  if Types=37 then
				   DateString = "(" & DateString &")"
				  elseIf Types=57 then
				  	DateString = "[" & DateString &"]"
				  end if
			  Case Else
				  DateString = DateStr
			 End Select
			 DateFormat = DateString
	   End Function



		Function SelectLabelParameter(Content, MatchStr)
			Dim regEx, Matches, Match,N
			Set regEx = New RegExp
			regEx.Pattern = MatchStr & "[^{\=}]*}"
			regEx.IgnoreCase = True
			regEx.Global = True
			Set Matches = regEx.Execute(Content)
			SelectLabelParameter = ""
			For Each Match In Matches
				on error resume next
				N=N+1
				IF N=1 Then
				SelectLabelParameter = Match.Value
				Else
				 SelectLabelParameter=SelectLabelParameter & "$$$" & Match.Value
				End IF
			Next
		End Function
		Function FunctionLabelParam(Content, MatchStr)
				FunctionLabelParam = Replace(Content, MatchStr & "(", "")
				FunctionLabelParam = Replace(Replace(FunctionLabelParam, ")}", ""), """", "")
		End Function
End Class
%>