<!--#include file="conn.asp" -->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<!--#include file="../include/Lebi_config.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_sort.asp
'* 最后更新 2013-03-01 by 56770.kingdge
'*****************************************
Set LB_XML = new ASPXML
admin_flag=",3.1,"
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_sort.inc"
CurrentId = 1
CurrentUrl = "admin_sort.asp"
LB_Head()
LB_Menu()
If OutSubmit = 1 Then CheckOutSubmit()
action = request("action")
sort_id = CheckNum(request("sort_id"),0)
id = CheckNum(request("id"),0)
c_id = CheckNum(request("c_id"),0)
paixu = CheckNum(request("paixu"),0)
sort_pic = Safereplace(request("sort_pic"))
c_menu = CheckNum(request("c_menu"),0)
is_hide = CheckNum(request("is_hide"),0)
htmlstate = checknum(request("htmlstate"),1)
%>
<div class="tabmenu mainwidth">
      <ul>
		<%If action = "skin" Then%>
		<li <%If htmlstate = 0 Then response.write("class=""current""") End If%>><a href="admin_sort.asp?skin=<%=request("skin")%>&action=skin&id=<%=request("id")%>&sort_id=<%=request("sort_id")%>&htmlstate=0"><span><%=Lang_sys(104)%></span></a></li>
		<li <%If htmlstate = 1 Then response.write("class=""current""") End If%>><a href="admin_sort.asp?skin=<%=request("skin")%>&action=skin&id=<%=request("id")%>&sort_id=<%=request("sort_id")%>&htmlstate=1"><span><%=Lang_sys(105)%></span></a></li>
		<%End If%>
        <li <%If action = "" Or action = "query" Then Response.Write("class=""current""") End If%>><a href="admin_sort.asp"><span><%=Lang_Menu(75)%></span></a></li>
        <li <%If action = "rate" Or action = "rate_ok" Then Response.Write("class=""current""") End If%>><a href="?action=rate"><span><%=Lang_Sort(74)%></span></a></li>
        <li><a href="admin_update.asp?u_type=1&prev=<%=server.urlencode(Backurl())%>"><span><%=Lang_Sort(8)%></span></a></li>
        <li <%If action = "add" Or action = "add_ok" Then Response.Write("class=""current""") End If%>><a href="?action=add"><span><%=Lang_Sort(22)%></span></a></li>
        <li <%If action = "unite" Or action = "unite_ok" Then Response.Write("class=""current""") End If%>><a href="?action=unite"><span><%=Lang_Sort(70)%></span></a></li>
      </ul>
</div>
<%
Response.Write("<div class=""tab-mainbody"">")
Response.Write("<div class=""tab-mainbody2"">")
If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
        adminflag()
End If
Select Case action
	Case "add" : add()
	Case "add_ok" : add_ok()
	Case "del" : del()
	Case "modi" : modi()
	Case "modi_ok" : modi_ok()
	Case "sortmodi" : sortmodi()
	Case "hb" : hb()
	Case "hb_ok" : hb_ok()
	Case "up" : up()
	Case "down" : down()
	Case "skin" : skin()
	Case "skin_ok" : skin_ok()
	Case "query" query()
	Case "unite" : unite()
	Case "unite_ok" : unite_ok()
	Case "rate" : rate()
	Case "rate_ok" : rate_ok()
	Case Else
		list()
End Select
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

sub add_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
        sort_name=Safereplace(request("sort_name"))
		sort_skin=Safereplace(request("sort_skin"))
		If safereplace(request("user_skin"))<>"1" Then
				sort_skin=""
		End If
        a_ys1=safereplace(request("strcolor"))
        a_ys2=safereplace(request("strbgcolor"))
        a_ys3=safereplace(request("fontsize"))
        a_ys4=safereplace(request("font1"))
        a_ys5=safereplace(request("font2_1"))
        If a_ys5="1" Then
            a_ys5="bold"
        Else
            a_ys5=""
        End If
        a_ys6=safereplace(request("font2_2"))
        If a_ys6="1" Then
            a_ys6="italic"
        Else
            a_ys6=""
        End If
        a_ys7=safereplace(request("font2_3"))
        If a_ys7="1" Then
            a_ys7="underline"
        Else
            a_ys7=""
        End If
        name_ys=a_ys1&"|"&a_ys2&"|"&a_ys3&"|"&a_ys4&"|"&a_ys5&"|"&a_ys6&"|"&a_ys7&"|"
        pic_size = safereplace(request("sort_pic_w"))&"|"&safereplace(request("sort_pic_h"))&"|"
	    sort_class = CheckNum(request("sort_class"),0)
	    If sort_class = 0 Then
	            c_father = 1
	    Else
	            c_father = 0
	    End If
	    sort_title = Trim(replace(request("sort_title"),"'",""))
		sort_key = Trim(replace(request("sort_key"),"'",""))
		sort_des = Trim(replace(request("sort_des"),"'",""))
		sort_info = sort_title &"$"& sort_key &"$"& sort_des &"$"
		c_foldername = ReplaceFolder(safereplace(request("c_foldername")))
		c_filename = ReplaceFolder(safereplace(request("c_filename")))
		c_rate=Replace(Replace(Safereplace(request("c_rate"))," ",""),",","|")&"||||||||||"
        if sort_name="" then
                response.write"<SCRIPT language=JavaScript>alert('"& Lang_Sort(1) &"');javascript:history.go(-1)</SCRIPT>"
                response.end
        else
                sql="select * from [Lebi_category] where c_name='"& sort_name &"' and c_parentid = "& sort_class &""
                set rs=server.createobject("ADODB.Recordset")
                rs.open sql, conn, 1, 3
                if not(rs.eof or rs.bof)then
                        response.write"<SCRIPT language=JavaScript>alert('"& Lang_Sort(2) &"');javascript:history.go(-1)</SCRIPT>"
                        response.end
                else
                        rs.addnew
						For LangT = 1 To TotalLang
								rs("c_name" & LanguageTxt(LangT))=Trim(safereplace(request("sort_name" & LanguageTxt(LangT))))
								rs("c_info" & LanguageTxt(LangT))=Trim(safereplace(request("sort_title" & LanguageTxt(LangT)))) &"$"& Trim(safereplace(request("sort_key" & LanguageTxt(LangT)))) &"$"& Trim(safereplace(request("sort_des" & LanguageTxt(LangT)))) &"$"
						Next
                        rs("c_father") = c_father
                        rs("c_parentid") = sort_class
                        rs("c_pic") = sort_pic
                        rs("c_order") = paixu
                        rs("c_name_ys") = name_ys
                        rs("c_pic_size") = pic_size
						rs("c_menu") = c_menu
						rs("is_hide") = is_hide
						rs("c_skin") = sort_skin
						rs("c_foldername") = c_foldername
						rs("c_filename") = c_filename
						rs("c_rate") = c_rate
                        rs.update
                end if
                rs.close : Set rs= Nothing
				ChildCount=conn.execute("select count(*) from [lebi_category] where c_parentid="&sort_class)(0)
				conn.execute("update [lebi_category] set c_child = "& checknum(ChildCount,0) &" where c_id="& sort_class &"")
				Set rs = conn.execute("select top 1 c_id from [Lebi_category] where c_name='"& sort_name &"' and c_parentid = "& sort_class &"")
				If Not rs.eof Then
						id = rs(0)
						If sort_skin <> "" Then
								CreateSkin(sort_skin)
						End If
						If c_filename = "" Then conn.execute ("update [Lebi_category] set c_filename='"& id &"' where c_id=" & id &"")
						If c_foldername = "" Then conn.execute ("update [Lebi_category] set c_foldername='"& id &"' where c_id=" & id &"")
				End If
				rs.close : Set rs= Nothing
				If Config_Lebi_Eshop(17)="1" Then
						Application.Contents.RemoveAll
				End If
                ManageLog Lang_Sort(3) &" ["& sort_name &"]"
				If Config_Lebi_Eshop(16)<>"0" Then
						NewEvent "1"
				End If
				SaveJsOption()
				m_u = "admin_skin_save.asp?action=tpl_showsort_one&c_id="& id &"&mes_type=0"
'				If sort_skin <> "" Then
'						b_u = "admin_sort.asp?action=skin&skin="&sort_skin&"&id="&id
'				Else
                		b_u = "admin_sort.asp?sort_id="&sort_id
'				End If
		        Call Up_mes(Lang_sys(45),"·"& Lang_sys(99),0,m_u&"&b_u="& server.urlencode(b_u),0,0,2,1)
        end if
end Sub

