<%
'**************************************
'* 最后更新 2013-10-17 by 56770.Kingdge
'* Copyright www.56770.com
'**************************************
Dim Html_page,strwebtitle,description,keywords,showpath,EshopUseType,EshopPicType,PicturePath
Dim Lebi_UserName,Lebi_UserGrade,Lebi_UserKey
EshopUseType = Config_Lebi_Eshop(23)
EshopPicType = Config_Lebi_Eshop(22)
Call HackSql()
Select Case EshopPicType
Case "0" PicturePath = picpath &"/"
Case "1" PicturePath = "Include/Lebi_Readpic.asp?src="
End Select
Lebi_UserId = safereplace(request.cookies(cookiesname&"_user")("user_id"))
If Lebi_UserId = "" Then Lebi_UserId = session(cookiesname&"_user"&"user_id")
Lebi_UserGrade = request.cookies(cookiesname&"_user")("user_grade")
If Lebi_UserGrade = "" Then Lebi_UserGrade = session(cookiesname&"_user"&"user_grade")
Lebi_UserGrade = checknum(Lebi_UserGrade,1)
Lebi_UserKey = safereplace(request.cookies(cookiesname&"_user")("user_key"))
If Lebi_UserKey = "" Then Lebi_UserKey = session(cookiesname&"_user"&"user_key")
Function GetUnionId()
		If safereplace(request("union")) = "" Then
				If session("unionid") = "" Then
						session("unionid") = Request.cookies(cookiesname&"_union")("unionid")
				End If
				GetUnionId = session("unionid")
		Else
				session("unionid") = safereplace(request("union"))
				Response.cookies(cookiesname&"_union")("unionid") = safereplace(request("union"))
				Response.Cookies(cookiesname&"_union").Expires = Date() + 1
				GetUnionId = safereplace(request("union"))
		End If
End Function
GetUnionId()
Function Choice_Language(str)
		Dim App_Choice_Language,DataCount,i,ThisUrl,LangUrl
		strFile = Eshop_url& Style_Folder &"Lebi.BankPayment."
		cache.name="Choice_Language"& LangTxt
		cache.reloadtime= 5000
		If cache.objisempty() Then
                set rs = conn.execute("select l_mark,l_path,l_ico from [Lebi_language] where l_state = 1 order by l_default desc,l_id desc")
				If Not (rs.eof And rs.bof) Then
						cache.value = rs.getrows()
						cache.DataCount = 1
				Else
						cache.value = ""
						cache.DataCount = 0
				End If
				rs.close : Set rs = Nothing
		End If
		App_Choice_Language = cache.value
		DataCount = cache.DataCount
		If show_html="0" Then
				If ISAPI_Rewrite = 1 Then
						ThisUrl = Request.ServerVariables("URL")
				Else
						ThisUrl = Replace(LCase(Request.ServerVariables("URL")),"default.asp","")
				End If
				If Request.ServerVariables("QUERY_STRING")<>"" Then ThisUrl = ThisUrl&"?"& Request.ServerVariables("QUERY_STRING")
		End If
        If DataCount = 1 Then
				For i = 0 To UBound(App_Choice_Language,2)
						rem 静态页 重构URL
						If show_html="1" Then
								Choice_Language = Choice_Language &"<a href="""& Eshop_url & App_Choice_Language(1,i) &""" class=""choicelang""><img src="""& Eshop_url &"images/"& App_Choice_Language(2,i) &""" border=""0"" align=""absmiddle"">"& App_Choice_Language(0,i) &"</a>&nbsp;&nbsp;"
						Else
								If Eshop_url = "/" Then
										If LangPath <> "" Then
												LangUrl = Replace(ThisUrl,"/"& LangPath,"")
										Else
												LangUrl = Replace(ThisUrl,"//","/")
										End If
								Else
										LangUrl = Replace(Replace(ThisUrl,Eshop_url,""),LangPath,"")
								End If
								Choice_Language = Choice_Language &"<a href="""& Replace(Eshop_url & App_Choice_Language(1,i) & LangUrl,"//","/") &""" class=""choicelang""><img src="""& Eshop_url &"images/"& App_Choice_Language(2,i) &""" border=""0"" align=""absmiddle"">"& App_Choice_Language(0,i) &"</a>&nbsp;&nbsp;"
						End If
				Next
		End If
End Function

Function BankPayment()
		Dim strFile,RLoadStyle(3),App_BankPayment,DataCount,i,LoadBankPayment,TmpLoadBankPayment,bank
		strFile = Eshop_url& Style_Folder &"Lebi.BankPayment."
		cache.name="BankPayment"& LangTxt
		cache.reloadtime= 5000
		If cache.objisempty() Then
                set rs = conn.execute("select bank"& LangTxt &",zf_fs"& LangTxt &" from [Lebi_bank] order by id desc")
				If Not (rs.eof And rs.bof) Then
						cache.value = rs.getrows()
						cache.DataCount = 1
				Else
						cache.value = ""
						cache.DataCount = 0
				End If
				rs.close : Set rs = Nothing
		End If
		App_BankPayment = cache.value
		DataCount = cache.DataCount
		RLoadStyle(0) = LoadStyle(strFile&"0.style")
		RLoadStyle(2) = splits(LoadStyle(strFile&"2.style"))
		RLoadStyle(3) = LoadStyle(strFile&"3.style")
		BankPayment = RLoadStyle(0)
        If DataCount = 1 Then
				For i = 0 To UBound(App_BankPayment,2)
					If Not IsNull(Trim(App_BankPayment(0,i))) And Trim(App_BankPayment(0,i)) <> "" Then 
						bank = replace(App_BankPayment(0,i), chr(32), "&nbsp;")
						bank = replace(bank, chr(13), "<br>")
						LoadBankPayment = RLoadStyle(2)
						ReplaceStyle "name",App_BankPayment(1,i),LoadBankPayment
						ReplaceStyle "content",bank,LoadBankPayment
						ReplaceStyle "loop_num",i+1,LoadBankPayment
						TmpLoadBankPayment = TmpLoadBankPayment & LoadBankPayment
					End If 
                Next
		Else
		        RLoadStyle(1) = splits(LoadStyle(strFile&"1.style"))
				TmpLoadBankPayment = RLoadStyle(1)
        End If
        BankPayment = BankPayment & TmpLoadBankPayment & RLoadStyle(3)
End Function

Public Function ProductSearchmenu(str)
		Dim strFile
		strFile = Eshop_url& Style_Folder &"Lebi.ProductSearchmenu."
		If str = 0 Then
                ProductSearchmenu = ProductSearchmenu & splits(LoadStyle(strFile&"0.style"))
		ElseIf str = 1 Then
                ProductSearchmenu = ProductSearchmenu & splits(LoadStyle(strFile&"1.style"))
		End If
End Function

Public Function ProductKeywords(g_topnum)
		g_topnum = checknum(g_topnum,5)
		Dim strFile,RLoadStyle(3),url
		strFile = Eshop_url& Style_Folder &"Lebi.ProductKeywords."
        Dim rs,App_ProductKeywords,DataCount,i,LoadProductKeywords,TmpLoadProductKeywords
		cache.name="ProductKeywords"& LangTxt
		cache.reloadtime= 5000
		If cache.objisempty() Then
                Set rs = conn.execute("select top "&g_topnum&" gjc"& LangTxt &",s_url,s_type from search order by cs DESC")
				If Not (rs.eof And rs.bof) Then
						cache.value = rs.getrows(g_topnum)
						cache.DataCount = 1
				Else
						cache.value = ""
						cache.DataCount = 0
				End If
				rs.close : Set rs = Nothing
		End If
		App_ProductKeywords = cache.value
		DataCount = cache.DataCount
		RLoadStyle(0) = LoadStyle(strFile&"0.style")
		RLoadStyle(2) = LoadStyle(strFile&"2.style")
		RLoadStyle(3) = LoadStyle(strFile&"3.style")
		ProductKeywords = RLoadStyle(0)
        If DataCount = 1 Then
			For i = 0 To UBound(App_ProductKeywords,2)
				If Not IsNull(Trim(App_ProductKeywords(0,i))) And Trim(App_ProductKeywords(0,i)) <> "" Then 
					LoadProductKeywords = RLoadStyle(2)
					Select Case App_ProductKeywords(2,i)
						   Case "0"
								Select Case ISAPI_Rewrite
									   Case "0" ReplaceStyle "url",Eshop_url & PagePath(9) &"?product_name="&Urlencode(App_ProductKeywords(0,i))&"&keytype=1",LoadProductKeywords
									   Case "1" ReplaceStyle "url",Eshop_url & LangPath &"search-"&Urlencode(App_ProductKeywords(0,i))&"-1.html",LoadProductKeywords
								End Select
						   Case "1"
							   ReplaceStyle "url",App_ProductKeywords(1,i),LoadProductKeywords
					End Select
					ReplaceStyle "name",App_ProductKeywords(0,i),LoadProductKeywords
					ReplaceStyle "loop_num",i + 1,LoadProductKeywords
					TmpLoadProductKeywords = TmpLoadProductKeywords & LoadProductKeywords
				End If 
			Next
			ProductKeywords = ProductKeywords & TmpLoadProductKeywords
		Else
			RLoadStyle(1) = splits(LoadStyle(strFile&"1.style"))
			ProductKeywords = ProductKeywords & RLoadStyle(1)
	    End If
		ProductKeywords = ProductKeywords & RLoadStyle(3)
End Function

Public Function SiteLogo()
		Dim strFile
		strFile = Eshop_url& Style_Folder &"Lebi.SiteLogo."
        if Trim(Sys_Logo)<>"" Then
		        SiteLogo = splits(LoadStyle(strFile&"0.style"))
		        ReplaceStyle "url",Sys_Logo,SiteLogo
				SiteLogo = SiteLogo
        end If
End Function

Public Function SiteAdv(str)
        SiteAdv = "<script type=""text/javascript"" src="""& Eshop_url &"include/Lebi_Html/SiteAdv.js""></script>"
End Function

Public Function FooterAdv(str)
        FooterAdv = "<script type=""text/javascript"" src="""& Eshop_url &"include/Lebi_Html/FooterAdv.js""></script>"
End function

Public Function Lebi_checkip()
		Dim UserIP,HTTP_X_FORWARDED_FOR,REMOTE_ADDR
		HTTP_X_FORWARDED_FOR = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
		REMOTE_ADDR = Request.ServerVariables("REMOTE_ADDR")
		If HTTP_X_FORWARDED_FOR = "" Then
				UserIP = REMOTE_ADDR
		Else
				UserIP = HTTP_X_FORWARDED_FOR
		End If
        If Trim(acceptIP) <> "" And ChkLoginIP(Trim(acceptIP),UserIP) = True Then
                response.write Replace(Replace(Lebi_word(64),"{userip}",UserIP),"{email}",sys_mail)
				response.End
	    End If
End Function

Public Function SiteBanner(str)
		Dim strFile
		strFile = LoadStyle(Eshop_url& Style_Folder &"Lebi.SiteBanner.0.style")
        SiteBanner = splits(strFile) '"<iframe src="""& Eshop_url &"include/Lebi_Html/SiteBanner.html"" width="""& gg1_w &""" height="""& gg1_h &""" frameborder=""0"" scrolling=""no""></iframe>"
End Function

rem	<-{ 商品调用 测试 2008-3-26 by 56770.WangLei
'str=属性 0 新品 1 热卖 2人气 3 全部
'str1=状态 0 所有 1推荐 2 不推荐
'str2=状态 0 所有 1 特价 2 非特价
'str3=样式 0 文本 1图片
'topnum=调用数量 0 为默认数量
'sortid=分类ID 0为调用所有分类
'cutnumber截取商品名称字节长度
'infolen 简要介绍长度
'..................................
Public Function ProductShow(str,str1,str2,str3,topnum,sortid,cutnumber,infolen)
        Dim strFile,RLoadStyle(10),tmpstr,rs,sql,strorder,strzt,Getrows_ProductShow_simple, i,App_ProductShow,Getrows_ProductShow_error,Getrows_ProductShow,ProductShow_i, showpic_width,showpic_height,stock,tmpstr_cpic,strtitle,sale,LoadProductShow(6),j,DataCount,Body_ProductShow,isPicWidth,isPicHeight,url
        str = checknum(str,0) : str1 = checknum(str1,0) : str2 = checknum(str2,0) : str3 = checknum(str3,0) : sortid = checknum(sortid,0) : cutnumber = checknum(cutnumber,10) : infolen = checknum(infolen,0)
		strzt = ""
        Select Case str
	           Case "0" : strorder = " p_order desc,sj desc,id desc" : strzt = strzt &" and IsNew=1"
	           Case "1" : strorder = " buys desc,id desc"
	           Case "2" : strorder = " views desc,id desc"
			   Case "3" : strorder = " p_order desc,sj desc,id desc"
	    End Select
		If sortid = 0 Then 
				Select Case str1
					   Case "1" : strzt = strzt &" and stj=1"
					   Case "2" : strzt = strzt &" and stj=0"
				End Select
		Else
				Select Case str1
					   Case "1" : strzt = strzt &" and ytj=1"
					   Case "2" : strzt = strzt &" and ytj=0"
				End Select
		End If 
        Select Case str2
	           Case "1" : strzt = strzt &" and cx=1"
	           Case "2" : strzt = strzt &" and cx=0"
	    End Select
		strFile = Eshop_url& Style_Folder &"Lebi.ProductShow."
		RLoadStyle(0) = splits(LoadStyle(strFile&"18.style"))	'购买按钮
		RLoadStyle(1) = splits(LoadStyle(strFile&"21.style"))	'收藏按钮
		RLoadStyle(2) = splits(LoadStyle(strFile&"19.style"))	'预订按钮
		RLoadStyle(3) = splits(LoadStyle(strFile&"20.style"))	'零库存
		If str3 = 0 Then '文本显示
				If linenum = 0 Then linenum = 1
				If topnum = 0 Then
						If str = "3" Then topnum = top4
						If str1 = "1" Then topnum = top6
						If str2 = "1" Then topnum = top8
						If str = "0" Then topnum = top4
						If str = "1" Then topnum = top10
						If str = "2" Then topnum = top9
				End If
				If topnum = 0 Then topnum = 5
				tmpstr = splits(LoadStyle(strFile&"0.style")) ' 主体头(文字)
				If str = "1" Then ' 热卖
						RLoadStyle(4) = splits(LoadStyle(strFile&"5.style"))
				ElseIf str = "2" Then ' 人气
						RLoadStyle(4) = splits(LoadStyle(strFile&"6.style"))
				ElseIf str = "0" Then ' 新品
						RLoadStyle(4) = splits(LoadStyle(strFile&"7.style"))
				ElseIf str1 <> "0" Then '推荐
						RLoadStyle(4) = splits(LoadStyle(strFile&"4.style"))
				ElseIf str2 <> "0" Then '特价
						RLoadStyle(4) = splits(LoadStyle(strFile&"3.style"))
				ElseIf sortid <> "0" Then '分类
						RLoadStyle(4) = splits(LoadStyle(strFile&"2.style"))
				Else
						RLoadStyle(4) = splits(LoadStyle(strFile&"7.style"))
				End If
				cache.name = cookiesname&"ProductShow"& LangTxt &str&str1&str2&str3&topnum&sortid&cutnumber&Lebi_UserGrade
				cache.reloadtime= 5000
				If cache.objisempty() Then
						Sql = "select top "&topnum&" p.id,p.product_name"& LangTxt &",p.sprice,p.cx,p.cprice,p.kucun,p.buys,p.views,(Select top 1 price from [Lebi_product_price] where product_id=p.id and grade_id="&Lebi_UserGrade&") as buyprice,briefed"& LangTxt &",p_filename from [Lebi_product] as p where zhuangtai=1 "& strzt &""
						if sortid<>"0" And IsSqlDataBase ="1" then sql=sql+" and CharIndex(',"& sortid &",',categoryid)>0"
						if sortid<>"0" And IsSqlDataBase ="0" then sql=sql+" and instr(categoryid,',"& sortid &",')>0"
						Sql = sql&" order by "&strorder&""
						set rs = Conn.Execute(sql)
						If Not rs.eof Then
								cache.value = rs.getrows()
								cache.DataCount = 1
						Else
								cache.value = ""
								cache.DataCount = 0
						End If
						rs.close : Set rs = Nothing
				End If
				Getrows_ProductShow_simple = cache.value
				DataCount = cache.DataCount
				If DataCount = 1 Then
						For i = 0 To UBound(Getrows_ProductShow_simple,2)
							If Not IsNull(Trim(Getrows_ProductShow_simple(1,i))) And Trim(Getrows_ProductShow_simple(1,i)) <> "" Then 
								LoadProductShow(0) = RLoadStyle(4)
								stock = Getrows_ProductShow_simple(5,i)
								Select Case show_html
									   Case "0"
											Select Case ISAPI_Rewrite
												   Case "0" ReplaceStyle "url",PagePath(10) &"?id="&Getrows_ProductShow_simple(0,i),LoadProductShow(0)
												   Case "1" ReplaceStyle "url",LangPath &"product-"&Getrows_ProductShow_simple(0,i)&".html",LoadProductShow(0)
											End Select
									   Case "1" ReplaceStyle "url",LangPath & Folder(0) & Getrows_ProductShow_simple(10,i) &".1."& Sys_Ext,LoadProductShow(0)
								End Select
								ReplaceStyle "target",Config_Lebi_Eshop(9),LoadProductShow(0)
								ReplaceStyle "name",Getrows_ProductShow_simple(1,i),LoadProductShow(0)
								ReplaceStyle "cut_name",Cutchar(Trim(Getrows_ProductShow_simple(1,i)),cutnumber),LoadProductShow(0)
								If checkPricePurview(Lebi_UserGrade) Then
										If Getrows_ProductShow_simple(3,i) = 0 Then
												ReplaceStyle "buy_price",formatnumber2(Getrows_ProductShow_simple(8,i)/moneyhl),LoadProductShow(0)
										Else
												ReplaceStyle "buy_price",formatnumber2(Getrows_ProductShow_simple(4,i)/moneyhl),LoadProductShow(0)
										End If
								Else
										ReplaceStyle "buy_price",Lebi_word(66),LoadProductShow(0)
								End If
								ReplaceStyle "buynum",Getrows_ProductShow_simple(6,i),LoadProductShow(0)
								ReplaceStyle "viewnum",Getrows_ProductShow_simple(7,i),LoadProductShow(0)
								ReplaceStyle "listcode",str &""& str1 &""& str2 &""& str3,LoadProductShow(0)
								ReplaceStyle "listcode",str &""& str1 &""& str2 &""& str3,LoadProductShow(0)
								ReplaceStyle "stock",stock,LoadProductShow(0)
								If infolen <> "0" Then
										ReplaceStyle "brief",Cutchar(Trim(Getrows_ProductShow_simple(9,i)),CInt(infolen)),LoadProductShow(0)
								Else
										ReplaceStyle "brief","",LoadProductShow(0)
								End If
								rem	<-{ 购买、预订、零库存 样式 by 56770.WangLei
								If InStr(LoadProductShow(0),"<{@btn_buy}>") > 0 Or InStr(LoadProductShow(0),"{@btn_buy}") > 0 Then
										if stock <= 0 then
												if CInt(getGradePurview(17)) = 1 Then
														tmpstr2=tmpstr2 & RLoadStyle(2)	'预定
												Else
														tmpstr2=tmpstr2 & RLoadStyle(3)	'零库存
												end if
										else
												tmpstr2=tmpstr2 & RLoadStyle(0)	'购买
										end If
										ReplaceStyle "listcode",str &""& str1 &""& str2 &""& str3,tmpstr2
										ReplaceStyle "type","",tmpstr2
										ReplaceStyle "isValid",getGradePurview(0),tmpstr2
										ReplaceStyle "id",Getrows_ProductShow_simple(0,i),tmpstr2
										ReplaceStyle "btn_buy",tmpstr2,LoadProductShow(0)
								End If
								rem	}->
								rem	<-{ 收藏按钮 by 56770.WangLei
								If InStr(LoadProductShow(0),"{@btn_fav}") > 0 Then
										tmpstr2 = RLoadStyle(1)	'收藏按钮
										ReplaceStyle "id",Getrows_ProductShow_simple(0,i),tmpstr2
										ReplaceStyle "name",Urlencode(Getrows_ProductShow_simple(1,i)),tmpstr2
										ReplaceStyle "backurl",Urlencode(geturl()),tmpstr2
										ReplaceStyle "type","",tmpstr2
										ReplaceStyle "btn_fav",tmpstr2,LoadProductShow(0)
								End If
								rem	}->
								ReplaceStyle "loop_num",i+1,LoadProductShow(0)
								tmpstr=tmpstr & LoadProductShow(0)
							End If 
						Next
				Else
						'暂无数据
						tmpstr = tmpstr & splits(LoadStyle(strFile&"1.style"))
				End If
				tmpstr = tmpstr & LoadStyle(strFile&"8.style")
		Else '图片显示
				If topnum = 0 Then
						If str = "3" Then topnum = top4
						If str1 = "1" Then topnum = top6
						If str2 = "1" Then topnum = top8
						If str = "0" Then topnum = top4
						If str = "1" Then topnum = top10
						If str = "2" Then topnum = top9
				End If
				If str = "2" Then ' 人气
						RLoadStyle(4) = splits(LoadStyle(strFile&"15.style"))
				ElseIf str = "0" Then ' 新品
						RLoadStyle(4) = splits(LoadStyle(strFile&"16.style"))
				ElseIf str1 <> "0" Then '推荐
						RLoadStyle(4) = splits(LoadStyle(strFile&"13.style"))
				ElseIf str = "1" Then ' 热卖
						RLoadStyle(4) = splits(LoadStyle(strFile&"14.style"))
				ElseIf str2 <> "0" Then '特价
						RLoadStyle(4) = splits(LoadStyle(strFile&"12.style"))
				ElseIf sortid <> "0" Then '分类
						RLoadStyle(4) = splits(LoadStyle(strFile&"11.style"))
				Else
						RLoadStyle(4) = splits(LoadStyle(strFile&"16.style"))
				End If

				tmpstr = LoadStyle(strFile&"9.style") ' 主体头(图片)
				tmpstr = tmpstr & "<form action=""#"" method=""post"" name=""LEBI_FORMBUY_"& str & str1 & str2 & str3 & topnum &""" id=""LEBI_FORMBUY_"& str & str1 & str2 & str3 & topnum &""">"
				cache.name = cookiesname&"ProductShow"& LangTxt &str&str1&str2&str3&topnum&sortid&cutnumber&Lebi_UserGrade
				cache.reloadtime= 5000
				If cache.objisempty() Then
						sql="select top "&topnum&" p.product_name"& LangTxt &",p.id,p.sprice,p.pic,p.pic_size,p.kucun,p.cpic,p.cx,p.cprice,p.buys,p.views,p.briefed"& LangTxt &",(Select top 1 price from [Lebi_product_price] where product_id=p.id and grade_id="&Lebi_UserGrade&") as buyprice,p.p_filename"
						for j=1 to UserGroupNumber
								sql = sql &",(Select top 1 price from [Lebi_product_price] where product_id=p.id and grade_id="&j&") as buyprice_"&j&""
						Next
						sql = sql &" from [Lebi_product] as p where zhuangtai=1 "& strzt &""
						if sortid<>"0" And IsSqlDataBase ="1" then sql=sql+" and CharIndex(',"& sortid &",',categoryid)>0"
						if sortid<>"0" And IsSqlDataBase ="0" then sql=sql+" and instr(categoryid,',"& sortid &",')>0"
						Sql = sql&" order by "&strorder&""
						set rs = Conn.Execute(sql)
						If Not rs.eof Then
								cache.value = rs.getrows()
								cache.DataCount = 1
						Else
								cache.value = ""
								cache.DataCount = 0
						End If
						rs.close : Set rs = Nothing
				End If
				Getrows_ProductShow = cache.value
				DataCount = cache.DataCount
				If DataCount = 1 Then
						For ProductShow_i = 0 To UBound(Getrows_ProductShow,2)
								Dim tmpstr2 : tmpstr2 = ""
								Body_ProductShow = RLoadStyle(4)
								If InStr(Getrows_ProductShow(6,ProductShow_i),"@@") > 0 Then
										tmpstr_cpic = Split(Getrows_ProductShow(6,ProductShow_i),"@@")(0)
										If tmpstr_cpic = "" Then tmpstr_cpic = Split(Getrows_ProductShow(6,ProductShow_i),"@@")(1)
								Else
										tmpstr_cpic = Getrows_ProductShow(6,ProductShow_i)
								End If
								If show_mouse="0" Then
										strtitle="<img src="& Eshop_url & PicturePath & tmpstr_cpic &" width="&pic_dw&"><br/><b>"&Getrows_ProductShow(0,ProductShow_i)&"</b>"
								End If
								stock = Getrows_ProductShow(5,ProductShow_i)
								Select Case show_html
										Case "0"
											Select Case ISAPI_Rewrite
												   Case "0" ReplaceStyle "url",PagePath(10) &"?id="&Getrows_ProductShow(1,ProductShow_i),Body_ProductShow
												   Case "1" ReplaceStyle "url",LangPath &"product-"&Getrows_ProductShow(1,ProductShow_i) &".html",Body_ProductShow
											End Select
										Case "1" ReplaceStyle "url",LangPath & Folder(0) & Getrows_ProductShow(13,ProductShow_i) &".1."& Sys_Ext,Body_ProductShow
								End Select
								ReplaceStyle "target",Config_Lebi_Eshop(9),Body_ProductShow
								If show_mouse = 0 Then
										ReplaceStyle "onmouse","onMouseover=""javascript:ddrivetip('"&strtitle&"', '#ffffff', '"& pic_dw + 10 &"')"" onMouseout=""hideddrivetip()""",Body_ProductShow
								Else 
										ReplaceStyle "onmouse","",Body_ProductShow
								End If
								ReplaceStyle "name",Getrows_ProductShow(0,ProductShow_i),Body_ProductShow
								ReplaceStyle "cut_name",Cutchar(Trim(Getrows_ProductShow(0,ProductShow_i)),cutnumber),Body_ProductShow
								ReplaceStyle "id",Getrows_ProductShow(1,ProductShow_i),Body_ProductShow
								ReplaceStyle "pic_url",PicturePath & Getrows_ProductShow(3,ProductShow_i),Body_ProductShow
								ReplaceStyle "lazyload_pic_url",Eshop_url & PicturePath & Getrows_ProductShow(3,ProductShow_i),Body_ProductShow
								If infolen <> "0" Then
										ReplaceStyle "brief",Cutchar(Trim(Getrows_ProductShow(11,ProductShow_i)),infolen),Body_ProductShow
								Else
										ReplaceStyle "brief","",Body_ProductShow
								End If
								ReplaceStyle "stock",stock,Body_ProductShow
								for j=1 to UserGroupNumber	'自定义会员组价
										If InStr(Body_ProductShow,"{@grade_price"&j&"}") > 0 Then
												If checkPricePurview(j) Then
														Select Case Getrows_ProductShow(7,ProductShow_i)
															   Case "0" : ReplaceStyle "grade_price"&j,Formatnumber2(Getrows_ProductShow(13+j,ProductShow_i)/moneyhl),Body_ProductShow
															   Case "1" : ReplaceStyle "grade_price"&j,Formatnumber2(Getrows_ProductShow(8,ProductShow_i)/moneyhl),Body_ProductShow
														End Select
												Else
														ReplaceStyle "grade_price"&j,Lebi_word(66),Body_ProductShow
												End If
										End If
								Next
								If checkPricePurview(Lebi_UserGrade) Then
										If Getrows_ProductShow(7,ProductShow_i) = 0 Then
												ReplaceStyle "buy_price",Formatnumber2(Getrows_ProductShow(12,ProductShow_i)/moneyhl),Body_ProductShow
										Else
												ReplaceStyle "buy_price",Formatnumber2(Getrows_ProductShow(8,ProductShow_i)/moneyhl),Body_ProductShow
										End If
								Else
										ReplaceStyle "buy_price",Lebi_word(66),Body_ProductShow
								End If
								ReplaceStyle "market_price",Formatnumber2(Getrows_ProductShow(2,ProductShow_i)/moneyhl),Body_ProductShow'市场价
								ReplaceStyle "sale_price",Formatnumber2(Getrows_ProductShow(8,ProductShow_i)/moneyhl),Body_ProductShow'促销价
								ReplaceStyle "listcode",str &""& str1 &""& str2 &""& str3 &""& topnum,Body_ProductShow
								rem	<-{ 购买、预订、零库存 样式 by 56770.WangLei
								If InStr(Body_ProductShow,"{@btn_buy}") > 0 Then
										if stock <= 0 then
												Select Case CInt(getGradePurview(17))
													   Case "1" : tmpstr2=tmpstr2 & RLoadStyle(2)	'预定
													   Case "0" : tmpstr2=tmpstr2 & RLoadStyle(3)	'零库存
												End Select
										else
												tmpstr2=tmpstr2 & RLoadStyle(0)	'购买
										end If
										ReplaceStyle "listcode",str &""& str1 &""& str2 &""& str3 &""& topnum,tmpstr2
										ReplaceStyle "type","",tmpstr2
										ReplaceStyle "isValid",getGradePurview(0),tmpstr2
										ReplaceStyle "id",Getrows_ProductShow(1,ProductShow_i),tmpstr2
										ReplaceStyle "btn_buy",tmpstr2,Body_ProductShow
								End If
								rem	}->
								rem	<-{ 收藏按钮 by 56770.WangLei
								If InStr(Body_ProductShow,"{@btn_fav}") > 0 Then
										tmpstr2 = RLoadStyle(1)	'收藏按钮
										ReplaceStyle "id",Getrows_ProductShow(1,ProductShow_i),tmpstr2
										ReplaceStyle "name",Urlencode(Getrows_ProductShow(0,ProductShow_i)),tmpstr2
										ReplaceStyle "backurl",Urlencode(geturl()),tmpstr2
										ReplaceStyle "type","",tmpstr2
										ReplaceStyle "btn_fav",tmpstr2,Body_ProductShow
								End If
								rem	}->
								ReplaceStyle "loop_num",ProductShow_i+1,Body_ProductShow
								tmpstr=tmpstr & Body_ProductShow
						Next
				Else
						'暂无数据
						tmpstr = tmpstr & splits(LoadStyle(strFile&"10.style"))
				End If
				tmpstr = tmpstr & "</form>"
				tmpstr = tmpstr & LoadStyle(strFile&"17.style") ' 表格结尾
		End If
		ProductShow = tmpstr
End Function
rem	}->

