<!-- #include file="../access.asp" -->
<!-- #include file="../html_clear.asp" -->
<!-- #include file="../web_config.asp" -->


<%'容错处理
function Chat_to_js()
On Error Resume Next
%>


<%
'模板内容读取替换
set rs=server.createobject("adodb.recordset")
sql="select * from web_service "
rs.open(sql),cn,1,1
if not rs.eof  then
web_ChatYes=rs("view_yes")
web_SerUrl=rs("name")
web_SerQR1=rs("wangwang")
web_SerQR2=rs("skype")

end if
rs.close
set rs=nothing
%>
<% '读取模板内容
if web_ChatYes=1 then
TemplatePath="/templates/common/SideBarTemplate.js"
else
TemplatePath="/templates/common/template.js"
end if
replace_code=ReadFromUTF(TemplatePath,"utf-8") 

%>
<%
replace_code=replace(replace_code,"$web_SerUrl$",web_SerUrl)
replace_code=replace(replace_code,"$web_SerQR1$",web_SerQR1)
replace_code=replace(replace_code,"$web_SerQR2$",web_SerQR2)
replace_code=replace(replace_code,"$ADs_Content$",ADs_Content)


%>

<%'声明HTML文件名,指定文件路径
filepath="/js/PetSideBar.js"
%>

<%
 '读取模板
'******************************************
'功能：生成UTF-8文件
'******************************************
mappath =filepath
Set objStream = Server.CreateObject("ADODB.Stream")
With objStream
.Open
.Charset = "utf-8"
.Position = objStream.Size
.WriteText=replace_code
.SaveToFile server.mappath(mappath),2
.Close
End With
Set objStream = Nothing
%>
<%
end function
%>