<!-- #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,i,j,Ind_01
Dim TodayDate
Dim Sql

TodayDate = Qsite.FormatDate(Date())

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

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

Rs.Open Sql , Conn , 1 , 1
If Rs.Eof Then
	Ind_01 = ""
	Ind_01 = Ind_01 & "<table width=""330"" border=""0"" cellpadding=""0"" cellspacing=""0"">"
	For i = 1 To 6
		Ind_01 = Ind_01 & "<tr>"
		For j = 1 To 2
			Ind_01 = Ind_01 & "<td width=""165"" height=""60"" valign=""top""><img src=""Images/Ad_Ind_02_def.jpg"" width=""155"" height=""50"" border=""0"" /></td>"
		Next
		Ind_01 = Ind_01 & "</tr>"
	Next
	Ind_01 = Ind_01 & "</table>"
Else
	Ind_01 = ""
	Ind_01 = Ind_01 & "<table width=""330"" border=""0"" cellpadding=""0"" cellspacing=""0"">"
	Ind_01 = Ind_01 & "<tr>"
	i = 0
	Do While Not Rs.Eof
		Ind_01 = Ind_01 & "<td width=""165"" height=""60"" valign=""top"">"
		If Rs("AdType") = "1" Then
			Ind_01 = Ind_01 & "<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=""155"" height=""50"">"
			Ind_01 = Ind_01 & "<param name=""movie"" value="""& Rs("AdPicUrl") &""" />"
			Ind_01 = Ind_01 & "<param name=""quality"" value=""high"" />"
			Ind_01 = Ind_01 & "<embed src="""& Rs("AdPicUrl") &""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width=""155"" height=""50""></embed>"
			Ind_01 = Ind_01 & "</object>"
		Else
			If Rs("AdUrl") <> "" And Rs("AdUrl") <> "http://" Then
				Ind_01 = Ind_01 & "<a href="""& Rs("AdUrl") &""" target=""_blank""><img src="""& Rs("AdPicUrl") &""" width=""155"" height=""50"" border=""0"" /></a>"
			Else
				Ind_01 = Ind_01 & "<img src="""& Rs("AdPicUrl") &""" width=""155"" height=""50"" border=""0"" />"
			End If
		End If
		Ind_01 = Ind_01 & "</td>"
	Rs.MoveNext
	i = i + 1
	If i >= 12 Then Exit Do
	If i Mod 2 = 0 And Not Rs.Eof Then Ind_01 = Ind_01 & "</tr><tr>"
	If ((i\2) + 1 < 6 Or i Mod 2 > 0) And Rs.Eof Then
		If i Mod 2 > 0 Then
			For j = (i Mod 2) + 1 To 2
				Ind_01 = Ind_01 & "<td width=""165"" height=""60"" valign=""top""><img src=""Images/Ad_Ind_02_def.jpg"" width=""155"" height=""50"" border=""0"" /></td>"
			Next
		End If
		If (i\2) + 1 < 6 Then
			For i = (i\2) + 2 To 6
				Ind_01 = Ind_01 & "<tr>"
				For j = 1 To 2
					Ind_01 = Ind_01 & "<td width=""165"" height=""60"" valign=""top""><img src=""Images/Ad_Ind_02_def.jpg"" width=""155"" height=""50"" border=""0"" /></td>"
				Next
				Ind_01 = Ind_01 & "</tr>"
			Next
		End If
	End If
	Loop
	Ind_01 = Ind_01 & "</tr>"
	Ind_01 = Ind_01 & "</table>"
End If
Rs.Close
%>
document.write('<%=Ind_01%>');