'..................................
'读取商品分类 特价列表
'..................................
Public Function SaleProductRecom(shownum)
		Dim ors,sql,DataCount,DataList,List_num,i, LoadListStr,strFile,tmpstr,loopstr,stock,SPRecom_url,pic_url
		shownum = checknum(shownum,0) : page = checknum(page,1) : sort_id = checknum(sort_id,0)
		If picwidth = 1 Then picwidth = 0
		If picheight = 1 Then picheight = 0
	    Set ors=new Cls_vbsPage
	    Set ors.Conn=conn
	    With ors
		    .PageSize=shownum
		    .PageName="Page"
		    .DbType="AC"
		    .RecType=0
		    .Pkey="id"
            .Field="id,product_name"& LangTxt &",sprice,cprice,kucun,pic,pic_size,cpic,p_filename"
		    .Table="[Lebi_product]"
			sql = "zhuangtai=1 and cx=1"
            if sort_id<>0 And IsSqlDataBase ="1" Then
                    sql = sql &" and CharIndex(',"& sort_id &",',categoryid)>0"
			End If
	        if sort_id<>0 And IsSqlDataBase ="0" Then
	                sql = sql &" and instr(categoryid,',"& sort_id &",')>0"
			End If
			.Condition=sql
	        .OrderBy="p_order desc,id desc"
	    End With
	    DataCount=ors.RecCount()
	    DataList=ors.ResultSet()
		List_num = 0
		strFile = Eshop_url& Style_Folder &"Lebi.SaleProductRecom."
		SaleProductRecom = LoadStyle(strFile&"0.style")
		LoadListStr = splits(LoadStyle(strFile&"2.style"))
	    If DataCount > 0 Then
		        For i = 0 To Ubound(DataList,2)
						loopstr = LoadListStr
						stock=DataList(4,i)
						Select Case show_html
							   Case "0"
									Select Case ISAPI_Rewrite
										   Case "0" SPRecom_url=PagePath(10) &"?id="& DataList(0,i)
										   Case "1" SPRecom_url=LangPath &"product-"& DataList(0,i)	&".html"
									End Select
							   Case "1" : SPRecom_url=Folder(0) & DataList(8,i)&".1."& Sys_Ext
						End Select
						If Trim(DataList(5,i))<>"" Then
							tmpstr = ""
							ReplaceStyle "pic_url",PicturePath & DataList(5,i),loopstr
							If show_mouse = "0" Then
									If InStr(DataList(7,i),"@@") > 0 Then
											pic_url = Split(DataList(7,i),"@@")(0)
											If pic_url = "" Then pic_url = Split(DataList(7,i),"@@")(1)
									Else
											pic_url = DataList(7,i)
									End If
									tmpstr = " onMouseover=""javascript:ddrivetip('<img src="& Eshop_url & PicturePath & pic_url &" width="& pic_dw &">', '#ffffff', '"& pic_dw &"')"" onMouseout=""hideddrivetip()"""
							Else
									tmpstr = ""
							End If
							ReplaceStyle "onmouse",tmpstr,loopstr
						End If
						ReplaceStyle "market_price",Formatnumber2(DataList(2,i)/moneyhl),loopstr
						If checkPricePurview(Lebi_UserGrade) Then
								ReplaceStyle "sale_price",Formatnumber2(DataList(3,i)/moneyhl),loopstr
						Else
								ReplaceStyle "sale_price",Lebi_word(66),loopstr
						End If
						If DataList(2,i) = 0 Then
								ReplaceStyle "discount","-",loopstr
						Else
								ReplaceStyle "discount",Formatnumber2(DataList(3,i)/DataList(2,i)*100) &"%",loopstr
						End If
						ReplaceStyle "name",DataList(1,i),loopstr
						ReplaceStyle "url",SPRecom_url,loopstr
						ReplaceStyle "target",Config_Lebi_Eshop(9),loopstr
						ReplaceStyle "loop_num",i + 1,loopstr
						SaleProductRecom = SaleProductRecom & loopstr
						List_num=List_num+1
				Next
		Else
		        SaleProductRecom = SaleProductRecom & splits(LoadStyle(strFile&"1.style"))
	    End If
	    SaleProductRecom = SaleProductRecom & LoadStyle(strFile&"3.style")
End Function

