<%
	Function skweb_Navano(html1,ModeID,ClassID,TitleCss,TCss,DiyContent,forcont,sqflist,html2)
	  html1Content=html1
	  If InStr(html1Content, "#fonhtml1") > 0  Then
	       navcfuc=skweb_NavC(ModeID,ClassID,TitleCss,TCss,DiyContent,forcont,sqflist,html2)
	       html1Content = Replace(html1Content, "#fonhtml1",navcfuc)
		   if navcfuc="" then
		   skweb_Navano = ""
		   else
		   skweb_Navano = html1Content
		   end if
	   else
		   skweb_Navano = html1Content
	   end if
	   End Function
	
	Function skweb_NavC(ModeID,ClassID,TitleCss,TCss,DiyContent,forcont,sqflist,html2)
			If ModeID ="8888" Then '全部
				  SqlStr = "Select ClassID,ClasseName,ClassName,ParentID,urlname From Class_skweb Where  ParentID='0' AND dh=1  Order by Orderid asc,ID asc"
				  
			ElseIf ModeID ="999" Then  '当前通用
				If InStr(Application(SkcmsCookies & "ClassID"),",") > 0 Then
				    SqlStr = "Select ClassID,ClasseName,ClassName,urlname From Class_skweb  Where  ClassID IN ('" & Application(SkcmsCookies & "ClassID") & "')  AND dh=1  Order by Orderid asc,ID asc"
				Else
				    SqlStr = "Select ClassID,ClasseName,ClassName,urlname From Class_skweb  Where   ParentID = '" & Application(SkcmsCookies & "ClassID") & "'  AND dh=1   Order by Orderid asc,ID asc"
				End If 
				  
			ElseIf  ModeID="0"  Then '输出指定栏目
			If InStr(ClassID,",") > 0 Then
				    SqlStr = "Select ClassID,ClasseName,ClassName,urlname From Class_skweb  Where  ClassID IN (" & ClassID & ")  AND dh=1  Order by Orderid asc,ID asc"
				Else
				    if sqflist="0" then
				    SqlStr = "Select ClassID,ClasseName,ClassName,urlname From Class_skweb  Where   ParentID = '" & ClassID & "'  AND dh=1   Order by Orderid asc,ID asc"
					else
				    SqlStr = "Select ClassID,ClasseName,ClassName,urlname From Class_skweb  Where   ClassID  = '" & ClassID & "'  AND dh=1   Order by Orderid asc,ID asc"					
					end if
					
				End If 
				
			Else
	  SqlStr = "Select ClassID,ClasseName,ClassName,urlname From Class_skweb where ModeID="&ModeID&" AND ParentID='0' AND dh=1  Order by Orderid asc,ID asc"
			End If 
	
			 Set RS=skweboa.SK_axe(SqlStr)
 			 If RS.EOF Then	 
			  
				If  ModeID ="999" And skweboa.skCMSlist(Application(SkcmsCookies & "ClassID"),11)<>"0" Then 
				  SqlStr = "Select ClassID,ClasseName,ClassName,urlname From Class_skweb  Where  ParentID='" & skweboa.skCMSlist(Application(SkcmsCookies & "ClassID"),11) & "' AND dh=1     Order by Orderid asc,ID asc"
				  Set RS=skweboa.SK_axe(SqlStr)
				  If Rs.eof Then GetClassNavigation="":RS.Close:Set RS=Nothing:Exit Function
				Else 
					GetClassNavigation="":RS.Close:Set RS=Nothing:Exit Function
				End If 
			End If 
			 	
			
  			 skwebSQL=RS.GetRows(-1):Set RS = Nothing
			 Dim skwebNum:skwebNum=Ubound(skwebSQL,2)
			 Dim ModID
			 Dim J:J=1
				 For K=0 To skwebNum
						DiyContents=DiyContent
						If InStr(DiyContents, "#ClassName") > 0  Then
						   DiyContents = Replace(DiyContents, "#ClassName",skweboa.skCMSlist(skwebSQL(0,N),2))
						End if

						If InStr(DiyContents, "#Classtitle") > 0  Then
						   DiyContents = Replace(DiyContents, "#Classtitle",skweboa.skCMSlist(skwebSQL(0,N),25))
						End if
						
						If InStr(DiyContents, "#Css") > 0  Then
