<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="../include/Lebi_config.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_Html_js.asp
'* 最后更新 2010-11-7 by 56770.kingdge
'*****************************************
Html_page="1"
Eshop_url = Replace(Eshop_url,"/tohtml/","/")
mes_type = CheckNum(request("mes_type"),0)
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_sort.inc"
Server.ScriptTimeout =99999
If mes_type = 1 Then
        Write_Lebi_Eshop("<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""1"" class=""classtd"">")
		Write_Lebi_Eshop("<tr><td colspan=""2"" id=""categoryname""></td></tr>")
        Write_Lebi_Eshop("<tr>")
        Write_Lebi_Eshop("<td width=""300"" align=""left"">")
        Write_Lebi_Eshop("<table width=""300"" border=""0"" cellspacing=""1"" cellpadding=""1"" height=""8"" bgcolor=""#B2B2A6""><tr><td bgcolor=ffffff height=""8""><img src=""../images/bar.gif"" width=0 height=8 id=bar_p_img name=bar_p_img align=absmiddle></td></tr></table>")
        Write_Lebi_Eshop("</td><td><span id=bar_p_txt2 name=bar_p_txt2 style=""font-size:9pt;color:red;""></span><span id=bar_p_txt1 name=bar_p_txt1 style=""font-size:9pt"">0</span><span style=""font-size:9pt"">%</span></td></tr>")
        Write_Lebi_Eshop("</table>")
Else
		CurrentId = 1
		CurrentUrl = "admin_sort.asp"
		LB_Head()
		LB_Menu()%>
		<div class="tabmenu mainwidth">
			  <ul>
				<li><a href="admin_sort.asp"><span><%=Lang_Menu(75)%></span></a></li>
				<li class="current"><a href="admin_update.asp?u_type=1&prev=<%=server.urlencode(Backurl())%>"><span><%=Lang_Sort(8)%></span></a></li>
				<li><a href="admin_sort.asp?action=add"><span><%=Lang_Sort(22)%></span></a></li>
			  </ul>
		</div>
		<%
		Response.Write("<div class=""tab-mainbody"">")
		Response.Write("<div class=""tab-mainbody2"">")
End If 

Select Case request("Stype")
	   Case "qqonline" qqonline()
	   Case "jsmenu" jsmenu()
End Select
If mes_type = 0 Then 
		Response.Write("</div>")
		Response.Write("</div>")
		LB_Footer()
End If 