'..................................
'读取会员登陆框
'styletype 显示样式 0 竖排 1 横排
'..................................
Public Function UserLogin(styletype)
		Dim strFile
		strFile = Eshop_url& Style_Folder &"Lebi.UserLogin."
        Dim rs,sql,UserLogin_user_jifen,UserLogin_user_money,url
        If Not IsNumeric(styletype) Or Isempty(styletype) Then styletype = 0
        Dim LoadUserLogin
        If Html_page="1" Then
                UserLogin = "<script type=""text/javascript"" src="""& Eshop_url & LangPath &"user/Html/UserLogin.asp?styletype="&styletype&"""></script>"
	    Else
                if Lebi_UserId <>"" Then
                        sql="select usermoney,jifen from [Lebi_user] where user_id='"& Lebi_UserId &"'"
	 		            set Rs = conn.execute(sql)
						UserLogin_user_money = rs(0)
			            UserLogin_user_jifen = rs(1)
						rs.close : Set rs = Nothing
						Dim sql1,rs1,re
						sql1="select top 1 id,ifview from [Lebi_message] where ifview = 0 and to_user='"& Lebi_UserId &"' order by id desc"
						set rs1=conn.execute(sql1)
						if not(rs1.eof And rs1.bof) Then
								re=" <a href="& Eshop_url & PagePath(0) &"?action=writemsg&action1=read&msgid="&rs1("id")&" title='"&Lebi_user(16)&"'><img src='"&Eshop_url&"images/m_news.gif' border='0'></a><bgsound src='"&Eshop_url&"images/mail.wav' loop='1'>"
						Else
								re="<img src='"&Eshop_url&"images/m_olds.gif' title='"&Lebi_user(16)&"'>"
						End If
						rs1.close:set rs1=Nothing
						If styletype = 0 Then
								LoadUserLogin = splits(LoadStyle(strFile&"1.style"))
						Else
								LoadUserLogin = splits(LoadStyle(strFile&"3.style"))
						End If
						ReplaceStyle "user_money",formatnumber2(UserLogin_user_money/moneyhl),LoadUserLogin
						ReplaceStyle "grade_ico",getGradePurview(18),LoadUserLogin
						ReplaceStyle "user_score",UserLogin_user_jifen,LoadUserLogin
						ReplaceStyle "user_msg",re,LoadUserLogin
						UserLogin = UserLogin & LoadUserLogin
                Else
						If styletype = 0 Then
								LoadUserLogin = splits(LoadStyle(strFile&"0.style"))
						Else
								LoadUserLogin = splits(LoadStyle(strFile&"2.style"))
						End If
					    ReplaceStyle "isCheckCode",checknum(Config_Lebi_Eshop(12),0),LoadUserLogin
                        UserLogin = UserLogin & LoadUserLogin
                End If
	   End If
End Function

'..................................
'读取会员登陆框欢迎信息
'..................................
Public Function UserLoginHead()
        if Lebi_UserId ="" Then:UserLoginHead=Lebi_word(34):Else:UserLoginHead=Lebi_UserId &"&nbsp;"&Lebi_user(14)&"":end If
End Function

'..................................
'读取购物车
'styletype 显示样式 0 竖排 1 横排
'..................................
Public Function ShoppingCart(styletype)
		styletype = checknum(styletype,0)
		Dim strFile
		strFile = Eshop_url& Style_Folder &"Lebi.ShoppingCart."
		If styletype = 0 Then
				ShoppingCart = splits(LoadStyle(strFile&"0.style"))
		ElseIf styletype = 1 Then
				ShoppingCart = splits(LoadStyle(strFile&"1.style"))
		End If
        ShoppingCart = ShoppingCart &"<script type=""text/javascript"" src="""& Eshop_url &"include/Lebi_Html/ShoppingCart.asp?styletype="& styletype &"&moneyhl="&  moneyhl &"""></script>"
End Function

'..................................
'读取商品品牌
'b_topnum = 调用数量
'b_type = 类型  0 混合 1 图片 2 文本
'b_recom = 推荐  0 否 1 是
'..................................
Public Function BrandShow(b_topnum,b_type,b_recom)
		Dim rs,sql,App_BrandShow,DataCount,i,strFile,RLoadStyle(4),LoadBrandShow,TmpLoadBrandShow,RLoadStyleList,url
		strFile = Eshop_url& Style_Folder &"Lebi.BrandShow."
		b_topnum = checknum(b_topnum,10) : b_type = checknum(b_type,0) : b_recom = checknum(b_recom,0)
		cache.name="BrandShow"& LangTxt & b_topnum & b_type & b_recom
		cache.reloadtime= 5000
		If cache.objisempty() Then
		        sql = "select top "& b_topnum &" brand"& LangTxt &",brand_pic,b_pronum from [Lebi_brand] where 1=1"
		        If b_type = 1 Then sql = sql&" and brand_pic>''"
				If b_recom = 1 Then sql = sql&" and tj = 1"
		        sql = sql&" order by paixu desc,id desc"
                set rs = conn.execute(sql)
				If rs.eof And rs.bof Then
						cache.value = ""
				        cache.DataCount = 0
				Else
                        cache.value = rs.getrows
                        cache.DataCount = 1
				End If
			    rs.close : Set rs = Nothing
		End If
		App_BrandShow = cache.value
		DataCount = cache.DataCount
		RLoadStyle(0) = LoadStyle(strFile&"0.style")
		RLoadStyle(2) = splits(LoadStyle(strFile&"2.style"))
		RLoadStyle(3) = splits(LoadStyle(strFile&"3.style"))
		RLoadStyle(4) = LoadStyle(strFile&"4.style")
		BrandShow = RLoadStyle(0)
		If DataCount = 1 Then
			For i = 0 To UBound(App_BrandShow,2)
				If Not IsNull(Trim(App_BrandShow(0,i))) And Trim(App_BrandShow(0,i)) <> "" Then 
					Select Case b_type
						   Case "0"
							   If Trim(App_BrandShow(1,i)) > "" Then
									   RLoadStyleList = RLoadStyle(2)
							   Else
									   RLoadStyleList = RLoadStyle(3)
							   End If
						   Case "1" RLoadStyleList = RLoadStyle(2)
						   Case "2" RLoadStyleList = RLoadStyle(3)
					End Select
					LoadBrandShow = RLoadStyleList
					ReplaceStyle "url",PagePath(4) &"?brand="&Urlencode(Trim(App_BrandShow(0,i))),LoadBrandShow
					ReplaceStyle "name",Trim(App_BrandShow(0,i)),LoadBrandShow
					ReplaceStyle "pic_src",Trim(App_BrandShow(1,i)),LoadBrandShow
					ReplaceStyle "pic_width",b_width,LoadBrandShow
					ReplaceStyle "pic_height",b_height,LoadBrandShow
					ReplaceStyle "loop_num",i+1,LoadBrandShow
					ReplaceStyle "num",App_BrandShow(2,i),LoadBrandShow
					TmpLoadBrandShow = TmpLoadBrandShow & LoadBrandShow
				End If 
			Next
		Else
			RLoadStyle(1) = splits(LoadStyle(strFile&"1.style"))
			BrandShow = BrandShow & RLoadStyle(1)
		End If
        BrandShow = BrandShow & TmpLoadBrandShow & RLoadStyle(4)
End Function

Function GetUrl() '获取当前URL全部地址 风流才子
        GetUrl="http://"&Request.ServerVariables("SERVER_NAME")&":"&request.ServerVariables("SERVER_PORT")&Request.ServerVariables("URL")
		If Request.ServerVariables("QUERY_STRING")<>"" Then GetURL=GetUrl&"?"& Request.ServerVariables("QUERY_STRING")
End Function

'..................................
'商品分类页状态转换代码部分
'..................................
Function onchangge_righturl(a,b,c,d)
        onchangge_righturl = ""
'		If a = 1 Then
'	            If listtype <> "" Then
'                        onchangge_righturl = onchangge_righturl &"&listtype="& listtype
'	            End If
'		End If
		If b = 1 Then
	            If listprice <> "" Then
                        onchangge_righturl = onchangge_righturl &"&listprice="& listprice
	            End If
	            If listtime <> "" Then
                        onchangge_righturl = onchangge_righturl &"&listtime="& listtime
	            End If
	            If listbuy <> "" Then
                        onchangge_righturl = onchangge_righturl &"&listbuy="& listbuy
	            End If
	            If listview <> "" Then
                        onchangge_righturl = onchangge_righturl &"&listview="& listview
	            End If
		End If
		If c = 1 Then
	            If sle_type <> "" Then
                        onchangge_righturl = onchangge_righturl &"&sle_type="& sle_type
	            End If
		End If
		If d = 1 Then
	            If addtime <> "" Then
                        onchangge_righturl = onchangge_righturl &"&addtime="& addtime
	            End If
	            If retime <> "" Then
                        onchangge_righturl = onchangge_righturl &"&retime="& retime
	            End If
		End If
		If ISAPI_Rewrite = "0" Then 
		If brand <> "" Then
				onchangge_righturl = onchangge_righturl &"&brand="& Urlencode(brand)
		End If
		End If 
		onchangge_righturl = onchangge_righturl
End Function

Public Function ProductListStylechange(showselect)
		Dim listprice_type,listprice_pictype,listprice_word,listtime_type,listtime_pictype,listtime_word,listtype,pagename
		listtype = request.querystring("listtype")
		If show_html = "0" Then
				If InStr(geturl(),"/new") > 0 Or InStr(geturl(),"newproduct.asp") > 0 Then
						If listtype = "" Then listtype = Left(Trim(skin_ys3),1)
						Select Case Config_Lebi_Eshop(16)
							   Case "0" pagename = "newproduct.asp?"
							   Case Else pagename = "new/default.asp?"
						End Select
				End If
				If InStr(geturl(),"/recom/") > 0 Or InStr(geturl(),"recom.asp") > 0 Then
						If listtype = "" Then listtype = Left(Trim(skin_ys2),1)
						Select Case Config_Lebi_Eshop(16)
							   Case "0" pagename = "recom.asp?"
							   Case Else pagename = "recom/default.asp?"
						End Select
				End If
				If InStr(geturl(),"/category/") > 0 Or InStr(geturl(),"showsort.asp") > 0 Then
						If listtype = "" Then listtype = Left(Trim(skin_ys1),1)
						Select Case Config_Lebi_Eshop(16)
							   Case "0" pagename = "showsort.asp?Sort_id="&sort_id&"&"
							   Case Else
									Select Case sort_id
										   Case "0" pagename = "category/0/default.asp?"
										   Case Else
										   pagename = "category/"& sort_foldername &"/default.asp?"
									End Select
						End Select
				End If
				If InStr(geturl(),"/sale/") > 0 Or InStr(geturl(),"tjia.asp") > 0 Then
						If listtype = "" Then listtype = top20
						Select Case Config_Lebi_Eshop(16)
							   Case "0" pagename = "tjia.asp?"
							   Case Else pagename = "sale/default.asp?"
						End Select
				End If
				If InStr(geturl(),"/unite/") > 0 Then
						If listtype = "" Then listtype = top19
						pagename = "unite/default.asp?"
				End If
				If InStr(geturl(),"/brand/") > 0 Then
						If listtype = "" Then listtype = top17
						Select Case Config_Lebi_Eshop(16)
							   Case "0" pagename = "brand/list/default.asp?Sort_id="&sort_id&"&"
							   Case Else pagename = "brand/list/default.asp?Sort_id="&sort_id&"&"
						End Select
				End If
				Select Case listtype
					   Case "0" listtype = "word"
					   Case "1" listtype = "pic"
					   Case "2" listtype = "listpic"
				End Select
		End If
		If request("listprice")="" Then
				listprice_type = "up"
				listprice_pictype = "0"
				listprice_word = Lebi_pro(10)
		ElseIf request("listprice")="up" Then
				listprice_type = "down"
				listprice_pictype = "1"
				listprice_word = Lebi_pro(10)
		ElseIf request("listprice")="down" Then
				listprice_type = "up"
				listprice_pictype = "2"
				listprice_word = Lebi_pro(11)
		End If
		If request("listtime")="" Then
				listtime_type = "up"
				listtime_pictype = "0"
				listtime_word = Lebi_pro(12)
		ElseIf request("listtime")="up" Then
				listtime_type = "down"
				listtime_pictype = "1"
				listtime_word = Lebi_pro(12)
		ElseIf request("listtime")="down" Then
				listtime_type = "up"
				listtime_pictype = "2"
				listtime_word = Lebi_pro(13)
		End If
		If request("listbuy")="" Then
				listbuy_type = "up"
				listbuy_pictype = "0"
				listbuy_word = Lebi_pro(120)
		ElseIf request("listbuy")="up" Then
				listbuy_type = "down"
				listbuy_pictype = "1"
				listbuy_word = Lebi_pro(121)
		ElseIf request("listbuy")="down" Then
				listbuy_type = "up"
				listbuy_pictype = "2"
				listbuy_word = Lebi_pro(120)
		End If
		If request("listview")="" Then
				listview_type = "up"
				listview_pictype = "0"
				listview_word = Lebi_pro(118)
		ElseIf request("listview")="up" Then
				listview_type = "down"
				listview_pictype = "1"
				listview_word = Lebi_pro(119)
		ElseIf request("listview")="down" Then
				listview_type = "up"
				listview_pictype = "2"
				listview_word = Lebi_pro(118)
		End If
		If show_html = 0 Then
		ProductListStylechange="<a href='"& Eshop_url & LangPath & pagename &"listtype=pic"&onchangge_righturl(0,1,1,1)&"' title="&Lebi_pro(9)&"><img src='http://"&Request.ServerVariables("SERVER_NAME")&":"&request.ServerVariables("SERVER_PORT") & Eshop_url & "images/icons/pic_"
		If listtype="pic" Then:ProductListStylechange=ProductListStylechange&"1":Else:ProductListStylechange=ProductListStylechange&"0":end If
		ProductListStylechange=ProductListStylechange&".gif' border='0' align='absmiddle'></a>&nbsp;"
		ProductListStylechange=ProductListStylechange&"<a href='"& Eshop_url & LangPath & pagename &"listtype=listpic"&onchangge_righturl(0,1,1,1)&"' title="&Lebi_pro(8)&"><img src='http://"&Request.ServerVariables("SERVER_NAME")&":"&request.ServerVariables("SERVER_PORT") & Eshop_url & "images/icons/piclist_"
		If listtype="listpic" Then:ProductListStylechange=ProductListStylechange&"1":Else:ProductListStylechange=ProductListStylechange&"0":end If
		ProductListStylechange=ProductListStylechange&".gif' border='0' align='absmiddle'></a>&nbsp;"
		ProductListStylechange=ProductListStylechange&"<a href='"& Eshop_url & LangPath & pagename &"listtype=word"&onchangge_righturl(0,1,1,1)&"' title="&Lebi_pro(7)&"><img src='http://"&Request.ServerVariables("SERVER_NAME")&":"&request.ServerVariables("SERVER_PORT") & Eshop_url & "images/icons/text_"
		If listtype="word" Then:ProductListStylechange=ProductListStylechange&"1":Else:ProductListStylechange=ProductListStylechange&"0":end If
		ProductListStylechange=ProductListStylechange&".gif' border='0' align='absmiddle'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
		ProductListStylechange=ProductListStylechange&"<a href='"& Eshop_url & LangPath & pagename &"listtype="& listtype &"&listprice="& listprice_type &""&onchangge_righturl(1,0,1,1)&"' title="""& listprice_word &"""><img src='http://"&Request.ServerVariables("SERVER_NAME")&":"&request.ServerVariables("SERVER_PORT") & Eshop_url & "images/icons/price_"& listprice_pictype &".gif' border='0' align='absmiddle'></a>&nbsp;"
		ProductListStylechange=ProductListStylechange&"<a href='"& Eshop_url & LangPath & pagename &"listtype="& listtype &"&listview="& listview_type &""&onchangge_righturl(1,0,1,1)&"' title='"& listview_word &"'><img src='http://"&Request.ServerVariables("SERVER_NAME")&":"&request.ServerVariables("SERVER_PORT") & Eshop_url & "images/icons/view_"& listview_pictype &".gif' border='0' align='absmiddle'></a>&nbsp;"
		ProductListStylechange=ProductListStylechange&"<a href='"& Eshop_url & LangPath & pagename &"listtype="& listtype &"&listbuy="& listbuy_type &""&onchangge_righturl(1,0,1,1)&"' title='"& listbuy_word &"'><img src='http://"&Request.ServerVariables("SERVER_NAME")&":"&request.ServerVariables("SERVER_PORT") & Eshop_url & "images/icons/buy_"& listbuy_pictype &".gif' border='0' align='absmiddle'></a>&nbsp;"
		ProductListStylechange=ProductListStylechange&"<a href='"& Eshop_url & LangPath & pagename &"listtype="& listtype &"&listtime="& listtime_type &""&onchangge_righturl(1,0,1,1)&"' title='"& listtime_word &"'><img src='http://"&Request.ServerVariables("SERVER_NAME")&":"&request.ServerVariables("SERVER_PORT") & Eshop_url & "images/icons/time_"& listtime_pictype &".gif' border='0' align='absmiddle'></a>"
		End If
		If showselect = 1 Then
		ProductListStylechange=ProductListStylechange&"&nbsp;<select name='jumpurl' onchange=""javascript:window.location.href=this.options[this.selectedIndex].value"">"
		ProductListStylechange=ProductListStylechange&"<option>"&Lebi_pro(15)&"</option>"
		If show_html = 0 Then
				ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & pagename &""">├ "&Lebi_pro(16)&"</option>"
		Else
				If sort_filename <> "" Then
						ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & Folder(2) & sort_filename &".1."& Sys_Ext &""">├ "&Lebi_pro(16)&"</option>"
				Else
						ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & Folder(2) & sort_id &".1."& Sys_Ext &""">├ "&Lebi_pro(16)&"</option>"
				End If
		End If
		If show_html = 0 Then
				ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & pagename &"listtype="& listtype &"&sle_type=1"""
		Else
				If sort_filename <> "" Then
						ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & Folder(2) & sort_filename &"-1.1."& Sys_Ext &""""
				Else
						ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & Folder(2) & sort_id &"-1.1."& Sys_Ext &""""
				End If
		End If
		If sle_type="1" Then ProductListStylechange=ProductListStylechange&" selected"
		ProductListStylechange=ProductListStylechange&">├ "&Lebi_pro(17)&"</option>"
		If show_html = 0 Then
				ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & pagename &"listtype="& listtype &"&sle_type=2"""
		Else
				If sort_filename <> "" Then
						ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & Folder(2) & sort_filename &"-2.1."& Sys_Ext &""""
				Else
						ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & Folder(2) & sort_id &"-2.1."& Sys_Ext &""""
				End If
		End If
		If sle_type="2" Then ProductListStylechange=ProductListStylechange&" selected"
		ProductListStylechange=ProductListStylechange&">├ "&Lebi_pro(20)&"</option>"
		If show_html = 0 Then
				ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & pagename &"listtype="& listtype &"&sle_type=3"""
		Else
				If sort_filename <> "" Then
						ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & Folder(2) & sort_filename &"-3.1."& Sys_Ext &""""
				Else
						ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & Folder(2) & sort_id &"-3.1."& Sys_Ext &""""
				End If
		End If
		If sle_type="3" Then ProductListStylechange=ProductListStylechange&" selected"
		ProductListStylechange=ProductListStylechange&">├ "&Lebi_pro(18)&"</option>"
		If show_html = 0 Then
				ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & pagename &"listtype="& listtype &"&sle_type=4"""
		Else
				If sort_filename <> "" Then
						ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & Folder(2) & sort_filename &"-4.1."& Sys_Ext &""""
				Else
						ProductListStylechange=ProductListStylechange&"<Option value="""& Eshop_url & LangPath & Folder(2) & sort_id &"-4.1."& Sys_Ext &""""
				End If
		End If
		If sle_type="4" Then ProductListStylechange=ProductListStylechange&" selected"
		ProductListStylechange=ProductListStylechange&">├ "&Lebi_pro(19)&"</option>"
		ProductListStylechange=ProductListStylechange&"</select>"
		End If
		ProductListStylechange = ArchiveHtml(ProductListStylechange)
End Function

'..................................
'读取 顾客商品浏览记录
't_len:标题截取字符长度 ; sum_qty:共多少个
'..................................
Public Function ProductViewHistory(t_len,sum_qty)
		Dim strFile,loop_num,LoadListStr,loadstr,loopstr_pic,loopstr_name,loopstr,tmpstr,i,IdList
		strFile = Eshop_url& Style_Folder &"Lebi.ProductViewHistory."
		t_len = checknum(t_len,12) : sum_qty = checknum(sum_qty,10) : col_qty = checknum(col_qty,1)
		If col_qty = 0 Then col_qty = 1
        If Html_page = "1" Then
		        LoadListStr = "<script type=""text/javascript"" src="""& Eshop_url &"include/Lebi_Html/ProductViewHistory.asp?do=list&topnum="& sum_qty &"&linenum="& col_qty &"&len="& t_len &"&product_type="& product_type &"""></script>"
	    Else
                Dim lsv,sqlv,LoadPVHistory,spUrl
		        sqlv = "select top "&sum_qty&" lsv_product_name,lsv_product_id,product_type,lsv_pic,lsv_id from [Lebi_lsview] where sessionid="& Checknum(request.cookies(cookiesname&"_user")("cookiesid"),GetUserId()) &" order by lsv_sj desc"
		        set lsv = conn.execute(sqlv)
				LoadListStr = LoadListStr & LoadStyle(strFile&"0.style")
				loadstr = splits(LoadStyle(strFile&"1.style"))
				loopstr = "" : i = 0 : IdList = "0"
				do while not lsv.eof
						tmpstr = loadstr
						If lsv("product_type")="unite" Then
								Select Case ISAPI_Rewrite
									   Case "0" spUrl = PagePath(8) &"?id="&lsv("lsv_product_id")
									   Case "1" spUrl = LangPath &"unite_show-"& lsv("lsv_product_id") &".html"
								End Select
						Else
								Select Case ISAPI_Rewrite
									   Case "0" spUrl = PagePath(10) &"?id="&lsv("lsv_product_id")
									   Case "1" spUrl = LangPath &"product-"& lsv("lsv_product_id") &".html"
								End Select
						End If
						ReplaceStyle "url",spUrl,tmpstr
						ReplaceStyle "target",Config_Lebi_Eshop(9),tmpstr
						ReplaceStyle "name",cutchar(lsv("lsv_product_name"),t_len),tmpstr
						ReplaceStyle "pic_url",PicturePath & lsv("lsv_pic"),tmpstr
						loopstr = loopstr & tmpstr
						i = i + 1
						IdList = IdList &","& lsv("lsv_id")
		        		lsv.movenext
		        Loop
		        LoadListStr = LoadListStr & loopstr
		        lsv.close:set lsv = nothing
				LoadListStr = LoadListStr & LoadStyle(strFile&"2.style")
				If i > 15 Then
						conn.execute("Delete from [Lebi_lsview] where sessionid="& Checknum(request.cookies(cookiesname&"_user")("cookiesid"),GetUserId()) &" and lsv_id not in("& IdList &")")
				End If
        End If
		ProductViewHistory = LoadListStr
End Function
'..................................
'读取 会员注册协议
'..................................
Public Function reg_doc()
        Dim rs,sql
        sql = "select info"& LangTxt &" from [Lebi_system]"
	    set Rs = conn.execute(sql)
        reg_doc = rs(0)
	    rs.close:set rs=nothing
End Function

Rem -----------------------------------------------------------------------------------------
Rem 乐彼网上开店软件(56770 Eshop) 版权信息
Rem 以下同样为计算机软件的组成部分，受《软件著作权法》的保护，未经许可不得擅自修改、去除。
Rem 购买版权信息去除服务 http://www.56770.com/service/Remove.html
copy_soft = LoadStyle(Eshop_url&"include/Upgrade.inc")
Function SoftwareCopyright()
		SoftwareCopyright = "<span style=""color:#999; font-size:11px"">Powered by <a href='http://www.56770.com/support/detail/?ref="&urlencode(Request.ServerVariables("SERVER_NAME"))&"' target='_blank' title='56770 Eshop "& copy_soft &"'><span style='color:#0954A6;font-weight:bold; font-size:11px'>56770 EShop</span></a> <span style='font-size:11px;color:#FFA32B;font-weight:bold;'>"& copy_soft &"</span></span>"
'		SoftwareCopyright = SoftwareCopyright &"<p style=""margin:0 auto; padding:5px; color:#999; font-size:11px; text-align:center;"">Processed in {$ FormatNumber((timer()-startime),6,-1) } second(s)</p>"
End Function
Rem -----------------------------------------------------------------------------------------

Public Function sitecopy(yearfrom,yearto)
        If not isnumeric(yearfrom) then yearfrom="2003"
        If not isnumeric(yearto) then yearto="2011"
		sitecopy = LoadStyle(Eshop_url&"include/lebi_data/SiteCopy"& LangTxt &".data")
		If cnzz_state = "1" Then
				sitecopy = sitecopy &" <script src='http://pw.cnzz.com/c.php?id="& cnzz_site_id &"&l=2' language='JavaScript' charset='gb2312'></script>"
		End If
		If Getlicense("56770eshop","key") = "0" Then 
				sitecopy = sitecopy & "&nbsp;&nbsp;"& SoftwareCopyright
		End If 
End Function

rem 专题栏目导航
rem z_type 类型 0 显示小类 1 关闭小类
rem z_style 样式 0 横版 1 竖版
Public Function NewsCategory(z_type,z_style)
		Dim strFile,RLoadStyle(20),LoadNewsCategory,TmpLoadNewsCategory,App_NewsCategory,DataCount, LoadNewsCategory_s,TmpLoadNewsCategory_s,App_NewsCategory_s,DataCount_s,i,News_default_url,sql,sqls, rss,classname,LoadNewsCategory_Father
		strFile = Eshop_url& Style_Folder &"Lebi.NewsCategory."
		z_type = checknum(z_type,0) : z_style = checknum(z_style,0) : classid = checknum(classid,0)
		If z_style = 0 Then
				RLoadStyle(0) = splits(LoadStyle(strFile&"0.style"))
				RLoadStyle(1) = splits(LoadStyle(strFile&"1.style"))
				RLoadStyle(2) = splits(LoadStyle(strFile&"2.style"))
				RLoadStyle(3) = splits(LoadStyle(strFile&"3.style"))
				RLoadStyle(4) = splits(LoadStyle(strFile&"4.style"))
				RLoadStyle(5) = splits(LoadStyle(strFile&"5.style"))
				RLoadStyle(6) = LoadStyle(strFile&"6.style")
				RLoadStyle(7) = LoadStyle(strFile&"7.style")
				NewsCategory = RLoadStyle(0)
				cache.name="NewsCategory"& LangTxt &z_style & z_type
				cache.reloadtime= 5000
				If cache.objisempty() Then
                        sql="select ClassName"& LangTxt &",classid,n_foldername,n_filename from [Lebi_newsclass] where"
						If z_type = 2 Or z_type = 3 Then  
								sql = sql &" parentid = 0"
						Else 
								If classid = 0 Then sql = sql &" parentid = 0"
								If classid <> 0 Then sql = sql &" classid = "& classid &""
						End If 
						sql = sql &" order by b_order desc"
                        set Rs = conn.execute(sql)
						If rs.eof Then
						        cache.value = ""
								cache.DataCount = 0
						Else
						        cache.value = rs.getrows
								cache.DataCount = 1
						End If
						rs.close : Set rs = Nothing
				End If
				App_NewsCategory = cache.value
				DataCount = cache.DataCount
				If DataCount = 1 Then
					For i = 0 To UBound(App_NewsCategory,2)
						If Not IsNull(Trim(App_NewsCategory(0,i))) And Trim(App_NewsCategory(0,i)) <> "" Then 
							If CLng(classid)=App_NewsCategory(1,i) Then
									LoadNewsCategory = RLoadStyle(2)
							Else
									LoadNewsCategory = RLoadStyle(1)
							End If
							Select Case show_html
								   Case "0"
										Select Case ISAPI_Rewrite
											   Case "0"
													Select Case Config_Lebi_Eshop(16)
														   Case "0" : ReplaceStyle "url",LangPath &"zhuanti.asp?action=news_class&classid="& App_NewsCategory(1,i),LoadNewsCategory
														   Case "1" : ReplaceStyle "url",LangPath &"news/"&  App_NewsCategory(2,i) &"/",LoadNewsCategory
														   Case "2" : ReplaceStyle "url",LangPath &"news/"&  App_NewsCategory(2,i) &"/default.asp",LoadNewsCategory
													End Select
											   Case "1" ReplaceStyle "url",LangPath &"news_class-"& App_NewsCategory(1,i) &".html",LoadNewsCategory
										End Select
								   Case "1" : ReplaceStyle "url",LangPath & Folder(1) & App_NewsCategory(3,i) &".1."& Sys_Ext,LoadNewsCategory
							End select
							ReplaceStyle "name",App_NewsCategory(0,i),LoadNewsCategory
							ReplaceStyle "loop_num",i+1,LoadNewsCategory
							TmpLoadNewsCategory = TmpLoadNewsCategory & LoadNewsCategory
						End If 
					Next
					NewsCategory = NewsCategory & TmpLoadNewsCategory
				End If
				NewsCategory = NewsCategory & RLoadStyle(3)
	            If z_type = 0 And classid <> 0 Then
						cache.name="NewsCategory"& LangTxt &z_style&classid
						cache.reloadtime= 5000
						If cache.objisempty() Then
								sql="select parentid,classid,classname"& LangTxt &",(select classname"& LangTxt &" from [Lebi_newsclass] where classid="&classid&") as parentname,n_foldername,n_filename from [Lebi_newsclass] where parentid="&classid&" order by b_order desc"
								set Rs = conn.execute(sql)
								If rs.eof Then
										cache.value = ""
										cache.DataCount = 0
								Else
										cache.value = rs.getrows
										cache.DataCount = 1
								End If
								rs.close : Set rs = Nothing
						End If
						App_NewsCategory_s = cache.value
						DataCount_s = cache.DataCount
						If DataCount_s = 1 Then
								LoadNewsCategory_Father = RLoadStyle(4)
								Set rs = conn.execute("select classname"& LangTxt &",n_foldername,n_filename from [Lebi_newsclass] where classid="&classid&"")
								If Not rs.eof Then
								ReplaceStyle "name",rs(0),LoadNewsCategory_Father
								Select Case show_html
									   Case "0"
											Select Case ISAPI_Rewrite
												   Case "0"
														Select Case Config_Lebi_Eshop(16)
															   Case "0" : ReplaceStyle "url",LangPath &"zhuanti.asp?action=news_class&classid="& classid,LoadNewsCategory_Father
															   Case "1" : ReplaceStyle "url",LangPath &"news/class/"& rs(1) &"/",LoadNewsCategory_Father
															   Case "2" : ReplaceStyle "url",LangPath &"news/class/"& rs(1) &"/default.asp",LoadNewsCategory_Father
														End Select
												   Case "1" ReplaceStyle "url",LangPath &"news_class-"& classid &".html",LoadNewsCategory_Father
											End Select
									   Case "1" : ReplaceStyle "url",LangPath & Folder(1) & rs(2) &".1."& Sys_Ext,LoadNewsCategory_Father
								End select
								End If
								rs.close : Set rs = Nothing
								NewsCategory = NewsCategory & LoadNewsCategory_Father
						        For i = 0 To UBound(App_NewsCategory_s,2)
									If Not IsNull(Trim(App_NewsCategory_s(2,i))) And Trim(App_NewsCategory_s(2,i)) <> "" Then 
										LoadNewsCategory_s = RLoadStyle(5)
										Select Case show_html
											   Case "0"
													Select Case ISAPI_Rewrite
														   Case "0"
																Select Case Config_Lebi_Eshop(16)
																	   Case "0" : ReplaceStyle "url",LangPath &"zhuanti.asp?action=news_class&classid="& App_NewsCategory_s(1,i),LoadNewsCategory_s
																	   Case "1" : ReplaceStyle "url",LangPath &"news/"& App_NewsCategory_s(4,i) &"/",LoadNewsCategory_s
																	   Case "2" : ReplaceStyle "url",LangPath &"news/"& App_NewsCategory_s(4,i) &"/default.asp",LoadNewsCategory_s
																End Select
														   Case "1" ReplaceStyle "url",LangPath &"news_class-"& App_NewsCategory_s(1,i) &".html",LoadNewsCategory_s
													End Select
											   Case "1" : ReplaceStyle "url",LangPath & Folder(1) & App_NewsCategory_s(5,i) &".1."& Sys_Ext,LoadNewsCategory_s
										End select
'										If CLng(classid)=App_NewsCategory_s(1,i) or CLng(Arrval(arrpid,loop_i-1))=App_NewsCategory_s(1,i) Then
'												ReplaceStyle "name","◆ "&App_NewsCategory_s(2,i),LoadNewsCategory_s
'										Else
												ReplaceStyle "name",App_NewsCategory_s(2,i),LoadNewsCategory_s
'										End If
										ReplaceStyle "loop_num",i+1,LoadNewsCategory_s
										TmpLoadNewsCategory_s = TmpLoadNewsCategory_s & LoadNewsCategory_s
									End If 
						        Next
								NewsCategory = NewsCategory & TmpLoadNewsCategory_s & RLoadStyle(6)
                        End If
                End If
				NewsCategory = NewsCategory & RLoadStyle(7)
		Else
				RLoadStyle(8) = LoadStyle(strFile&"8.style")
				RLoadStyle(9) = splits(LoadStyle(strFile&"9.style"))
				RLoadStyle(10) = splits(LoadStyle(strFile&"10.style"))
				RLoadStyle(11) = splits(LoadStyle(strFile&"11.style"))
				RLoadStyle(12) = splits(LoadStyle(strFile&"12.style"))
				RLoadStyle(13) = splits(LoadStyle(strFile&"13.style"))
				RLoadStyle(14) = LoadStyle(strFile&"14.style")
				NewsCategory = RLoadStyle(8)
				cache.name="NewsCategory"& LangTxt & z_style & z_type & classid
				cache.reloadtime= 5000
				If cache.objisempty() Then
                        sql="select classname"& LangTxt &",classid,n_foldername,n_filename from [Lebi_newsclass] where"
						If z_type = 2 Or z_type = 3 Then  
							sql = sql &" ParentID=0"
						Else 
							If classid = 0 Then sql = sql &" ParentID=0"
							If classid <> 0 Then sql = sql &" classid="&classid&""
						End If 
						sql = sql &" order by B_order desc"
                        set Rs = conn.execute(sql)
						If rs.eof Then
						        cache.value = ""
								cache.DataCount = 0
						Else
						        cache.value = rs.getrows
								cache.DataCount = 1
						End If
						rs.close : Set rs = Nothing
				End If
				App_NewsCategory = cache.value
				DataCount = cache.DataCount
				If DataCount = 1 Then
						For i = 0 To UBound(App_NewsCategory,2)
							If Not IsNull(Trim(App_NewsCategory(0,i))) And Trim(App_NewsCategory(0,i)) <> "" Then 
						        LoadNewsCategory = RLoadStyle(9)
								Select Case show_html
									   Case "0"
											Select Case ISAPI_Rewrite
												   Case "0"
														Select Case Config_Lebi_Eshop(16)
															   Case "0" : ReplaceStyle "url",LangPath &"zhuanti.asp?action=news_class&classid="& App_NewsCategory(1,i),LoadNewsCategory
															   Case "1" : ReplaceStyle "url",LangPath &"news/"& App_NewsCategory(2,i) &"/",LoadNewsCategory
															   Case "2" : ReplaceStyle "url",LangPath &"news/"& App_NewsCategory(2,i) &"/default.asp",LoadNewsCategory
														End Select
												   Case "1" ReplaceStyle "url",LangPath &"news_class-"& App_NewsCategory(1,i) &".html",LoadNewsCategory
											End Select
									   Case "1" : ReplaceStyle "url",LangPath & Folder(1) & App_NewsCategory(3,i) &".1."& Sys_Ext,LoadNewsCategory
								End select
								ReplaceStyle "name",App_NewsCategory(0,i),LoadNewsCategory
								ReplaceStyle "loop_num",i + 1,LoadNewsCategory
								If z_type = 0 Or z_type = 2 Then
										cache.name="NewsCategory_s"& LangTxt &z_style&App_NewsCategory(1,i)
										cache.reloadtime= 5000
										If cache.objisempty() Then
										        sql="select classid,classname"& LangTxt &",n_foldername,n_filename from [Lebi_newsclass] where parentid="&App_NewsCategory(1,i)&" order by b_order desc"
										        set Rs = conn.execute(sql)
												If rs.eof Then
														cache.value = ""
														cache.DataCount = 0
												Else
														cache.value = rs.getrows
														cache.DataCount = 1
												End If
												rs.close : Set rs = Nothing
										End If
										App_NewsCategory_s = cache.value
										DataCount_s = cache.DataCount
										If DataCount_s = 1 Then
											LoadNewsCategory = LoadNewsCategory & RLoadStyle(11)
											For i_s = 0 To UBound(App_NewsCategory_s,2)
												If Not IsNull(Trim(App_NewsCategory_s(1,i_s))) And Trim(App_NewsCategory_s(1,i_s)) <> "" Then 
													LoadNewsCategory_s = RLoadStyle(12)
													Select Case show_html
														   Case "0"
																Select Case ISAPI_Rewrite
																	   Case "0"
																			Select Case Config_Lebi_Eshop(16)
																				   Case "0" : ReplaceStyle "url",LangPath &"zhuanti.asp?action=news_class&classid="& App_NewsCategory_s(0,i_s),LoadNewsCategory_s
																				   Case "1" : ReplaceStyle "url",LangPath &"news/"& App_NewsCategory_s(2,i_s) &"/",LoadNewsCategory_s
																				   Case "2" : ReplaceStyle "url",LangPath &"news/"& App_NewsCategory_s(2,i_s) &"/default.asp",LoadNewsCategory_s
																			End Select
																	   Case "1"	ReplaceStyle "url",LangPath &"news_class-"& App_NewsCategory_s(0,i_s) &".html",LoadNewsCategory_s
																End Select
														   Case "1" : ReplaceStyle "url",LangPath & Folder(1) & App_NewsCategory_s(3,i_s) &".1."& Sys_Ext,LoadNewsCategory_s
													End select
													ReplaceStyle "name",App_NewsCategory_s(1,i_s),LoadNewsCategory_s
													ReplaceStyle "loop_num",i_s + 1,LoadNewsCategory_s
													TmpLoadNewsCategory_s = TmpLoadNewsCategory_s & LoadNewsCategory_s
												End If 
											Next
											LoadNewsCategory = LoadNewsCategory & TmpLoadNewsCategory_s & RLoadStyle(13)
											TmpLoadNewsCategory_s = ""
										End If
								End If
								LoadNewsCategory = LoadNewsCategory & RLoadStyle(10)
								TmpLoadNewsCategory = TmpLoadNewsCategory & LoadNewsCategory
							End If 
						Next
				End If
				NewsCategory = NewsCategory & TmpLoadNewsCategory & RLoadStyle(14)
		End If
End Function

'获得父分类
Function ArrayParent(ClassID)
		Dim ParentID,ArrayStr,rsClass
		ParentID=ClassID : ArrayStr=ParentID&"@"
		do while ParentID > 0
		set rsClass=conn.execute("Select ParentID From [Lebi_newsclass] where ClassID = "&ParentID)
		if not(rsClass.eof or rsClass.bof) then
				ParentID = rsClass(0)
		Else
				ParentID = 0
		end if
		rsClass.close:set rsClass=nothing
		If ParentID>0 Then ArrayStr=ArrayStr&ParentID&"@"
		Loop
		If Len(ArrayStr)>1 Then
				ArrayStr=Left(ArrayStr,Len(ArrayStr)-1)
		End If
		ArrayParent=Split(ArrayStr,"@")
End Function

' HelpCategory
'购物帮助栏目
'linenum 每行数量
'是否显示小标题  0 否 1 是
Public Function HelpCategory(showtitle)
        Dim url_aboutus,url_message,sql,url,page,App_HelpCategory,DataCount,i,App_HelpCategory_s, DataCount_s,i_s,strFile,RLoadStyle(4),LoadHelpCategory,TmpHelpCategory,loop_titlelist,LoadHelpCategory_s,TmpLoadHelpCategory_s,TmpLoadHelpCategory,url_s
		showtitle = checknum(showtitle,0)
        Select Case show_html
		       Case "0"
					Select Case ISAPI_Rewrite
						   Case "0"
								Select Case Config_Lebi_Eshop(16)
									   Case "0"
											url_aboutus = LangPath &"help.asp?action=system"
											url_message = LangPath &"help.asp?action=help_class&news_type=0"
									   Case "1"
											url_aboutus = LangPath &"help/system/"
											url_message = LangPath &"help/class/?id=0"
									   Case "2"
											url_aboutus = LangPath &"help/system/default.asp"
											url_message = LangPath &"help/class/default.asp?id=0"
								End Select
						   Case "1"
								url_aboutus = LangPath &"help_system.html"
								url_message = LangPath &"help_class-0.html"
					End Select
			   Case "1"
			        url_aboutus = LangPath & Folder(6) &"about_us."& Sys_Ext
			        url_message = LangPath & Folder(6) &"news.1."& Sys_Ext
		End Select
		strFile = Eshop_url& Style_Folder &"Lebi.HelpCategory."
		cache.name="HelpCategory"& LangTxt
		cache.reloadtime= 5000
		If cache.objisempty() Then
                set Rs = conn.execute("select type_id,newstype"& LangTxt &" from [Lebi_helptype] order by n_order desc")
				If Not (rs.eof And rs.bof) Then
	                    cache.value = rs.getrows
						cache.DataCount = 1
				Else
	                    cache.value = ""
						cache.DataCount = 0
				End If
				rs.close : Set rs = Nothing
		End If
		App_HelpCategory = cache.value
		DataCount = cache.DataCount
		If DataCount = 1 Then
		        RLoadStyle(0) = splits(LoadStyle(strFile&"0.style"))
				RLoadStyle(1) = splits(LoadStyle(strFile&"1.style"))
				RLoadStyle(3) = splits(LoadStyle(strFile&"3.style"))
				RLoadStyle(4) = splits(LoadStyle(strFile&"4.style"))
				HelpCategory = RLoadStyle(0)
				ReplaceStyle "url_aboutus",url_aboutus,HelpCategory
				ReplaceStyle "url_message",url_message,HelpCategory
                For i = 0 To UBound(App_HelpCategory,2)
					If Not IsNull(Trim(App_HelpCategory(1,i))) And Trim(App_HelpCategory(1,i)) <> "" Then 
				        LoadHelpCategory = RLoadStyle(1)
                        Select Case show_html
		                       Case "0"
									Select Case ISAPI_Rewrite
										   Case "0"
												Select Case Config_Lebi_Eshop(16)
													   Case "0" : url = "help.asp?action=help_class&news_type="& App_HelpCategory(0,i)
													   Case "1" : url = "help/class/?id="& App_HelpCategory(0,i)
													   Case "2" : url = "help/class/default.asp?id="& App_HelpCategory(0,i)
												End Select
										   Case "1" url = "help_class-"& App_HelpCategory(0,i) &".html"
									End Select
		                	   Case "1" : url = Folder(6) & App_HelpCategory(0,i) &".1."& Sys_Ext
		                End Select
				        If showtitle = 1 Then
				                loop_titlelist = ""
								RLoadStyle(2) = splits(LoadStyle(strFile&"2.style"))
		                        cache.name="HelpCategory_"& LangTxt & App_HelpCategory(0,i)
		                        cache.reloadtime= 5000
		                        If cache.objisempty() Then
                                        set Rs = conn.execute("select id,subject"& LangTxt &" from [Lebi_help] where type_id="& App_HelpCategory(0,i) &" order by id desc")
				                        If Not (rs.eof And rs.bof) Then
	                                            cache.value = rs.getrows
												cache.DataCount = 1
				                        Else
	                                            cache.value = ""
												cache.DataCount = 0
				                        End If
				                        rs.close : Set rs = Nothing
		                        End If
								App_HelpCategory_s = cache.value
								DataCount_s = cache.DataCount
		                        If DataCount_s = 1 Then
                                        For i_s = 0 To UBound(App_HelpCategory_s,2)
											If (i_s+1) Mod top25 = 0 Then
													page = (i_s+1)/top25
											Else
													page = Split(formatnumber2(((i_s+1)/top25)),".")(0) + 1
											End If
											If Not IsNull(Trim(App_HelpCategory_s(1,i_s))) And Trim(App_HelpCategory_s(1,i_s)) <> "" Then 
												LoadHelpCategory_s = RLoadStyle(2)
								                Select Case show_html
				      				                   Case "0"
															Select Case ISAPI_Rewrite
																   Case "0"
																		Select Case Config_Lebi_Eshop(16)
																			   Case "0" : url_s = "help.asp?action=help_class&news_type="& App_HelpCategory(0,i) &"&page="& page &"#"& App_HelpCategory_s(0,i_s)
																			   Case "1" : url_s = "help/class/?id="& App_HelpCategory(0,i) &"&page="& page &"#"& App_HelpCategory_s(0,i_s)
																			   Case "2" : url_s = "help/class/default.asp?id="& App_HelpCategory(0,i) &"&page="& page &"#"& App_HelpCategory_s(0,i_s)
																		End Select
																   Case "1" url_s = "help_class-"& App_HelpCategory(0,i) &"-"& page &".html#"& App_HelpCategory_s(0,i_s)
															End Select
					  				                   Case "1" : url_s = Folder(6) & App_HelpCategory(0,i) &"."& page &"."& Sys_Ext &"#"& App_HelpCategory_s(0,i_s)
								                End Select
										        ReplaceStyle "url",LangPath & url_s,LoadHelpCategory_s
										        ReplaceStyle "title",App_HelpCategory_s(1,i_s),LoadHelpCategory_s
                                                TmpLoadHelpCategory_s = TmpLoadHelpCategory_s & LoadHelpCategory_s
											End If 
                                        Next
								Else
								        TmpLoadHelpCategory_s = ""
                                End If
				        End If
				        ReplaceStyle "url",LangPath & url,LoadHelpCategory
				        ReplaceStyle "name",App_HelpCategory(1,i),LoadHelpCategory
				        ReplaceStyle "loop_num",i+1,LoadHelpCategory
				        ReplaceStyle "loop_titlelist",,LoadHelpCategory
				        TmpLoadHelpCategory = TmpLoadHelpCategory & LoadHelpCategory & TmpLoadHelpCategory_s & RLoadStyle(3)
						TmpLoadHelpCategory_s = ""
					End If 
				Next
        End If
        HelpCategory = HelpCategory & TmpLoadHelpCategory & RLoadStyle(4)
End Function

Function searchForm()
        Dim loop_brand
        set Rs = conn.execute("select brand"& LangTxt &" from [Lebi_brand] order by paixu desc")
        Do while not rs.eof
		If Not IsNull(Trim(rs(0))) And Trim(rs(0)) <> "" Then 
			loop_brand = loop_brand &"<option value='"&rs(0)&"'>├ "&rs(0)&"</option>"
		End If 
        rs.movenext
        Loop
        rs.Close:set rs=nothing
        searchForm = splits(LoadStyle(Eshop_url& Style_Folder &"Lebi.searchForm.0.style"))
	    ReplaceStyle "loop_brand",loop_brand,searchForm
End Function

Function SiteFooterMenu()
        Dim strFile,RLoadStyle(4),LoadSiteFooterMenu,TmpLoadSiteFooterMenu,LoadSiteFooterMenu_s,TmpLoadSiteFooterMenu_s
		Dim rs,App_SiteFooterMenu,DataCount,i,DataCount_s,App_SiteFooterMenu_s,i_s,father_name,item_name,SiteFooterMenu_loop
		strFile = Eshop_url& Style_Folder &"Lebi.SiteFooterMenu."
		cache.name="SiteFooterMenu"& LangTxt
		cache.reloadtime= 5000
		If cache.objisempty() Then
                set Rs = conn.execute("select f_id,f_url,f_target,f_name"& LangTxt &" from [Lebi_footer] order by f_paixu desc")
				If Not (rs.eof And rs.bof) Then
	                    cache.value = rs.getrows
						cache.DataCount = 1
				Else
	                    cache.value = ""
						cache.DataCount = 0
				End If
				rs.close : Set rs = Nothing
		End If
		App_SiteFooterMenu = cache.value
		DataCount = cache.DataCount
		If DataCount = 1 Then
			RLoadStyle(0) = LoadStyle(strFile&"0.style")
			RLoadStyle(1) = LoadStyle(strFile&"1.style")
			RLoadStyle(2) = LoadStyle(strFile&"2.style")
			RLoadStyle(3) = LoadStyle(strFile&"3.style")
			RLoadStyle(4) = LoadStyle(strFile&"4.style")
			SiteFooterMenu = RLoadStyle(0)
			For i = 0 To UBound(App_SiteFooterMenu,2)
				If Not IsNull(Trim(App_SiteFooterMenu(3,i))) And Trim(App_SiteFooterMenu(3,i)) <> "" Then 
					LoadSiteFooterMenu = RLoadStyle(1)
					If Trim(App_SiteFooterMenu(1,i))<>"" Then
							If InStr(LCase(Trim(App_SiteFooterMenu(1,i))),"http://")>0 Then
									father_name = "<a href="""& Trim(App_SiteFooterMenu(1,i)) &""" target="""& Trim(App_SiteFooterMenu(2,i)) &""">"& trim(App_SiteFooterMenu(3,i)) &"</a>"
							Else
									father_name = "<a href="""& Eshop_url & LangPath & Trim(App_SiteFooterMenu(1,i)) &""" target="""& Trim(App_SiteFooterMenu(2,i)) &""">"&trim(App_SiteFooterMenu(3,i))&"</a>"
							End If
					Else
							father_name = trim(App_SiteFooterMenu(3,i))
					End If
					ReplaceStyle "father_name",father_name,LoadSiteFooterMenu
					ReplaceStyle "loop_num",i + 1,LoadSiteFooterMenu
					Dim rs_s
					cache.name="SiteFooterMenu_"& LangTxt & App_SiteFooterMenu(0,i)
					cache.reloadtime= 5000
					If cache.objisempty() Then
							set Rs_s = conn.execute("select f_s_url,f_s_target,f_s_name"& LangTxt &" from [Lebi_footer_s] where f_id="&App_SiteFooterMenu(0,i)&" order by f_s_paixu desc")
							If Not Rs_s.eof Then
									cache.value = Rs_s.getrows
									cache.DataCount = 1
							Else
									cache.value = ""
									cache.DataCount = 0
							End If
							Rs_s.close : Set Rs_s = Nothing
					End If
					App_SiteFooterMenu_s = cache.value
					DataCount_s = cache.DataCount
					If DataCount_s = 1 Then
						For i_s = 0 To UBound(App_SiteFooterMenu_s,2)
							If Not IsNull(Trim(App_SiteFooterMenu_s(2,i_s))) And Trim(App_SiteFooterMenu_s(2,i_s)) <> "" Then 
								LoadSiteFooterMenu_s = RLoadStyle(2)
								If Trim(App_SiteFooterMenu_s(0,i_s))<>"" Then
										If InStr(LCase(Trim(App_SiteFooterMenu_s(0,i_s))),"http://")>0 Then
												item_name = "<a href="""& Trim(App_SiteFooterMenu_s(0,i_s)) &""" target="""& Trim(App_SiteFooterMenu_s(1,i_s)) &""">"& Trim(App_SiteFooterMenu_s(2,i_s)) &"</a>"
										Else
												item_name = "<a href="""& Eshop_url & LangPath & Trim(App_SiteFooterMenu_s(0,i_s)) &""" target="""& Trim(App_SiteFooterMenu_s(1,i_s)) &""">"& Trim(App_SiteFooterMenu_s(2,i_s)) &"</a>"
										End If
								Else
										item_name = Trim(App_SiteFooterMenu_s(2,i_s))
								End If
								ReplaceStyle "item_name",item_name,LoadSiteFooterMenu_s
								ReplaceStyle "loop_num",i_s + 1,LoadSiteFooterMenu_s
								TmpLoadSiteFooterMenu_s = TmpLoadSiteFooterMenu_s & LoadSiteFooterMenu_s
							End If 
						Next
					End If
					LoadSiteFooterMenu = LoadSiteFooterMenu & TmpLoadSiteFooterMenu_s & RLoadStyle(3)
					TmpLoadSiteFooterMenu_s = ""
					TmpLoadSiteFooterMenu = TmpLoadSiteFooterMenu & LoadSiteFooterMenu
				End If 
			Next
        End If
		SiteFooterMenu = SiteFooterMenu & TmpLoadSiteFooterMenu & RLoadStyle(4)
End Function

Function www56770comlockuserip
        Dim userip
        userip = request.servervariables("remote_addr")
	    If lockip<>"" and ChkLoginIP(lockip,userip)=True Then
                'response.redirect"lock.asp"
		response.End
        End If
End Function

Rem 商品功效导航 2006-2-13 56770.kingdge
Function ProductEffect()
		sort_id = checknum(sort_id,0)
        Dim Getrows_ProductEffect,ProductEffect_i,strFile,url
		strFile = Eshop_url& Style_Folder &"Lebi.ProductEffect."
		cache.name="ProductEffect"& LangTxt
		cache.reloadtime= 5000
		If cache.objisempty() Then
                Set rs = conn.execute("select g_id,g_name"& LangTxt &" from [Lebi_gongxiao] order by g_paixu desc")
				If Not (rs.eof And rs.bof) Then
						cache.value = rs.getrows
				Else
				        cache.value = ""
				End If
				rs.close : Set rs = Nothing
		End If
        If IsArray(cache.value) Then
				If sort_id = 0 Then sort_foldername = 0
                Getrows_ProductEffect = cache.value
				ProductEffect = splits(LoadStyle(strFile&"0.style"))
				For ProductEffect_i = 0 To UBound(Getrows_ProductEffect,2)
					If Not IsNull(Trim(Getrows_ProductEffect(1,ProductEffect_i))) And Trim(Getrows_ProductEffect(1,ProductEffect_i)) <> "" Then 
                        ProductEffect=ProductEffect & splits(LoadStyle(strFile&"1.style"))
						Select Case Config_Lebi_Eshop(16)
							   Case "0" : url = "showsort.asp?sort_id="& sort_id &"&gongxiao="&Getrows_ProductEffect(0,ProductEffect_i)&"&brand="&brand&"&listtype="&listtype&"&listprice="&listprice&"&listtime="&listtime&"&sle_type="&sle_type
							   Case "1" : url = "category/"& sort_foldername &"/?gongxiao="&Getrows_ProductEffect(0,ProductEffect_i)&"&brand="&brand&"&listtype="&listtype&"&listprice="&listprice&"&listtime="&listtime&"&sle_type="&sle_type
							   Case "2" : url = "category/"& sort_foldername &"/default.asp?gongxiao="&Getrows_ProductEffect(0,ProductEffect_i)&"&brand="&brand&"&listtype="&listtype&"&listprice="&listprice&"&listtime="&listtime&"&sle_type="&sle_type
						End Select
						ReplaceStyle "url",LangPath & url,ProductEffect
						ReplaceStyle "name",Getrows_ProductEffect(1,ProductEffect_i),ProductEffect
						ReplaceStyle "loop_num",ProductEffect_i + 1,ProductEffect
					End If 
                Next
				ProductEffect=ProductEffect & splits(LoadStyle(strFile&"2.style"))
	    End If
End Function

Rem 商品适合人群导航 2006-2-13 56770.kingdge
Function ProductPerson()
		p_linenum = checknum(p_linenum,1) : sort_id = checknum(sort_id,0)
        Dim Getrows_ProductPerson,ProductPerson_i,strFile,url
		strFile = Eshop_url& Style_Folder &"Lebi.ProductPerson."
		cache.name="ProductPerson"& LangTxt
		cache.reloadtime= 5000
		If cache.objisempty() Then
                Set rs = conn.execute("select p_id,p_name"& LangTxt &" from [Lebi_person] order by p_paixu desc")
				If Not (rs.eof And rs.bof) Then
						cache.value = rs.getrows
				Else
				        cache.value = ""
				End If
				rs.close : Set rs = Nothing
		End If
        If IsArray(cache.value) Then
                Getrows_ProductPerson = cache.value
				ProductPerson = splits(LoadStyle(strFile&"0.style"))
				For ProductPerson_i = 0 To UBound(Getrows_ProductPerson,2)
					If Not IsNull(Trim(Getrows_ProductPerson(1,ProductPerson_i))) And Trim(Getrows_ProductPerson(1,ProductPerson_i)) <> "" Then 
						If sort_id = 0 Then sort_foldername = 0
                        ProductPerson=ProductPerson & splits(LoadStyle(strFile&"1.style"))
						Select Case Config_Lebi_Eshop(16)
							   Case "0" : url = "showsort.asp?sort_id="& sort_id &"&person="&Getrows_ProductPerson(0,ProductPerson_i)&"&brand="&brand&"&listtype="&listtype&"&listprice="&listprice&"&listtime="&listtime&"&sle_type="&sle_type
							   Case "1" : url = "category/"& sort_foldername &"/?person="&Getrows_ProductPerson(0,ProductPerson_i)&"&brand="&brand&"&listtype="&listtype&"&listprice="&listprice&"&listtime="&listtime&"&sle_type="&sle_type
							   Case "2" : url = "category/"& sort_foldername &"/default.asp?person="&Getrows_ProductPerson(0,ProductPerson_i)&"&brand="&brand&"&listtype="&listtype&"&listprice="&listprice&"&listtime="&listtime&"&sle_type="&sle_type
						End Select
						ReplaceStyle "url",LangPath & url,ProductPerson
						ReplaceStyle "name",Getrows_ProductPerson(1,ProductPerson_i),ProductPerson
						ReplaceStyle "loop_num",ProductPerson_i + 1,ProductPerson
					End If 
                Next
				ProductPerson=ProductPerson & splits(LoadStyle(strFile&"2.style"))
	    End If
End Function

rem 网站随机广告
rem Adway 显示范围 0 首页 1 分类页 2 底层页
rem Adtype_Flash Flash广告显示属性 0 关闭 1 显示
rem Adtype_Pic   图片广告显示属性 0 关闭 1 显示
rem Adtype_Text  文字广告显示属性 0 关闭 1 显示
Function SiteRandAdv(Adway,Adtype_Flash,Adtype_Pic,Adtype_Text)
        SiteRandAdv = "<script type=""text/javascript"" src="""& Eshop_url &"include/Lebi_Html/SiteRandAdv.asp?Adway="& Adway &"&Adtype_Flash="& Adtype_Flash &"&Adtype_Pic="& Adtype_Pic &"&Adtype_Text="& Adtype_Text &"&Sort_id="& sort_id &"""></script>"
End Function

rem 商品Tags
rem topnum 调用数量
Public Function ProductTags(topnum)
		topnum = checknum(topnum,5)
        Dim Getrows_ProductTags,i,strFile,url
		cache.name="ProductTags"& LangTxt
		cache.reloadtime= 5000
		If cache.objisempty() Then
			Set rs = conn.execute("select top "&topnum&" tags_name"& LangTxt &" from [Lebi_tags] order by tags_num desc")
			If Not (rs.eof And rs.bof) Then
				cache.value = rs.getrows(topnum)
			Else
				cache.value = ""
			End If
			rs.close : Set rs = Nothing
		End If
		strFile = Eshop_url& Style_Folder &"Lebi.ProductTags."
        If IsArray(cache.value) Then
			Getrows_ProductTags = cache.value
			ProductTags = splits(LoadStyle(strFile&"0.style"))
			For i = 0 To UBound(Getrows_ProductTags,2)
				If Not IsNull(Trim(Getrows_ProductTags(0,i))) And Trim(Getrows_ProductTags(0,i)) <> "" Then 
					ProductTags = ProductTags & splits(LoadStyle(strFile&"1.style"))
					Select Case ISAPI_Rewrite
						   Case "0" ReplaceStyle "url",PagePath(9) &"?product_name="&Urlencode(Getrows_ProductTags(0,i))&"&keytype=4",ProductTags
						   Case "1" ReplaceStyle "url",LangPath &"search-"&Urlencode(Getrows_ProductTags(0,i))&"-4.html",ProductTags
					End Select
					ReplaceStyle "name",Getrows_ProductTags(0,i),ProductTags
					ReplaceStyle "loop_num",i + 1,ProductTags
				End If 
			Next
			ProductTags = ProductTags & splits(LoadStyle(strFile&"2.style"))
	    End If
End Function

Function sitecount()
		sitecount = "<script type=""text/javascript"" src="""& Eshop_url & LangPath &"count.asp""></script>"