sub modi_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
        sort_name=Safereplace(request("sort_name"))
		sort_skin=Safereplace(request("sort_skin"))
		If safereplace(request("user_skin"))<>"1"  Then
				sort_skin=""
		End If
        a_ys1=safereplace(request("strcolor"))
        a_ys2=safereplace(request("strbgcolor"))
        a_ys3=safereplace(request("fontsize"))
        a_ys4=safereplace(request("font1"))
        a_ys5=safereplace(request("font2_1"))
        If a_ys5="1" Then
            a_ys5="bold"
        Else
            a_ys5=""
        End If
        a_ys6=safereplace(request("font2_2"))
        If a_ys6="1" Then
            a_ys6="italic"
        Else
            a_ys6=""
        End If
        a_ys7=safereplace(request("font2_3"))
        If a_ys7="1" Then
            a_ys7="underline"
        Else
            a_ys7=""
        End If
        name_ys=a_ys1&"|"&a_ys2&"|"&a_ys3&"|"&a_ys4&"|"&a_ys5&"|"&a_ys6&"|"&a_ys7&"|"
        pic_size = safereplace(request("sort_pic_w"))&"|"&safereplace(request("sort_pic_h"))&"|"
	    sort_class = CheckNum(request("sort_class"),0)
	    If sort_class = 0 Then
	            c_father = 1
	    Else
	            c_father = 0
	    End If
	    sort_title = safereplace(request("sort_title"))
		sort_key = safereplace(request("sort_key"))
		sort_des = safereplace(request("sort_des"))
		sort_info = sort_title &"$"& sort_key &"$"& sort_des &"$"
		c_foldername = ReplaceFolder(safereplace(request("c_foldername")))
		c_filename = ReplaceFolder(safereplace(request("c_filename")))
		c_rate=Replace(Replace(Safereplace(request("c_rate"))," ",""),",","|")&"||||||||||"
        if sort_name="" then
                response.write"<SCRIPT language=JavaScript>alert('"& Lang_Sort(1) &"');javascript:history.go(-1)</SCRIPT>"
                response.end
        else
                sql = "select * from [Lebi_category] where c_name='"& sort_name &"' and c_parentid = "& sort_class &" and c_id <> "& id &""
                set rs= conn.execute(sql)
                If Not rs.eof Then
                        response.write"<SCRIPT language=JavaScript>alert('"& Lang_Sort(2) &"');javascript:history.go(-1)</SCRIPT>"
                        response.end
                End If
		        rs.Close : set rs= Nothing
				rem <-{类别转移所属类别更新原始类别下属类别数量 by 56770.kingdge 2011-01-13
                sql = "select c_parentid from [Lebi_category] where c_id = "& id &""
                set rs= conn.execute(sql)
                If Not rs.eof Then
                        If rs(0) <> 0 And CLng(sort_class) <> CLng(rs(0)) Then
								ChildCount=conn.execute("select count(*) from [lebi_category] where c_parentid="& rs(0))(0)
								conn.execute("update [lebi_category] set c_child = "& checknum(ChildCount,0)-1 &" where c_id="& rs(0) &"")
						End If
                End If
				rs.Close : set rs= Nothing
				rem }->
                sql="select * from [Lebi_category] where c_id = "& id &""
                set rs=server.createobject("ADODB.Recordset")
                rs.open sql, conn, 1, 3
						For LangT = 1 To TotalLang
								rs("c_name" & LanguageTxt(LangT))=Trim(safereplace(request("sort_name" & LanguageTxt(LangT))))
								rs("c_info" & LanguageTxt(LangT))=Trim(safereplace(request("sort_title" & LanguageTxt(LangT)))) &"$"& Trim(safereplace(request("sort_key" & LanguageTxt(LangT)))) &"$"& Trim(safereplace(request("sort_des" & LanguageTxt(LangT)))) &"$"
						Next
                        rs("c_father") = c_father
                        rs("c_parentid") = sort_class
                        rs("c_pic") = sort_pic
                        rs("c_order") = paixu
                        rs("c_name_ys") = name_ys
                        rs("c_pic_size") = pic_size
						rs("c_menu") = c_menu
						rs("is_hide") = is_hide
						rs("c_skin") = sort_skin
						rs("c_foldername") = c_foldername
						rs("c_filename") = c_filename
						rs("c_rate") = c_rate
                        rs.update
						If sort_skin <> "" Then
								CreateSkin(sort_skin)
						End If
                rs.close
                set rs=Nothing
				ChildCount=conn.execute("select count(*) from [lebi_category] where c_parentid="&sort_class)(0)
				conn.execute("update [lebi_category] set c_child = "& checknum(ChildCount,0) &" where c_id="& sort_class &"")
				If Config_Lebi_Eshop(17)="1" Then
						Application.Contents.RemoveAll
				End If
				SaveJsOption()
                ManageLog Lang_Sort(5) &" ["&sort_name&"]"
				m_u = "admin_skin_save.asp?action=tpl_showsort_one&c_id="& id &"&mes_type=0"
				b_u = "admin_sort.asp?sort_id="&sort_id
		        Call Up_mes(Lang_sys(48),"·"& Lang_sys(99),0,m_u&"&b_u="& server.urlencode(b_u),0,0,2,1)
        end if
end Sub

Sub hb_ok()
		unitesort1 = checknum(request.Form("unitesort1"),0)
		unitesort2 = checknum(request.Form("unitesort2"),0)
		For LangT = 1 To TotalLang
				conn.execute("update [lebi_Category] set c_name" & LanguageTxt(LangT) &" = '"& Trim(safereplace(request("sort_name" & LanguageTxt(LangT)))) &"' where c_id = "& unitesort1 &"")
		Next
		rem <-{更新类别2下属类别数量 by 56770.kingdge 2011-01-13
		sql = "select c_parentid from [Lebi_category] where c_id = "& unitesort2 &""
		set rs= conn.execute(sql)
		If Not rs.eof Then
				If rs(0) <> 0 Then
						ChildCount=conn.execute("select count(*) from [lebi_category] where c_parentid="& rs(0))(0)
						conn.execute("update [lebi_category] set c_child = "& checknum(ChildCount,0)-1 &" where c_id="& rs(0) &"")
				End If
				conn.execute("update [lebi_Category] set c_parentid = "& unitesort1 &" where c_parentid = "& unitesort2 &"")
		End If
		rs.Close : set rs= Nothing
		rem }->
		Set rs = conn.execute("select c_id from [lebi_Category] where c_parentid = "& unitesort2 &"")
		If Not rs.eof Then
				c_id = rs(0)
		End If
		rs.close : Set rs = Nothing
		If CLng(c_id) = CLng(unitesort1) Then
				Set rs = conn.execute("select c_parentid from [lebi_Category] where c_id = "& unitesort2 &"")
				If Not rs.eof Then
					c_id = rs(0)
				End If
				rs.close : Set rs = Nothing
				conn.execute("update [lebi_Category] set c_parentid = "& c_id &" where c_parentid = "& unitesort2 &"")
		Else
				conn.execute("update [lebi_Category] set c_parentid = "& unitesort1 &" where c_parentid = "& unitesort2 &"")
		End If
		conn.execute("delete from [lebi_Category] where c_id = "& unitesort2 &"")
		Set rs = server.CreateObject("adodb.recordset")
		sql = "Select categoryid from [lebi_Product] where 1=1"
		If IsSqlDataBase = 1 Then sql=sql + " and charindex(',"& unitesort2 &",',categoryid)>0"
		If IsSqlDataBase = 0 Then sql=sql + " and instr(categoryid,',"& unitesort2 &",')>0"
		rs.open sql,conn,1,3
		Do While Not rs.eof
				rs(0) = Replace(rs(0),","& unitesort2 &",",","& unitesort1 &",")
				rs.update
		rs.movenext
		Loop
		rs.close : Set rs = Nothing
		rem <-{更新类别1下属类别数量 by 56770.kingdge 2011-01-13
		sql = "select c_parentid from [Lebi_category] where c_id = "& unitesort1 &""
		set rs= conn.execute(sql)
		If Not rs.eof Then
				If rs(0) <> 0 Then
						ChildCount=conn.execute("select count(*) from [lebi_category] where c_parentid="& rs(0))(0)
						conn.execute("update [lebi_category] set c_child = "& checknum(ChildCount,0) &" where c_id="& rs(0) &"")
				End If
				ChildCount=conn.execute("select count(*) from [lebi_category] where c_parentid="& unitesort1)(0)
				conn.execute("update [lebi_category] set c_child = "& checknum(ChildCount,0) &" where c_id="& unitesort1 &"")
		End If
		rs.Close : set rs= Nothing
		rem }->
		SaveJsOption()
		ManageLog Lang_Sort(6) &" ["& unitesortto&"]"
		m_u="?sort_id="& sort_id
		Call Up_mes(Lang_sys(69),"·"& Lang_sys(68),0,m_u,0,0,2,1)
End Sub

sub del()
        If OnlyRead = 1 Then OnlyReadMessage()
		If IsSqlDataBase = 1 Then
				Set rs = conn.execute("select c_parentid from [Lebi_category] where c_id = "& id &"")
				If Not rs.eof Then
						ChildCount=conn.execute("select count(*) from [lebi_category] where c_parentid="&rs(0))(0)
						conn.execute("update [lebi_category] set c_child = "& checknum(ChildCount,0)-1 &" where c_id="& rs(0) &"")
						conn.execute("delete from [lebi_category] where c_id = "& id &"")
				End If
				rs.close : Set rs = Nothing
		Else
				Set rs = server.CreateObject("adodb.recordset")
				rs.open "select c_parentid from [Lebi_category] where c_id = "& id &"",conn,1,3
				If Not rs.eof Then
						ChildCount=conn.execute("select count(*) from [lebi_category] where c_parentid="&rs(0))(0)
						conn.execute("update [lebi_category] set c_child = "& checknum(ChildCount,0)-1 &" where c_id="& rs(0) &"")
						rs.delete
						rs.update
				End If
				rs.close : Set rs = Nothing
		End If 
		conn.execute("delete from [Lebi_category] where c_parentid = "& id &"")
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		End If
		SaveJsOption()
		ManageLog Lang_Sort(7) &" ["&id&"]"
		Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,"?sort_id="& sort_id,0,0,2,1)
end Sub

Sub up()
        If OnlyRead = 1 Then OnlyReadMessage()
        conn.execute "update [Lebi_category] set c_order=c_order+1 where c_id=" & c_id
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		End If
		SaveJsOption()
        response.redirect "?sort_id="& sort_id
        response.end()
End Sub

Sub down()
        If OnlyRead = 1 Then OnlyReadMessage()
        conn.execute "update [Lebi_category] set c_order=c_order-1 where c_id=" & c_id
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		End If
		SaveJsOption()
        response.redirect "?sort_id="& sort_id
        response.end()
End Sub

sub unite_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
        sort_name=Safereplace(request("sort_name"))
	    sort_class = CheckNum(request("sort_class"),0)
	    If sort_class = 0 Then
	            c_father = 1
	    Else
	            c_father = 0
	    End If
        a_ys1=safereplace(request("strcolor"))
        a_ys2=safereplace(request("strbgcolor"))
        a_ys3=safereplace(request("fontsize"))
        a_ys4=safereplace(request("font1"))
        a_ys5=safereplace(request("font2_1"))
        If a_ys5="1" Then
            a_ys5="bold"
        Else
            a_ys5=""
        End If
        a_ys6=safereplace(request("font2_2"))
        If a_ys6="1" Then
            a_ys6="italic"
        Else
            a_ys6=""
        End If
        a_ys7=safereplace(request("font2_3"))
        If a_ys7="1" Then
            a_ys7="underline"
        Else
            a_ys7=""
        End If
        name_ys=a_ys1&"|"&a_ys2&"|"&a_ys3&"|"&a_ys4&"|"&a_ys5&"|"&a_ys6&"|"&a_ys7&"|"
		arr_sort_name = Split(sort_name,Chr(13)&Chr(10))
		For i = 0 To UBound(arr_sort_name)
		If Trim(arr_sort_name(i)) <> "" Then
                sql="select * from [Lebi_category] where c_name='"& arr_sort_name(i) &"' and c_parentid = "& sort_class &""
                set rs=server.createobject("ADODB.Recordset")
                rs.open sql, conn, 1, 3
                if rs.eof Then
                        rs.addnew
						For LangT = 1 To TotalLang
								rs("c_name" & LanguageTxt(LangT))=Split(Trim(safereplace(request("sort_name" & LanguageTxt(LangT)))),Chr(13)&Chr(10))(i)
								rs("c_info" & LanguageTxt(LangT))="$$$"
						Next
                        rs("c_father") = c_father
                        rs("c_parentid") = sort_class
                        rs("c_pic") = ""
                        rs("c_order") = UBound(arr_sort_name)-i
                        rs("c_name_ys") =  name_ys
                        rs("c_pic_size") = "30|30"
						rs("c_menu") = c_menu
						rs("is_hide") = is_hide
						rs("c_skin") = ""
						rs("c_rate") = "||||||||||||||||||||"
                        rs.update
                end if
                rs.close : Set rs= Nothing
				ChildCount=conn.execute("select count(*) from [lebi_category] where c_parentid="&sort_class)(0)
				conn.execute("update [lebi_category] set c_child = "& checknum(ChildCount,0) &" where c_id="& sort_class &"")
				Set rs = conn.execute("select top 1 c_id from [Lebi_category] where c_name='"& arr_sort_name(i) &"' and c_parentid = "& sort_class &"")
				If Not rs.eof Then
						id = rs(0)
						conn.execute ("update [Lebi_category] set c_filename='"& id &"',c_foldername='"& id &"' where c_id=" & id &"")
				End If
				rs.close : Set rs= Nothing
				If Config_Lebi_Eshop(17)="1" Then
						Application.Contents.RemoveAll
				End If
                ManageLog Lang_Sort(3) &" ["& sort_name &"]"
				If Config_Lebi_Eshop(16)<>"0" Then
						NewEvent "1"
				End If
		End If
		Next
		SaveJsOption()
		m_u = "admin_skin_save.asp?filename=product_list.htm&mes_type=0"
		b_u = "admin_sort.asp?action=unite"
		Call Up_mes(Lang_sys(45),"·"& Lang_sys(99),0,m_u&"&b_u="& server.urlencode(b_u),0,0,2,1)
