<!-- #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_05
Dim TodayDate
Dim Sql

TodayDate = Qsite.FormatDate(Date())

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

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

Rs.Open Sql , Conn , 1 , 1
If Rs.Eof Then
	Ind_05 = ""
Else
	Ind_05 = ""
	Ind_05 = Ind_05 & "<div id=""ad"" style=""position:absolute"">"
	If Rs("AdType") = "1" Then
		Ind_05 = Ind_05 & "<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=""240"" height=""100"">"
		Ind_05 = Ind_05 & "<param name=""movie"" value="""& Rs("AdPicUrl") &""" />"
		Ind_05 = Ind_05 & "<param name=""quality"" value=""high"" />"
		Ind_05 = Ind_05 & "<embed src="""& Rs("AdPicUrl") &""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width=""240"" height=""100""></embed>"
		Ind_05 = Ind_05 & "</object>"
	Else
		If Rs("AdUrl") <> "" And Rs("AdUrl") <> "http://" Then
			Ind_05 = Ind_05 & "<a href="""& Rs("AdUrl") &""" target=""_blank""><img src="""& Rs("AdPicUrl") &""" border=""0"" /></a>"
		Else
			Ind_05 = Ind_05 & "<img src="""& Rs("AdPicUrl") &""" border=""0"" />"
		End If
	End If
	Ind_05 = Ind_05 & "</div>"
End If
Rs.Close

If Ind_05 <> "" Then
%>
document.write('<%=Ind_05%>');

var x = 50,y = 60
var xin = true, yin = true
var step = 1 
var delay = 30
var obj=document.getElementById("ad") 
function floatAD() {
	var L=T=0;
	var R= document.body.clientWidth-obj.offsetWidth;
	var B = document.body.clientHeight-obj.offsetHeight;
	obj.style.left = x + document.body.scrollLeft;
	obj.style.top = y + document.body.scrollTop;
	x = x + step*(xin?1:-1);
	if (x < L) { xin = true; x = L} 
	if (x > R){ xin = false; x = R} 
	y = y + step*(yin?1:-1); 
	if (y < T) { yin = true; y = T } 
	if (y > B) { yin = false; y = B } 
}
var itl= setInterval("floatAD()", delay); 
obj.onmouseover=function(){clearInterval(itl)}
obj.onmouseout=function(){itl=setInterval("floatAD()", delay)}
<%
End If
%>