End Function

rem 分类导航
rem s_type 类型 0 关闭下拉菜单 1 显示下拉菜单
rem c_id 分类ID 0 为所有分类
Function ProductCategoryMenu(s_type,c_id)
		s_type = checknum(s_type,0) : c_id = checknum(c_id,0)
        Dim rs,sql,Getrows_ProductCategoryMenu_error,Getrows_ProductCategoryMenu,i,ProductCategoryMenu_url,B,strFile,RLoadStyle(5)
		If s_type = "1" Then
		        ProductCategoryMenu = "<script src="""& Eshop_url &"include/js/down_menu.js""></script>"
		End If
		cache.name="ProductCategoryMenu"& LangTxt &"_"&s_type&"_"&c_id
		cache.reloadtime= 5000
		If cache.objisempty() Then
				sql = "select c_id,c_name"& LangTxt &",c_foldername,c_filename from [Lebi_category] where c_menu = 1 and is_hide=0"
				If c_id = "0" Then sql = sql &" and c_father = 1"
				If c_id <> "0" Then sql = sql &" and c_id = "& c_id &""
				sql = sql &" order by c_order desc"
	            set rs=conn.execute(sql)
	            If rs.eof And rs.bof Then
		  		        Getrows_ProductCategoryMenu_error = 1
		  		Else
		  		        Getrows_ProductCategoryMenu_error = 0
		  				cache.value = rs.getrows
		  		End If
		  		rs.close : Set rs = Nothing
	    End If
		strFile = Eshop_url& Style_Folder &"Lebi.ProductCategoryMenu."
		ProductCategoryMenu = ProductCategoryMenu & LoadStyle(strFile&"0.style")
		If Getrows_ProductCategoryMenu_error = 0 Then
				RLoadStyle(1) = splits(LoadStyle(strFile&"1.style"))
				RLoadStyle(3) = splits(LoadStyle(strFile&"3.style"))
				RLoadStyle(4) = splits(LoadStyle(strFile&"4.style"))
				RLoadStyle(5) = LoadStyle(strFile&"5.style")
                Getrows_ProductCategoryMenu = cache.value
		        For i = 0 To UBound(Getrows_ProductCategoryMenu,2)
					If Not IsNull(Trim(Getrows_ProductCategoryMenu(1,i))) And Trim(Getrows_ProductCategoryMenu(1,i)) <> "" Then 
						Select Case show_html
							   Case "0"
									Select Case ISAPI_Rewrite
										   Case "0"
												Select Case Config_Lebi_Eshop(16)
													   Case "0" : ProductCategoryMenu_url = "showsort.asp?sort_id="& Getrows_ProductCategoryMenu(0,i)
													   Case "1" : ProductCategoryMenu_url = "category/"& Getrows_ProductCategoryMenu(2,i) &"/"
													   Case "2" : ProductCategoryMenu_url = "category/"& Getrows_ProductCategoryMenu(2,i) &"/default.asp"
												End Select
										   Case "1" ProductCategoryMenu_url = "category-"& Getrows_ProductCategoryMenu(2,i) &".html"
									End Select
							   Case "1" : ProductCategoryMenu_url = Folder(2) & Getrows_ProductCategoryMenu(3,i) &".1."& Sys_Ext
						End Select
                        ProductCategoryMenu = ProductCategoryMenu & RLoadStyle(1)
						ReplaceStyle "url",LangPath & ProductCategoryMenu_url,ProductCategoryMenu
						ReplaceStyle "name",Getrows_ProductCategoryMenu(1,i),ProductCategoryMenu
						ReplaceStyle "loop_num",i + 1,ProductCategoryMenu
						If s_type = "1" Then
				                B = B+1
        		                ProductCategoryMenu = ProductCategoryMenu & "&nbsp;"&RLoadStyle(3)
				                ReplaceStyle "loop_num1",b,ProductCategoryMenu
				                ReplaceStyle "loop_num2",b-1,ProductCategoryMenu
								ProductCategoryMenu = ProductCategoryMenu & ProductCategoryMenu_loop (Getrows_ProductCategoryMenu(0,i),B,RLoadStyle(4))
								ProductCategoryMenu = ProductCategoryMenu & RLoadStyle(5)
				                B = B-1
						End If
					End If 
				Next
		End If
		ProductCategoryMenu = ProductCategoryMenu & LoadStyle(strFile&"2.style")
