<!-- #include file = "../Conn.asp" -->
<!-- #include file = "../Comm/Site_Class.asp" -->
<%
Response.Expires = -1 
Response.ExpiresAbsolute = Now() - 1 
Response.cachecontrol = "no-cache"

PagePath = "../"

Set Qsite = New Site_Class
Qsite.SiteConfig()

If Not IsObject(Conn) Then ConnectionDatabase()

Dim Rs,strShow,Ad_Top_02
Dim pp
Dim TodayDate
Dim Sql

TodayDate = Qsite.FormatDate(Date())

Set Rs = server.createobject("ADODB.Recordset")

pp = Qsite.chgStr(Trim(Request.QueryString("PagePath")))

If pp = "" Or IsNull(pp) Then pp = ""


Sql = "select top 1 * from AdTbl where AdWz like '%|1|%' and AdPause = '0' and ValidityDate > '"& TodayDate &"' order by AdId desc"

Rs.Open Sql , Conn , 1 , 1
If Rs.Eof Then
	Ad_Top_02 = ""
Else
	If InStr(Rs("AdPicUrl") , "http://") > 0 Then
		strShow = Rs("AdPicUrl")
	Else
		strShow = pp & Rs("AdPicUrl")
	End If
	If Rs("AdType") = "1" Then
		Ad_Top_02 = "<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"" width=""170"" height=""60"">"
		Ad_Top_02 = Ad_Top_02 & "<param name=""movie"" value="""& strShow &""" />"
		Ad_Top_02 = Ad_Top_02 & "<param name=""quality"" value=""high"" />"
		Ad_Top_02 = Ad_Top_02 & "<embed src="""& strShow &""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width=""170"" height=""60""></embed>"
		Ad_Top_02 = Ad_Top_02 & "</object>"
	Else
		If Rs("AdUrl") <> "" And Rs("AdUrl") <> "http://" Then
			Ad_Top_02 = "<a href="""& Rs("AdUrl") &""" target=""_blank""><img src="""& strShow &""" width=""170"" height=""60"" border=""0"" /></a>"
		Else
			Ad_Top_02 = "<img src="""& strShow &""" width=""170"" height=""60"" border=""0"" />"
		End If
	End If
End If
Rs.Close
%>
document.write('<%=Ad_Top_02%>');