<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/config.asp"-->
<%
id=trim(request("id"))
if id="" then
   ad="广告调用错误！"
   ad="document.write("""&ad&""")"
else
  set rs=server.CreateObject("adodb.recordset")
  sql="select * from cw_ad where id="&id
  rs.open sql,conn,1,1
  if not rs.eof then
     if rs("type")=0 then
	    ad="<a href='"&rs("link")&"' target='_blank'><img src='"&cf_root&rs("pic")&"' width='"&rs("width")&"' height='"&rs("height")&"' /></a>"
		ad="document.write("""&ad&""")"
	 end if
	 if rs("type")=1 then
	    ad=rs("code")
		ad=Ad_Re(ad)
	 end if
	 if rs("type")=2 then
	    ad="<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='"&rs("width")&"' height='"&rs("height")&"'><param name='movie' value='"&cf_root&rs("pic")&"' /><param name='quality' value='high' /><embed src='"&cf_root&rs("pic")&"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"&rs("width")&"' height='"&rs("height")&"'></embed></object>"
	  ad="document.write("""&ad&""")"
	 end if
  else
    ad="广告不存在"
  end if
  rs.close
  set rs=nothing  
end if

Function Ad_Re(t0)
	IF Len(t0)=0 Then Ad_Re="":Exit Function
	t1=Replace(t0,"""","\""")
	t1=Replace(t1,"/","\/")
	t1=Replace(t1,vbcrlf,""");"&vbcrlf&"document.writeln(""")
	Ad_Re="document.writeln("""&t1&""");"
End Function

response.Write(ad)'输出内容
call closes()
%>