End Function

Function ProductCategoryMenu_loop(a,b,LoadProductCategoryMenu)
        Dim rs1,i,ProductCategoryMenu_loop_url,Getrows_ProductCategoryMenu_loop_error,Getrows_ProductCategoryMenu_loop
		cache.name="ProductCategoryMenu_loop"& LangTxt & a
		cache.reloadtime= 5000
		If cache.objisempty() Then
	            Set Rs1=Conn.Execute("select c_id,c_name"& LangTxt &",c_foldername,c_filename from [Lebi_category] where c_parentid = "& a &" and is_hide=0 order by c_order desc")
	            If rs1.eof And rs1.bof Then
		  		        Getrows_ProductCategoryMenu_loop_error = 1
		  		Else
		  		        Getrows_ProductCategoryMenu_loop_error = 0
		  				cache.value = rs1.getrows
		  		End If
		  		rs1.close : Set rs1 = Nothing
	    End If
		If Getrows_ProductCategoryMenu_loop_error = 0 Then
                Getrows_ProductCategoryMenu_loop = cache.value
		        For i = 0 To UBound(Getrows_ProductCategoryMenu_loop,2)
					If Not IsNull(Trim(Getrows_ProductCategoryMenu_loop(1,i))) And Trim(Getrows_ProductCategoryMenu_loop(1,i)) <> "" Then 
				        Select Case show_html
							   Case "0"
									Select Case ISAPI_Rewrite
										   Case "0"
												Select Case Config_Lebi_Eshop(16)
													   Case "0" : ProductCategoryMenu_loop_url = "showsort.asp?sort_id="& Getrows_ProductCategoryMenu_loop(0,i)
													   Case "1" : ProductCategoryMenu_loop_url = "category/"& Getrows_ProductCategoryMenu_loop(2,i) &"/"
													   Case "2" : ProductCategoryMenu_loop_url = "category/"& Getrows_ProductCategoryMenu_loop(2,i) &"/default.asp"
												End Select
											Case "1" ProductCategoryMenu_loop_url = "category-"& Getrows_ProductCategoryMenu_loop(2,i) &".html"
									End Select
							   Case "1" : ProductCategoryMenu_loop_url = Folder(2) & Getrows_ProductCategoryMenu_loop(3,i) &".1."& Sys_Ext
				        End Select
        		        ProductCategoryMenu_loop = ProductCategoryMenu_loop & LoadProductCategoryMenu
				        ReplaceStyle "loop_num1",b,ProductCategoryMenu_loop
				        ReplaceStyle "url",LangPath & ProductCategoryMenu_loop_url,ProductCategoryMenu_loop
				        ReplaceStyle "name",Getrows_ProductCategoryMenu_loop(1,i),ProductCategoryMenu_loop
						ReplaceStyle "loop_num",i + 1,ProductCategoryMenu_loop
        		        b=b+1
	    		        'ProductCategoryMenu_loop = ProductCategoryMenu_loop & ProductCategoryMenu_loop (rs1("c_id"),b)
        		        b=b-1
					End If 
	    		Next
		End If
End Function

Function SiteQQService()
        Dim rs,rss,QQ_face,strFile,RLoadStyle,App_SiteQQService_error,App_SiteQQService,i,App_SiteQQService_P_error,App_SiteQQService_P,P_i
		If qq_zt=1 Then
		        strFile = Eshop_url& Style_Folder &"Lebi.SiteQQService."
		        cache.name="SiteQQService"& LangTxt
		        cache.reloadtime= 5000
		        If cache.objisempty() Then
	                    Set Rs=Conn.Execute("select q_s_id,q_s_name from [Lebi_qq_sort] where ShowLang like '%"& LangName &"%' order by q_s_paixu desc")
						If Not (rs.eof And rs.bof) Then
								cache.value = rs.getrows()
								cache.DataCount = 1
						Else
								cache.value = ""
								cache.DataCount = 0
						End If
		  		        rs.close : Set rs = Nothing
	            End If
		Else
		  		DataCount = 0
		End If
		App_SiteQQService = cache.value
		DataCount = cache.DataCount
		If DataCount = 1 And qq_zt = 1 Then
			If qq_ys=0 Then
				SiteQQService = LoadStyle(strFile&"6.style")
				For i = 0 To UBound(App_SiteQQService,2)
						SiteQQService=SiteQQService & LoadStyle(strFile&"7.style")
						SiteQQService=SiteQQService & splits(LoadStyle(strFile&"8.style"))
						ReplaceStyle "qq_group",Trim(App_SiteQQService(1,i)),SiteQQService
						cache.name="SiteQQService_P"& App_SiteQQService(0,i) & LangTxt
						cache.reloadtime= 5000
						If cache.objisempty() Then
								Set Rs=Conn.Execute("select q.q_num,q.q_name,t.t_online,t.t_code,t.t_face,t.t_url,t.t_text from [Lebi_qq] as q,[Lebi_qq_type] as t where q.t_id = t.t_id and q.q_s_id = "& checknum(App_SiteQQService(0,i),0) &" and q.ShowLang like '%"& LangName &"%' order by t.t_order desc,q.q_paixu desc")
								If Not (rs.eof And rs.bof) Then
										cache.value = rs.getrows()
										cache.DataCount = 1
								Else
										cache.value = ""
										cache.DataCount = 0
								End If
								rs.close : Set rs = Nothing
						End If
						App_SiteQQService_P = cache.value
						DataCount_P = cache.DataCount
						If DataCount_P = 1 Then
							For P_i = 0 To UBound(App_SiteQQService_P,2)
								If Not IsNull(Trim(App_SiteQQService_P(1,P_i))) And Trim(App_SiteQQService_P(1,P_i)) <> "" Then 
									SiteQQService=SiteQQService & LoadStyle(strFile&"9.style")
									SiteQQService=Replace(SiteQQService,"tencent://message/?Uin={@qq_num}&Site={@qq_name}&Menu=yes","{@url}")
									Select Case App_SiteQQService_P(2,P_i)
									Case "0" QQ_face = Eshop_url & App_SiteQQService_P(4,P_i)
									Case "1" QQ_face = App_SiteQQService_P(3,P_i)
									End Select 
									ReplaceStyle "uid",Trim(App_SiteQQService_P(0,P_i)),QQ_face
									url = Trim(App_SiteQQService_P(5,P_i))
									ReplaceStyle "uid",Trim(App_SiteQQService_P(0,P_i)),url
									ReplaceStyle "uname",Trim(App_SiteQQService_P(1,P_i)),url
									ReplaceStyle "url",url,SiteQQService
									ReplaceStyle "text",Trim(App_SiteQQService_P(6,P_i)),SiteQQService
									ReplaceStyle "uname",Trim(App_SiteQQService_P(1,P_i)),SiteQQService
									ReplaceStyle "uface",QQ_face,SiteQQService
									ReplaceStyle "loop_num",P_i + 1,SiteQQService
									rem <-{兼容老标签 2011-03-15 by 56770.Kingdge
									ReplaceStyle "qq_num",Trim(App_SiteQQService_P(0,P_i)),SiteQQService
									ReplaceStyle "qq_face",QQ_face,SiteQQService
									ReplaceStyle "qq_name",Trim(App_SiteQQService_P(1,P_i)),SiteQQService
									rem }->
								End If 
							Next
						End If
						SiteQQService=SiteQQService & LoadStyle(strFile&"10.style")
				Next
				SiteQQService=SiteQQService & LoadStyle(strFile&"11.style")
			ElseIf qq_ys=1 Then
				rem 更新QQ咨询插件 56770.kingdge 2006-2-12
				SiteQQService = splits(LoadStyle(strFile&"0.style"))
				For i = 0 To UBound(App_SiteQQService,2)
					SiteQQService=SiteQQService & LoadStyle(strFile&"1.style")
					SiteQQService=SiteQQService & splits(LoadStyle(strFile&"2.style"))
					ReplaceStyle "qq_group",Trim(App_SiteQQService(1,i)),SiteQQService
					cache.name="SiteQQService_P"& App_SiteQQService(0,i) & LangTxt
					cache.reloadtime= 5000
					If cache.objisempty() Then
						Set Rs=Conn.Execute("select q.q_num,q.q_name,t.t_online,t.t_code,t.t_face,t.t_url,t.t_text from [Lebi_qq] as q,[Lebi_qq_type] as t where q.t_id = t.t_id and q.q_s_id = "& checknum(App_SiteQQService(0,i),0) &" and q.ShowLang like '%"& LangName &"%' order by t.t_order desc,q.q_paixu desc")
						If Not (rs.eof And rs.bof) Then
								cache.value = rs.getrows()
								cache.DataCount = 1
						Else
								cache.value = ""
								cache.DataCount = 0
						End If
						rs.close : Set rs = Nothing
					End If
					App_SiteQQService_P = cache.value
					DataCount_P = cache.DataCount
					If DataCount_P = 1 Then
						For P_i = 0 To UBound(App_SiteQQService_P,2)
								Select Case App_SiteQQService_P(2,P_i)
								Case "0" QQ_face = Eshop_url & App_SiteQQService_P(4,P_i)
								Case "1" QQ_face = App_SiteQQService_P(3,P_i)
								End Select 
								ReplaceStyle "uid",Trim(App_SiteQQService_P(0,P_i)),QQ_face
								SiteQQService=SiteQQService & LoadStyle(strFile&"3.style")
								SiteQQService=Replace(SiteQQService,"tencent://message/?Uin={@qq_num}&Site={@qq_name}&Menu=yes","{@url}")
								url = Trim(App_SiteQQService_P(5,P_i))
								ReplaceStyle "uid",Trim(App_SiteQQService_P(0,P_i)),url
								ReplaceStyle "uname",Trim(App_SiteQQService_P(1,P_i)),url
								ReplaceStyle "url",url,SiteQQService
								ReplaceStyle "text",Trim(App_SiteQQService_P(6,P_i)),SiteQQService
								ReplaceStyle "uname",Trim(App_SiteQQService_P(1,P_i)),SiteQQService
								ReplaceStyle "uface",QQ_face,SiteQQService
								ReplaceStyle "loop_num",P_i + 1,SiteQQService
								rem <-{兼容老标签 2011-03-15 by 56770.Kingdge
								ReplaceStyle "qq_num",Trim(App_SiteQQService_P(0,P_i)),SiteQQService
								ReplaceStyle "qq_face",QQ_face,SiteQQService
								ReplaceStyle "qq_name",Trim(App_SiteQQService_P(1,P_i)),SiteQQService
								rem }->
						Next
					End If
					SiteQQService=SiteQQService & LoadStyle(strFile&"4.style")
				Next
				SiteQQService=SiteQQService & splits(LoadStyle(strFile&"5.style"))
			End If
        End If
End Function

Sub User_jifen_product_state()  'WangLei 2007-12-20 添加捆绑推荐时间修改
        If IsSqlDataBase = 1 Then
                conn.execute ("update [Lebi_product] set cx=0 where dateadd(d,p_cx_sj,sj)<"&sqlnowstring&" and p_cx_sj<>0 and cx=1")
                conn.execute ("update [Lebi_product] set stj=0 where dateadd(d,p_stj_sj,sj)<"&sqlnowstring&" and p_stj_sj<>0 and stj=1")
                conn.execute ("update [Lebi_product] set ytj=0 where dateadd(d,p_ytj_sj,sj)<"&sqlnowstring&" and p_ytj_sj<>0 and ytj=1")
				conn.execute ("update [Lebi_product_unite] set ytj=0 where dateadd(d,p_ytj_sj,sj)<"&sqlnowstring&" and p_ytj_sj<>0 and ytj=1")
        Else
                conn.execute ("update [Lebi_product] set cx=0 where dateadd('d',p_cx_sj,sj)<"&sqlnowstring&" and p_cx_sj<>0 and cx=1")
                conn.execute ("update [Lebi_product] set stj=0 where dateadd('d',p_stj_sj,sj)<"&sqlnowstring&" and p_stj_sj<>0 and stj=1")
                conn.execute ("update [Lebi_product] set ytj=0 where dateadd('d',p_ytj_sj,sj)<"&sqlnowstring&" and p_ytj_sj<>0 and ytj=1")
				conn.execute ("update [Lebi_product_unite] set ytj=0 where dateadd('d',p_ytj_sj,sj)<"&sqlnowstring&" and p_ytj_sj<>0 and ytj=1")
        End If
End Sub

Function ShopOthermes()
        Dim strFile,RLoadStyle
        strFile = Eshop_url& Style_Folder &"Lebi.ShoppingCartSuccess."
		RLoadStyle = splits(LoadStyle(strFile&"0.style"))
        ShopOthermes = "<script type=""text/javascript"" src="""& Eshop_url &"include/js/js_s.js""></script>"& vbcrlf
        ShopOthermes = ShopOthermes & "<script type=""text/javascript"" src="""& Eshop_url &"include/js/js_link.js""></script>"& vbcrlf
		ShopOthermes = ShopOthermes & "<script type=""text/javascript"" src="""& Eshop_url &"include/js/LightBox.js""></script>"& vbcrlf
        ShopOthermes = ShopOthermes & "<script type=""text/javascript"">var Ajaxbaskettext="""& RLoadStyle &""";var EshopDomin="""& Eshop_url &""";var LangPath="""& LangPath &""";var moneyhl="""& moneyhl &""";var text1 = """& Lebi_cart(34) &""";var text2 = """& Lebi_cart(127) &""";var text3 = """& Lebi_cart(195) &""";var text4 = """& Lebi_word(5) &""";</script>"& vbcrlf
		ShopOthermes = ShopOthermes & "<script type=""text/javascript"" src="""& Eshop_url & LangPath &"message/OpenMsg.asp""></script>"& vbcrlf
		If qq_zt = 1 And qq_ys = 1 Then ShopOthermes = ShopOthermes & "<script type=""text/javascript"" src="""& Eshop_url &"include/Lebi_Html/SiteQQService.js""></script>"& vbcrlf
		If kehu_state = "1" Then ShopOthermes = ShopOthermes & kehu_code & vbcrlf
'		if Sys_Skip_Window=1 And request.cookies(cookiesname)("tanchu")="" then
'				ShopOthermes = ShopOthermes & "<script type=""text/javascript"">function openpopup(){window.open("""& Eshop_url &"Message/OpenMsg/"","""",""width=300,height=100,left=0,top=30,status=no,resizable=no,menubar=no,location=no"")};openpopup()</script>"
'		End If
End Function

rem	<-{  捆绑产品子产品显示样式 2008-1-14 by 56770.WangLei
rem puid:捆绑促销产品ID; tp:返回字符串类型样式; fgf:分隔符
Function getUniteChild(puid,tp,fgf)
		Dim rs_u,zArr,sArr,j
		getUniteChild = ""
		set rs_u = conn.execute("select product_unite_info from [Lebi_product_unite] where id ="&puid&"")
		If not rs_u.eof then
				zArr = Split(rs_u("product_unite_info"),"||||")
				for j=0 to ubound(zArr)
						sArr = Split(zArr(j),"||")
						If UBound(sArr) > 3 Then
								Select Case tp
									   Case "0" :
										If getUniteChild<>"" Then
												getUniteChild=getUniteChild & fgf
										End If
										Set DPro = conn.execute("select product_name"& LangTxt &",p_filename from Lebi_Product where id = "& sArr(0) &"")
										If Not DPro.eof Then
												name = DPro(0)
										Else
												name = sArr(2)
										End If
										Select Case show_html
											   Case "1" : getUniteChild=getUniteChild&"<a href="""&Eshop_url & Folder(0) & DPro(1)&".1."& Sys_Ext &""" target='_blank'>"& name &"</a>"
											   Case "0"
													Select Case ISAPI_Rewrite
														   Case "0" getUniteChild=getUniteChild&"<a href="""& Eshop_url & PagePath(10) &"?id="& sArr(0) &""" target='_blank'>"& name &"</a>"
														   Case "1" getUniteChild=getUniteChild&"<a href="""& Eshop_url & LangPath &"product-"& sArr(0) &".html"" target='_blank'>"& name &"</a>"
													End Select
										End Select
										getUniteChild=getUniteChild&"<br />"& Lebi_pro_unite(1) &"：<span>"& sArr(4) &"</span>&nbsp;&nbsp;"& Lebi_pro_unite(2) &"：<span class=""price"">"& dw & Formatnumber2(sArr(3)/moneyhl) &"</span>"
								End Select
						End If
				Next
		End If
		rs_u.Close : set rs_u = nothing
End Function
rem	}->