end Sub

sub rate_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
		Set rs = server.CreateObject("adodb.recordset")
		rs.open "select c_id,c_rate from [Lebi_category] where c_father = 1 order by c_order desc",conn,1,3
		If Not rs.eof Then
				Do While Not rs.eof
					rs(1) = Replace(Replace(Safereplace(request("c_rate_"& rs(0) &""))," ",""),",","|")&"||||||||||"
					rs.update
				rs.movenext
				Loop
		End If
		rs.close : Set rs = Nothing
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		End If
		ManageLog Lang_Sort(75)
		Call Up_mes(Lang_sys(69),"·"& Lang_sys(68),0,"?action=rate",0,0,2,1)
end Sub

Sub list()
		lang = safereplace(request("lang"))
		If lang = "" Then lang = LanguageTxt(0)
%>
<script>
function cate_change(a,b)
{
	if(document.getElementById(""+a+"").style.display==''||document.getElementById(""+a+"").style.display=='block')
	{
		document.getElementById(""+a+"").style.display='none';
		document.getElementById(""+b+"").className='cate_open';
	}
	else
	{
		document.getElementById(""+a+"").style.display='';
		document.getElementById(""+b+"").className='cate_close';
	}
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<thead>
<tr>
	<form method="get" name="Lebi" action="?">
	<td height="30" align="left" class="classhead">
		<table border="0" cellspacing="0" cellpadding="0">
		<tr>
		<td>
		<select name="lang">
		<option value="" selected>┌ <%=Lang_sys(67)%></option>
		<%For LangT = 1 To TotalLang%>
		<option value="<%= LanguageTxt(LangT) %>"<%=judge2(LanguageTxt(LangT),Lang)%>>├ <%= LanguageName(LangT) %></option>
		<%Next%>
		</select></td>
		<td style="padding-left:5px;"><input name="keyword" id="keyword" type="text" class="form_query" size="15" autocomplete="off" onkeyup="search_suggest('keyword','lebi_category','<%=lang%>')"><input name="Submit" type="submit" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query"><input type="hidden" name="action" value="query"><br /><div id="search_suggest_keyword" class="search_suggest" style="display:none"></div></td>
		</tr>
		</table>
	</td>
	</form>
     <td class="classhead" align="right">
	 <%=QuickMenu("Admin_score.asp|"& Lang_Menu(75) &"","admin_brand.asp|"& Lang_Menu(76) &"")%>
	 </td>
</tr>
</thead>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="list" class="classtable2">
 <tr>
     <td class="classhead" height="30" align="center" colspan="9" style="line-height:180%;">
<%
sql = "Select c_id,c_name From [Lebi_category] where c_father = 1 order by c_order desc"
set Rs = conn.execute(sql)
do while not rs.eof
If CLng(sort_id) = CLng(rs("c_id")) Then
	Response.Write("<a href=""?sort_id="& rs("c_id") &"""><span style=""color:#ff0000;font-weight:bold;font-size:12px;"">"& rs("c_name") &"</span></a>&nbsp;&nbsp;|&nbsp;&nbsp;")
Else
	Response.Write("<a href=""?sort_id="& rs("c_id") &"""><span style=""font-size:12px;"">"& rs("c_name") &"</span></a>&nbsp;&nbsp;|&nbsp;&nbsp;")
End If
rs.movenext
loop
rs.close
%>
</td>
</tr>
<tr>
<td height="30" class="classtop" width="5%"><%=Lang_Sort(9)%></td>
<td class="classtop" width="22%"><%=Lang_Sort(10)%></td>
<td class="classtop" width="8%"><%=Lang_Sort(11)%></td>
<td class="classtop" width="8%"><%=Lang_Sort(12)%></td>
<td class="classtop" width="8%"><%=Lang_Sort(13)%></td>
<td class="classtop" width="8%"><%=Lang_Sort(14)%></td>
<td class="classtop" width="8%"><%=Lang_Sort(15)%></td>
<td class="classtop" width="8%"><%=Lang_Sort(16)%></td>
<td width="25%" class="classtop"><%=Lang_Sort(17)%></td>
</tr>
<%
If sort_id <> 0 Then
		response.write CategoryList(sort_id,0)
Else
		response.write CategoryList(0,0)
End If
%>
</table>
<script>tdshow("list");</script>
<%
End Sub

Sub add()
		rem <-{获取最大ID 2008-6-4 by Lebi.kingdge
		Set rs = conn.execute("select top 1 c_id from [Lebi_category] order by c_id desc")
		If Not rs.eof Then
		bigid = rs(0)+1
		Else
		bigid = 1
		End If
		rs.close : Set rs = Nothing
		rem }->
%>
		<script language="vbscript">
		function toAsc(str)
				toAsc = hex(asc(str))
		end function
		</script>
		<script language="javascript">
		function LebiCopyFolder(){
		var iscopy = document.getElementById('CopyFolder');
		if (iscopy.checked){
		document.getElementById('c_foldername').value=document.getElementById('sort_name').value;
		}
		}
		function LebiCopyFolderToPinYin(){
		var iscopy = document.getElementById('CopyFolderToPinYin');
		if (iscopy.checked){
		document.getElementById('c_foldername').value=CC2PY(document.getElementById('sort_name').value);
		}
		}
		function LebiCopyName(){
		var iscopy = document.getElementById('CopyName');
		if (iscopy.checked){
		document.getElementById('c_filename').value=document.getElementById('sort_name').value;
		}
		}
		function LebiCopyNameToPinYin(){
		var iscopy = document.getElementById('CopyNameToPinYin');
		if (iscopy.checked){
		document.getElementById('c_filename').value=CC2PY(document.getElementById('sort_name').value);
		}
		}
		function CheckForm()
		{
			if (CheckEmpty('sort_name<%= LanguageTxt(1) %>')){ShowMessage('sort_name<%= LanguageTxt(1) %>','<%=Lang_Sort(1)%>');return false;}
		}
		function showrate()
		{
			var sort_class=document.getElementById("sort_class").value;
			if (sort_class == 0)
			{
				document.getElementById('$_rate').style.display='block';
			}else{
				document.getElementById('$_rate').style.display='none';
			}
		}
		//类别文字样式预览效果 2008-6-4 by Lebi.kingdge
		function showstyle()
		{
			var text = document.getElementById('sort_name').value;
			if (text ==""){text="56770 EShop"}
			var color = document.getElementById('strcolor').value;
			var size = document.getElementById('fontsize').value;
			if (size > 50){size="12";text="Copyright www.56770.com"}else{if (size<8){size="12";text="56770 EShop"}}
			var fontfamily = document.getElementById('font1').options[document.getElementById('font1').selectedIndex].value;
			var bgcolor = document.getElementById('strbgcolor').value;
			var fontweight = document.getElementById('font2_1');
			if (fontweight.checked){fontweight = "bold"}else{fontweight = ""}
			var fontstyle = document.getElementById('font2_2');
			if (fontstyle.checked){fontstyle = "italic"}else{fontstyle = ""}
			var textdecoration = document.getElementById('font2_3');
			if (textdecoration.checked){textdecoration = "underline"}else{textdecoration = ""}
			document.getElementById('style').innerHTML = "<span style='font:"+size+"px;font-family:"+fontfamily+";color:"+color+";background:"+bgcolor+";font-weight:"+fontweight+";font-style:"+fontstyle+";text-decoration:"+textdecoration+";'>"+text+"</span>"
		}
		</script>
	   <script language="javascript" type="text/javascript" src="inc/js/PinYin.js"></script>
       <script language="javascript" type="text/javascript" src="inc/js/dialog.js"></script>
	   <script language="javascript" type="text/javascript" src="Upfile/js/Upload_Other.js"></script>
       <table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
            <form name="sort_add" method="post" action="?action=add_ok" onSubmit="return CheckForm();">
            <tr>
              <td class="classhead" height="30" align="left">
                <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
			</td>
			<td class="classhead" align="right">
			  <%=QuickMenu("","")%>
			</td>
           </tr>
            <tr>
              <td class="classtop" height="30" colspan="2" align="left"><%=Lang_Sort(22)%></td>
			</td>
           </tr>
			<tr>
			<td class="classbg" colspan="2">
			<ul id="tablist">
			   <%For LangT = 1 To TotalLang%>
			   <li<%If LangT = 1 Then response.write(" class=""selected""") End If%>><a rel="tcontent<%= LangT %>" style="CURSOR:hand;"><%= LanguageName(LangT) %></a></li>
			   <%Next%>
			</ul>
			<div id="tabcontentcontainer">
			<%For LangT = 1 To TotalLang%>
			   <div id="tcontent<%= LangT %>" class="tabcontent">
			   <table cellspacing="0" cellpadding="4" width="100%" border="0" id="add_<%= LangT %>">
			<tr class="classrow">
			<td width="15%" height="30" class="classrow"><%=Lang_Sort(23)%></td>
			<td class="classrow">
			<input type="text" id="sort_name<%= LanguageTxt(LangT) %>" name="sort_name<%= LanguageTxt(LangT) %>" onkeyup="showstyle()" class="form"> <span id="mes_sort_name<%= LanguageTxt(LangT) %>"></span>
			</td>
			</tr>
			<tr>
			<td class="classtop" height="30" colspan="2"><%=Lang_Sort(24)%></td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(25)%></td>
			<td class="classrow">
			<input name="sort_title<%= LanguageTxt(LangT) %>" type="text" size="60" value="" class="form">
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(26)%></td>
			<td class="classrow">
			<input name="sort_key<%= LanguageTxt(LangT) %>" type="text" size="60" value="" class="form">
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(27)%></td>
			<td class="classrow">
			<input name="sort_des<%= LanguageTxt(LangT) %>" type="text" size="60" value="" class="form">
			</td>
			</tr>
				</table>
				</div>
				<script>tdshow("add_<%= LangT %>");</script>
			<%Next%>
			</div>
			<script>showtabcontent("tablist")</script>
			<ul id="tablistmain">
			   <li class="selected"><a rel=""><%=Lang_sys(66)%></a></li>
			</ul>
			<div id="tabcontentcontainer">
			<table cellspacing="0" cellpadding="4" width="100%" border="0" id="add_other">
			<tr class="classrow">
			<td width="15%" height="30" class="classrow"><%=Lang_Sort(28)%></td>
			<td class="classrow" colspan="2">
			<select name="sort_class" id="sort_class" onchange="showrate()">
			<option value="0"><%=Lang_Sort(29)%></option>
			<%
			sort (0),ii,id
			ii = 0
			%>
			</select>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(30)%></td>
			<td class="classrow" colspan="2">
			<input type="radio" name="c_menu" value="1" checked><%=Lang_Sort(68)%> <input type="radio" name="c_menu" value="0"><%=Lang_Sort(69)%>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(31)%></td>
			<td class="classrow" colspan="2">
			<input type="radio" name="is_hide" value="0" checked> <%=Lang_Sort(32)%>
			<input type="radio" name="is_hide" value="1" > <%=Lang_Sort(33)%>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(34)%></td>
			<td class="classrow" colspan="2">
			<input type="text" name="paixu" class="form" value="0" size="5">
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(35)%></td>
			<td class="classrow" colspan="2">
			<input type="text" id="sort_pic" name="sort_pic" class="form"> <input type="button" id="Upload_sort_pic" name="Upload_sort_pic" value="<%=Lang_sys(52)%>" onclick="uploadpanel('sort_add','sort_pic','sort_pic')" class="btn_upload">
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(36)%></td>
			<td class="classrow" colspan="2">
			<input type="text" name="sort_pic_w" value="30" size="5" class="form"> Px
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(37)%></td>
			<td class="classrow" colspan="2">
			<input type="text" name="sort_pic_h" value="30" size="5" class="form"> Px
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(38)%></td>
			<td class="classrow" colspan="2">
			<table cellspacing="0" cellpadding="0"><tr><td>
			<input type="radio" name="user_skin" value="1" onclick="document.getElementById('$_skin').style.display='block';" /> <%=Lang_Sort(68)%>
			<input type="radio" name="user_skin" value="0" onclick="document.getElementById('$_skin').style.display='none';" checked /> <%=Lang_Sort(69)%></td>
			<td id="$_skin" style="padding-left:5px;display:none"><%=Lang_Sort(39)%><input type="text" name="sort_skin" class="form" value="Lebi.Category<%=bigid%>.style" size="41"></td></tr></table>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(40)%></td>
			<td class="classrow" colspan="2">
			<input name="c_foldername" id="c_foldername" value="" type="text" maxlength="250" class="form" size="20"> <input type="checkbox" onclick="LebiCopyFolder();" name="CopyFolder" id="CopyFolder" value="1" > <%=Lang_Sort(41)%> <input type="checkbox" onclick="LebiCopyFolderToPinYin();" name="CopyFolderToPinYin" id="CopyFolderToPinYin" value="1" > <%=Lang_Sort(42)%>
			</td>
			</tr>
			<tr id="$_rate" class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(72)%></td>
			<td class="classrow" colspan="2">
			<%
			For g = 1 To UserGroupNumber
			response.write cache_grade_name(g) &"：<input name=""c_rate"" id=""c_rate"" value="""" type=""text"" class=""form"" size=""5"" onkeyup=""value=value.replace(/[^\d\.]/g,'');"">&nbsp;&nbsp;"
			Next
			%> <img src="images/help.gif" align="absmiddle"  onmouseover="showhintinfo(this,0,0,'','<%=Lang_Sort(73)%>','50','up');" onmouseout="hidehintinfo();" />
			</td>
			</tr>
			<tr>
			<td class="classtop" height="30" colspan="3"><%=Lang_Sort(43)%>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(44)%></td>
			<td class="classrow">
			<input name="strcolor" type="text" size="7" id="strcolor" value="" onpropertychange="showstyle()" class="form"> <img border=0  id="s_strcolor" src="Images/rect.gif" width=18 onclick="colorcd('sort_add','strcolor','fontcolor')" align="absmiddle" style="cursor:pointer;">
			</td>
			<td width="360" align="center" rowspan="5"><div style="width:100%;height:150px;border:#CCC 1px solid;background:#FFF;"><p style="text-align:left;padding:5px;"><%=Lang_Sort(45)%></p><span id="style"></span></div>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(46)%></td>
			<td class="classrow">
			<input name="strbgcolor" type="text" size="7" id="strbgcolor" value="" onpropertychange="showstyle()" class="form"> <img border=0 id="s_strbgcolor" src="Images/rect.gif" width=18 onclick="colorcd('sort_add','strbgcolor','bgcolor')" align="absmiddle" style="cursor:pointer;">
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(47)%></td>
			<td class="classrow">
			<input id="fontsize" name="fontsize" type="text" size="5" value="12" onkeyup="showstyle()" class="form"> px
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(48)%></td>
			<td class="classrow">
			<select id="font1" name="font1" onChange="showstyle()">
				<option value="0"><%=Lang_Sort(49)%></option>
				<option value="宋体">宋体</option>
				<option value="黑体">黑体</option>
				<option value="楷体_GB2312">楷体</option>
				<option value="仿宋_GB2312">仿宋</option>
				<option value="隶书">隶书</option>
				<option value="幼圆">幼圆</option>
				<option value="Arial">Arial</option>
				<option value="Arial Black">Arial Black</option>
				<option value="Arial Narrow">Arial Narrow</option>
				<option value="Brush Script	MT">Brush Script MT</option>
				<option value="Century Gothic">Century Gothic</option>
				<option value="Comic Sans MS">Comic Sans MS</option>
				<option value="Courier">Courier</option>
				<option value="Courier New">Courier New</option>
				<option value="MS Sans Serif">MS Sans Serif</option>
				<option value="Script">Script</option>
				<option value="System">System</option>
				<option value="Times New Roman">Times New Roman</option>
				<option value="Tahoma">Tahoma</option>
				<option value="Verdana">Verdana</option>
				<option value="Wide Latin">Wide Latin</option>
				<option value="Webdings">Webdings</option>
				<option value="Wingdings">Wingdings</option>
			</select>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(50)%></td>
			<td class="classrow">
			<input type="checkbox" value="1" id="font2_1" name="font2_1" onClick="showstyle()"> <%=Lang_Sort(51)%>
			<input type="checkbox" value="1" id="font2_2" name="font2_2" onClick="showstyle()"> <%=Lang_Sort(52)%>
			<input type="checkbox" value="1" id="font2_3" name="font2_3" onClick="showstyle()"> <%=Lang_Sort(53)%>
			</td>
			</tr>
			<tr>
			<td class="classtop" height="30" colspan="3"><%=Lang_Sort(54)%>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(55)%></td>
			<td class="classrow" colspan="2">
			<input name="c_filename" id="c_filename" value="" type="text" maxlength="250" class="form" size="20"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Sort(56)%>','50','up');" onmouseout="hidehintinfo();" /> <input type="checkbox" onclick="LebiCopyName();" name="CopyName" id="CopyName" value="1" > <%=Lang_Sort(41)%> <input type="checkbox" onclick="LebiCopyNameToPinYin();" name="CopyNameToPinYin" id="CopyNameToPinYin" value="1" > <%=Lang_Sort(42)%>
			</td>
			</tr>
			</table>
			</div>
			<script>tdshow("add_other");</script>
			</td>
			</tr>
			<tr class="classfooter">
			<td align="left" height="30" colspan="2" class="classfooter">
			<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"><input type="hidden" name="sort_id" value="<%=sort_id%>">
			</td>
			</tr>
		</form>
		</table>
<%
End Sub

Sub modi()
%>
		<script language="vbscript">
		function toAsc(str)
				toAsc = hex(asc(str))
		end function
		</script>
		<script language="javascript">
		function LebiCopyFolder(){
		var iscopy = document.getElementById('CopyFolder');
		if (iscopy.checked){
		document.getElementById('c_foldername').value=document.getElementById('sort_name').value;
		}
		}
		function LebiCopyFolderToPinYin(){
		var iscopy = document.getElementById('CopyFolderToPinYin');
		if (iscopy.checked){
		document.getElementById('c_foldername').value=CC2PY(document.getElementById('sort_name').value);
		}
		}
		function LebiCopyName(){
		var iscopy = document.getElementById('CopyName');
		if (iscopy.checked){
		document.getElementById('c_filename').value=document.getElementById('sort_name').value;
		}
		}
		function LebiCopyNameToPinYin(){
		var iscopy = document.getElementById('CopyNameToPinYin');
		if (iscopy.checked){
		document.getElementById('c_filename').value=CC2PY(document.getElementById('sort_name').value);
		}
		}
		function CheckForm()
		{
			if (CheckEmpty('sort_name<%= LanguageTxt(1) %>')){ShowMessage('sort_name<%= LanguageTxt(1) %>','<%=Lang_Sort(1)%>');return false;}
		}
		//类别文字样式预览效果 2008-6-4 by Lebi.kingdge
		function showstyle()
		{
			var text = document.getElementById('sort_name').value;
			if (text ==""){text="56770 EShop"}
			var color = document.getElementById('strcolor').value;
			var size = document.getElementById('fontsize').value;
			if (size > 50){size="12";text="Copyright www.56770.com"}else{if (size<8){size="12";text="56770 EShop"}}
			var fontfamily = document.getElementById('font1').options[document.getElementById('font1').selectedIndex].value;
			var bgcolor = document.getElementById('strbgcolor').value;
			var fontweight = document.getElementById('font2_1');
			if (fontweight.checked){fontweight = "bold"}else{fontweight = ""}
			var fontstyle = document.getElementById('font2_2');
			if (fontstyle.checked){fontstyle = "italic"}else{fontstyle = ""}
			var textdecoration = document.getElementById('font2_3');
			if (textdecoration.checked){textdecoration = "underline"}else{textdecoration = ""}
			document.getElementById('style').innerHTML = "<span style='font:"+size+"px;font-family:"+fontfamily+";color:"+color+";background:"+bgcolor+";font-weight:"+fontweight+";font-style:"+fontstyle+";text-decoration:"+textdecoration+";'>"+text+"</span>"
		}
		</script>
	   <script language="javascript" type="text/javascript" src="inc/js/PinYin.js"></script>
       <script language="javascript" type="text/javascript" src="inc/js/dialog.js"></script>
	   <script language="javascript" type="text/javascript" src="Upfile/js/Upload_Other.js"></script>
       <table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
            <form name="sort_edit" method="post" action="?action=modi_ok" onSubmit="return CheckForm();">
            <tr>
              <td class="classhead" height="30" align="left">
                <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
			</td>
			<td class="classhead" align="right">
			  <%=QuickMenu("","")%>
			</td>
           </tr>
            <tr>
              <td class="classtop" height="30" colspan="2" align="left"><%=Lang_Sort(67)%></td>
			</td>
           </tr>
			<%
			Set rs = conn.execute("select * from [Lebi_category] where c_id="& id &"")
			sort_pic = rs("c_pic")
			name_ys = rs("c_name_ys")
			pic_size = rs("c_pic_size")
			c_menu = rs("c_menu")
			is_hide = rs("is_hide")
			sort_skin = rs("c_skin")
			c_order = rs("c_order")
			c_foldername = rs("c_foldername")
			c_filename = rs("c_filename")
			paixu = rs("c_order")
			c_rate = Split(rs("c_rate"),"|")
			If IsNull(sort_skin) Then sort_skin = ""
			If InStr(name_ys,"|")>0 Then
					a_ys=Split(name_ys,"|")
				a_ys1=Trim(a_ys(0))
				a_ys2=Trim(a_ys(1))
				a_ys3=Trim(a_ys(2))
				a_ys4=Trim(a_ys(3))
				a_ys5=Trim(a_ys(4))
				a_ys6=Trim(a_ys(5))
				a_ys7=Trim(a_ys(6))
			Else
				a_ys1=""
				a_ys2=""
				a_ys3=""
				a_ys4=""
				a_ys5=""
				a_ys6=""
				a_ys7=""
			End If
			If instr(pic_size,"|")>0 Then
					sort_pic_size = split(pic_size,"|")
					sort_pic_w = trim(sort_pic_size(0))
				sort_pic_h = trim(sort_pic_size(1))
			Else
					sort_pic_w = "30"
				sort_pic_h = "30"
			End If
			%>
			<tr>
			<td class="classrow" colspan="2">
			<ul id="tablist">
			   <%For LangT = 1 To TotalLang%>
			   <li<%If LangT = 1 Then response.write(" class=""selected""") End If%>><a rel="tcontent<%= LangT %>" style="CURSOR:hand;"><%= LanguageName(LangT) %></a></li>
			   <%Next%>
			</ul>
			<div id="tabcontentcontainer">
			<%
			For LangT = 1 To TotalLang
			c_info = rs("c_info"& LanguageTxt(LangT))
			If InStr(c_info,"$") = 0 Or IsNull(c_info) Then c_info = "$$$"
			%>
			   <div id="tcontent<%= LangT %>" class="tabcontent">
			   <table cellspacing="0" cellpadding="4" width="100%" border="0" id="edit_<%= LangT %>">
			<tr class="classrow">
			<td width="15%" height="30" class="classrow"><%=Lang_Sort(23)%></td>
			<td width="85%" class="classrow">
			<input type="text" id="sort_name<%= LanguageTxt(LangT) %>" name="sort_name<%= LanguageTxt(LangT) %>" class="form" value="<%=rs("c_name"& LanguageTxt(LangT))%>" onkeyup="showstyle()"> <span id="mes_sort_name<%= LanguageTxt(LangT) %>"></span>
			</td>
			</tr>
			<tr>
			<td class="classtop" height="30" colspan="2"><%=Lang_Sort(24)%></td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(25)%></td>
			<td class="classrow">
			<input name="sort_title<%= LanguageTxt(LangT) %>" type="text" size="60" value="<%= Split(c_info,"$")(0) %>" class="form">
			</td>
			</tr>
			<tr>
			<td height="30" class="classrow"><%=Lang_Sort(26)%></td>
			<td class="classrow">
			<input name="sort_key<%= LanguageTxt(LangT) %>" type="text" size="60" value="<%= Split(c_info,"$")(1) %>" class="form">
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(27)%></td>
			<td class="classrow">
			<input name="sort_des<%= LanguageTxt(LangT) %>" type="text" size="60" value="<%= Split(c_info,"$")(2) %>" class="form">
			</td>
			</tr>
				</table>
				</div>
				<script>tdshow("edit_<%= LangT %>");</script>
			<%Next%>
			</div>
			<script>showtabcontent("tablist")</script>
			<ul id="tablistmain">
			   <li class="selected"><a rel=""><%=Lang_sys(66)%></a></li>
			</ul>
			<div id="tabcontentcontainer">
			<table cellspacing="0" cellpadding="4" width="100%" border="0" id="edit_other">
			<tr class="classrow">
			<td width="15%" height="30" class="classrow"><%=Lang_Sort(28)%></td>
			<td class="classrow" colspan="2">
			<select name="sort_class">
			<option value="0"><%=Lang_Sort(29)%></option>
			<%
			set Rss = conn.execute("select c_parentid from [Lebi_category] where c_id = "& id &"")
			If rss.eof Then
					c_parentid = 0
			Else
					c_parentid = rss("c_parentid")
			End If
			rss.Close : set Rss = nothing
			sort (0),ii,c_parentid
			ii = 0
			%>
			</select>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(30)%></td>
			<td class="classrow" colspan="2">
			<input type="radio" name="c_menu" value="1" <%If c_menu = 1 Then response.write"checked"%>><%=Lang_Sort(68)%> <input type="radio" name="c_menu" value="0" <%If c_menu = 0 Then response.write"checked"%>><%=Lang_Sort(69)%>
			</td>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(31)%></td>
			<td class="classrow" colspan="2">
			<input type="radio" name="is_hide" value="0" <%If is_hide = 0 Then response.write"checked"%>> <%=Lang_Sort(32)%>
			<input type="radio" name="is_hide" value="1" <%If is_hide = 1 Then response.write"checked"%>> <%=Lang_Sort(33)%>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(34)%></td>
			<td class="classrow" colspan="2">
			<input type="text" name="paixu" class="form" value="<%=paixu%>" size="5">
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(35)%></td>
			<td class="classrow" colspan="2">
			<input type="text" id="sort_pic" name="sort_pic" class="form" value="<%=sort_pic%>"> <input type="button" id="Upload_sort_pic" name="Upload_sort_pic" value="<%=Lang_sys(52)%>" onclick="uploadpanel('sort_edit','sort_pic','sort_pic')" class="btn_upload">
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(36)%></td>
			<td class="classrow" colspan="2">
			<input type="text" name="sort_pic_w" value="<%= sort_pic_w %>" size="5" class="form"> Px
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(37)%></td>
			<td class="classrow" colspan="2">
			<input type="text" name="sort_pic_h" value="<%= sort_pic_h %>" size="5" class="form"> Px
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(38)%></td>
			<td class="classrow" colspan="2">
			<table cellspacing="0" cellpadding="0"><tr><td>
			<input type="radio" name="user_skin" value="1" onclick="document.getElementById('$_skin').style.display='block';" <% If sort_skin<>"" Then Response.Write("checked") %> /> <%=Lang_Sort(68)%>
			<input type="radio" name="user_skin" value="0" onclick="document.getElementById('$_skin').style.display='none';" <% If sort_skin="" Then Response.Write("checked") %> /> <%=Lang_Sort(69)%></td>
			 <td id="$_skin" style="padding-left:5px;<% If sort_skin="" Then Response.Write("display:none") %>"><%=Lang_Sort(39)%><input type="text" name="sort_skin" class="form" value="<% If sort_skin="" Then : Response.Write("Lebi.Category"&id&".style") : Else : Response.Write(sort_skin) : End If%>" size="41"></td></tr></table>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(40)%></td>
			<td class="classrow" colspan="2">
			<input name="c_foldername" id="c_foldername" value="<%=c_foldername%>" type="text" maxlength="250" class="form" size="20"> <input type="checkbox" onclick="LebiCopyFolder();" name="CopyFolder" id="CopyFolder" value="1" > <%=Lang_Sort(41)%> <input type="checkbox" onclick="LebiCopyFolderToPinYin();" name="CopyFolderToPinYin" id="CopyFolderToPinYin" value="1" > <%=Lang_Sort(42)%>
			</td>
			</tr>
			<%If rs("c_father") = 1 Then%>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(72)%></td>
			<td class="classrow" colspan="2">
			<%
			For g = 1 To UserGroupNumber
			response.write cache_grade_name(g) &"：<input name=""c_rate"" id=""c_rate"" value="""& c_rate(g-1) &""" type=""text"" class=""form"" size=""5"" onkeyup=""value=value.replace(/[^\d\.]/g,'');"">&nbsp;&nbsp;"
			Next
			%> <img src="images/help.gif" align="absmiddle"  onmouseover="showhintinfo(this,0,0,'','<%=Lang_Sort(73)%>','50','up');" onmouseout="hidehintinfo();" />
			</td>
			</tr>
			<%End If%>
			<tr>
			<td class="classtop" height="30" colspan="3"><%=Lang_Sort(43)%></td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(44)%></td>
			<td class="classrow">
			<input id="strcolor" name="strcolor" type="text" size="7" value="<%=a_ys1%>" onpropertychange="showstyle()" class="form"> <img border=0  id="s_strcolor" src="Images/rect.gif" width=18 onclick="colorcd('sort_edit','strcolor','fontcolor')" align="absmiddle" style="cursor:pointer;background-Color:<%=a_ys1%>;">
			</td>
			<td width="360" align="center" rowspan="5"><div style="width:100%;height:150px;border:#CCC 1px solid;background:#FFF;"><p style="text-align:left;padding:5px;"><%=Lang_Sort(45)%></p><span id="style"><span style="background-color:<%=a_ys2%>;color:<%=a_ys1%>;font-size:<%=a_ys3%>px;font-family:<%=a_ys4%>;font-weight:<%=a_ys5%>;font-style:<%=a_ys6%>;text-decoration:<%=a_ys7%>;"><%=rs("c_name")%></span></span></div>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(46)%></td>
			<td class="classrow">
			<input name="strbgcolor" type="text" size="7" id="strbgcolor" value="<%=a_ys2%>" onpropertychange="showstyle()" class="form"> <img border=0 id="s_strbgcolor" src="Images/rect.gif" width=18 align="absmiddle" onclick="colorcd('sort_edit','strbgcolor','bgcolor')" style="cursor:pointer;background-Color:<%=a_ys2%>;">
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(47)%></td>
			<td class="classrow">
			<input id="fontsize" name="fontsize" type="text" size="5" value="<%=a_ys3%>" onkeyup="showstyle()" class="form"> px
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(48)%></td>
			<td class="classrow">
			<select id="font1" name="font1" onchange="showstyle()">
				<option value="<%=a_ys4%>"><%=a_ys4%></option>
				<option value=""><%=Lang_Sort(49)%></option>
				<option value="宋体">宋体</option>
				<option value="黑体">黑体</option>
				<option value="楷体_GB2312">楷体</option>
				<option value="仿宋_GB2312">仿宋</option>
				<option value="隶书">隶书</option>
				<option value="幼圆">幼圆</option>
				<option value="Arial">Arial</option>
				<option value="Arial Black">Arial Black</option>
				<option value="Arial Narrow">Arial Narrow</option>
				<option value="Brush Script	MT">Brush Script MT</option>
				<option value="Century Gothic">Century Gothic</option>
				<option value="Comic Sans MS">Comic Sans MS</option>
				<option value="Courier">Courier</option>
				<option value="Courier New">Courier New</option>
				<option value="MS Sans Serif">MS Sans Serif</option>
				<option value="Script">Script</option>
				<option value="System">System</option>
				<option value="Times New Roman">Times New Roman</option>
				<option value="Tahoma">Tahoma</option>
				<option value="Verdana">Verdana</option>
				<option value="Wide Latin">Wide Latin</option>
				<option value="Webdings">Webdings</option>
				<option value="Wingdings">Wingdings</option>
			</select>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(50)%></td>
			<td class="classrow">
			<input type="checkbox" value="1" id="font2_1" name="font2_1" onClick="showstyle()" <%If a_ys5="bold" Then response.write"checked"%>> <%=Lang_Sort(51)%>
			<input type="checkbox" value="1" id="font2_2" name="font2_2" onClick="showstyle()" <%If a_ys6="italic" Then response.write"checked"%>> <%=Lang_Sort(52)%>
			<input type="checkbox" value="1" id="font2_3" name="font2_3" onClick="showstyle()" <%If a_ys7="underline" Then response.write"checked"%>> <%=Lang_Sort(53)%>
			</td>
			</tr>
			<tr>
			<td class="classtop" height="30" colspan="3"><%=Lang_Sort(54)%>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(55)%></td>
			<td class="classrow" colspan="2">
			<input name="c_filename" id="c_filename" value="<%=c_filename%>" type="text" maxlength="250" class="form" size="20"> <img src="images/help.gif" align="absmiddle"  onmouseover="showhintinfo(this,0,0,'','<%=Lang_Sort(56)%>','50','up');" onmouseout="hidehintinfo();" /> <input type="checkbox" onclick="LebiCopyName();" name="CopyName" id="CopyName" value="1" > <%=Lang_Sort(41)%> <input type="checkbox" onclick="LebiCopyNameToPinYin();" name="CopyNameToPinYin" id="CopyNameToPinYin" value="1" > <%=Lang_Sort(42)%>
			</td>
			</tr>
			</table>
			</div>
			<script>tdshow("edit_other");</script>
			</td>
			</tr>
			<tr class="classfooter">
			<td align="left" height="30" colspan="2" class="classfooter">
			<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
			<input type="hidden" name="sort_id" value="<%=sort_id%>"><input type="hidden" name="id" value="<%=id%>">
			</td>
			</tr>
		</form>
		</table>
<%
rs.close : set rs=Nothing
End Sub

Sub hb%>
		<script language="javascript">
		function CheckForm()
		{
			var unitesort1 = document.getElementById("unitesort1").value;
			var unitesort2 = document.getElementById("unitesort2").value;
			if (CheckEmpty('sort_name<%= LanguageTxt(1) %>')){ShowMessage('sort_name<%= LanguageTxt(1) %>','<%=Lang_Sort(57)%>');return false;}
			if (CheckEmpty('unitesort2')){ShowMessage('unitesort2','<%=Lang_Sort(58)%>');return false;}
			if(unitesort1 == unitesort2){ShowMessage('unitesort2','<%=Lang_Sort(59)%>');return false;}
		}
		</script>
       <table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
            <form name="sort_hb" method="post" action="?action=hb_ok" onSubmit="return CheckForm();">
            <tr>
              <td class="classhead" height="30" align="left">
                <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
			</td>
			<td class="classhead" align="right">
			  <%=QuickMenu("","")%>
			</td>
           </tr>
            <tr>
              <td class="classtop" height="30" colspan="2" align="left"><%=Lang_Sort(60)%></td>
			</td>
           </tr>
			<tr>
			<td class="classbg" colspan="2">
			<ul id="tablist">
			   <%For LangT = 1 To TotalLang%>
			   <li<%If LangT = 1 Then response.write(" class=""selected""") End If%>><a rel="tcontent<%= LangT %>" style="CURSOR:hand;"><%= LanguageName(LangT) %></a></li>
			   <%Next%>
			</ul>
			<div id="tabcontentcontainer">
			<%For LangT = 1 To TotalLang%>
			   <div id="tcontent<%= LangT %>" class="tabcontent">
			   <table cellspacing="0" cellpadding="4" width="100%" border="0" id="add_<%= LangT %>">
			<tr class="classrow">
			<td width="15%" height="30" class="classrow"><%=Lang_Sort(61)%></td>
			<td class="classrow">
			<input type="text" id="sort_name<%= LanguageTxt(LangT) %>" name="sort_name<%= LanguageTxt(LangT) %>" class="form"> <span id="mes_sort_name<%= LanguageTxt(LangT) %>"></span>
			</td>
			</tr>
				</table>
				</div>
				<script>tdshow("add_<%= LangT %>");</script>
			<%Next%>
			</div>
			<script>showtabcontent("tablist")</script>
			<ul id="tablistmain">
			   <li class="selected"><a rel=""><%=Lang_sys(66)%></a></li>
			</ul>
			<div id="tabcontentcontainer">
			<table cellspacing="0" cellpadding="4" width="100%" border="0" id="add_other">
			<tr class="classrow">
			<tr>
				<td width="15%" height="30" class="classrow"><%=Lang_Sort(23)%></td>
				<td class="classrow"><select name="unitesort1" id="unitesort1"><%
				sort (0),ii,id
				ii = 0
				%></select>
				</td>
			</tr>
			<tr>
				<td width="15%" height="30" class="classrow"><%=Lang_Sort(62)%></td>
				<td class="classrow"><select name="unitesort2" id="unitesort2"><option value="" selected><%=Lang_Sort(63)%></option><%
				sort (0),ii,0
				ii = 0
				%></select> <span id="mes_unitesort2"></span>
				</td>
			</tr>
			</table>
			</div>
			</td>
			</tr>
			<tr class="classfooter">
			<td align="left" height="30" colspan="2" class="classfooter">
			<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
			<input type="hidden" name="sort_id" value="<%=sort_id%>"><input type="hidden" name="id" value="<%=id%>">
			</td>
			</tr>
		</form>
		</table>
		<script>tdshow("add_other");</script>