'skweboa.SK_FoundInArr(Replace(skweboa.SK_CID_temp(skwebSQL(0,N)),"'",""),CStr(Application(SkcmsCookies & "classid")),",")=True   无限下级关系  
If  CStr(Application(SkcmsCookies & "classid"))=skwebSQL(0,N) or   CStr(skweboa.skCMSlist(Application(SkcmsCookies & "classid"),11))=skwebSQL(0,N)      And Trim(TitleCss)<>"" Then 
								 DiyContents = Replace(DiyContents, "#Css",TitleCss)
							Else 
								 DiyContents = Replace(DiyContents, "#Css",TCss)
							End If 
						End if
 						If InStr(DiyContents, "#AutoID") > 0  Then
						   DiyContents = Replace(DiyContents, "#AutoID",J)
						End if
 						If InStr(DiyContents, "#ModID") > 0  Then
 							If  N Mod 2 =0 Then ModID=0 Else ModID=1
						    DiyContents = Replace(DiyContents, "#ModID",ModID)
						End If
 						If InStr(DiyContents, "#Path") > 0  Then
						   DiyContents = Replace(DiyContents, "#Path",skweboa.SK_Root_directory)
						End if
 						 
  						If InStr(DiyContents, "#ClassSeo") > 0  Then
						   DiyContents = Replace(DiyContents, "#ClassSeo",skweboa.skCMSlist(skwebSQL(0,N),25))
						End if
  						If InStr(DiyContents, "#Classimg") > 0  Then
						   DiyContents = Replace(DiyContents, "#Classimg",skweboa.skCMSlist(skwebSQL(0,N),24))
						End if
  						If InStr(DiyContents, "#Classico") > 0  Then
						   DiyContents = Replace(DiyContents, "#Classico",skweboa.skCMSlist(skwebSQL(0,N),28))
						End if						
  						If InStr(DiyContents, "#Classinfo") > 0  Then
						   DiyContents = Replace(DiyContents, "#Classinfo",skweboa.skCMSlist(skwebSQL(0,N),9))
						End if
 
						If InStr(DiyContents, "#ClassLink") > 0  Then
						   DiyContents = Replace(DiyContents, "#ClassLink",skweboa.SK_MYListname(skwebSQL(0,N)))
						End If

						If InStr(DiyContents, "#ClassID") > 0  Then
						   DiyContents = Replace(DiyContents, "#ClassID",skwebSQL(0,N))
						End If
						
						If InStr(DiyContents, "#fornav") > 0  Then
						   DiyContents = Replace(DiyContents, "#fornav",skweb_Navaenzf(skwebSQL(0,N),TitleCss,TCss,forcont,html2))
						End If
					   skweb_NavC = skweb_NavC&DiyContents
 				     N=N+1:j=j+1
 				 Next
		End Function
		
		
		
		
	'无限包裹区	
			Function skweb_Navaenzf(ClassID,TitleCss,TCss,forcont,html2)
	  html2Content=html2
	  If InStr(html2Content, "#fonhtml2") > 0  Then
	        tnav=skweb_twoNav(ClassID,TitleCss,TCss,forcont,html2)
 
'skweboa.SK_FoundInArr(Replace(skweboa.SK_CID_temp(ClassID),"'",""),CStr(Application(SkcmsCookies & "classid")),",")=True   无限下级关系  
 If  CStr(Application(SkcmsCookies & "classid"))=ClassID  or  CStr(skweboa.skCMSlist(Application(SkcmsCookies & "classid"),11))=ClassID      And Trim(TitleCss)<>""  Then 
								 html2Content = Replace(html2Content, "#Css",TitleCss)
							Else 
								 html2Content = Replace(html2Content, "#Css",TCss)
							End If 
			
	       html2Content = Replace(html2Content,"#fonhtml2",tnav)
		   if tnav="" then
		   skweb_Navaenzf = ""
		   else
		   skweb_Navaenzf = html2Content
		   end if
		else
		skweb_Navaenzf = ""
	   end if
	   End Function
 
	 	
		
		Function skweb_twoNav(ClassID,TitleCss,TCss,DiyContent,html2)
			 SqlStr = "Select ClassID,ClasseName,ClassName,urlname From Class_skweb  Where   ParentID = '" & ClassID & "'  AND dh=1   Order by Orderid asc,ID asc"
			 Set RS=skweboa.SK_axe(SqlStr)
 			 If RS.EOF Then	 
			  skweb_twoNav =""
			  RS.Close:Set RS=Nothing:Exit Function
			End If 

  			 skwebSQL=RS.GetRows(-1):Set RS = Nothing
			 Dim skwebNum:skwebNum=Ubound(skwebSQL,2)
			 Dim ModID
			 Dim J:J=1
				 For K=0 To skwebNum
						towContents=DiyContent
						If InStr(towContents, "#ClassName") > 0  Then
						   towContents = Replace(towContents, "#ClassName",skweboa.skCMSlist(skwebSQL(0,N),2))
						End if

						If InStr(towContents, "#Classtitle") > 0  Then
						   towContents = Replace(towContents, "#Classtitle",skweboa.skCMSlist(skwebSQL(0,N),25))
						End if
						
						If InStr(towContents, "#Css") > 0  Then