rem	<-{ 专题分类相关函数  2008-02-26  by 56770.icystar
'获得子分类
Function ArrayClass(ClassID)
		Dim rsClass
		ArrayClass=ClassID
		set rsClass=conn.execute("Select classid From [Lebi_newsclass] where ParentID = "&ClassID)
		if not(rsClass.eof or rsClass.bof) then
				do while not rsClass.eof
						ArrayClass=ArrayClass&","&ArrayClass(rsClass(0))
						rsClass.movenext
				loop
		end if
		rsClass.close:set rsClass=nothing
End Function

'获得数组元素值
Function Arrval(arr,num)
		On Error Resume Next
		If num=-1 or num>UBound(arr) Then
				num=UBound(arr)
		End If
		Arrval=arr(num)
		If Err.Number>0 Then
				Arrval=-1
		End If
End Function

'rem	<-{ 会员组价格 2008-2-28 by 56770.WangLei
'rem	获取会员组价格 WangLei 2008-2-26
'rem t:类型; gdj:会员等级；pid:产品ID; iscx 是否是促销； cp
'Function getUsersPrice(t,gdj,pid,iscx,cprice)
'	Dim sql,cookieGrade,rs_up
'	cookieGrade = Trim(request.cookies(cookiesname&"_user")("user_grade"))
'
'	If cookieGrade ="" Or Not IsNumeric(cookieGrade) Then cookieGrade = 0
'	If Trim(t)	 ="" Or Not IsNumeric(t)   Then t = 0
'	If Trim(gdj) ="" Or Not IsNumeric(gdj) Then gdj = 0
'	If Trim(pid) ="" Or Not IsNumeric(pid) Then pid = 0
'	If Trim(cprice) ="" Or Not IsNumeric(cprice) Then cprice = 0
'	If iscx = "1" Then	' 促销
'		getUsersPrice = Formatnumber2(cprice/moneyhl)
'		If Trim(getUsersPrice) = "" Then getUsersPrice = 0
'		Exit Function
'	End If
'
'	Select Case t
'		Case "0"	'放回登陆等级相对价格
'			If cookieGrade = 0 Then
'				If InStr(cache_ugrade_qx(0),",1,")<1 Then
'					getUsersPrice = Lebi_word(66)
'					Exit Function
'				Else
'					cookieGrade = 1
'				End If
'			End If
'			sql="Select price from [Lebi_product_price] where product_id="&pid&" and grade_id="&cookieGrade&" "
'			set rs_up = conn.execute(sql)
'			If not rs_up.eof Then
'				getUsersPrice = Formatnumber2(rs_up("price")/moneyhl)
'			End If
'			rs_up.close:Set rs_up = Nothing
'		Case "1"	'返回登陆等级能查看的权限价格数组，
'				sql="Select grade_id,price from [Lebi_product_price] where product_id="&pid&" order by grade_id "
'				set rs_up = conn.execute(sql)
'				Dim i : i = 0
'				Do while not rs_up.eof
'					If InStr(cache_ugrade_qx(i),","&rs_up("grade_id")&",") > 0 Then
'						getUsersPrice = getUsersPrice & "," & Formatnumber2(rs_up("price")/moneyhl)
'					Else
'						getUsersPrice = getUsersPrice & "," & Lebi_word(66)
'					End If
'					rs_up.movenext
'				Loop
'				rs_up.close:Set rs_up = Nothing
'		Case "2"	'返回指定等级价格
'				sql="Select grade_id,price from [Lebi_product_price] where product_id="&pid&" and grade_id="&gdj&" "
'				set rs_up = conn.execute(sql)
'				If not rs_up.eof Then
'					If InStr(cache_ugrade_qx(cookieGrade),","&rs_up("grade_id")&",") > 0 Then
'						getUsersPrice = Formatnumber2(rs_up("price")/moneyhl)
'					Else
'						getUsersPrice = Lebi_word(66)
'					End If
'					rs_up.movenext
'				End If
'				rs_up.close:Set rs_up = Nothing
'		Case Else
'
'	End Select
'	If Trim(getUsersPrice) = "" Then getUsersPrice = 0
'End Function
'rem	}->

rem	<-{  获得会员组权限 2008-3-4 by 56770.WangLei
rem tp=0:购买权限;tp=1:收藏权限;t=2:购物积分;t=3:最低订单提交金额;=4:是否积分转换;=5:积分转换额
Function getGradePurview(tp)
		Dim Grade
		Grade = request.cookies(cookiesname&"_user")("user_grade")
		If Grade = "" Then Grade = session(cookiesname&"_user"&"user_grade")
		Grade = checknum(Grade,0)
		Select Case tp
				Case "0"	' 购买权限
					getGradePurview = cache_ugrade_buy(Grade)
				Case "1"	' 收藏权限
					getGradePurview = cache_ugrade_fav(Grade)
				Case "2"	' 购物积分
					getGradePurview = cache_buy_jifen(Grade)
				Case "3"	' 最低订单提交金额
					getGradePurview = cache_low_price(Grade)
				Case "4"	' 是否积分转换
					getGradePurview = cache_is_jifen_zh(Grade)
				Case "5"	' 积分转换额
					getGradePurview = cache_jifen_zh(Grade)
				Case "6"	' 是否自动开启资金帐号
					getGradePurview = cache_auto_accounts(Grade)
				Case "7"	' 开启资金帐号所需积分
					getGradePurview = cache_accounts_jifen(Grade)
				Case "8"	' 开启资金帐号所需消费金额
					getGradePurview = cache_accounts_cash(Grade)
				Case "9"	' 是否开启评论审核
					getGradePurview = cache_comments_auditing(Grade)
				Case "10"	' 是否自动升级高等级
					getGradePurview = cache_auto_upgrade(Grade)
				Case "11"	' 自动升级所需积分
					getGradePurview = cache_upgrade_jifen(Grade)
				Case "12"	' 是否扣除积分
					getGradePurview = cache_del_jifen(Grade)
				Case "13"	' 会员等级名称
					getGradePurview = cache_grade_name(Grade)
				Case "14"	' 是否自动降级
					getGradePurview = cache_auto_upgrade(Grade)
				Case "15"	' 自动降级天数
					getGradePurview = cache_degrade_days(Grade)
				Case "16"	' 降级金额
					getGradePurview = cache_degrade_cash(Grade)
				Case "17"	' 是否开启预订
					getGradePurview = cache_advance_booking(Grade)
				Case "18"	' 等级图标
					If Grade = 0 Then Grade = 1
					getGradePurview = cache_grade_ico(Grade)
				Case "19"	' 是否收取预付款
					getGradePurview = cache_is_advance(Grade)
				Case "20"	' 收取预付款比率
					getGradePurview = cache_advance_percent(Grade)
				Case "21"	' 收藏夹最大产品数量
					getGradePurview = cache_fav_qty(Grade)
				Case Else
					getGradePurview = 0
		End Select
End Function
rem	}->

rem	<-{ 专题幻灯 2008-3-4 by 56770.icystar
' O 排序 1 时间倒序； 2 点击倒序； 3 时间顺序； 点击顺序
' N 数目
' W 宽度
' H 高度
' T 时间
' E 效果
' L 标题长度
Function NewsSlidePic(O,N,W,H,T,E,L)
		Dim R, Nsp, Sql, Rs
		Randomize
		R = CLng(Rnd*1000)
		If IsEmpty(O) Or Not IsNumeric(O) Then O = 0
		If IsEmpty(N) Or Not IsNumeric(N) Then N = 10
		If IsEmpty(W) Or Not IsNumeric(W) Then W = 200
		If IsEmpty(H) Or Not IsNumeric(H) Then H = 150
		If IsEmpty(T) Or Not IsNumeric(T) Then T = 5000
		If IsEmpty(E) Or Not IsNumeric(E) Then E = 23
		If IsEmpty(L) Or Not IsNumeric(L) Then L = 0

		Nsp="<script language='JavaScript'>"&vbCrlf
		Nsp=Nsp&"<!--"&vbCrlf
		Nsp=Nsp&"function objSP_News(){this.ImgUrl='';this.LinkUrl='';this.Title='';}"&vbCrlf
		Nsp=Nsp&"function SlidePic_News(_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=SlidePic_News_Add;this.Show=SlidePic_News_Show;this.LoopShow=SlidePic_News_LoopShow;}"&vbCrlf
		Nsp=Nsp&"function SlidePic_News_Add(_SP){this.AllPic[this.AllPic.length]=_SP;}"&vbCrlf
		Nsp=Nsp&"function SlidePic_News_Show(){"&vbCrlf
		Nsp=Nsp&"  if(this.AllPic[0]==null)return false;"&vbCrlf
		Nsp=Nsp&"  document.write('<div align=\'center\'><a id=\'Url_'+this.ID+'\' href=\'\' target=\'_blank\'><img id=\'Img_'+this.ID+'\' style=\'filter:revealTrans(duration=2,transition=23);\' src=\'javascript:null\' border=\'0\'></a>');"&vbCrlf
		Nsp=Nsp&"  if(this.TitleLen != 0){document.write('<br><span id=\'Title_'+this.ID+'\'></span></div>');}"&vbCrlf
		Nsp=Nsp&"  else{document.write('</div>');}"&vbCrlf
		Nsp=Nsp&"  this.Img = document.getElementById('Img_'+this.ID);"&vbCrlf
		Nsp=Nsp&"  this.Url = document.getElementById('Url_'+this.ID);"&vbCrlf
		Nsp=Nsp&"  this.Title = document.getElementById('Title_'+this.ID);"&vbCrlf
		Nsp=Nsp&"  this.ImgChange={'w':this.Width,'h':this.Height};"&vbCrlf
		Nsp=Nsp&"  this.LoopShow();"&vbCrlf
		Nsp=Nsp&"}"&vbCrlf
		Nsp=Nsp&"function SlidePic_News_LoopShow(){"&vbCrlf
		Nsp=Nsp&"  if(this.PicNum<this.AllPic.length-1) this.PicNum++; "&vbCrlf
		Nsp=Nsp&"  else this.PicNum=0; "&vbCrlf
		Nsp=Nsp&"  this.Img.filters.revealTrans.Transition=this.Effect;"&vbCrlf
		Nsp=Nsp&"  this.Img.filters.revealTrans.apply();"&vbCrlf
		Nsp=Nsp&"  this.Img.src=this.AllPic[this.PicNum].ImgUrl;"&vbCrlf
		Nsp=Nsp&"  this.ImgChange=SlidePic_ImgChange(this.Width,this.Height,this.Img.src);"&vbCrlf
		Nsp=Nsp&"  this.Img.width=this.ImgChange.w;"&vbCrlf
		Nsp=Nsp&"  this.Img.height=this.ImgChange.h;"&vbCrlf
		Nsp=Nsp&"  this.Img.filters.revealTrans.play();"&vbCrlf
		Nsp=Nsp&"  this.Url.href=this.AllPic[this.PicNum].LinkUrl;"&vbCrlf
		Nsp=Nsp&"  if(this.Title)this.Title.innerHTML='<a href=\''+this.AllPic[this.PicNum].LinkUrl+'\' target=\'_blank\'>'+this.AllPic[this.PicNum].Title+'</a>';"&vbCrlf
		Nsp=Nsp&"  this.Img.timer=setTimeout(this.ID+'.LoopShow()',this.TimeOut);"&vbCrlf
		Nsp=Nsp&"}"&vbCrlf
		Nsp=Nsp&"function SlidePic_ImgChange(w,h,s){"&vbCrlf
		Nsp=Nsp&"	var e=w/h;"&vbCrlf
		Nsp=Nsp&"	var img=document.createElement('img');"&vbCrlf
		Nsp=Nsp&"	img.src=s;"&vbCrlf
		Nsp=Nsp&"	if(img.width*img.height>0)"&vbCrlf
		Nsp=Nsp&"		e=img.width/img.height;"&vbCrlf
		Nsp=Nsp&"	if(e*h>w)return{'w':w,'h':w/e};"&vbCrlf
		Nsp=Nsp&"	else return{'w':h*e,'h':h};"&vbCrlf
		Nsp=Nsp&"};"&vbCrlf
		Nsp=Nsp&"//-->"&vbCrlf
		Nsp=Nsp&"</script>"&vbCrlf

		Nsp=Nsp&"<script language='JavaScript'>"&vbCrlf
		Nsp=Nsp&"<!--"&vbCrlf
		Nsp=Nsp&"var SlidePic_"&R&" = new SlidePic_News('SlidePic_"&R&"');"&vbCrlf
		Nsp=Nsp&"SlidePic_"&R&".Width    = "&W&";"&vbCrlf
		Nsp=Nsp&"SlidePic_"&R&".Height   = "&H&";"&vbCrlf
		Nsp=Nsp&"SlidePic_"&R&".TimeOut  = "&T&";"&vbCrlf
		Nsp=Nsp&"SlidePic_"&R&".Effect   = "&E&";"&vbCrlf
		Nsp=Nsp&"SlidePic_"&R&".TitleLen = "&L&";"&vbCrlf

		Sql="select top "&N&" * from [Lebi_news] where pic=1"
		If O=0 Then Sql=Sql&" order by infotime desc"
		If O=1 Then Sql=Sql&" order by hits desc"
		If O=2 Then Sql=Sql&" order by infotime asc"
		If O=3 Then Sql=Sql&" order by hits asc"
		Set Rs=Conn.Execute(sql)
		If Not Rs.Eof Then
		Do While Not Rs.Eof
		Nsp=Nsp&"var oSP = new objSP_News();"&vbCrlf
		Nsp=Nsp&"oSP.ImgUrl = '"&Rs("pic_src")&"';"&vbCrlf
		If Config_Lebi_Eshop(16) = 0 Then
				Nsp=Nsp&"oSP.LinkUrl = '"&Eshop_url&"zhuanti.asp?action=news_list&id="&Rs("id")&"';"&vbCrlf
		Else
				Nsp=Nsp&"oSP.LinkUrl = '"&Eshop_url&"news/list/?id="&Rs("id")&"';"&vbCrlf
		End If
		Nsp=Nsp&"oSP.Title = '"&Rs("title")&"';"&vbCrlf
		Nsp=Nsp&"SlidePic_"&R&".Add(oSP);"&vbCrlf
		Rs.MoveNext
		Loop
		End If
		Rs.Close
		Set Rs=Nothing
		Nsp=Nsp&"SlidePic_"&R&".Show();"&vbCrlf
		Nsp=Nsp&"//-->"&vbCrlf
		Nsp=Nsp&"</script>"&vbCrlf

		NewsSlidePic=Nsp
End Function
'..................................
'读取商品分类 详细
's_type 1 详细分类 0 简洁分类
'..................................
Public Function ProductCategoryShow(s_type,showsmallcategorynum)
		s_type = checknum(s_type,0)
		Dim rs,sql,categorylist,i,url,style,style_text,i_s,url_s,style_s,style_s_text,strFile,RLoadStyle(20), App_ProductCategoryShow,DataCount,App_ProductCategoryShow_s,DataCount_s,LoadProductCategoryShow, TmpProductCategoryShow,LoadProductCategoryShow_s,TmpProductCategoryShow_s,TmpNum,TmpNum_s,TmpXml, TmpXml_s,category_show,TmpLoadProductCategoryShow,TmpLoadProductCategoryShow_s
		strFile = Eshop_url& Style_Folder &"Lebi.ProductCategoryShow."
		category_show = False
		If s_type = "1" then
				cache.name="ProductCategoryShow"& LangTxt & s_type
				cache.reloadtime= 5000
				If cache.objisempty() Then
						sql="select c_id,c_pic,c_name"& LangTxt &",c_name_ys,c_pic_size,c_pronum,c_foldername,c_filename"
						sql = sql &" from [Lebi_category] where c_father = 1 and is_hide = 0 order by c_order desc"
						Set Rs = conn.execute(sql)
						If Not rs.eof Then
								cache.value = rs.getrows()
								cache.DataCount = 1
						Else
						        cache.value = ""
								cache.DataCount = 0
						End If
						rs.close : Set rs = Nothing
				End If
				App_ProductCategoryShow = cache.value
				DataCount = cache.DataCount
				If DataCount = 1 Then
						RLoadStyle(0) = LoadStyle(strFile&"0.style")
						RLoadStyle(1) = splits(LoadStyle(strFile&"1.style"))
						RLoadStyle(2) = splits(LoadStyle(strFile&"2.style"))
						RLoadStyle(3) = splits(LoadStyle(strFile&"3.style"))
						RLoadStyle(4) = LoadStyle(strFile&"4.style")
						ProductCategoryShow = RLoadStyle(0)
						For i = 0 To UBound(App_ProductCategoryShow,2)
							If Not IsNull(Trim(App_ProductCategoryShow(2,i))) And Trim(App_ProductCategoryShow(2,i)) <> "" Then 
								LoadProductCategoryShow = RLoadStyle(1)
								Select Case show_html
									   Case "1" : url = Folder(2) & App_ProductCategoryShow(7,i) &".1."& Sys_Ext
									   Case "0"
											Select Case ISAPI_Rewrite
												   Case "0"
														Select Case Config_Lebi_Eshop(16)
															   Case "0" : url = "showsort.asp?sort_id="& App_ProductCategoryShow(0,i)
															   Case "1" : url = "category/"& App_ProductCategoryShow(6,i) &"/"
															   Case "2" : url = "category/"& App_ProductCategoryShow(6,i) &"/default.asp"
														End Select
													Case "1" url = "category-"& App_ProductCategoryShow(6,i) &".html"
											End Select
								End Select
								Dim str_showpicsize,showpic_width,showpic_height,pic_url
								If trim(App_ProductCategoryShow(1,i))<>"" Then
										str_showpicsize = Split(trim(App_ProductCategoryShow(4,i)),"|")
										showpic_width = str_showpicsize(0)
										showpic_height = str_showpicsize(1)
										pic_url = App_ProductCategoryShow(1,i)
								Else
										showpic_width=0
										showpic_height=0
										pic_url = ""
								End If
								style=Split(App_ProductCategoryShow(3,i),"|")
								style_text=""
								If Trim(style(0)) <> "" Then
										style_text=style_text&"color:"&Trim(style(0))&";"
								End If
								If Trim(style(1)) <> "" Then
										style_text=style_text&"background-color:"&Trim(style(1))&";"
								End If
								If Trim(style(2)) <> "" Then
										style_text=style_text&"font-size:"&Trim(style(2))&"px;"
								End If
								If Trim(style(3)) <> "" Then
										style_text=style_text&"font-family:"&Trim(style(3))&";"
								End If
								If Trim(style(4)) <> "" Then
										style_text=style_text&"font-weight:"&Trim(style(4))&";"
								End If
								If Trim(style(5)) <> "" Then
										style_text=style_text&"font-style:"&Trim(style(5))&";"
								End If
								If Trim(style(6)) <> "" Then
										style_text=style_text&"text-decoration:"&Trim(style(6))&";"
								End If
								cache.name="ProductCategoryShow"& LangTxt &s_type&App_ProductCategoryShow(0,i)
								cache.reloadtime= 5000
								If cache.objisempty() Then
										sql = "select"
										If showsmallcategorynum <> 0 Then
												sql = sql &" top "& showsmallcategorynum &""
										End If
										sql = sql &" c_id,c_name"& LangTxt &",c_name_ys,c_pronum,c_foldername,c_filename from [Lebi_category] where is_hide = 0 and c_parentid="& App_ProductCategoryShow(0,i) &" order by c_order desc"
										Set rs = conn.execute(sql)
										If Not rs.eof Then
												cache.value = rs.getrows()
												cache.DataCount = 1
										Else
												cache.value = ""
												cache.DataCount = 0
										End If
										rs.close : Set rs = Nothing
								End If
								App_ProductCategoryShow_s = cache.value
								DataCount_s = cache.DataCount
								If DataCount_s = 1 Then
									    For i_s = 0 To UBound(App_ProductCategoryShow_s,2)
											If Not IsNull(Trim(App_ProductCategoryShow_s(1,i_s))) And Trim(App_ProductCategoryShow_s(1,i_s)) <> "" Then 
									            LoadProductCategoryShow_s = RLoadStyle(2)
												Select Case show_html
													   Case "1" : url_s = Folder(2) & App_ProductCategoryShow_s(5,i_s) &".1."& Sys_Ext
													   Case "0"
															Select Case ISAPI_Rewrite
																   Case "0"
																		Select Case Config_Lebi_Eshop(16)
																			   Case "0" : url_s = "showsort.asp?sort_id="& App_ProductCategoryShow_s(0,i_s)
																			   Case "1" : url_s = "category/"& App_ProductCategoryShow_s(4,i_s) &"/"
																			   Case "2" : url_s = "category/"& App_ProductCategoryShow_s(4,i_s) &"/default.asp"
																		End Select
																	Case "1" url_s = "category-"& App_ProductCategoryShow_s(4,i_s) &".html"
															End Select
												End Select
												style_s=Split(App_ProductCategoryShow_s(2,i_s),"|")
												style_s_text=""
												If Trim(style_s(0)) <> "" Then
														style_s_text=style_s_text&"color:"&Trim(style_s(0))&";"
												End If
												If Trim(style_s(1)) <> "" Then
														style_s_text=style_s_text&"background-color:"&Trim(style_s(1))&";"
												End If
												If Trim(style_s(2)) <> "" Then
														style_s_text=style_s_text&"font-size:"&Trim(style_s(2))&"px;"
												End If
												If Trim(style_s(3)) <> "" Then
														style_s_text=style_s_text&"font-family:"&Trim(style_s(3))&";"
												End If
												If Trim(style_s(4)) <> "" Then
														style_s_text=style_s_text&"font-weight:"&Trim(style_s(4))&";"
												End If
												If Trim(style_s(5)) <> "" Then
														style_s_text=style_s_text&"font-style:"&Trim(style_s(5))&";"
												End If
												If Trim(style_s(6)) <> "" Then
														style_s_text=style_s_text&"text-decoration:"&Trim(style_s(6))&";"
												End If
												ReplaceStyle "url",LangPath & url_s,LoadProductCategoryShow_s
												ReplaceStyle "name",App_ProductCategoryShow_s(1,i_s),LoadProductCategoryShow_s
												ReplaceStyle "style",style_s_text,LoadProductCategoryShow_s
												ReplaceStyle "id",App_ProductCategoryShow_s(0,i_s),LoadProductCategoryShow_s
												ReplaceStyle "num",App_ProductCategoryShow_s(3,i_s),LoadProductCategoryShow_s
												Select Case ISAPI_Rewrite
													   Case "0" ReplaceStyle "xml",PagePath(11) &"?sort_id="& App_ProductCategoryShow_s(0,i_s),LoadProductCategoryShow_s
													   Case "1" ReplaceStyle "xml",LangPath &"rss-"& App_ProductCategoryShow_s(0,i_s) &".html",LoadProductCategoryShow_s
												End Select
												ReplaceStyle "loop_num",i_s+1,LoadProductCategoryShow_s
												TmpLoadProductCategoryShow_s = TmpLoadProductCategoryShow_s & LoadProductCategoryShow_s
											End If 
										Next
								End If
								ReplaceStyle "url",LangPath & url,LoadProductCategoryShow
								ReplaceStyle "id",App_ProductCategoryShow(0,i),LoadProductCategoryShow
								ReplaceStyle "pic_url",pic_url,LoadProductCategoryShow
								ReplaceStyle "pic_width",showpic_width,LoadProductCategoryShow
								ReplaceStyle "pic_height",showpic_height,LoadProductCategoryShow
								ReplaceStyle "name",App_ProductCategoryShow(2,i),LoadProductCategoryShow
								ReplaceStyle "style",style_text,LoadProductCategoryShow
								ReplaceStyle "num",App_ProductCategoryShow(5,i),LoadProductCategoryShow
								Select Case ISAPI_Rewrite
									   Case "0" ReplaceStyle "xml",PagePath(11) &"?sort_id="& App_ProductCategoryShow(0,i),LoadProductCategoryShow
									   Case "1" ReplaceStyle "xml",LangPath &"rss-"& App_ProductCategoryShow(0,i) &".html",LoadProductCategoryShow
								End Select
								ReplaceStyle "loop_num",i+1,LoadProductCategoryShow
								TmpLoadProductCategoryShow = TmpLoadProductCategoryShow & LoadProductCategoryShow & TmpLoadProductCategoryShow_s & RLoadStyle(3)
								TmpLoadProductCategoryShow_s = ""
							End If 
						Next
				End If
				ProductCategoryShow = ProductCategoryShow & TmpLoadProductCategoryShow & RLoadStyle(4)
        Else
				RLoadStyle(5) = LoadStyle(strFile&"5.style")
				RLoadStyle(6) = splits(LoadStyle(strFile&"6.style"))
				RLoadStyle(7) = splits(LoadStyle(strFile&"7.style"))
				RLoadStyle(8) = LoadStyle(strFile&"8.style")
				RLoadStyle(9) = LoadStyle(strFile&"9.style")
				ProductCategoryShow = RLoadStyle(5)
				cache.name="ProductCategoryShow"& LangTxt & s_type
				cache.reloadtime= 5000
				If cache.objisempty() Then
		                sql="select c_id,c_name"& LangTxt &",c_name_ys,c_pronum,c_foldername,c_filename"
						sql = sql &" from [Lebi_category] where c_father = 1 and is_hide = 0 order by c_order desc"
		                Set Rs = conn.execute(sql)
						If Not rs.eof Then
								cache.value = rs.getrows()
								cache.DataCount = 1
						Else
						        cache.value = ""
								cache.DataCount = 0
						End If
						rs.close : Set rs = Nothing
				End If
				App_ProductCategoryShow = cache.value
				DataCount = cache.DataCount
				If DataCount = 1 Then
		                For i = 0 To UBound(App_ProductCategoryShow,2)
							If Not IsNull(Trim(App_ProductCategoryShow(1,i))) And Trim(App_ProductCategoryShow(1,i)) <> "" Then 
								cache.name="ProductCategoryShow"& LangTxt &s_type&App_ProductCategoryShow(0,i)
								cache.reloadtime= 5000
								If cache.objisempty() Then
										sql = "select"
										If showsmallcategorynum <> 0 Then
												sql = sql &" top "& showsmallcategorynum &""
										End If
										sql = sql &" c_id,c_name"& LangTxt &",c_name_ys,c_pronum,c_foldername,c_filename from [Lebi_category] where is_hide = 0 and  c_parentid="& App_ProductCategoryShow(0,i) &" order by c_order desc"
										Set rs = conn.execute(sql)
										If Not rs.eof Then
												cache.value = rs.getrows()
												cache.DataCount = 1
										Else
												cache.value = ""
												cache.DataCount = 0
										End If
										rs.close : Set rs = Nothing
								End If
								App_ProductCategoryShow_s = cache.value
								DataCount_s = cache.DataCount
								If DataCount_s = 1 Then
									For i_s = 0 To UBound(App_ProductCategoryShow_s,2)
										If Not IsNull(Trim(App_ProductCategoryShow_s(1,i_s))) And Trim(App_ProductCategoryShow_s(1,i_s)) <> "" Then 
											LoadProductCategoryShow_s = ""
											LoadProductCategoryShow_s = LoadProductCategoryShow_s & RLoadStyle(7)
											Select Case show_html
												   Case "1" : url_s = Folder(2) & App_ProductCategoryShow_s(5,i_s) &".1."& Sys_Ext
												   Case "0"
														Select Case ISAPI_Rewrite
															   Case "0"
																	Select Case Config_Lebi_Eshop(16)
																		   Case "0" : url_s = "showsort.asp?sort_id="& App_ProductCategoryShow_s(0,i_s)
																		   Case "1" : url_s = "category/"& App_ProductCategoryShow_s(4,i_s) &"/"
																		   Case "2" : url_s = "category/"& App_ProductCategoryShow_s(4,i_s) &"/default.asp"
																	End Select
																Case "1" url_s = "category-"& App_ProductCategoryShow_s(4,i_s) &".html"
														End Select
											End Select
											style_s=Split(App_ProductCategoryShow_s(2,i_s),"|")
											style_s_text=""
											If Trim(style_s(0)) <> "" Then
													style_s_text=style_s_text&"color:"&Trim(style_s(0))&";"
											End If
											If Trim(style_s(1)) <> "" Then
													style_s_text=style_s_text&"background-color:"&Trim(style_s(1))&";"
											End If
											If Trim(style_s(2)) <> "" Then
													style_s_text=style_s_text&"font-size:"&Trim(style_s(2))&"px;"
											End If
											If Trim(style_s(3)) <> "" Then
													style_s_text=style_s_text&"font-family:"&Trim(style_s(3))&";"
											End If
											If Trim(style_s(4)) <> "" Then
													style_s_text=style_s_text&"font-weight:"&Trim(style_s(4))&";"
											End If
											If Trim(style_s(5)) <> "" Then
													style_s_text=style_s_text&"font-style:"&Trim(style_s(5))&";"
											End If
											If Trim(style_s(6)) <> "" Then
													style_s_text=style_s_text&"text-decoration:"&Trim(style_s(6))&";"
											End If
											ReplaceStyle "url",LangPath & url_s,LoadProductCategoryShow_s
											ReplaceStyle "name",App_ProductCategoryShow_s(1,i_s),LoadProductCategoryShow_s
											ReplaceStyle "style",style_s_text,LoadProductCategoryShow_s
											ReplaceStyle "id",App_ProductCategoryShow_s(0,i_s),LoadProductCategoryShow_s
											ReplaceStyle "tagid",App_ProductCategoryShow(0,i),LoadProductCategoryShow_s
											ReplaceStyle "num",App_ProductCategoryShow_s(3,i_s),LoadProductCategoryShow_s
											Select Case ISAPI_Rewrite
												   Case "0" ReplaceStyle "xml",PagePath(11) &"?sort_id="& App_ProductCategoryShow_s(0,i_s),LoadProductCategoryShow_s
												   Case "1" ReplaceStyle "xml",LangPath &"rss-"& App_ProductCategoryShow_s(0,i_s) &".html",LoadProductCategoryShow_s
											End Select
											ReplaceStyle "loop_num",i_s+1,LoadProductCategoryShow_s
											TmpLoadProductCategoryShow_s = TmpLoadProductCategoryShow_s & LoadProductCategoryShow_s
										End If 
									Next
								End If
								LoadProductCategoryShow = RLoadStyle(6)
								If show_html = 1 Then
										url = Folder(2) & App_ProductCategoryShow(5,i) &".1."& Sys_Ext
								Else
										Select Case ISAPI_Rewrite
											   Case "0"
													Select Case Config_Lebi_Eshop(16)
														   Case "0" : url = "showsort.asp?sort_id="& App_ProductCategoryShow(0,i)
														   Case "1" : url = "category/"& App_ProductCategoryShow(4,i) &"/"
														   Case "2" : url = "category/"& App_ProductCategoryShow(4,i) &"/default.asp"
													End Select
											   Case "1" url = "category-"& App_ProductCategoryShow(4,i) &".html"
										End Select
								End If
								style=Split(App_ProductCategoryShow(2,i),"|")
								style_text=""
								If Trim(style(0)) <> "" Then
										style_text=style_text&"color:"&Trim(style(0))&";"
								End If
								If Trim(style(1)) <> "" Then
										style_text=style_text&"background-color:"&Trim(style(1))&";"
								End If
								If Trim(style(2)) <> "" Then
										style_text=style_text&"font-size:"&Trim(style(2))&"px;"
								End If
								If Trim(style(3)) <> "" Then
										style_text=style_text&"font-family:"&Trim(style(3))&";"
								End If
								If Trim(style(4)) <> "" Then
										style_text=style_text&"font-weight:"&Trim(style(4))&";"
								End If
								If Trim(style(5)) <> "" Then
										style_text=style_text&"font-style:"&Trim(style(5))&";"
								End If
								If Trim(style(6)) <> "" Then
										style_text=style_text&"text-decoration:"&Trim(style(6))&";"
								End If
								ReplaceStyle "url",LangPath & url,LoadProductCategoryShow
								ReplaceStyle "id",App_ProductCategoryShow(0,i),LoadProductCategoryShow
								ReplaceStyle "tagid",App_ProductCategoryShow(0,i),LoadProductCategoryShow
								ReplaceStyle "name",App_ProductCategoryShow(1,i),LoadProductCategoryShow
								ReplaceStyle "style",style_text,LoadProductCategoryShow
								ReplaceStyle "num",App_ProductCategoryShow(3,i),LoadProductCategoryShow
								Select Case ISAPI_Rewrite
									   Case "0" ReplaceStyle "xml",PagePath(11) &"?sort_id="& App_ProductCategoryShow(0,i),LoadProductCategoryShow
									   Case "1" ReplaceStyle "xml",LangPath &"rss-"& App_ProductCategoryShow(0,i) &".html",LoadProductCategoryShow
								End Select
								ReplaceStyle "loop_num",i+1,LoadProductCategoryShow
								TmpLoadProductCategoryShow = TmpLoadProductCategoryShow & LoadProductCategoryShow & TmpLoadProductCategoryShow_s & RLoadStyle(8)
								TmpLoadProductCategoryShow_s = ""
							End If 
						Next
				End If
				ProductCategoryShow = ProductCategoryShow & TmpLoadProductCategoryShow & RLoadStyle(9)
		End If
End Function
'..................................
'读取公告内容
'topnum 读取记录条数
'cutcharnum 标题显示长度
'd_type 0 固定模式 1 滚动模式
'datetype 0 不显示时间
'..................................
Public Function SiteMessage(topnum,cutcharnum,d_type,datetype)
		topnum = checknum(topnum,5) : cutcharnum = checknum(cutcharnum,10) : d_type = checknum(d_type,0) : datetype = checknum(datetype,0)
		Dim strFile,RLoadStyle(7),rs,sql,tmpstr,i,page,url,LoadSiteMessage,TmpLoadSiteMessage,DataCount, App_SiteMessage
		strFile = Eshop_url& Style_Folder &"Lebi.SiteMessage."
		If show_html = "1" Then
		        SiteMessage = "<script type=""text/javascript"" src="""& Eshop_url &"include/Lebi_Html/SiteMessage.asp?topnum="& topnum &"&cutcharnum="& cutcharnum &"&type="& d_type &"&datetype="& datetype &"&LangTxt="& LangTxt &"&LangPath="& LangPath &"""></script>"
		Else
				cache.name="SiteMessage"& LangTxt & d_type
				cache.reloadtime= 5000
				If cache.objisempty() Then
						sql = "select top "&topnum&" subject"& LangTxt &",id,message"& LangTxt &""
						If datetype <> 0 Then sql = sql &",idate"
						sql = sql &" from [Lebi_help] where syxs=1 order by idate DESC,id desc"
						Set rs = conn.execute(sql)
						If rs.eof Then
								cache.value = ""
								cache.DataCount = 0
						Else
								cache.value = rs.getrows()
								cache.DataCount = 1
						End If
						rs.close : Set rs = Nothing
				End If
				App_SiteMessage = cache.value
				DataCount = cache.DataCount
				If d_type = 0 Then
						RLoadStyle(0) = LoadStyle(strFile&"0.style")
						SiteMessage = RLoadStyle(0)
						If DataCount = 1 Then
								RLoadStyle(2) = splits(LoadStyle(strFile&"2.style"))
								For i = 0 To UBound(App_SiteMessage,2)
									If Not IsNull(Trim(App_SiteMessage(0,i))) And Trim(App_SiteMessage(0,i)) <> "" Then 
										LoadSiteMessage = RLoadStyle(2)
										If ((i+1)/top25) = 1 Then
												page = 1
										Else
												If top25 > 1 Then 
														page = Split(formatnumber2(((i+1)/top25)),".")(0) + 1
												Else
														page = Split(formatnumber2(((i+1)/top25)),".")(0)
												End If 
										End If
										Select Case show_html
											   Case "0"
													Select Case ISAPI_Rewrite
														   Case "0"
																Select Case Config_Lebi_Eshop(16)
																	   Case "0" : url = "help.asp?action=help_class&news_type=0&page="& page &"#"& App_SiteMessage(1,i)
																	   Case "1" : url = "help/class/?news_type=0&page="& page &"#"& App_SiteMessage(1,i)
																	   Case "2" : url = "help/class/default.asp?news_type=0&page="& page &"#"& App_SiteMessage(1,i)
																End Select
														   Case "1" url = "help_class-0-"& page &".html#"& App_SiteMessage(1,i)
													End Select
											   Case "1" : url = Folder(6) &"news."& page &"."& Sys_Ext &"#"& App_SiteMessage(1,i)
										End Select
										If datetype <> 0 Then
												ReplaceStyle "time",Formatdate(App_SiteMessage(3,i),datetype) &" ",LoadSiteMessage
										Else
												ReplaceStyle "time","",LoadSiteMessage
										End If
										ReplaceStyle "url",LangPath & url,LoadSiteMessage
										ReplaceStyle "title",App_SiteMessage(0,i),LoadSiteMessage
										ReplaceStyle "content",App_SiteMessage(2,i),LoadSiteMessage
										ReplaceStyle "cut_title",Cutchar(App_SiteMessage(0,i),cutcharnum),LoadSiteMessage
										ReplaceStyle "loop_num",i+1,LoadSiteMessage
										TmpLoadSiteMessage = TmpLoadSiteMessage & LoadSiteMessage
									End If 
								Next
						Else
								RLoadStyle(1) = splits(LoadStyle(strFile&"1.style"))
								SiteMessage = SiteMessage & RLoadStyle(1)
						End If
						RLoadStyle(3) = LoadStyle(strFile&"3.style")
						SiteMessage = SiteMessage & TmpLoadSiteMessage & RLoadStyle(3)
				Else
						RLoadStyle(4) = LoadStyle(strFile&"4.style")
						SiteMessage = RLoadStyle(4)
						If DataCount = 1 Then
								RLoadStyle(6) = splits(LoadStyle(strFile&"6.style"))
								For i = 0 To UBound(App_SiteMessage,2)
									If Not IsNull(Trim(App_SiteMessage(0,i))) And Trim(App_SiteMessage(0,i)) <> "" Then 
										LoadSiteMessage = RLoadStyle(6)
										If ((i+1)/top25) = 1 Then
												page = 1
										Else
												If top25 > 1 Then 
														page = Split(formatnumber2(((i+1)/top25)),".")(0) + 1
												Else
														page = Split(formatnumber2(((i+1)/top25)),".")(0)
												End If 
										End If
										Select Case show_html
											   Case "0"
													Select Case ISAPI_Rewrite
														   Case "0"
																Select Case Config_Lebi_Eshop(16)
																	   Case "0" : url = "help.asp?action=help_class&news_type=0&page="& page &"#"& App_SiteMessage(1,i)
																	   Case "1" : url = "help/class/?news_type=0&page="& page &"#"& App_SiteMessage(1,i)
																	   Case "2" : url = "help/class/default.asp?news_type=0&page="& page &"#"& App_SiteMessage(1,i)
																End Select
														   Case "1" url = "help_class-0-"& page &".html#"& App_SiteMessage(1,i)
													End Select
											   Case "1" : url = Folder(6) &"news."& page &"."& Sys_Ext &"#"& App_SiteMessage(1,i)
										End Select
										If datetype <> 0 Then
												ReplaceStyle "time",Formatdate(App_SiteMessage(3,i),datetype) &" ",LoadSiteMessage
										Else
												ReplaceStyle "time","",LoadSiteMessage
										End If
										ReplaceStyle "url",LangPath & url,LoadSiteMessage
										ReplaceStyle "title",App_SiteMessage(0,i),LoadSiteMessage
										ReplaceStyle "content",App_SiteMessage(2,i),LoadSiteMessage
										ReplaceStyle "cut_title",Cutchar(App_SiteMessage(0,i),cutcharnum),LoadSiteMessage
										ReplaceStyle "loop_num",i+1,LoadSiteMessage
										TmpLoadSiteMessage = TmpLoadSiteMessage & LoadSiteMessage
									End If 
								Next
						Else
								RLoadStyle(5) = splits(LoadStyle(strFile&"5.style"))
								SiteMessage = SiteMessage & RLoadStyle(5)
						End If
						RLoadStyle(7) = LoadStyle(strFile&"7.style")
						SiteMessage = SiteMessage & TmpLoadSiteMessage & RLoadStyle(7)
				End If
		End If
End Function

'..................................
'读取投票信息
'..................................
Public Function SiteVote(voteid,showvotenum)
		voteid = checknum(voteid,0) : showvotenum = checknum(showvotenum,1)
		Dim strFile,RLoadStyle(6),DataCount,rs,sql,vote_id,Data_SiteVote,i,LoadSiteVote,TmpLoadSiteVote,VoteNum
		cache.name="SiteVote"& LangTxt & vote_id
		cache.reloadtime= 5000
		If cache.objisempty() Then
		        If voteid = 0 Then
		                sql ="SELECT title"& LangTxt &",select1"& LangTxt &",select2"& LangTxt &",select3"& LangTxt &",select4"& LangTxt &",select5"& LangTxt &",select6"& LangTxt &",select7"& LangTxt &",select8"& LangTxt &",id"
						If showvotenum = 1 Then sql = sql &",answer1,answer2,answer3,answer4,answer5,answer6,answer7,answer8"
						sql = sql &" FROM [vote] where IsChecked=1 "
				Else
		                sql ="SELECT title"& LangTxt &",select1"& LangTxt &",select2"& LangTxt &",select3"& LangTxt &",select4"& LangTxt &",select5"& LangTxt &",select6"& LangTxt &",select7"& LangTxt &",select8"& LangTxt &",id"
						If showvotenum = 1 Then sql = sql &",answer1,answer2,answer3,answer4,answer5,answer6,answer7,answer8"
						sql = sql &" FROM [vote] where id = "& vote_id &""
				End If
                set rs=conn.execute(sql)
                If rs.eof And rs.bof then
		                cache.value = ""
						cache.DataCount = 0
                Else
		                cache.value = rs.getrows
						cache.DataCount = 1
		        End If
		        rs.close : Set rs = Nothing
		End If
		Data_SiteVote = cache.value
		Count_SiteVote = cache.DataCount
		strFile = Eshop_url & Style_Folder &"Lebi.SiteVote."
		RLoadStyle(0) = splits(LoadStyle(strFile&"0.style"))
		RLoadStyle(6) = splits(LoadStyle(strFile&"6.style"))
		SiteVote = RLoadStyle(0)
		If Count_SiteVote = 1 Then
			If Not IsNull(Trim(Data_SiteVote(0,0))) And Trim(Data_SiteVote(0,0)) <> "" Then
			   RLoadStyle(2) = LoadStyle(strFile&"2.style")
			   ReplaceStyle "title",Data_SiteVote(0,0),RLoadStyle(2)
			   RLoadStyle(3) = LoadStyle(strFile&"3.style")
			   RLoadStyle(4) = LoadStyle(strFile&"4.style")
			   RLoadStyle(5) = splits(LoadStyle(strFile&"5.style"))
		       for i=1 to 8
	                   if Trim(Data_SiteVote(i,0))<>"" then
					   		   LoadSiteVote = RLoadStyle(3)
							   ReplaceStyle "loop_num",i,LoadSiteVote
							   ReplaceStyle "name",Data_SiteVote(i,0),LoadSiteVote
							   If showvotenum = 1 Then
							           VoteNum = Replace(LCase(RLoadStyle(4)),"{@qty}",Data_SiteVote(i+9,0))
							   Else
							           VoteNum = ""
							   End If
							   ReplaceStyle "qty",VoteNum,LoadSiteVote
							   If i = 1 Then LoadSiteVote = Replace(LoadSiteVote,"input","input checked")
							   TmpLoadSiteVote = TmpLoadSiteVote & LoadSiteVote
	                    end If
                Next
                SiteVote = SiteVote & RLoadStyle(2) & TmpLoadSiteVote & RLoadStyle(5)
				SiteVote = SiteVote & RLoadStyle(6)
				ReplaceStyle "id",Data_SiteVote(9,0),SiteVote
			End If 
		Else
			RLoadStyle(1) = splits(LoadStyle(strFile&"1.style"))
			SiteVote = SiteVote & RLoadStyle(1)
			SiteVote = SiteVote & RLoadStyle(6)
		End If
End Function

rem 友情连接 LOGO 2006-3-7 56770.kingdge
rem l_type 类型 0 混合模式 1 图片连接 2 文字连接
rem l_topnum 调用数量 0 所有
Public Function SiteLink(l_type,l_topnum)
		l_type = checknum(l_type,0) : l_topnum = checknum(l_topnum,0)
		Dim strFile,RLoadStyle(4)
		strFile = Eshop_url& Style_Folder &"Lebi.SiteLink."
		Dim rs,sql,App_SiteLink,DataCount,i,LoadSiteLink,TmpLoadSiteLink
		cache.name="SiteLink"&l_type
		cache.reloadtime= 5000
		If cache.objisempty() Then
				If l_topnum = "0" Then
   	                    sql = "select logo,url,wordlink,xs from [Lebi_huoban] where show=1"
				Else
   	                    sql = "select top "& l_topnum &" logo,url,wordlink,xs from [Lebi_huoban] where show=1"
				End If
	            If l_type = "1" Then sql = sql &" and xs=1"
	            If l_type = "2" Then sql = sql &" and xs=0" '如果是文字连接应该显示所有 2008-4-7 by 56770.kingdge
	            sql = sql &" order by bs desc"
   	            set Rs = conn.execute(sql)
				If rs.eof And rs.bof Then
				        cache.value = ""
						cache.DataCount = 0
				Else
				        cache.value = rs.getrows
						cache.DataCount = 1
				End If
				rs.close : Set rs = Nothing
		End If
		App_SiteLink = cache.value
		RLoadStyle(0) = LoadStyle(strFile&"0.style")
		RLoadStyle(2) = LoadStyle(strFile&"2.style")
		RLoadStyle(3) = LoadStyle(strFile&"3.style")
		RLoadStyle(4) = LoadStyle(strFile&"4.style")
		DataCount = cache.DataCount
        SiteLink = RLoadStyle(0)
		If DataCount = 1 Then
				For i = 0 To UBound(App_SiteLink,2)
						Select Case l_type
							   Case "1" LoadSiteLink = RLoadStyle(2)
							   Case "2" LoadSiteLink = RLoadStyle(3)
							   Case Else
										If trim(App_SiteLink(0,i)) <> "" Then
												LoadSiteLink = RLoadStyle(2)
										Else
												LoadSiteLink = RLoadStyle(3)
										End If
						End Select
					   ReplaceStyle "url",trim(App_SiteLink(1,i)),LoadSiteLink
					   ReplaceStyle "name",trim(App_SiteLink(2,i)),LoadSiteLink
					   ReplaceStyle "pic_url",Eshop_url & trim(App_SiteLink(0,i)),LoadSiteLink
					   ReplaceStyle "loop_num",i+1,LoadSiteLink
					   TmpLoadSiteLink = TmpLoadSiteLink & LoadSiteLink
				Next
				SiteLink = SiteLink & TmpLoadSiteLink
		Else
		        RLoadStyle(1) = splits(LoadStyle(strFile&"1.style"))
				SiteLink = SiteLink & RLoadStyle(1)
		End If
		SiteLink = SiteLink & RLoadStyle(4)
End Function

'..................................
'读取首页专题
'z_topnum 调用数量 0 为默认数量
'z_classid 分类ID 0 为所有分类
'z_type 显示模式 0文本模式 1 图片模式
'z_state 是否推荐 0 为所有 1 为推荐 2 为不推荐
'z_order 排序方式 0 为时间 1 为浏览量
'z_cutnumber 标题截取字符数
'..................................
Public Function NewsShow(z_topnum,z_classid,z_type,z_state,z_order,z_cutnumber)
		z_topnum = checknum(z_topnum,0) : z_classid = checknum(z_classid,0) : z_type = checknum(z_type,0) : z_state = checknum(z_state,0) : z_order = checknum(z_order,0) : z_cutnumber = checknum(z_cutnumber,12)
		If z_topnum = 0 Then z_topnum = top1
		If z_classid = 0 Then z_classid = classid '如果分类ID是0，则读取分类列表中的分类ID 2008-4-11 by 56770.kingdge
		z_classid = checknum(z_classid,0)
		Dim strFile,RLoadStyle(6)
		strFile = Eshop_url& Style_Folder &"Lebi.NewsShow."
        Dim rs,sql,Data_NewsShow,App_NewsShow,NewsShow_i,LoadNewsShow,TmpLoadNewsShow
		cache.name="NewsShow"& LangTxt &z_topnum&z_linenum&z_classid&z_type&z_state&z_order&z_cutnumber
		cache.reloadtime= 5000
		If cache.objisempty() Then
		        sql = "select top "& z_topnum &" id,title"& LangTxt &",pic,pic_src,strcolor,n_filename from [Lebi_news] where 1=1"
				If IsSqlDataBase = 1 And z_classid <> 0 Then sql = sql &" and charindex(',"&z_classid&",',classid)>0"
				If IsSqlDataBase = 0 And z_classid <> 0 Then sql = sql &" and instr(classid,',"&z_classid&",')>0"
		        If z_type = 1 Then sql = sql &" and pic_src > ''"
				If z_state <> 0 Then sql = sql &" and n_tj ="& z_state &""
		        If z_order = 0 Then sql = sql &" order by id desc"
		        If z_order = 1 Then sql = sql &" order by hits desc,id desc"
		        set Rs = conn.execute(sql)
		        if rs.eof And rs.bof Then
				        cache.value = ""
                        cache.DataCount = 0
		        Else
                        cache.value = rs.getrows
						cache.DataCount = 1
		        End If
		        rs.close : Set rs = Nothing
		End If
		App_NewsShow = cache.value
		Data_NewsShow = cache.DataCount
		RLoadStyle(0) = LoadStyle(strFile&"0.style")
		RLoadStyle(6) = LoadStyle(strFile&"6.style")
		NewsShow = RLoadStyle(0)
        If Data_NewsShow = 1 Then
			RLoadStyle(2) = Splits(LoadStyle(strFile&"2.style"))
			Select Case z_type
				   Case "0"
					   If z_classid = 0 Then
							   RLoadStyle(4) = Splits(LoadStyle(strFile&"4.style"))
							   RLoadStyle(2) = RLoadStyle(4)
					   Else
							   RLoadStyle(5) = Splits(LoadStyle(strFile&"5.style"))
							   RLoadStyle(2) = RLoadStyle(5)
					   End If
				   Case "1"
					   If z_classid = 0 Then
							   RLoadStyle(2) = RLoadStyle(2)
					   Else
							   RLoadStyle(3) = Splits(LoadStyle(strFile&"3.style"))
							   RLoadStyle(2) = RLoadStyle(3)
					   End If
			End Select
			For NewsShow_i = 0 To UBound(App_NewsShow,2)
				If Not IsNull(Trim(App_NewsShow(1,NewsShow_i))) And Trim(App_NewsShow(1,NewsShow_i)) <> "" Then
					LoadNewsShow = RLoadStyle(2)
					Select Case show_html
						   Case "0"
								Select Case ISAPI_Rewrite
									   Case "0"
											Select Case Config_Lebi_Eshop(16)
												   Case "0" : ReplaceStyle "url",LangPath &"zhuanti.asp?action=news_list&id="& App_NewsShow(0,NewsShow_i),LoadNewsShow
												   Case "1" : ReplaceStyle "url",LangPath &"news/list/?id="& App_NewsShow(0,NewsShow_i),LoadNewsShow
												   Case "2" : ReplaceStyle "url",LangPath &"news/list/default.asp?id="& App_NewsShow(0,NewsShow_i),LoadNewsShow
											End Select
									   Case "1" ReplaceStyle "url",LangPath &"news_list-"& App_NewsShow(0,NewsShow_i) &".html",LoadNewsShow
								End Select
						   Case "1" : ReplaceStyle "url",LangPath & Folder(1) &"info/"& App_NewsShow(5,NewsShow_i) &"."& Sys_Ext,LoadNewsShow
					End Select
					ReplaceStyle "title",App_NewsShow(1,NewsShow_i),LoadNewsShow
					ReplaceStyle "color",Cutchar(App_NewsShow(4,NewsShow_i),z_cutnumber),LoadNewsShow
					ReplaceStyle "cut_title",Cutchar(App_NewsShow(1,NewsShow_i),z_cutnumber),LoadNewsShow
					ReplaceStyle "pic_src",App_NewsShow(3,NewsShow_i),LoadNewsShow
					ReplaceStyle "loop_num",NewsShow_i+1,LoadNewsShow
					TmpLoadNewsShow = TmpLoadNewsShow + LoadNewsShow
				End If 
			Next
			NewsShow = NewsShow & TmpLoadNewsShow
		Else
			RLoadStyle(1) = splits(LoadStyle(strFile&"1.style"))
			NewsShow = NewsShow & RLoadStyle(1)
		End If
		NewsShow = NewsShow & RLoadStyle(6)
End Function
rem	}->

Function NewsPicShow(topnum)
		topnum = checknum(topnum,4)
		Dim strFile,RLoadStyle(3),rs,sql,App_NewsPicShow,DataCount,i,LoadNewsPicShow,TmpNewsPicShow, TmpLoadNewsPicShow
		strFile = Eshop_url& Style_Folder &"Lebi.NewsPicShow."
		cache.name="NewsPicShow"& LangTxt
		cache.reloadtime= 5000
		If cache.objisempty() Then
		        sql = "select top "& topnum &" id,title"& LangTxt &",pic_src,n_filename from [Lebi_news] where pic=1 order by infotime desc"
		        set Rs = conn.execute(sql)
		        if rs.eof And rs.bof Then
				        cache.value = ""
                        cache.DataCount = 0
		        Else
                        cache.value = rs.getrows
						cache.DataCount = 1
		        End If
		        rs.close : Set rs = Nothing
		End If
		App_NewsPicShow = cache.value
		DataCount = cache.DataCount
		RLoadStyle(0) = splits(LoadStyle(strFile&"0.style"))
		RLoadStyle(3) = splits(LoadStyle(strFile&"3.style"))
'		ReplaceStyle "countnum",UBound(App_NewsPicShow,2)+1,NewsPicShow
		If DataCount > 0 Then
			NewsPicShow = RLoadStyle(0)
			ReplaceStyle "countnum",UBound(App_NewsPicShow,2)+1,NewsPicShow
			RLoadStyle(2) = splits(LoadStyle(strFile&"2.style"))
			For i = 0 To UBound(App_NewsPicShow,2)
				If Not IsNull(Trim(App_NewsPicShow(1,i))) And Trim(App_NewsPicShow(1,i)) <> "" Then
					LoadNewsPicShow = RLoadStyle(2)
					Select Case show_html
						   Case "0"
								Select Case ISAPI_Rewrite
									   Case "0"
											Select Case Config_Lebi_Eshop(16)
												   Case "0" : ReplaceStyle "url",Eshop_url & LangPath &"zhuanti.asp?action=news_list&id="& App_NewsPicShow(0,i),LoadNewsPicShow
												   Case "1" : ReplaceStyle "url",Eshop_url & LangPath &"news/list/?id="& App_NewsPicShow(0,i),LoadNewsPicShow
												   Case "2" : ReplaceStyle "url",Eshop_url & LangPath &"news/list/default.asp?id="& App_NewsPicShow(0,i),LoadNewsPicShow
											End Select
									   Case "1" ReplaceStyle "url",Eshop_url & LangPath &"news_list-"& App_NewsPicShow(0,i) &".html",LoadNewsPicShow
								End Select
						   Case "1" : ReplaceStyle "url",Eshop_url & LangPath & Folder(1) &"info/"& App_NewsPicShow(3,i) &"."& Sys_Ext,LoadNewsPicShow
					End Select
					If InStr(App_NewsPicShow(2,i),"http://") > 0 Then 
							ReplaceStyle "pic_url",App_NewsPicShow(2,i),LoadNewsPicShow
					Else
							ReplaceStyle "pic_url",Eshop_url & App_NewsPicShow(2,i),LoadNewsPicShow
					End If 
					ReplaceStyle "title",App_NewsPicShow(1,i),LoadNewsPicShow
					ReplaceStyle "loop_num",i+1,LoadNewsPicShow
					TmpLoadNewsPicShow = TmpLoadNewsPicShow & LoadNewsPicShow
				End If 
			Next
			NewsPicShow = NewsPicShow & TmpLoadNewsPicShow & RLoadStyle(3)
		Else
			NewsPicShow = ""
		End If
End Function

Function NewsTop()
		Dim strFile,RLoadStyle(3),rs,sql,App_NewsTop,DataCount,i,LoadNewsTop,TmpNewsTop,content,TmpLoadNewsTop
		strFile = Eshop_url& Style_Folder &"Lebi.NewsTop."
		classid = checknum(classid,0)
		cache.name="NewsTop"& LangTxt & classid
		cache.reloadtime= 5000
		If cache.objisempty() Then
		        sql = "select top 1 id,title"& LangTxt &",content_view"& LangTxt &",content"& LangTxt &",strcolor,n_filename from [Lebi_news] where n_top=1"
				If IsSqlDataBase = 1 And classid <> 0 Then sql = sql &" charindex(',"&classid&",',classid)>0"
				If IsSqlDataBase = 0 And classid <> 0 Then sql = sql &" instr(classid,',"&classid&",')>0"
				sql = sql &" order by infotime desc"
		        set Rs = conn.execute(sql)
		        if rs.eof And rs.bof Then
				        cache.value = ""
                        cache.DataCount = 0
		        Else
                        cache.value = rs.getrows
						cache.DataCount = 1
		        End If
		        rs.close : Set rs = Nothing
		End If
		App_NewsTop = cache.value
		DataCount = cache.DataCount
		RLoadStyle(0) = LoadStyle(strFile&"0.style")
		RLoadStyle(3) = LoadStyle(strFile&"3.style")
		NewsTop = RLoadStyle(0)
		If DataCount = 1 Then
				RLoadStyle(2) = splits(LoadStyle(strFile&"2.style"))
				For i = 0 To UBound(App_NewsTop,2)
						LoadNewsTop = RLoadStyle(2)
						Select Case show_html
							   Case "0"
									Select Case ISAPI_Rewrite
										   Case "0"
												Select Case Config_Lebi_Eshop(16)
													   Case "0" : ReplaceStyle "url",LangPath &"zhuanti.asp?action=news_list&id="& App_NewsTop(0,i),LoadNewsTop
													   Case "1" : ReplaceStyle "url",LangPath &"news/list/?id="& App_NewsTop(0,i),LoadNewsTop
													   Case "2" : ReplaceStyle "url",LangPath &"news/list/default.asp?id="& App_NewsTop(0,i),LoadNewsTop
												End Select
										   Case "1" ReplaceStyle "url",LangPath &"news_list-"& App_NewsTop(0,i) &".html",LoadNewsTop
									End Select
							   Case "1" : ReplaceStyle "url",LangPath & Folder(1) &"info/"& App_NewsTop(5,i) &"."& Sys_Ext,LoadNewsTop
						End Select
						content = RemoveHTML(App_NewsTop(2,i))
						If content = "" Or IsNull(content) Then content = Left(RemoveHTML(App_NewsTop(3,i)),200)
						content = Replace(content,Chr(13),"<br />")&"……"
						ReplaceStyle "title",App_NewsTop(1,i),LoadNewsTop
						ReplaceStyle "color",App_NewsTop(4,i),LoadNewsTop
						ReplaceStyle "content",content,LoadNewsTop
						TmpLoadNewsTop = TmpLoadNewsTop & LoadNewsTop
				Next
		Else
				RLoadStyle(1) = splits(LoadStyle(strFile&"1.style"))
				TmpLoadNewsTop = RLoadStyle(1)
		End If
		NewsTop = NewsTop & TmpLoadNewsTop & RLoadStyle(3)
End Function

Function checkPricePurview(price_dj)
		Dim Grade
		Grade = request.cookies(cookiesname&"_user")("user_grade")
		If Grade = "" Then Grade = session(cookiesname&"_user"&"user_grade")
		Grade = checknum(Grade,0)
		price_dj = checknum(price_dj,0)
		If Grade = 0 Then
				If InStr(cache_ugrade_qx(Grade),","&price_dj+1&",")>0 And price_dj = 0 Then
						checkPricePurview = True
						Exit Function
				End If
				If InStr(cache_ugrade_qx(Grade),","&price_dj&",")>0 Then
						checkPricePurview = True
				Else
						checkPricePurview = False
				End If
		Else
				If InStr(cache_ugrade_qx(Grade),","&price_dj&",")>0 Then
						checkPricePurview = True
				Else
						checkPricePurview = false
				End If
		End If
End Function

Function GuestBookShow(shownum,showtype,showlength)
		shownum = checknum(shownum,5) : showtype = checknum(showtype,0) : showlength = checknum(showlength,12)
        Dim Getrows_GuestBookShow,GuestBookShow_i,strFile,GuestBookShowContent
		strFile = Eshop_url& Style_Folder &"Lebi.GuestBookShow."
		cache.name="GuestBookShow"
		cache.reloadtime= 5000
		If cache.objisempty() Then
                Set rs = conn.execute("select top "& shownum &" name,title,content,time from Guestbook where show = 1 order by time desc")
				If Not (rs.eof And rs.bof) Then
						cache.value = rs.getrows
						cache.DataCount = 1
				Else
				        cache.value = ""
						cache.DataCount = 0
				End If
				rs.close : Set rs = Nothing
		End If
        If cache.DataCount = 1 Then
                Getrows_GuestBookShow = cache.value
				GuestBookShow = splits(LoadStyle(strFile&"0.style"))

				For GuestBookShow_i = 0 To UBound(Getrows_GuestBookShow,2)
                        GuestBookShow=GuestBookShow & LoadStyle(strFile&"1.style") & splits(LoadStyle(strFile&"2.style"))
						ReplaceStyle "name",Getrows_GuestBookShow(0,GuestBookShow_i),GuestBookShow
						ReplaceStyle "title",Getrows_GuestBookShow(1,GuestBookShow_i),GuestBookShow
						ReplaceStyle "time",Getrows_GuestBookShow(3,GuestBookShow_i),GuestBookShow
						If showtype = 1 Then
								GuestBookShowContent = splits(LoadStyle(strFile&"3.style"))
								ReplaceStyle "content",Cutchar(Getrows_GuestBookShow(2,GuestBookShow_i),showlength),GuestBookShowContent
						End If
						ReplaceStyle "loop_num",GuestBookShow_i + 1,GuestBookShow
						GuestBookShow = GuestBookShow & splits(GuestBookShowContent) & LoadStyle(strFile&"4.style")
                Next
				GuestBookShow=GuestBookShow & splits(LoadStyle(strFile&"5.style"))
	    End If
End Function

Function NewsSearch()
        Dim Getrows_NewsSearch,NewsSearch_i,strFile,CategoryOption
		strFile = Eshop_url& Style_Folder &"Lebi.NewsSearch."
		NewsSearch = splits(LoadStyle(strFile&"0.style"))
		cache.name="NewsSearch"& LangTxt
		cache.reloadtime= 5000
		If cache.objisempty() Then
                Set rs = conn.execute("select classid,classname"& LangTxt &" from Lebi_newsclass order by b_order desc")
				If Not (rs.eof And rs.bof) Then
						cache.value = rs.getrows
						cache.DataCount = 1
				Else
				        cache.value = ""
						cache.DataCount = 0
				End If
				rs.close : Set rs = Nothing
		End If
        If cache.DataCount = 1 Then
                Getrows_NewsSearch = cache.value
				CategoryOption = "<select name=""classid"">"
				CategoryOption = CategoryOption & "<option value=""0"">"& Lebi_word(71) &"</option>"
				For NewsSearch_i = 0 To UBound(Getrows_NewsSearch,2)
					If Not IsNull(Trim(Getrows_NewsSearch(1,NewsSearch_i))) And Trim(Getrows_NewsSearch(1,NewsSearch_i)) <> "" Then
						CategoryOption = CategoryOption & "<option value="""& Getrows_NewsSearch(0,NewsSearch_i) &""">"& Getrows_NewsSearch(1,NewsSearch_i) &"</option>"
					End If 
                Next
				CategoryOption = CategoryOption & "</select>"
	    End If
		ReplaceStyle "category",CategoryOption,NewsSearch
		Select Case Config_Lebi_Eshop(16)
			   Case "0" : ReplaceStyle "url",LangPath &"zhuanti.asp?action=news_class",NewsSearch
			   Case "1" : ReplaceStyle "url",LangPath &"news/class/",NewsSearch
			   Case "2" : ReplaceStyle "url",LangPath &"news/class/default.asp",NewsSearch
		End Select
End Function

rem <-{商品评论调用 by 56770.Kingdge 2009-3-20
Function CommentShow(shownum,contentlen,namelen)
        Dim Getrows_CommentShow,CommentShow_i,strFile,CommentShowContent,url
		strFile = Eshop_url& Style_Folder &"Lebi.CommentShow."
		cache.name="CommentShow"& LangTxt
		cache.reloadtime= 5000
		If cache.objisempty() Then
                Set rs = conn.execute("select top "& shownum &" d.name,d.content,d.vtime,d.downid,p.pic,p.product_name"& LangTxt &",p.p_filename from Lebi_Dvote as d,Lebi_Product as p where d.downid = p.id and d.show = 1 and LangTxt = '"& LangTxt &"' order by d.vtime desc,d.id desc")
				If Not (rs.eof And rs.bof) Then
						cache.value = rs.getrows
						cache.DataCount = 1
				Else
				        cache.value = ""
						cache.DataCount = 0
				End If
				rs.close : Set rs = Nothing
		End If
		CommentShow = splits(LoadStyle(strFile&"0.style"))
        If cache.DataCount = 1 Then
                Getrows_CommentShow = cache.value
				For CommentShow_i = 0 To UBound(Getrows_CommentShow,2)
                        CommentShow=CommentShow & LoadStyle(strFile&"2.style")
						Select Case show_html
							   Case "0"
									Select Case ISAPI_Rewrite
										   Case "0" url=Eshop_url & PagePath(10) &"?id="& Getrows_CommentShow(3,CommentShow_i)
										   Case "1" url=Eshop_url & LangPath &"product-"& Getrows_CommentShow(3,CommentShow_i) &".html"
									End Select
							   Case "1" : url=Eshop_url & LangPath & Folder(0) & Getrows_CommentShow(6,CommentShow_i) &".1."& Sys_Ext
						End Select
						ReplaceStyle "user",Getrows_CommentShow(0,CommentShow_i),CommentShow
						ReplaceStyle "content",Getrows_CommentShow(1,CommentShow_i),CommentShow
						ReplaceStyle "shortcontent",Cutchar(Getrows_CommentShow(1,CommentShow_i),contentlen),CommentShow
						ReplaceStyle "time",FormatDateTime(Getrows_CommentShow(2,CommentShow_i),2),CommentShow
						ReplaceStyle "url",url,CommentShow
						ReplaceStyle "pic_src",Eshop_url & PicturePath & Getrows_CommentShow(4,CommentShow_i),CommentShow
						ReplaceStyle "name",Getrows_CommentShow(5,CommentShow_i),CommentShow
						ReplaceStyle "shortname",Cutchar(Getrows_CommentShow(5,CommentShow_i),contentlen),CommentShow
						ReplaceStyle "loop_num",CommentShow_i + 1,CommentShow
                Next
		Else
				CommentShow=CommentShow & splits(LoadStyle(strFile&"1.style"))
		End If
		CommentShow=CommentShow & splits(LoadStyle(strFile&"3.style"))
End Function
rem }->

rem <-{发货通知调用 by 56770.Kingdge 2009-3-22
Function ShipmentMessageShow(shownum)
		shownum = checknum(shownum,10)
        Dim Getrows_ShipmentMessageShow,ShipmentMessageShow_i,strFile,ShipmentMessageShowContent,url
		strFile = Eshop_url& Style_Folder &"Lebi.ShipmentMessageShow."
		cache.name="ShipmentMessageShow"
		cache.reloadtime= 5000
		If cache.objisempty() Then
                Set rs = conn.execute("select top "& shownum &" s_order_number,s_name,s_no,s_user_name,s_date,s_fei1,s_fei2 from Lebi_ShipMes order by s_id desc")
				If Not (rs.eof And rs.bof) Then
						cache.value = rs.getrows
						cache.DataCount = 1
				Else
				        cache.value = ""
						cache.DataCount = 0
				End If
				rs.close : Set rs = Nothing
		End If
		ShipmentMessageShow = splits(LoadStyle(strFile&"0.style"))
        If cache.DataCount = 1 Then
                Getrows_ShipmentMessageShow = cache.value
				For ShipmentMessageShow_i = 0 To UBound(Getrows_ShipmentMessageShow,2)
                        ShipmentMessageShow=ShipmentMessageShow & LoadStyle(strFile&"2.style")
						ReplaceStyle "order_number",Getrows_ShipmentMessageShow(0,ShipmentMessageShow_i),ShipmentMessageShow
						ReplaceStyle "name",Getrows_ShipmentMessageShow(1,ShipmentMessageShow_i),ShipmentMessageShow
						ReplaceStyle "number",Getrows_ShipmentMessageShow(2,ShipmentMessageShow_i),ShipmentMessageShow
						ReplaceStyle "username",Getrows_ShipmentMessageShow(3,ShipmentMessageShow_i),ShipmentMessageShow
						ReplaceStyle "time",Getrows_ShipmentMessageShow(4,ShipmentMessageShow_i),ShipmentMessageShow
						ReplaceStyle "price",dw & formatnumber2(Getrows_ShipmentMessageShow(5,ShipmentMessageShow_i)) & dw2,ShipmentMessageShow
						ReplaceStyle "loop_num",ShipmentMessageShow_i + 1,ShipmentMessageShow
						ShipmentMessageShow=splits(ShipmentMessageShow)
                Next
		Else
				ShipmentMessageShow=ShipmentMessageShow & splits(LoadStyle(strFile&"1.style"))
		End If
		ShipmentMessageShow=ShipmentMessageShow & splits(LoadStyle(strFile&"3.style"))
End Function
rem }->

Function GuestBookMessage()
        Dim notice
        set Rs = conn.execute("select notice"& LangTxt &" from [notice]")
        if rs(0)<>"" then
                notice = replace(rs(0),chr(13),"<br>")
                notice = replace(notice,chr(32),"&nbsp;")
                GuestBookMessage= notice
        else
                GuestBookMessage=""
        end if
        rs.close:set rs=Nothing
End Function

Function Common(tag)
		cache.name="Lebi_Common"& tag & LangTxt
		cache.reloadtime= 5000
		If cache.objisempty() Then
				Set rs = conn.execute("select c_content"& LangTxt &",c_id from [Lebi_Common] where t_tag = '"& tag &"'")
				If Not rs.eof Then 
						cache.value = rs.getstring(,1,"<Common_"& tag & LangTxt &">","","")
						cache.DataCount = 1
						SqlNum = SqlNum + 1
				End If 
				rs.close:Set rs=Nothing
		End If
		If cache.DataCount = 1 Then 
				Common = Split(cache.value,"<Common_"& tag & LangTxt &">")(0)
		End If 
End Function 
%>