<%
End Sub

Sub getsort(sortid,getsort_i)
        sql_getsort = "select c_id,c_name,c_pic,c_order,c_pronum,c_menu,c_skin,is_hide from [Lebi_category] where c_parentid = "& sortid &" order by c_order desc"
	    Set rs_getsort = Conn.Execute(sql_getsort)
		If rs_getsort.eof Then Exit Sub
	    do while not rs_getsort.eof
        Response.write("<tr class=""classrow"">")
        Response.write("<td class=""classrow"">"& rs_getsort("c_id") &"</td>")
        Response.write("<td class=""classrow"">"& tmp(getsort_i,"├ ") & rs_getsort("c_name") &"</td>")
        Response.write("<td height=""30"" class=""classrow"">")
        if trim(rs_getsort("c_pic"))<>"" then
		        response.write"<img src=""../"&rs_getsort("c_pic")&""" border=""0"" height=""25"" width=""25"">"
		Else
		        response.write"&nbsp;"
		end If
		Response.write("</td>")
		Response.write("<td class=""classrow"">")
		If rs_getsort("is_hide") = "0" Then response.write"<font color=red>√</font>" Else response.write"×" End If
        Response.write("</td>")
		Response.write("<td class=""classrow"">")
		If rs_getsort("c_menu") = "1" Then response.write"<font color=red>√</font>" Else response.write"×" End If
        Response.write("</td>")
        Response.write("<td class=""classrow"">"& rs_getsort("c_pronum") &"</td>")
		Response.write("<td class=""classrow"">"& rs_getsort("c_order") &"</td>")
        Response.write("<td class=""classrow""><input type=""image"" name=""up"" title=""↑"" onClick=""location.href='?action=up&sort_id="& sort_id &"&c_id="& rs_getsort("c_id") &"';return false;"" src=""images/icon_up.gif"" align=""absmiddle"">&nbsp;<input type=""image"" name=""down"" title=""↓"" onClick=""location.href='?action=down&sort_id="& sort_id &"&c_id="& rs_getsort("c_id") &"';return false;"" src=""images/icon_down.gif"" align=""absmiddle""></td>")
        Response.write("<td class=""classrow"">")
		Response.write("<a href=""?id="& rs_getsort("c_id") &"&sort_id="& sort_id &"&action=add"">"& Lang_sys(5) &"</a> | <a href=""?id="& rs_getsort("c_id") &"&sort_id="& sort_id &"&action=modi"">"& Lang_sys(51) &"</a> | <a href=""?id="& rs_getsort("c_id") &"&sort_id="& sort_id &"&action=hb"">"& Lang_Sort(19) &"</a> | <a href=""?id="& rs_getsort("c_id") &"&sort_id="& sort_id &"&action=del"" onClick=""return confirm('"& Lang_sys(64) &"')"">"& Lang_sys(15) &"</a>")
		If rs_getsort("c_skin") <> "" Then Response.Write(" | <a href=""?skin="&rs_getsort("c_skin")&"&action=skin&sort_id="& sort_id &""">"& Lang_Sort(20) &"</a>")
        Response.write("</td></tr>")
        getsort_i=getsort_i+1
	    getsort rs_getsort("c_id"),getsort_i
        getsort_i=getsort_i-1
	    rs_getsort.movenext
	    loop
        rs_getsort.Close : Set rs_getsort = Nothing