' skweboa.SK_FoundInArr(Replace(skweboa.SK_CID_temp(skwebSQL(0,N)),"'",""),CStr(Application(SkcmsCookies & "classid")),",")=True     无限下级关系
If  CStr(Application(SkcmsCookies & "classid"))=skwebSQL(0,N) or   CStr(skweboa.skCMSlist(Application(SkcmsCookies & "classid"),11))=skwebSQL(0,N)       And Trim(TitleCss)<>"" Then 
								 towContents = Replace(towContents, "#Css",TitleCss)
							Else 
								 towContents = Replace(towContents, "#Css",TCss)
							End If 
						End if

 						If InStr(towContents, "#AutoID") > 0  Then
						   towContents = Replace(towContents, "#AutoID",J)
						End if
 						If InStr(towContents, "#ModID") > 0  Then
 							If  N Mod 2 =0 Then ModID=0 Else ModID=1
						    towContents = Replace(towContents, "#ModID",ModID)
						End If
 						If InStr(towContents, "#Path") > 0  Then
						   towContents = Replace(towContents, "#Path",skweboa.SK_Root_directory)
						End if
 						 
  						If InStr(towContents, "#ClassSeo") > 0  Then
						   towContents = Replace(towContents, "#ClassSeo",skweboa.skCMSlist(skwebSQL(0,N),25))
						End if
  						If InStr(towContents, "#Classimg") > 0  Then
						   towContents = Replace(towContents, "#Classimg",skweboa.skCMSlist(skwebSQL(0,N),24))
						End if
  						If InStr(towContents, "#Classico") > 0  Then
						   towContents = Replace(towContents, "#Classico",skweboa.skCMSlist(skwebSQL(0,N),28))
						End if						
  						If InStr(towContents, "#Classinfo") > 0  Then
						   towContents = Replace(towContents, "#Classinfo",skweboa.skCMSlist(skwebSQL(0,N),9))
						End if
 
						If InStr(towContents, "#ClassLink") > 0  Then
						   towContents = Replace(towContents, "#ClassLink",skweboa.SK_MYListname(skwebSQL(0,N)))
						End If

						If InStr(towContents, "#ClassID") > 0  Then
						   towContents = Replace(towContents, "#ClassID",skwebSQL(0,N))
						End If
						
						If InStr(towContents, "#fornav") > 0  Then
						   towContents = Replace(towContents, "#fornav",skweb_Navaenzf(skwebSQL(0,N),TitleCss,TCss,DiyContent,html2))
						End If
					   skweb_twoNav =skweb_twoNav&towContents
 				     N=N+1:j=j+1
 				 Next
		End Function
		
		
		
		
		
		
		
		
		

		
		Function sktitle_Nav(ClassID,DiyContent)
			 SqlStr = "Select ClassID,ClasseName,ClassName,urlname From Class_skweb  Where   ClassID = '" & ClassID & "'   Order by Orderid asc,ID asc"
			 Set RS=skweboa.SK_axe(SqlStr)
 			 If RS.EOF Then	 
			  sktitle_Nav =DiyContent
			  RS.Close:Set RS=Nothing:Exit Function
			End If 

  			 skwebSQL=RS.GetRows(-1):Set RS = Nothing
			 Dim skwebNum:skwebNum=Ubound(skwebSQL,2)
			 Dim ModID
						If InStr(DiyContent, "#ClassName") > 0  Then
						   DiyContent = Replace(DiyContent, "#ClassName",skweboa.skCMSlist(skwebSQL(0,N),2))
						End if

						If InStr(DiyContent, "#Classtitle") > 0  Then
						   DiyContent = Replace(DiyContent, "#Classtitle",skweboa.skCMSlist(skwebSQL(0,N),25))
						End if

 						If InStr(DiyContent, "#AutoID") > 0  Then
						   DiyContent = Replace(DiyContent, "#AutoID",J)
						End if
 						If InStr(DiyContent, "#ModID") > 0  Then
 							If  N Mod 2 =0 Then ModID=0 Else ModID=1
						    DiyContent = Replace(DiyContent, "#ModID",ModID)
						End If
 						If InStr(DiyContent, "#Path") > 0  Then
						   DiyContent = Replace(DiyContent, "#Path",skweboa.SK_Root_directory)
						End if
 						 
  						If InStr(DiyContent, "#ClassSeo") > 0  Then
						   DiyContent = Replace(DiyContent, "#ClassSeo",skweboa.skCMSlist(skwebSQL(0,N),25))
						End if
  						If InStr(DiyContent, "#Classimg") > 0  Then
						   DiyContent = Replace(DiyContent, "#Classimg",skweboa.skCMSlist(skwebSQL(0,N),24))
						End if
  						If InStr(DiyContent, "#Classico") > 0  Then
						   DiyContent = Replace(DiyContent, "#Classico",skweboa.skCMSlist(skwebSQL(0,N),28))
						End if						
  						If InStr(DiyContent, "#Classinfo") > 0  Then
						   DiyContent = Replace(DiyContent, "#Classinfo",skweboa.skCMSlist(skwebSQL(0,N),9))
						End if
 
						If InStr(DiyContent, "#ClassLink") > 0  Then
						   DiyContent = Replace(DiyContent, "#ClassLink",skweboa.SK_MYListname(skwebSQL(0,N)))
						End If
						
						
						If InStr(DiyContent, "#ClassID") > 0  Then
						   DiyContent = Replace(DiyContent, "#ClassID",skwebSQL(0,N))
						End If
  
					   sktitle_Nav = sktitle_Nav&DiyContent
 				 
		End Function
		
%>
