<!--#include file="../odbc/conn.asp" -->
<%
rs.open "select top 1 * from ad where District='a' and pos>20 and pos<23 and datafirst<='"&date&"' and datalast>='"&date&"' and type<>'text' and app<>'del' order by pos",dsnstr,3,1
if not rs.bof and not rs.eof then
if trim(rs("type")&" ")="flash" then
response.write "var imgheight"& vbCrLf
response.write "var imgleft"& vbCrLf
response.write "document.ns = navigator.appName == ""Netscape"""& vbCrLf
response.write "window.screen.width>800 ? imgheight=100:imgheight=100"& vbCrLf
response.write "window.screen.width>800 ? imgleft=15:imgleft=120"& vbCrLf
response.write "function myload()"& vbCrLf
response.write "{"& vbCrLf
response.write "if (navigator.appName == ""Netscape"")"& vbCrLf
response.write "{document.myleft.pageY=pageYOffset+window.innerHeight-imgheight;"& vbCrLf
response.write "document.myleft.pageX=imgleft;"& vbCrLf
response.write "leftmove();"& vbCrLf
response.write "}"& vbCrLf
response.write "else"& vbCrLf
response.write "{"& vbCrLf
response.write "myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;"& vbCrLf
response.write "myleft.style.left=imgleft;"& vbCrLf
response.write "leftmove();"& vbCrLf
response.write "}"& vbCrLf
response.write "}"& vbCrLf
response.write "function leftmove()"& vbCrLf
response.write " {"& vbCrLf
response.write " if(document.ns)"& vbCrLf
response.write " {"& vbCrLf
response.write " document.myleft.top=pageYOffset+window.innerHeight-imgheight"& vbCrLf
response.write " document.myleft.left=imgleft;"& vbCrLf
response.write " setTimeout(""leftmove();"",80)"& vbCrLf
response.write " }"& vbCrLf
response.write " else"& vbCrLf
response.write " {"& vbCrLf
response.write " myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;"& vbCrLf
response.write " myleft.style.left=imgleft;"& vbCrLf
response.write " setTimeout(""leftmove();"",80)"& vbCrLf
response.write " }"& vbCrLf
response.write " }"& vbCrLf
response.write ""& vbCrLf
response.write "function MM_reloadPage(init) {  //reloads the window if Nav4 resized"& vbCrLf
response.write "  if (init==true) with (navigator) {if ((appName==""Netscape"")&&(parseInt(appVersion)==4)) {"& vbCrLf
response.write "    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}"& vbCrLf
response.write "  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();"& vbCrLf
response.write "}"& vbCrLf
response.write "MM_reloadPage(true)"& vbCrLf
response.write ""& vbCrLf
response.write "if (navigator.appName == ""Netscape"")"& vbCrLf
response.write "{"& vbCrLf
response.write "document.write(""<layer id=myleft top=300 width=80 height=88><EMBED src='"&"/ad/flash/"&htmlcode(trim(rs("show")&" "))&"' quality=high  WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave-flash' id=changhongout wmode='transparent'></EMBED></layer>"");"& vbCrLf
response.write "myload()}"& vbCrLf
response.write "else"& vbCrLf
response.write "{"& vbCrLf
response.write "document.write(""<div id=myleft style='position: absolute;width:80;top:300;left:5;visibility: visible;z-index: 1'><EMBED src='"&"/ad/flash/"&htmlcode(trim(rs("show")&" "))&"' quality=high  WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave-flash' id=changhongout wmode='transparent'></EMBED></div>"");"& vbCrLf
response.write "myload()"& vbCrLf
response.write "}"& vbCrLf

elseif trim(rs("type")&" ")="pic" then
response.write "var imgheight"& vbCrLf
response.write "var imgleft"& vbCrLf
response.write "document.ns = navigator.appName == ""Netscape"""& vbCrLf
response.write "window.screen.width>800 ? imgheight=100:imgheight=100"& vbCrLf
response.write "window.screen.width>800 ? imgleft=15:imgleft=120"& vbCrLf
response.write "function myload()"& vbCrLf
response.write "{"& vbCrLf
response.write "if (navigator.appName == ""Netscape"")"& vbCrLf
response.write "{document.myleft.pageY=pageYOffset+window.innerHeight-imgheight;"& vbCrLf
response.write "document.myleft.pageX=imgleft;"& vbCrLf
response.write "leftmove();"& vbCrLf
response.write "}"& vbCrLf
response.write "else"& vbCrLf
response.write "{"& vbCrLf
response.write "myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;"& vbCrLf
response.write "myleft.style.left=imgleft;"& vbCrLf
response.write "leftmove();"& vbCrLf
response.write "}"& vbCrLf
response.write "}"& vbCrLf
response.write "function leftmove()"& vbCrLf
response.write " {"& vbCrLf
response.write " if(document.ns)"& vbCrLf
response.write " {"& vbCrLf
response.write " document.myleft.top=pageYOffset+window.innerHeight-imgheight"& vbCrLf
response.write " document.myleft.left=imgleft;"& vbCrLf
response.write " setTimeout(""leftmove();"",80)"& vbCrLf
response.write " }"& vbCrLf
response.write " else"& vbCrLf
response.write " {"& vbCrLf
response.write " myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;"& vbCrLf
response.write " myleft.style.left=imgleft;"& vbCrLf
response.write " setTimeout(""leftmove();"",80)"& vbCrLf
response.write " }"& vbCrLf
response.write " }"& vbCrLf
response.write ""& vbCrLf
response.write "function MM_reloadPage(init) {  //reloads the window if Nav4 resized"& vbCrLf
response.write "  if (init==true) with (navigator) {if ((appName==""Netscape"")&&(parseInt(appVersion)==4)) {"& vbCrLf
response.write "    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}"& vbCrLf
response.write "  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();"& vbCrLf
response.write "}"& vbCrLf
response.write "MM_reloadPage(true)"& vbCrLf
response.write ""& vbCrLf
response.write "if (navigator.appName == ""Netscape"")"& vbCrLf
response.write "{"& vbCrLf
response.write "document.write(""<layer id=myleft top=300 width=80 height=88><a href='"&"/kingstone/configseting/ad/adcount.asp?district=a&pos=21-22&url="&htmlcode(trim(rs("url")&" "))&"' target=_blank><img src='"&"/ad/pic/"&htmlcode(trim(rs("show")&" "))&"' WIDTH=80 HEIGHT=80 id=changhongout border=0></a></layer>"");"& vbCrLf
response.write "myload()}"& vbCrLf
response.write "else"& vbCrLf
response.write "{"& vbCrLf
response.write "document.write(""<div id=myleft style='position: absolute;width:80;top:300;left:5;visibility: visible;z-index: 1'><a href='"&"/kingstone/configseting/ad/adcount.asp?district=a&pos=21-22&url="&htmlcode(trim(rs("url")&" "))&"' target=_blank><img src='"&"/ad/pic/"&htmlcode(trim(rs("show")&" "))&"' WIDTH=80 HEIGHT=80 id=changhongout border=0></a></div>"");"& vbCrLf
response.write "myload()"& vbCrLf
response.write "}"& vbCrLf
end if
end if
rs.close
set rs=nothing
dsnstr.close
set dsnstr=nothing
%>