End sub

Sub skin()
If request("skin") = "" Then
        Call Up_mes(Lang_sys(46),"·"& Lang_Sort(21),0,"javascript:history.back()",0,0,2,1)
		Exit Sub
End If
%>
<style type="text/css">
table.collapse tfoot td img{border:none;vertical-align:bottom;padding-left:10px;float:right;}
</style>
<script language="javascript">
function tablecollapse()
{
var collapseClass='collapse';
var collapsePic='lang/<%=LangFilePath%>/images/tab/bt_close.gif';
var expandPic='lang/<%=LangFilePath%>/images/tab/bt_open.gif';
var initialCollapse=true;
var t=document.getElementsByTagName('table');
var checktest= new RegExp("(^|\\s)" + collapseClass + "(\\s|$)");
for (var i=0;i<t.length;i++)
{
if(!checktest.test(t[i].className)){continue;}
t[i].getElementsByTagName('tfoot')[0].onclick=function()
{
var tb=this.parentNode.getElementsByTagName('tbody');
for(var i=0;i<tb.length;i++)
{
tb[i].style.display=tb[i].style.display=='none'?'':'none';
}
var li=this.getElementsByTagName('img')[0];
li.src=li.src.indexOf(collapsePic)==-1?collapsePic:expandPic;
}
if(initialCollapse)
{
var tb=t[i].getElementsByTagName('tbody');
for(var j=0;j<tb.length;j++)
{
tb[j].style.display='none';
}
}
var newa=document.createElement('a');
newa.href='#';
newa.onclick=function(){return false;}
var newimg=document.createElement('img');
newimg.src=initialCollapse?expandPic:collapsePic;
var tf=t[i].getElementsByTagName('tfoot')[0];
var lt=tf.getElementsByTagName('td')[tf.getElementsByTagName('td').length-1];
newa.appendChild(newimg);
lt.insertBefore(newa,lt.firstChild);
}
}
window.onload=tablecollapse;
function runscript(n){
	txtRun=n;window.open("../templates_view.asp","templates_view")
}
</script>
<script language="javascript" type="text/javascript" src="ckeditor/ckeditor.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="style" class="classtable">
<form method="post" action="?action=skin_ok&id=<%=CInt(request("id"))%>">
<tr>
 <td height="30" class="classhead" align="left">
			<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="this.form.reset();return false;" align="absmiddle">
			<input type="hidden" name="skin" value="<%=request("skin")%>">
			<input type="hidden" name="sort_id" value="<%=sort_id%>">
			<input type="hidden" name="htmlstate" value="<%=htmlstate%>">
 </td>
