<%set rsad = server.createobject("adodb.recordset")
rsad.open "select * from AD where TypeCode='1' and MenuCode<>'' and left(MenuCode,2)='02' order by id desc",conn,1,1
if rsad.eof then
rsad.cancel:rsad.close
rsad.open "select * from AD where TypeCode='0' order by id desc",conn,1,1
end if
if not rsad.eof then%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="5" bgcolor="9E0B0E">&nbsp;</td>
    <td>
	  <%if rsad("linkurl")&""<>"" then%><a href="<%=rsad("LinkUrl")%>" target="_blank" title="<%=rsad("AltText")%>"><%end if%><%=ShowPicture(rsad("PicPath"),765,60,"")%></a>
	</td>
    <td width="5" bgcolor="9E0B0E">&nbsp;</td>
  </tr>
  <tr>
    <td height="1" bgcolor="9E0B0E"></td>
    <td bgcolor="9E0B0E"></td>
    <td bgcolor="9E0B0E"></td>
  </tr>
</table>
<%end if
rsad.close
set rsad = nothing%>