<%
'=================================================
'函数名：xycms_menu
'功能：导航菜单内容调用
'调用参数：xyview,是否显示；xytid,菜单位置
'=================================================
function xycms_menu(xyview,xytid)
dim menu
set menu=server.CreateObject("adodb.recordset")
menu.open "select * from menu where view="&xyview&" and tid="&xytid&" order by pl_id asc",conn,1,1
while not menu.eof
response.Write("<li><a href="""&menu("url")&""" target="""&menu("open_m")&""" class=""menu"" title="""&menu("title")&""">"&menu("title")&"</a></li>")
menu.movenext
wend
menu.close
set menu=nothing
end function

'=================================================
'函数名：xycms_flash
'功能：焦点图调用
'调用参数：xypicw,长度；xypich,宽度
'=================================================
function xycms_flash(xypicw,xypich) %>
<script type="text/javascript">
	var swf_width=<%=xypicw%>;
	var swf_height=<%=xypich%>;
	//-- 标签调用设置 焦点图片自动播放时间(秒)|文字颜色|文字背景色|文字背景透明度|按键数字颜色|当前按键颜色|普通按键色彩 XYCMS --
	var config='5|0xffffff|0x97210a|40|0xffffff|0x666666|0x000000';
	var files='',links='', texts='';
	<% Set xy_rs = server.CreateObject("adodb.recordset")
          xy_sql = "select * from [news] where len(img)>4 and tuijian=1 order by id desc"
       xy_rs.Open xy_sql, conn, 1, 1
       do while not xy_rs.EOF
       response.Write("files+='|"&xy_rs("img")&"';links+='|shownews"&xy_rs("id")&".html';texts+='|"&xy_rs("title")&"';")
       xy_rs.moveNext
       loop
       xy_rs.Close
       set xy_rs = nothing %>
	   files=files.substring(1);
	   links=links.substring(1);
	   texts=texts.substring(1);
	   document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"                codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
	   document.write('<param name="movie" value="images/xy_cms.swf" />');
	   document.write('<param name="quality" value="high" />');
       document.write('<param name="menu" value="false" />');
	   document.write('<param name=wmode value="opaque" />');
	   document.write('<param name="FlashVars" value="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'" />');
	   document.write('<embed src="images/xy_cms.swf" wmode="opaque" FlashVars="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	   document.write('</object>');
</script> 
<% end function

'关于我们字数截取
function xycms_about(aid,strlen)
set aboutus=server.CreateObject("adodb.recordset")
aboutus.open "select * from [common] where id="&aid&"",conn,1,1
if aboutus.eof and aboutus.bof then
response.Write("&nbsp;暂无信息记录 !")
end if
response.Write("<a href=""common.asp?id="&aboutus("id")&""" title=""" & aboutus("title") &""">"  & CutStr(aboutus("body"),strlen,"...") & "</a>")
aboutus.close
set aboutus=nothing
end function

'=================================================
'函数名：xycms_commonlist
'功能：企业简介分类
'调用参数：无
'=================================================
function xycms_commonlist()
set commonlist=server.CreateObject("adodb.recordset")
commonlist.open "select * from [common] order by pl_id asc",conn,1,1
if commonlist.eof and commonlist.bof then
response.Write("&nbsp;暂无记录 !")
end if
while not commonlist.eof
response.Write("<li><a href=""common.asp?id="&commonlist("id")&""" title=""" & commonlist("title") &""">"  & commonlist("title") & "</a></li>")
commonlist.movenext
wend
commonlist.close
set commonlist=nothing
end function

'=================================================
'函数名：xycms_newslist
'功能：新闻分类
'调用参数：无
'=================================================
function xycms_newslist()
set newslist=server.CreateObject("adodb.recordset")
newslist.open "select * from [news_fl] order by pl_id asc",conn,1,1
if newslist.eof and newslist.bof then
response.Write("&nbsp;暂无记录 !")
end if
while not newslist.eof
response.Write("<li><a href=""news.asp?id="&newslist("id")&""" title=""" & newslist("title") &""">"  & newslist("title") & "</a></li>")
newslist.movenext
wend
newslist.close
set newslist=nothing
end function


'=================================================
'函数名：xycms_news
'功能：新闻内容
'调用参数：xytop,调用条数；xytitle,标题字数；xyfl，新闻分类；xytj，是否推荐；xyorder，排列顺序
'=================================================
function xycms_news(xytop,xytitle,xyfl,xytj,xyorder)
Dim xycms_fl,xycms_tj,xycms_order
select case xyfl
       case 0
	   xycms_fl=""
	   case else
	   xycms_fl="and ssfl="&xyfl&""
end select
select case xytj
       case 0
	   xycms_tj=""
	   case 1
	   xycms_tj="and tuijian=1"
	   case else
	   xycms_tj=""
end select
select case xyorder
       case 0
	   xycms_order="order by id desc"
	   case 1
	   xycms_order="order by hit desc"
	   case else
	   xycms_order=""
end select
set news=server.CreateObject("adodb.recordset")
  sql="select top "&xytop&" * from [news] where passed=1 "&xycms_fl&" "&xycms_tj&" "&xycms_order&""
news.open sql,conn,1,1
if news.eof and news.bof then
response.Write("&nbsp;暂无该新闻内容 !")
else
while not news.eof
dim url,color
if IsNull(news("url")) or trim(news("url")&"")="" then
url="shownews.asp?id="&news("id")&""
else
url=""&news("url")&""
end if
if IsNull(news("color")) or trim(news("color")&"")="" then
color="#000000"
else
color=""&news("color")&""
end if 
%>
<li><a href="<%=url%>" style="color:<%=color%>;" title="<%=news("title")%>"><%=left(news("title"),xytitle)%></a>&nbsp;&nbsp;<span>[<%=FormatDateTime(news("data"),2)%>]</span> </li>
<% news.movenext
wend
news.close
set news=nothing
end if
end function 

'=================================================
'函数名：xycms_productsbigfl
'功能：一级分类
'=================================================
function xycms_productsbigfl()
set bigfl=server.CreateObject("adodb.recordset")
bigfl.open "select * from [bigclass] order by pl_id asc",conn,1,1
if bigfl.eof and bigfl.bof then
response.Write("&nbsp;暂无信息记录 !")
end if
while not bigfl.eof%>
<li><a href="pro.asp?bigclassid=<%=bigfl("bigclassid")%>" title="<%=bigfl("bigclassname")%>"><%=bigfl("bigclassname")%></a></li>
<% bigfl.movenext
wend
bigfl.close
set bigfl=nothing
end function

'=================================================
'函数名：xycms_contact
'功能：联系方式
'调用参数：数
'=================================================
function xycms_contact()%>
<li>名称：<%=wzname%></li>
<li>联系电话：<font color="#666666"><%=telnum%></font></li>
<li>联系地址：<font color="#666666"><%=address%></font></li>
<li>网址：<font color="#666666"><%=wzurl%></font></li>
<li>E_mail：<font color="#666666"><%=email%></font></li>
<% end function 

function xycms_proimg()
set proimg=server.createobject("adodb.recordset") 
exec="select * from  [products] where len(img)>4 order by id desc  " 
proimg.open exec,conn,1,1 
if proimg.eof and proimg.bof then
response.Write("<li>暂无信息记录!</li>")
else
do while not proimg.eof
%>
<td align=center><a href="showpro.asp?id=<%=proimg("id")%>" target="_blank"><img src="<%=proimg("img")%>" width="210" height="150" /><br><%=left(proimg("title"),10)%></a></td><td width="10">&nbsp;</td>
<%
proimg.movenext 
loop 
proimg.close
set proimg=nothing
end if
end function
%>