<td class="classhead" align="right">
  <%=QuickMenu("","")%>
</td>
</tr>
<tr>
  <td class="classtop" colspan="2" height="30"><%=Lang_Sort(64)%>
</td>
</tr>
<tr>
<td class="classbg" colspan="2">
<ul id="tablist">
   <%For LangT = 1 To TotalLang%>
   <li<%If LangT = 1 Then response.write(" class=""selected""") End If%>><a rel="tcontent<%= LangT %>" style="CURSOR:hand;"><%= LanguageName(LangT) %></a></li>
   <%Next%>
</ul>
<div id="tabcontentcontainer">
<%
For LangT = 1 To TotalLang
LB_XML.Path = server.MapPath("../skins/"& LanguageSkin(LangT) &"/data.xml")
LB_XML.Data = "data"
LB_XML.open
LB_XML.SelectTable("config")
stylefolder = LB_XML.read("stylefolder")
LB_XML.close
main_skin = LoadSkin("../"& stylefolder &"category/"& request("skin"))
%>
   <div id="tcontent<%= LangT %>" class="tabcontent">
	   <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0" style="margin-top:5px">
 <tr class="classrow">
 <td class="classrow" colspan="2">
	<textarea cols=102 rows=24 name="main_skin<%=LangT%>" id="main_skin<%=LangT%>" class=html><%=server.htmlencode(main_skin)%></textarea>
	<%If htmlstate = 0 Then%>
	<script type="text/javascript">
	CKEDITOR.replace('main_skin<%=LangT%>',{height:400});
	</script>
	<%Else%>
	 <br /><a href="javascript:u_Size(-10,'main_skin<%=LangT%>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>
	 <a href="javascript:u_Size(10,'main_skin<%=LangT%>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a>
	<%End If%>
 </td>