Sub qqonline()
        Dim Body_Jsqqonline
	    Body_Jsqqonline = ""
	    Body_Jsqqonline = Body_Jsqqonline &"var startX = document.body.clientWidth-"&cint(sys_oicq_x)&" //set x offset of bar in pixels"&vbcrlf
        if qq_wz=1 and qq_zt=1 Then
                Body_Jsqqonline = Body_Jsqqonline &"var startY = "&cint(sys_oicq_y)&";"&vbcrlf
        elseif qq_wz=0 and qq_zt=1 Then
				Body_Jsqqonline = Body_Jsqqonline &"var startY = "&cint(sys_oicq_y)&";"&vbcrlf
        end If
        If CLng(qq_wz)=1 And CLng(qq_zt)=1 Then
                Body_Jsqqonline = Body_Jsqqonline &"var verticalpos=""fromtop"""&vbcrlf
        ElseIf CLng(qq_wz)=0 And CLng(qq_zt)=1 Then
                Body_Jsqqonline = Body_Jsqqonline &"var verticalpos=""frombottom"""&vbcrlf
        end If
	    Body_Jsqqonline = Body_Jsqqonline &"function iecompattest(){"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"   return (document.compatMode && document.compatMode!=""BackCompat"")? document.documentElement : document.body"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"}"&vbcrlf

	    Body_Jsqqonline = Body_Jsqqonline &"function staticbar(){"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"	barheight=document.getElementById(""divStayTopLeft"").offsetHeight"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"	var ns = (navigator.appName.indexOf(""Netscape"") != -1) || window.opera;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"	var d = document;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"	function ml(id){"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		var el=d.getElementById(id);"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		el.style.visibility=""visible"""&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		if(d.layers)el.style=el;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		el.sP=function(x,y){this.style.left=x+""px"";this.style.top=y+""px"";};"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		el.x = startX;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		if (verticalpos==""fromtop"")"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		el.y = startY;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		else{"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		el.y -= startY;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		}"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		return el;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"	}"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"	window.stayTopLeft=function(){"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		if (verticalpos==""fromtop""){"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		var pY = ns ? pageYOffset : iecompattest().scrollTop;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		ftlObj.y += (pY + startY - ftlObj.y)/8;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		}"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		else{"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		ftlObj.y += (pY - startY - ftlObj.y)/8;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		}"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		ftlObj.sP(ftlObj.x, ftlObj.y);"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"		setTimeout(""stayTopLeft()"", 10);"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"	}"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"	ftlObj = ml(""divStayTopLeft"");"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"	stayTopLeft();"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"}"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"if(typeof(HTMLElement)!=""undefined""){"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"  HTMLElement.prototype.contains=function (obj)"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"  {"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"	  while(obj!=null&&typeof(obj.tagName)!=""undefind""){"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"　 　 if(obj==this) return true;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"　　	　obj=obj.parentNode;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"　	  }"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"	  return false;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"  }"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"}"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"if (window.addEventListener)"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"window.addEventListener(""load"", staticbar, false)"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"else if (window.attachEvent)"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"window.attachEvent(""onload"", staticbar)"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"else if (document.getElementById)"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"window.onload=staticbar"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"function SiteServiceOver(){"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"   document.getElementById(""divMenu"").style.display = ""none"";"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"   document.getElementById(""divOnline"").style.display = ""block"";"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"   document.getElementById(""divStayTopLeft"").style.width = ""170px"";"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"}"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"function SiteServiceOut(){"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"   document.getElementById(""divMenu"").style.display = ""block"";"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"   document.getElementById(""divOnline"").style.display = ""none"";"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"}"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"function ShowSiteService(theEvent){ //Firefox"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"　 if (theEvent){"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"　    var browser=navigator.userAgent;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"　	  if (browser.indexOf(""Firefox"")>0){"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"　　     if (document.getElementById('divOnline').contains(theEvent.relatedTarget)) {"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"　　         return;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"         }"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"      }"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"	  if (browser.indexOf(""MSIE"")>0){ //IE"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"          if (document.getElementById('divOnline').contains(event.toElement)) {"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"	          return;"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"          }"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"      }"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"   }"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"   document.getElementById(""divMenu"").style.display = ""block"";"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"   document.getElementById(""divOnline"").style.display = ""none"";"&vbcrlf
	    Body_Jsqqonline = Body_Jsqqonline &"}"
		Savehtml "../include/Lebi_Html/SiteQQService.js",Body_Jsqqonline
		If mes_type = 0 Then
	            Write_Lebi_Eshop("<script>alert('"& Lang_sys(72) &"');</script>")
		Else
				Write_Lebi_Eshop("<script>categoryname.innerHTML="""";bar_p_img.width=300;bar_p_txt2.innerHTML='';bar_p_txt1.innerHTML=""100"";</script>")
		End If
End Sub

Sub jsmenu()
        Dim Body_Jsmenu
		Lang = safereplace(request("lang"))
		prev = request("prev")
		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
		If prev = "" Then
				If mes_type = 0 Then
						Write_Lebi_Eshop("<script>alert('"& Lang_sys(72) &"');</script>")
				Else
						Write_Lebi_Eshop("<script>categoryname.innerHTML="""";bar_p_img.width=300;bar_p_txt2.innerHTML='';bar_p_txt1.innerHTML=""100"";</script>")
				End If
		Else
				Call Up_mes(Lang_sys(69),"·"& Lang_sys(68),0,prev,0,0,2,1)
		End If
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
%>