<%
'*******************************************************
'易达CMS中小企业快速建站系统
'软件开发 黑龙江省世纪伟成网络科技有限公司
'网址：http://yidacms.com
'软件享有著作权，未经公司或开发者同意禁止更改以下代码。
'*******************************************************
function Yidacms_ad(str)
set reg=new regexp
reg.IgnoreCase = False 
reg.Global = True 
reg.Pattern = "<Yidacms_Ad:\{(.+?)\}>([\s\S]*?)<Yidacms_Ad>"
set aa=reg.execute(str)
for each match in aa
bq=match.submatches(0)
nr=match.submatches(1)
leixing=nbq(bq,"leixing")
str=replace(str,match,adt(leixing,nr))
next
Yidacms_ad=str
end function

Function adt(leixing,yida_cms)
set rs = server.createobject("adodb.recordset")
sql="select * from shuaiweb_ad where id = "&leixing&""
rs.open sql,dbok,1,1
	if rs.bof and rs.eof then
		adt = "没有该条广告记录!"
			Else
		adt = rs("shuaiweb_adneirong")
	end if		   
rs.Close
set rs=nothing
End Function


	Function Yidacms_ad_floating(a)
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_ad where id = 1"
	rs.open sql,dbok,1,1
        floatingt = floatingt & "<script src='"&webpath&"t/ad/piaofu.js' language='JavaScript'></script>"&vbcrlf
        floatingt = floatingt & "<div id='piaofu'>"&vbcrlf
        floatingt = floatingt & "	<a href='"&rs("shuaiweb_adurl1")&"' target='_blank'><img src='"&webpath&rs("shuaiweb_adimg1")&"' border='0'></a>"&vbcrlf
        floatingt = floatingt & "</div>"&vbcrlf
        floatingt = floatingt & "<script>"&vbcrlf
        floatingt = floatingt & "	var piaofurun=new AdMove('piaofu');"&vbcrlf
        floatingt = floatingt & "	piaofurun.Run();"&vbcrlf
        floatingt = floatingt & "</script>"&vbcrlf
        a = replace(a,"{YidacmsAd:floating}",floatingt)
        Yidacms_ad_floating = a
	End Function

	Function Yidacms_ad_couplets(a)
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_ad where id = 1"
	rs.open sql,dbok,1,1
        coupletst = coupletst & "<DIV id='lovexin12' style='left:22px;POSITION:absolute;TOP:69px;'>"&vbcrlf
        coupletst = coupletst & "	<a href='"&rs("shuaiweb_adurl2")&"' target='_blank'><img src='"&webpath&rs("shuaiweb_adimg2")&"' border='0'></a>"&vbcrlf
        coupletst = coupletst & "<br><a href=JavaScript:; onclick=""document.getElementById('lovexin12').style.display='none';""><img border='0' src='"&webpath&"t/ad/close.gif'></a>"&vbcrlf
        coupletst = coupletst & "</DIV>"&vbcrlf
        coupletst = coupletst & "<DIV id='lovexin14' style='right:22px;POSITION:absolute;TOP:69px;'>"&vbcrlf
        coupletst = coupletst & "	<a href='"&rs("shuaiweb_adurl3")&"' target='_blank'><img src='"&webpath&rs("shuaiweb_adimg3")&"' border='0'></a>"&vbcrlf
        coupletst = coupletst & "<br><a href=JavaScript:; onclick=""document.getElementById('lovexin14').style.display='none';""><img border='0' src='"&webpath&"t/ad/close.gif'></a>"&vbcrlf
        coupletst = coupletst & "</DIV>"&vbcrlf
        coupletst = coupletst & "<script src='"&webpath&"t/ad/duilian.js' language='JavaScript'></script>"&vbcrlf
        coupletst = coupletst & "<script>window.setInterval('heartBeat()',1);</script>"&vbcrlf
        a = replace(a,"{YidacmsAd:couplets}",coupletst)
        Yidacms_ad_couplets = a
	End Function

	Function Yidacms_ad_popup(a)
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_ad where id = 1"
	rs.open sql,dbok,1,1
        popupt = popupt & "<div id='msg_win' style='display:block;top:490px;visibility:visible;opacity:1;'>"&vbcrlf
        popupt = popupt & "	<div class='icos'><a id='msg_min' title='最小化' href='javascript:void 0'></a>"&vbcrlf
        popupt = popupt & "	<a id='msg_close' title='关闭' href='javascript:void 0'>×</a></div>"&vbcrlf
        popupt = popupt & "<div id='msg_title'>"&rs("shuaiweb_adtitle")&"</div>"&vbcrlf
        popupt = popupt & "<div id='msg_content'>"&rs("shuaiweb_adneirong1")&"</div>"&vbcrlf
        popupt = popupt & "</div>"&vbcrlf
        popupt = popupt & "<script src='"&webpath&"t/ad/tc.js' language='JavaScript'></script>"&vbcrlf
        popupt = popupt & "<LINK href='"&webpath&"t/ad/tc.css' type=text/css rel=stylesheet>"&vbcrlf
        a = replace(a,"{YidacmsAd:popup}",popupt)
        Yidacms_ad_popup = a
	End Function
%>