</tr>
		</table>
	</div>
<%Next%>
</div>
<script>showtabcontent("tablist")</script>
</td>
</tr>
  <tr class="classrow">
     <td align="left" height="30" colspan="2" class="classfooter">
		<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="this.form.reset();return false;">
	 </td>
  </tr>
</form>
</table>
<script>tdshow("style");</script>
<%
End Sub

Sub query()
		page=checknum(request("page"),1)
		keyword=safereplace(Trim(request("keyword")))
		lang = safereplace(request("lang"))
		If lang = "" Then lang = LanguageTxt(0)
		Dim ors
		Set ors=new Cls_vbsPage
		Set ors.Conn=conn
		With ors
		.PageSize=10
		.PageName="Page"
		If IsSqlDataBase = 0 Then
				.DbType="AC"
		Else
				.DbType="MSSQL"
		End If
		.RecType=-1
		.Pkey="c.c_id"
		.Field="c.c_pic,c.c_id,c.c_name"& lang &",c.c_order,c.c_pronum,c.is_hide,c.c_skin,(select c_name"& lang &" from [Lebi_category] where c_id = c.c_parentid) as c_parentname,c_foldername"
		.Table="[Lebi_category] as c"
		sql = "1=1"
		If keyword <> "" Then sql = sql &" and (c.c_name"& lang &" like '%"& keyword &"%')"
		.Condition=sql
		.OrderBy="c.c_order desc,c.c_id desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<thead>
<tr>
	<form method="get" name="forms" action="?">
	<td height="30" align="left" class="classhead">
		<table border="0" cellspacing="0" cellpadding="0">
		<tr>
		<td>
		<select name="lang">
		<option value="" selected>┌ <%=Lang_sys(67)%></option>
		<%For LangT = 1 To TotalLang%>
		<option value="<%= LanguageTxt(LangT) %>"<%=judge2(LanguageTxt(LangT),Lang)%>>├ <%= LanguageName(LangT) %></option>
		<%Next%>
		</select></td>
		<td style="padding-left:5px;"><input name="keyword" id="keyword" type="text" value="<%=keyword%>" class="form_query" size="20" autocomplete="off" onkeyup="search_suggest('keyword','lebi_category','<%=lang%>')"><input name="Submit" type="submit" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query"><input type="hidden" name="action" value="query"><br /><div id="search_suggest_keyword" class="search_suggest" style="display:none"></div>
		</td>
		</tr>
		</table>
	</td>
	</form>
     <td class="classhead" height="30" align="right"><%=QuickMenu("","")%></td>
</tr>
</thead>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="list" class="classtable">
<tr>
  <td class="classtop" width="5%" height="30"><%=Lang_Sort(9)%></td>
  <td class="classtop" width="15%"><%=Lang_Sort(10)%></td>
  <td class="classtop" width="15%"><%=Lang_Sort(65)%></td>
  <td class="classtop" width="8%"><%=Lang_Sort(11)%></td>
  <td class="classtop" width="8%"><%=Lang_Sort(12)%></td>
  <td class="classtop" width="8%"><%=Lang_Sort(14)%></td>
  <td class="classtop" width="8%"><%=Lang_Sort(15)%></td>
  <td class="classtop" width="26%"><%=Lang_Sort(17)%></td>
 </tr>
<%
If DataCount >0 Then
		For i = 0 To Ubound(DataList,2)
%>
<tr class="classrow">
  <td height="30" class="classrow"><%=DataList(1,i)%></td>
  <td height="30" class="classrow"><%=DataList(2,i)%></td>
  <td height="30" class="classrow"><%=DataList(7,i)%></td>
  <td height="30" class="classrow"><%if trim(DataList(0,i))<>"" then response.write"<img src=""../"&DataList(0,i)&""" border=""0"" height=""30"" width=""30"">" Else response.write"&nbsp;" end if%></td>
  <td height="30" class="classrow"><%If DataList(5,i) = 0 Then response.write"<font color=red>√</font>" Else response.write"×" End If%></td>
  <td height="30" class="classrow"><%=DataList(4,i)%></td>
  <td height="30" class="classrow"><%=DataList(3,i)%></td>
  <td height="30" class="classrow">
	<a href="?id=<%=DataList(1,i)%>&action=add"><%=Lang_sys(5)%></a> |
	<a href="?id=<%=DataList(1,i)%>&action=modi"><%=Lang_sys(51)%></a> |
	<a href="?id=<%=DataList(1,i)%>&action=hb"><%=Lang_Sort(19)%></a> |
	<a href="?id=<%=DataList(1,i)%>&action=del" onClick="return confirm('<%=Lang_sys(64)%>')"><%=Lang_sys(15)%></a>
	<% If DataList(6,i) <> "" Then Response.Write(" | <a href=""?skin="&DataList(6,i)&"&action=skin&id="&DataList(1,i)&""">"& Lang_Sort(20) &"</a>") %>			 | <a target="_blank" href="<%If Config_Lebi_Eshop(16) = 0 Then
	Response.Write("../showsort.asp?id="& DataList(0,i) &"")
	Else
	Response.Write("../category/"& DataList(8,i) &"/")
	End If
	%>"><%=Lang_sys(59)%></a></td>
</tr>
<%
        Next
End If
%>
<tr>
	<td height="30" class="classfooter" align="right" colspan="8"><%=ors.ShowPageFoot(page)%></td>
</tr>
</table>
<script>tdshow("list");</script>
<%
End sub

