<!--#include file="Conn.asp"-->
<%
Set rs=Server.CreateObject("ADODB.Recordset") 
ID = Cint(Request.QueryString("id"))
menu = Request.QueryString("menu")
If ID <= 0 or menu = "" Then
Response.Redirect("/")
End If
Sub js
Rs.open "select * from sd_foxad where sd_id="&ID,conn,1,1
MYLX = Rs("sd_lx")
IF MYLX=0 THEN
If Rs("sd_outtime") <> "" Then
	If DateDiff("d",now(),Rs("sd_outtime")) < 0 Then
		Response.Write("document.writeln("""");")
	Else	
	content = Rs("sd_content")
	content = Replace(content,"\","\\")
	content = Replace(content,"/","\/")
	content = Replace(content,"""","\""")
	content = Replace(content,"'","\'")
	con = Split(content,chr(13)&chr(10))
	For i = 0 To UBound(con)
		Response.Write "document.writeln("&chr(34)&"<a href="&Rs("sd_beiz")&" target=_blank><img src="&Replace(con(i),chr(13),"")&" width="&Rs("sd_width")&" height="&Rs("sd_height")&" border=0></a>"&chr(34)&");"
	Next		
	End If
Else
	content = Rs("sd_content")
	content = Replace(content,"\","\\")
	content = Replace(content,"/","\/")
	content = Replace(content,"""","\""")
	content = Replace(content,"'","\'")
	con = Split(content,chr(13)&chr(10))
	For i = 0 To UBound(con)
		Response.Write "document.writeln("&chr(34)&"<a href="&Rs("sd_beiz")&" target=_blank><img src="&Replace(con(i),chr(13),"")&" width="&Rs("sd_width")&" height="&Rs("sd_height")&" border=0></a>"&chr(34)&");"
	Next
End If
ELSEIF MYLX=1 THEN
If Rs("sd_outtime") <> "" Then
	If DateDiff("d",now(),Rs("sd_outtime")) < 0 Then
		Response.Write("document.writeln("""");")
	Else	
	content = Rs("sd_content")
	content = Replace(content,"\","\\")
	content = Replace(content,"/","\/")
	content = Replace(content,"""","\""")
	content = Replace(content,"'","\'")
	con = Split(content,chr(13)&chr(10))
	For i = 0 To UBound(con)
		Response.Write "document.writeln("&chr(34)&"<param name='movie' value='"&Replace(con(i),chr(13),"")&"'><param name='quality' value='high'><embed src='"&Replace(con(i),chr(13),"")&"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"&Rs("sd_width")&"' height='"&Rs("sd_height")&"'></embed></object>"&chr(34)&");"
	Next		
	End If
Else
	content = Rs("sd_content")
	content = Replace(content,"\","\\")
	content = Replace(content,"/","\/")
	content = Replace(content,"""","\""")
	content = Replace(content,"'","\'")
	con = Split(content,chr(13)&chr(10))
	For i = 0 To UBound(con)
		Response.Write "document.writeln("&chr(34)&"<param name='movie' value='"&Replace(con(i),chr(13),"")&"'><param name='quality' value='high'><embed src='"&Replace(con(i),chr(13),"")&"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"&Rs("sd_width")&"' height='"&Rs("sd_height")&"'></embed></object>"&chr(34)&");"
	Next
End If
ELSE
If Rs("sd_outtime") <> "" Then
	If DateDiff("d",now(),Rs("sd_outtime")) < 0 Then
		Response.Write("document.writeln("""");")
	Else	
	content = Rs("sd_content")
	content = Replace(content,"\","\\")
	content = Replace(content,"/","\/")
	content = Replace(content,"""","\""")
	content = Replace(content,"'","\'")
	con = Split(content,chr(13)&chr(10))
	For i = 0 To UBound(con)
		Response.Write "document.writeln("&chr(34)&Replace(con(i),chr(13),"")&chr(34)&");"
	Next		
	End If
Else
	content = Rs("sd_content")
	content = Replace(content,"\","\\")
	content = Replace(content,"/","\/")
	content = Replace(content,"""","\""")
	content = Replace(content,"'","\'")
	con = Split(content,chr(13)&chr(10))
	For i = 0 To UBound(con)
		Response.Write "document.writeln("&chr(34)&Replace(con(i),chr(13),"")&chr(34)&");"
	Next
End If
END IF
Rs.close

End Sub

Select case menu
	case "js"
		js
End Select

Set Rs = Nothing
conn.close:Set conn = Nothing
%>