Sub unite()
%>
		<script>
		function CheckForm()
		{
			if (CheckEmpty('sort_name<%= LanguageTxt(1) %>')){ShowMessage('sort_name<%= LanguageTxt(1) %>','<%=Lang_Sort(1)%>');return false;}
		}
		</script>
       <script language="javascript" type="text/javascript" src="inc/js/dialog.js"></script>
       <table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
            <form name="sort_add" method="post" action="?action=unite_ok" onSubmit="return CheckForm();">
            <tr>
              <td class="classhead" height="30" align="left">
                <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
			</td>
			<td class="classhead" align="right">
			  <%=QuickMenu("","")%>
			</td>
           </tr>
            <tr>
              <td class="classtop" height="30" colspan="2" align="left"><%=Lang_Sort(22)%></td>
			</td>
           </tr>
			<tr>
			<td class="classbg" colspan="2">
			<ul id="tablist">
			   <%For LangT = 1 To TotalLang%>
			   <li<%If LangT = 1 Then response.write(" class=""selected""") End If%>><a rel="tcontent<%= LangT %>" style="CURSOR:hand;"><%= LanguageName(LangT) %></a></li>
			   <%Next%>
			</ul>
			<div id="tabcontentcontainer">
			<%For LangT = 1 To TotalLang%>
			   <div id="tcontent<%= LangT %>" class="tabcontent">
			   <table cellspacing="0" cellpadding="4" width="100%" border="0" id="add_<%= LangT %>">
			<tr class="classrow">
			<td width="15%" height="30" class="classrow" valign="top" style="padding-top:6px"><%=Lang_Sort(23)%></td>
			<td class="classrow">
			<textarea id="sort_name<%= LanguageTxt(LangT) %>" name="sort_name<%= LanguageTxt(LangT) %>" cols="30" rows="10" onkeyup="showstyle()" class="text"></textarea> <span id="mes_sort_name<%= LanguageTxt(LangT) %>"></span><br />
			 <a href="javascript:u_Size(-5,'sort_name<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>
			 <a href="javascript:u_Size(5,'sort_name<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a>
			</td>
			</tr>
				</table>
				</div>
				<script>tdshow("add_<%= LangT %>");</script>
			<%Next%>
			</div>
			<script>showtabcontent("tablist")</script>
			<ul id="tablistmain">
			   <li class="selected"><a rel=""><%=Lang_sys(66)%></a></li>
			</ul>
			<div id="tabcontentcontainer">
			<table cellspacing="0" cellpadding="4" width="100%" border="0" id="add_other">
			<tr class="classrow">
			<td width="15%" height="30" class="classrow"><%=Lang_Sort(28)%></td>
			<td class="classrow" colspan="2">
			<select name="sort_class">
			<option value="0"><%=Lang_Sort(29)%></option>
			<%
			sort (0),ii,id
			ii = 0
			%>
			</select>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(30)%></td>
			<td class="classrow" colspan="2">
			<input type="radio" name="c_menu" value="1" checked><%=Lang_Sort(68)%> <input type="radio" name="c_menu" value="0"><%=Lang_Sort(69)%>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(31)%></td>
			<td class="classrow" colspan="2">
			<input type="radio" name="is_hide" value="0" checked> <%=Lang_Sort(32)%>
			<input type="radio" name="is_hide" value="1" > <%=Lang_Sort(33)%>
			</td>
			</tr>
			<tr>
			<td class="classtop" height="30" colspan="3"><%=Lang_Sort(43)%>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(44)%></td>
			<td class="classrow">
			<input name="strcolor" type="text" size="7" id="strcolor" value="" onpropertychange="showstyle()" class="form"> <img border=0  id="s_strcolor" src="Images/rect.gif" width=18 onclick="colorcd('sort_add','strcolor','fontcolor')" align="absmiddle" style="cursor:pointer;">
			</td>
			<td width="360" align="center" rowspan="5"><div style="width:100%;height:150px;border:#CCC 1px solid;background:#FFF;"><p style="text-align:left;padding:5px;"><%=Lang_Sort(45)%></p><span id="style"></span></div>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(46)%></td>
			<td class="classrow">
			<input name="strbgcolor" type="text" size="7" id="strbgcolor" value="" onpropertychange="showstyle()" class="form"> <img border=0 id="s_strbgcolor" src="Images/rect.gif" width=18 onclick="colorcd('sort_add','strbgcolor','bgcolor')" align="absmiddle" style="cursor:pointer;">
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(47)%></td>
			<td class="classrow">
			<input id="fontsize" name="fontsize" type="text" size="5" value="12" onkeyup="showstyle()" class="form"> px
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(48)%></td>
			<td class="classrow">
			<select id="font1" name="font1" onChange="showstyle()">
				<option value="0"><%=Lang_Sort(49)%></option>
				<option value="宋体">宋体</option>
				<option value="黑体">黑体</option>
				<option value="楷体_GB2312">楷体</option>
				<option value="仿宋_GB2312">仿宋</option>
				<option value="隶书">隶书</option>
				<option value="幼圆">幼圆</option>
				<option value="Arial">Arial</option>
				<option value="Arial Black">Arial Black</option>
				<option value="Arial Narrow">Arial Narrow</option>
				<option value="Brush Script	MT">Brush Script MT</option>
				<option value="Century Gothic">Century Gothic</option>
				<option value="Comic Sans MS">Comic Sans MS</option>
				<option value="Courier">Courier</option>
				<option value="Courier New">Courier New</option>
				<option value="MS Sans Serif">MS Sans Serif</option>
				<option value="Script">Script</option>
				<option value="System">System</option>
				<option value="Times New Roman">Times New Roman</option>
				<option value="Tahoma">Tahoma</option>
				<option value="Verdana">Verdana</option>
				<option value="Wide Latin">Wide Latin</option>
				<option value="Webdings">Webdings</option>
				<option value="Wingdings">Wingdings</option>
			</select>
			</td>
			</tr>
			<tr class="classrow">
			<td height="30" class="classrow"><%=Lang_Sort(50)%></td>
			<td class="classrow">
			<input type="checkbox" value="1" id="font2_1" name="font2_1" onClick="showstyle()"> <%=Lang_Sort(51)%>
			<input type="checkbox" value="1" id="font2_2" name="font2_2" onClick="showstyle()"> <%=Lang_Sort(52)%>
			<input type="checkbox" value="1" id="font2_3" name="font2_3" onClick="showstyle()"> <%=Lang_Sort(53)%>
			</td>
			</tr>
			</table>
			</div>
			<script>tdshow("add_other");</script>
			</td>
			</tr>
			<tr class="classfooter">
			<td align="left" height="30" colspan="2" class="classfooter">
			<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"><input type="hidden" name="sort_id" value="<%=sort_id%>">
			</td>
			</tr>
		</form>
		<tr>
		<td colspan="2" class="classfaq">
		<div class="faq_main">
		<p class="faq_title"><%=Lang_sys(49)%></p>
		<%=Lang_Sort(71)%>
		</div>
		</td>
		</tr>
		</table>
<%
end Sub

Sub rate()
	%>
	<table width="100%" border="0" cellspacing="0" cellpadding="0" id="list" class="classtable">
	<FORM METHOD="POST" ACTION="?action=rate_ok" name="grade">
	<thead>
	<tr>
	<td height="30" class="classhead"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
	<td colspan="<%=UserGroupNumber%>" height="30" align="right" class="classhead">
	<%=QuickMenu("admin_sort.asp|"& Lang_Menu(75) &"","admin_update.asp?u_type=1&prev="& server.urlencode(Backurl()) &"|"& Lang_Sort(8) &"")%>
	</td>
	</tr>
	<tr>
	<td class="classtop" height="30"><%=Lang_Sort(10)%></td>
	<%For g = 1 To UserGroupNumber%>
	<td class="classtop" width="10%"><%=cache_grade_name(g)%></td>
	<%Next%>
	</tr>
	</thead>
	<%
	IsData = 0
	Set rs = conn.execute("select c_id,c_name,c_rate from [Lebi_category] where c_father = 1 order by c_order desc")
	If Not rs.eof Then
			Data = rs.getrows()
			IsData = 1
	End If
	rs.close : Set rs = Nothing
	If IsData = 1 Then
	For i = 0 To UBound(Data,2)
	%>
	<tr class="classrow">
	<td height="30" class="classrow"><%=Data(1,i)%></td>
	<%For g = 1 To UserGroupNumber%>
	<td class="classrow"><input type="text" name="c_rate_<%=Data(0,i)%>" id="c_rate_<%=Data(0,i)%>" size="5" value="<%=Split(Data(2,i),"|")(g-1)%>" class="form" onkeyup="value=value.replace(/[^\d\.]/g,'');"></td>
	<%Next%>
	</tr>
	<%
	Next
	End If
	%>
	<tfoot>
	<tr>
	<td height="30" class="classfooter" align="left" colspan="<%=UserGroupNumber+1%>"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
	</tr>
	</tfoot>
	</tbody>
	</FORM>
	<tr>
	<td colspan="<%=UserGroupNumber+1%>" class="classfaq">
	  <div class="faq_main">
	  <p class="faq_title"><%=Lang_sys(49)%></p>
	  <%=Lang_Sort(73)%>
	  </div>
	</td>
	</tr>
	</table>
	<script>tdshow("list");</script>
	<%
End Sub

Sub skin_ok()
	If Trim(request("skin"))="" Then
		response.write "Error"
	Else
		For LangT = 1 To TotalLang 
				LB_XML.Path = server.MapPath("../skins/"& LanguageSkin(LangT) &"/data.xml")
				LB_XML.Data = "data"
				LB_XML.open
				LB_XML.SelectTable("config")
				stylefolder = LB_XML.read("stylefolder")
				LB_XML.close
				Savehtml "../"& stylefolder &"category/"& request("skin"),StyleSafereplace(trim(request("main_skin"& LangT)))
		Next 
		Application.Contents.RemoveAll
		ManageLog Lang_Sort(66) &" ["&id&"]"
		m_u = "admin_skin_save.asp?action=tpl_showsort_one&c_id="& CInt(request("id")) &"&mes_type=0"
		b_u = "admin_sort.asp?htmlstate="& htmlstate
		Call Up_mes(Lang_sys(45),"·"& Lang_sys(99),0,m_u&"&b_u="& server.urlencode(b_u),0,0,2,1)
	End if
End sub

Function LoadSkin(strFile)
		Dim strTempPath,objFSO,objStm
		strTempPath = Server.MapPath(strFile)
		Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
		Set objStm = Server.CreateObject("ADODB.Stream")
			If objFso.FileExists(strTempPath) Then
				objStm.charset = "UTF-8"
				objStm.open
				objStm.LoadFromFile strTempPath
				LoadSkin = objStm.ReadText
			End If
		Set objStm = Nothing
		Set objFSO = Nothing
End Function

Function CreateSkin(strFile)
		On Error Resume Next 
		Dim objFSO,rs_skin
		Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
		For LangT = 1 To TotalLang
				LB_XML.Path = server.MapPath("../skins/"& LanguageSkin(LangT) &"/data.xml")
				LB_XML.Data = "data"
				LB_XML.open
				LB_XML.SelectTable("config")
				stylefolder = LB_XML.read("stylefolder")
				LB_XML.close
				If Not objFso.FileExists(Server.MapPath("../"& stylefolder &"category/"& strFile)) Then
						If Not objFSO.FolderExists(server.MapPath("../"& stylefolder &"category/")) Then 
								objFSO.CreateFolder(server.MapPath("../"& stylefolder &"category/")) 
						End If 
						Savehtml "../"& stylefolder &"category/"& strFile,LoadFile("../skins/"& LanguageSkin(LangT) &"/template/product_list.htm")
				End If 
		Next
		Set objFSO = Nothing
End Function

Sub SaveJsOption()
        Dim Body_Jsmenu
		For LangT = 1 To TotalLang
				Body_Jsmenu= menu_sort_search (0,0,0,LanguageTxt(LangT))
				Savehtml "../include/Lebi_Html/CategoryOption"& LanguageTxt(LangT) &".js",htmltojs(Body_Jsmenu)
		Next
End Sub

Function menu_sort_search(a,b,c,d)
		sql="select c_id,c_name"& d &",c_child from [Lebi_category] where c_parentid = "& a &" order by c_order desc"
		Set Rs1=Conn.Execute(sql)
		If Not Rs1.eof Then 
			sortdata = rs1.getrows()
			Issortdata = 1
		End If 
		Rs1.close : Set Rs1 = Nothing 
		If Issortdata = 1 Then 
			For ii = 0 To UBound(sortdata,2)
				If a = 0 Then
						menu_sort_search=menu_sort_search&"<option value='"& clng(sortdata(0,ii)) &"'"
				if clng(sortdata(0,ii)) = clng(c) Then menu_sort_search=menu_sort_search&"Selected"
						menu_sort_search=menu_sort_search&">+ "& sortdata(1,ii) &"</option>"
				Else
						menu_sort_search=menu_sort_search&"<option value='"& clng(sortdata(0,ii)) &"'"
				If clng(sortdata(0,ii)) = clng(c) Then menu_sort_search=menu_sort_search&"Selected"
						menu_sort_search=menu_sort_search&">"& tmp(b,"├ ") &" "& sortdata(1,ii) &"</option>"
				End If
				if sortdata(2,ii)>0 Then
					b=b+1
					menu_sort_search=menu_sort_search& menu_sort_search (sortdata(0,ii),b,c,d)
					b=b-1
				End If 
			Next 
		End If 
End Function
%>