www.gusucode.com > 中网景企业网站源码时尚版 2009.73码程序 > common/function.asp

    <%
Dim rs,sql,classid,thispage,PagePara,keywords
Dim cnksername,classname,classname_en,cnkname
Dim dmn01,dmn02,dmn03,dmn04,dmn13,dmn05,dmn06,dmn07,dmn08,dmn09,dmn10,dmn11,dmn12
Dim asphsm,hthome,dis,roly,cnklable,cnklablecode,theym,cnkhost
classname=""
classname_en=""
Dim UserID,username,userpwd,weblevel
UserID=Request.Cookies(cookies_name)("UserID")
username=sqlchkchar(Request.Cookies(cookies_name)("username"))
userpwd=Request.Cookies(cookies_name)("UserPwd")
weblevel=Request.Cookies(cookies_name)("weblevel")
'cnkname=chr(-10544)&chr(-12808)&chr(-16720)&chr(-12808)&chr(-10818)&chr(-12363)&chr(-12877)
asphsm=".asp"
theym="83,69,82,86,69,82,95,78,65,77,69"
cnklablecode="40,-10544,-12808,-16720,-12808,-10818,-12363,-12877,41"
Dim ChannelID
ChannelID=Request("ChannelID")
if ChannelID<>"" then Call IsNum(ChannelID)
cnkhost=asctostr(theym)
Set rs=Server.Createobject("ADODB.Recordset")
cnksername=Request.ServerVariables(cnkhost)
keywords=Trim(Request("keywords"))
'some XHTML code
Const clearboth="<div class=""clearboth""></div>"

'==Nav & 全局 & 调用==
Function GetMenu(id,l)
Dim rsclass,sqlstr,ChildCount,i,classtype,classnamestr,onmouseup,listtype,isdspcl
Dim Link,OpenType,en,str
if l=1 then en="_en"
if isdispclass=1 then isdspcl="&disproclass=yes"
set rsclass=server.CreateObject("adodb.recordset")
sqlstr="select ChannelID,ChannelName"&en&",Link,OpenType,isShowSubMenu,ChannelType,ModuleType from cnk_Channel where UpChannelID="&id&" and isStop=0 and isShowNav=1  order by paixu"
rsclass.open sqlstr,conn,1,1
if rsclass.recordcount>0 then
	If id>0 Then str=str&"<div>"&vbcrlf
	while not rsclass.eof
		If rsclass(3)=1 Then OpenType=" target=""_blank""" else OpenType=""
		If rsclass(5)=0 Then Link=contentfile&"?ModuleType="&rsclass(6)&"&ChannelID="&rsclass(0)&isdspcl else Link=rsclass(2)
		str=str&"<a href="""&Link&""""&OpenType&">"&rsclass(1)&"</a>"&vbcrlf
		If rsclass(4)=1 Then 
			ChildCount=conn.execute("select count(*) from cnk_Channel where isStop=0 and UpChannelID="&rsclass(0))(0)
			if ChildCount>0 then str=str&GetMenu(rsclass(0),l)
		End If
		if rsclass(0)=3 and rsclass(4)=1 then
			Dim proleibie,pronew,prorecomm,prohot,protejia
			if l=0 then
				proleibie="产品类别"
				pronew="最新产品"
				prorecomm="推荐产品"
				prohot="热门产品"
				protejia="特价产品"
			else
				proleibie="Products Class"
				pronew="New Products"
				prorecomm="Recommend Products"
				prohot="Hot Products"
				protejia="Discount Products"
			end if
			if isnewpro=1 or isrecompro=1 or ishotpro=1 or istjpro=1 then
				str=str&"<div>"&vbcrlf
				str=str&"<a href=""javascript:void(0);"">"&proleibie&"</a>"&vbcrlf
				str=str&"<div>"&vbcrlf
				str=str&GetProClassList(0,l)
				str=str&"</div>"&vbcrlf
				if isnewpro=1 then str=str&"<a href="""&contentfile&"?ModuleType=3&ChannelID=3&sort=new"">"&pronew&"</a>"&vbcrlf
				if isrecompro=1 then str=str&"<a href="""&contentfile&"?ModuleType=3&ChannelID=3&sort=recomm"">"&prorecomm&"</a>"&vbcrlf
				if ishotpro=1 then str=str&"<a href="""&contentfile&"?ModuleType=3&ChannelID=3&sort=hot"">"&prohot&"</a>"&vbcrlf
				if istjpro=1 then str=str&"<a href="""&contentfile&"?ModuleType=3&ChannelID=3&sort=tejia"">"&protejia&"</a>"&vbcrlf
				str=str&"</div>"&vbcrlf
			else
				str=str&"<div>"&GetProClassList(0,l)&"</div>"&vbcrlf
			end if
		end if
		if rsclass(0)=7 and rsclass(4)=1 and username<>"" then
			Dim umodi,upwd,umsg,uorder,ufavo,uout
			if l=0 then
				umodi="修改信息"
				upwd="修改密码"
				umsg="个人留言"
				uorder="我的订单"
				ufavo="我的收藏"
				uout="退出登录"
			else
				umodi="Edit My Infomation"
				upwd="Modify My Password"
				umsg="My Message"
				uorder="My Order"
				ufavo="My Favorite"
				uout="Logout"
			end if
			str=str&"<div>"&vbcrlf
			str=str&"<a href=""users.asp?action=modiinfo&subtitle="&umodi&""">"&umodi&"</a>"&vbcrlf
			str=str&"<a href=""users.asp?action=modipwd&subtitle="&upwd&""">"&upwd&"</a>"&vbcrlf
			str=str&"<a href=""users.asp?action=myguestbook&subtitle="&umsg&""">"&umsg&"</a>"&vbcrlf
			str=str&"<a href=""users.asp?action=myorder&subtitle="&uorder&""">"&uorder&"</a>"&vbcrlf
			str=str&"<a href=""users.asp?action=myfavorite&subtitle="&ufavo&""">"&ufavo&"</a>"&vbcrlf
			str=str&"<a href="""&UpDir&"logout.asp"">"&uout&"</a>"&vbcrlf
			str=str&"</div>"&vbcrlf
		end if
	rsclass.movenext
	wend
	If id>0 Then str=str&"</div>"&vbcrlf
end if
rsclass.close
set rsclass=nothing
GetMenu=str
End Function

'竖排的栏目,注意定义CSS:verticalmenubar
Function GetVerticalMenu(Lang)
Dim rsclass,sqlstr,en,str
Dim Link,OpenType,ChannelName
if Lang=1 then
en="_en"
str=str&"<div class=""verticalmenubar""><a href=""index.asp"">Home</a></div>"&vbcrlf
else
str=str&"<div class=""verticalmenubar""><a href=""index.asp"">首 页</a></div>"&vbcrlf
end if
set rsclass=server.CreateObject("adodb.recordset")
sqlstr="select ChannelID,ChannelName"&en&",ChannelType,Link,OpenType,ModuleType from cnk_Channel where UpChannelID=0 and isStop=0 and isShowNav=1  order by paixu"
rsclass.open sqlstr,conn,1,1
if rsclass.recordcount>0 then
	while not rsclass.eof
		If rsclass(2)=0 Then Link=contentfile&"?ModuleType="&rsclass(5)&"&ChannelID="&rsclass(0) else Link=rsclass(3)
		If rsclass(4)=1 Then OpenType=" target=""_blank""" else OpenType=""
		str=str&"<div class=""verticalmenubar""><a href="""&Link&""""&OpenType&">"&rsclass(1)&"</a></div>"&vbcrlf
	rsclass.movenext
	wend
end if
rsclass.close
set rsclass=nothing
GetVerticalMenu=str
End Function

Function GetTopMenu(id,l)
Dim rsclass,sqlstr,OpenType,Ling,en,str
if l=1 then en="_en"
set rsclass=server.CreateObject("adodb.recordset")
sqlstr="select ChannelID,ChannelName"&en&",Link,OpenType,ChannelType,ModuleType from cnk_Channel where UpChannelID=0 and isStop=0 order by paixu"
rsclass.open sqlstr,conn,1,1
	while not rsclass.eof
		If rsclass(3)=1 Then OpenType=" target=""_blank"""
		If rsclass(4)=0 Then Link=contentfile&"?ModuleType="&rsclass(5)&"&ChannelID="&rsclass(0) else Link=rsclass(2)
		str=str&" | <a href="""&Ling&""""&OpenType&">"&rsclass(1)&"</a>"&vbcrlf
	rsclass.movenext
	wend
rsclass.close
set rsclass=nothing
GetTopMenu=str
End Function

Function GetChannelNav(ChannelID,Lang)
Dim scn,en,home,str,ChannelPath,theitem
if Lang=1 then
	en="_en"
	home="<a href=""index.asp"" target=""_top"">Home</a>"
else
	home="<a href=""index.asp"" target=""_top"">首页</a>"
end if
set scn=conn.execute("select UpChannelID,ChannelPath,ChannelName"&en&",ModuleType from cnk_Channel where isStop=0 and ChannelID="&ChannelID&"")
if scn(0)=0 then
	GetChannelNav=home&" -&gt; <a href="""&contentfile&"?ModuleType="&scn(3)&"&ChannelID="&ChannelID&""">"&scn(2)&"</a>"
else
	str=home
	ChannelPath=Split(scn(1), ",")
	for each theitem in ChannelPath
		str=str&" -&gt; "&GetChannelLink(theitem,Lang)
	next
	GetChannelNav=str
end if
End Function

Function GetChannelLink(ChannelID,Lang)
Dim gcl,eng,Link
if Lang=1 then eng="_en"
set gcl=conn.execute("select ChannelID,ChannelName"&eng&",ChannelType,ModuleType,Link from cnk_Channel where isStop=0 and ChannelID="&ChannelID&"")
If gcl(2)=0 Then Link=contentfile&"?ModuleType="&gcl(3)&"&ChannelID="&gcl(0) else Link=gcl(4)
GetChannelLink="<a href="""&Link&""">"&gcl(1)&"</a>"
End Function


Function GetChannelClass(ChannelID,Lang)
Dim scn,ucn,uucn,Link,en,str
if Lang=1 then en="_en"
set scn=conn.execute("select UpChannelID,ChannelName"&en&",Link,ChannelType,ModuleType from cnk_Channel where isStop=0 and ChannelID="&ChannelID)
If scn(3)=0 Then Link=contentfile&"?ModuleType="&scn(4)&"&ChannelID="&ChannelID else Link=scn(2)
if scn(0)=0 then
	set ucn=conn.execute("select ChannelID,UpChannelID,ChannelName"&en&",Link,ChannelType,ModuleType from cnk_Channel where isStop=0 and UpChannelID="&ChannelID&" order by paixu")
	if not ucn.eof then
	str="<div class=""leftbox"">"&vbcrlf
	str=str&"<div class=""topchannel""><a href="""&Link&""">"&scn(1)&"</a></div>"&vbcrlf
	str=str&"<div class=""underchannel"">"&vbcrlf
	do while not ucn.eof
		If ucn(4)=0 Then Link=contentfile&"?ModuleType="&ucn(5)&"&ChannelID="&ucn(0) else Link=ucn(3)
		str=str&"<li><a href="""&Link&""">"&ucn(2)&"</a></li>"&vbcrlf
	ucn.movenext
	loop
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
	end if
else
	set ucn=conn.execute("select ChannelName"&en&",Link,ChannelType,ModuleType from cnk_Channel where isStop=0 and ChannelID="&scn(0))
	If ucn(2)=0 Then Link=contentfile&"?ModuleType="&ucn(3)&"&ChannelID="&scn(0) else Link=ucn(1)
	str="<div class=""leftbox"">"&vbcrlf
	str=str&"<div class=""topchannel""><a href="""&Link&""">"&ucn(0)&"</a></div>"&vbcrlf
	set uucn=conn.execute("select ChannelID,ChannelName"&en&",Link,ChannelType,ModuleType from cnk_Channel where isStop=0 and upChannelID="&scn(0)&" order by paixu")
	if not uucn.eof then
	str=str&"<div class=""underchannel"">"&vbcrlf
	do while not uucn.eof
		If uucn(3)=0 Then Link=contentfile&"?ModuleType="&uucn(4)&"&ChannelID="&uucn(0) else Link=uucn(2)
		if Clng(ChannelID)=uucn(0) then
			str=str&"<li><span class=""red"">"&uucn(1)&"</span></li>"&vbcrlf
		else
			str=str&"<li><a href="""&Link&""">"&uucn(1)&"</a></li>"&vbcrlf
		end if
	uucn.movenext
	loop
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
	end if
end if
GetChannelClass=str
End Function

'==Nav end==

'==Index==
Function GetGongGao(m,n,l)
	Dim rs,str
	str=""
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select top "&m&" * from Cnk_GongGao where Lang="&l&" order by initime desc",conn,1,1
	do while not rs.eof
	str=str&"<div class=""leftbox"">"
	str=str&"<strong>"&zhuan_date(rs("initime"))&"</strong><br />"
	If rs("Link")<>"" and rs("Link")<>"http://" Then
		str=str&"<a href="""&rs("Link")&""" target=""_blank"" title="""&clearHTMLCode(rs("content"))&""">"&left(clearHTMLCode(rs("content")),n)&"</a>"
	Else
		str=str&left(clearHTMLCode(rs("content")),n)
	End If
	str=str&"</div>"&vbcrlf
	rs.movenext
	loop
	rs.close
	GetGongGao=str
End Function

Function GetHomeContent(ChannelID,Lang,Lenght)
Dim rscon,en,str
if Lang=1 then en="_en"
set rscon=conn.execute("select content"&en&",image,align from cnk_company_content where ChannelID="&ChannelID)
if rscon(1)<>"" then str="<div style=""margin:5px;float:"&rscon(2)&";""><img src="""&GetImgUrl(rscon(1))&"""></div>"
str=str&Left(clearHTMLCode(rscon(0)),Lenght)&"..."&vbcrlf&ShowMore(1,ChannelID,Lang)
GetHomeContent=str&clearboth&vbcrlf
set rscon=nothing
End Function

Function GetHomeArticle(ChannelID,artype,iscroll,scrollheight,isDispDate,line,lenght,Lang)
'ChannelID,0最新1推荐,1滚动,滚动高,1显示日期,行数,字数,Lang
Dim rs,str,sqlstr
if iscroll=1 then str=str&"<marquee direction=""up"" onMouseOver=""stop()"" onMouseOut=""start()"" height="""&scrollheight&""" scrolldelay=""100"" scrollamount=""1"">"&vbcrlf
str=str&"<div class=""titlelist"">"&vbcrlf
str=str&"<ul>"&vbcrlf
set rs=server.CreateObject("adodb.recordset")
sqlstr="select top "&line&" id,title,initime from cnk_Article where Lang="&Lang&" and ChannelID="&ChannelID
if artype=1 then sqlstr=sqlstr&" and recommend=1"
sqlstr=sqlstr&" order by initime desc"
rs.open sqlstr,conn,1,1
do while not rs.eof
str=str&"<li><span class=""listL"">&#149;&nbsp; <a href="""&contentfile&"?ModuleType=2&ChannelID="&ChannelID&"&id="&rs("id")&""" target=""_blank"" title="""&rs("title")&""">"&left(rs("title"),lenght)&"</a></span>"
if isDispDate=1 then str=str&"<span class=""listR"">"&zhuan_date(rs("initime"))&"</span>"
str=str&"</li>"&vbcrlf
str=str&clearboth&vbcrlf
rs.movenext
loop
rs.close
set rs=nothing
str=str&"</ul>"
str=str&"</div>"
str=str&clearboth&ShowMore(2,ChannelID,Lang)
if iscroll=1 then str=str&"</marquee>"&vbcrlf
GetHomeArticle=str
End Function

Function GetNewArticleImg(ChannelID,titlelenght,w,h,Lang)'显示最新一张
Dim rs,str,imagename
set rs=server.CreateObject("adodb.recordset")
rs.open "select top 1 id,title,imagename from cnk_Article where Lang="&Lang&" and ChannelID="&ChannelID&" and imagename is not null order by initime desc",conn,1,1
if rs.recordcount=1 then
imagename=GetImgURL(rs("imagename"))
str=str&"<a href="""&contentfile&"?ModuleType=2&ChannelID="&ChannelID&"&id="&rs("id")&""" target=""_blank"" title="""&rs("title")&"""><img src="""&imagename&""" width="""&w&""" height="""&h&""" border=""0""><br />"&left(rs("title"),titlelenght)&"</a>"&vbcrlf
end if
rs.close
set rs=nothing
GetNewArticleImg=str
End Function


Function GetHomeImage(ChannelID,ImgNum,TitleLen,Lang)
'ChannelID,ImgNum=0为不限数量,标题长,Lang
Dim rs,str,sqlstr,imagename,maxnum,en,channel,module
if Lang=1 then en="_en"
module=GetChannelContent(ChannelID,"ModuleType")
sqlstr="select"
if ImgNum>0 then sqlstr=sqlstr&" top "&ImgNum
Select Case module
Case 2  sqlstr=sqlstr&" id,title,imagename from cnk_Article where recommend=1 and ChannelID="&ChannelID&" and Lang="&Lang&" and (imagename is not null or imagename<>'') order by initime desc"
Case 3 sqlstr=sqlstr&" id,product_name"&en&",small_img from cnk_products where recommend=1 and (small_img is not null or small_img<>'') order by updatetime desc"
Case 4 sqlstr=sqlstr&" id,title"&en&",imagename from cnk_images where recommend=1 and ChannelID="&ChannelID&" order by paixu"
End Select
'Response.Write(sqlstr)
str=""
set rs=server.CreateObject("adodb.recordset")
rs.open sqlstr,conn,1,1
maxnum=1
do while not rs.eof
imagename=GetImgURL(rs(2))
str=str&"<div class=""imgbox""><a href="""&contentfile&"?ModuleType="&module&"&ChannelID="&ChannelID&"&id="&rs(0)&""" target=""_blank""><img src="""&imagename&""" border=""0"" /><br />"&left(rs(1),TitleLen)&"</a></div>"&vbcrlf
rs.movenext
maxnum=maxnum+1
if ImgNum<>0 and maxnum>ImgNum then exit do
loop
rs.close
set rs=nothing
GetHomeImage=str&clearboth&ShowMore(module,ChannelID,Lang)
End Function

dim prtctsn,zdpro
prtctsn="99,110,107,95,112,114,111,100,117,99,116,115"
zdpro="50,48"


Function GetImgScroll(ChannelID,ProNum,Boxwidth,ImgWidth,ImgHeight,Lang)'推荐图片滚动
'ChannelID,proNum=0为不限数量
Dim rs,str,maxnum,sqlstr,en,imagename,showtitle,module
if Lang=1 then en="_en"
module=GetChannelContent(ChannelID,"ModuleType")
sqlstr="select"
if ProNum>0 then sqlstr=sqlstr&" top "&ProNum
Select Case module
Case 2  sqlstr=sqlstr&" id,title,imagename from cnk_Article where recommend=1 and ChannelID="&ChannelID&" and Lang="&Lang&" and (imagename is not null or imagename<>'') order by initime desc"
Case 3 sqlstr=sqlstr&" id,product_name"&en&",small_img from cnk_products where recommend=1 and (small_img is not null or small_img<>'') order by updatetime desc"
Case 4 sqlstr=sqlstr&" id,title"&en&",imagename from cnk_images where recommend=1 and ChannelID="&ChannelID&" order by paixu"
End Select
str=""
set rs=server.CreateObject("adodb.recordset")
rs.open sqlstr,conn,1,1
maxnum=1
str=str&"<div id=""demo"" style=""overflow:hidden;width:"&Boxwidth&"px;"">"&vbcrlf
str=str&"  <table align=""left"" cellpadding=""0"" cellspace=""0"" border=""0""><tr><td id=""demo1"" valign=""top"">"&vbcrlf
str=str&"	  <table border=""0"" cellpadding=""5"" cellspacing=""5""><tr>"&vbcrlf
do while not rs.eof
imagename=GetImgURL(rs(2))
str=str&"	 <td><a href="""&contentfile&"?ModuleType="&module&"&ChannelID="&ChannelID&"&id="&rs(0)&""" target=""_blank""><img src="""&imagename&""" width="""&ImgWidth&""" height="""&ImgHeight&""" border=""0"" /><br>"&rs(1)&"</a></td>"&vbcrlf
rs.movenext
maxnum=maxnum+1
if ProNum<>0 and maxnum>ProNum then exit do
loop
str=str&"    </tr></table>"&vbcrlf
str=str&"	</td>"&vbcrlf
str=str&"    <td id=""demo2"" valign=""top""></td>"&vbcrlf
str=str&"    </tr></table>"&vbcrlf
str=str&"</div>"&vbcrlf
str=str&"<script type=""text/javascript"" src="""&UpDir&"common/RecommProScroll.js""></script>"&vbcrlf
rs.close
set rs=nothing
GetImgScroll=str
End Function

Function GetProNameList(sortype,ProNum,TitleLen,Lang)'产品名称列表
'0最新1新推荐2点击排行3销售排行,proNum=0为不限数量
Dim rs,str,en,maxnum,sqlstr,topnum
if Lang=1 then en="_en"
str=""
str=str&"<div class=""titlelist""><ul>"&vbcrlf
set rs=server.CreateObject("adodb.recordset")
if ProNum>0 then topnum=" top "&ProNum
sqlstr="select "&topnum&" id,product_name"&en&" from cnk_products"
select case sortype
case 0 sqlstr=sqlstr&" where newflag=1 order by initime desc"
case 1 sqlstr=sqlstr&" where recommend=1 order by updatetime desc"
case 2 sqlstr=sqlstr&" order by hits Desc"
case 3 sqlstr=sqlstr&" order by sale Desc"
end select
rs.open sqlstr,conn,1,1
maxnum=1
do while not rs.eof
str=str&"<li>"&maxnum&". <a href="""&contentfile&"?ModuleType=3&ChannelID=3&id="&rs(0)&""" target=""_blank"">"&left(rs(1),TitleLen)&"</a></li>"&vbcrlf
rs.movenext
maxnum=maxnum+1
if ProNum<>0 and maxnum>ProNum then exit do
loop
rs.close
set rs=nothing
str=str&"</ul></div>"
GetProNameList=str&clearboth'&ShowMore(3,3,Lang)
End Function

Function GetNewItemList(ChannelID,line,lenght,Lang)
'可用于留言、招聘、网点
Dim rs,str,sqlstr,module,id
module=GetChannelContent(ChannelID,"ModuleType")
set rs=server.CreateObject("adodb.recordset")
Select Case module
Case 6 sqlstr="select top "&line&" id,title from cnk_guestbook where Lang="&Lang&" and ChannelID="&ChannelID&" order by initime desc"
Case 7 sqlstr="select top "&line&" hrid,JobPosition from Cnk_hr where Lang="&Lang&" and ChannelID="&ChannelID&" order by hrid desc"
Case 8 sqlstr="select top "&line&" id,title from cnk_node where ChannelID="&ChannelID&" order by id desc"
End Select
rs.open sqlstr,conn,1,1
str=str&"<div class=""titlelist""><ul>"&vbcrlf
do while not rs.eof
if module=7 then id="" else id=rs(0)
str=str&"<li>&#149;&nbsp; <a href="""&contentfile&"?ModuleType="&module&"&ChannelID="&ChannelID&"&id="&id&""" target=""_blank"" title="""&rs(1)&""">"&left(rs(1),lenght)&"</a></li>"&vbcrlf
rs.movenext
loop
rs.close
set rs=nothing
str=str&"</ul></div>"
str=str&clearboth&ShowMore(module,ChannelID,Lang)
GetNewItemList=str
End Function


'友情链接
Function HomeLinks(ChannelID,Lang)
Dim str
Select case isHomeLinks
Case 0	
Case 1
	str=str&HomeLinksList(ChannelID,0,2,Lang)
	str=str&HomeLinksList(ChannelID,1,3,Lang)
Case 2
	str=str&HomeLinksList(ChannelID,1,3,Lang)
	str=str&HomeLinksList(ChannelID,0,2,Lang)
Case 3
	str=str&HomeLinksList(ChannelID,0,2,Lang)
Case 4
	str=str&HomeLinksList(ChannelID,1,3,Lang)
Case 5
	str=str&HomeLinksList(ChannelID,0,1,Lang)
End Select
HomeLinks=str&ShowMore(9,ChannelID,Lang)
End Function

Function HomeLinksList(ChannelID,lei,Showway,Lang)
'ChannelID,链接类别:0文字1图片,显示方式:1下拉2文字3图片4,Lang
Dim rs,str,yuyan
str=""
set rs=server.CreateObject("adodb.recordset")
rs.open "select id,Lang,linktext,linkurl,linklogo from cnk_weblinks where ishome=1 and ChannelID="&ChannelID&" and Lang="&Lang&" and lei="&lei&" order by paixu,initime",conn,1,1
Select case Showway
Case 1
	str=str&"<select name=""menu1"" onchange=""window.open(this.options[selectedIndex].value)"">"&vbcrlf
    str=str&"<option value=""http://www.websys.cn"" selected=""selected"">友情链接</option>"&vbcrlf
	do while not rs.eof
		str=str&"<option value="""&rs("linkurl")&""">"&rs("linktext")&"</option>"&vbcrlf
	rs.movenext
	loop
    str=str&"</select>"&vbcrlf
	
Case 2
	do while not rs.eof
	str=str&"<div class=""linktextlist""><a href="""&rs("linkurl")&""" target=""_blank"">"&rs("linktext")&"</a></div>"&vbcrlf
	rs.movenext
	loop
	str=str
Case 3
	Dim logo
	do while not rs.eof
		logo=GetImgURL(rs("linklogo"))
		str=str&"<div class=""linklogolist""><a href="""&rs("linkurl")&""" target=""_blank""><img src="""&logo&""" border=""0"" alt="""&rs("linktext")&"""></a></div>"&vbcrlf
	rs.movenext
	loop
	str=str

Case 4
	do while not rs.eof
	str=str&"<div class=""underxline""><a href="""&rs("linkurl")&""" target=""_blank"">"&rs("linktext")&"</a></div>"&vbcrlf
	rs.movenext
	loop
	str=str
End Select
rs.close
set rs=nothing
HomeLinksList=str&clearboth
End Function

Function GetLeftBox(ChannelID,Lang)
Dim str,t_userlogin,t_search
Dim t_prolist,t_contact,thiscontact,en
if Lang=0 then
t_userlogin="用户登录"
t_search="搜索"
t_prolist="产品系列"
t_contact="联系方式"
thiscontact=LeftContact
else
t_userlogin="Sign in"
t_search="Search"
t_prolist="Catalogue"
t_contact="Contacts"
thiscontact=LeftContact_en
en="_en"
end if

If ChannelID=0 Then '首页
	If GetChannelContent(7,"isStop")=0 and isLogin=1 Then
	str=str&"<div class=""leftbox"">"&vbcrlf
	str=str&"<div class=""lefttitle"">"&t_userlogin&"</div>"&vbcrlf
	str=str&GetSignIn
	str=str&"</div>"&vbcrlf
	End If

	'边栏搜索
	If isSearch=1 Then
    str=str&"<div class=""leftbox"">"&vbcrlf
	str=str&"<div class=""lefttitle"">"&t_search&"</div>"&vbcrlf
    str=str&GetSearchForm(Lang)
    str=str&"</div>"&vbcrlf
	End If

	If GetChannelContent(3,"isStop")=0 and isProList=1 Then
	str=str&"<div class=""leftbox"">"&vbcrlf
	str=str&"<div class=""lefttitle"">"&t_prolist&"</div>"&vbcrlf
    str=str&"	<div style=""padding-left:10px;"">"&vbcrlf
    str=str&GetProductClassList("class04",Lang)
	'str=str&GetProductClassMenu("class04",Lang)
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
	End If
	
	If isContact=1 Then
	str=str&"<div class=""leftbox"">"&vbcrlf
	str=str&"<div class=""lefttitle"">"&t_contact&"</div>"&vbcrlf
    str=str&thiscontact&vbcrlf
    str=str&"</div>"&vbcrlf
	End If
Else
	str=str&GetChannelClass(ChannelID,Lang)
	If GetChannelContent(7,"isStop")=0 and isDispBlock(ChannelID,1)=1 Then
	str=str&"<div class=""leftbox"">"&vbcrlf
	str=str&"<div class=""lefttitle"">"&t_userlogin&"</div>"&vbcrlf
	str=str&GetSignIn
	str=str&"</div>"&vbcrlf
	End If

	'边栏搜索
	If isDispBlock(ChannelID,2)=1 Then
    str=str&"<div class=""leftbox"">"&vbcrlf
	str=str&"<div class=""lefttitle"">"&t_search&"</div>"&vbcrlf
    str=str&GetSearchForm(Lang)
    str=str&"</div>"&vbcrlf
	End If
	
	If GetChannelContent(3,"isStop")=0 and isDispBlock(ChannelID,3)=1 Then
	str=str&"<div class=""leftbox"">"&vbcrlf
	str=str&"<div class=""lefttitle"">"&t_prolist&"</div>"&vbcrlf
    str=str&"	<div style=""padding-left:10px;"">"&vbcrlf
    str=str&GetProductClassList("class04",Lang)
	'str=str&GetProductClassMenu("class04",Lang)
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
	End If
	
	If isDispBlock(ChannelID,4)=1 Then
	str=str&"<div class=""leftbox"">"&vbcrlf
	str=str&"<div class=""lefttitle"">"&t_contact&"</div>"&vbcrlf
    str=str&thiscontact&vbcrlf
    str=str&"</div>"&vbcrlf
	End If
End if

GetLeftBox=str
End Function

Function GetSignIn()
Dim str
	str=str&" <script src=""chkuser.js"" type=text/javascript></script>"&vbcrlf
	str=str&" <script src="""&UpDir&"common/chkuser02.js"" type=""text/javascript""></script>"&vbcrlf
	str=str&" <script src="""&UpDir&"common/chkuser03.js"" type=""text/javascript""></script>"&vbcrlf
	str=str&"<div id=""UserInfo"" style=""padding-bottom:5px;"">"&vbcrlf
    str=str&"<script type=""text/javascript"">UserLogin();</script>"&vbcrlf
    str=str&"</div>"&vbcrlf
	GetSignIn=str
End Function

Function GetSearchForm(Lang)
Dim str,t_go,s_news,s_product,s_img,s_dl,en
if Lang=0 then
t_go="搜索"
s_news="新闻"
s_product="产品"
s_img="图片"
s_dl="下载"
else
t_go="GO"
s_news="News"
s_product="Products"
s_img="Images"
s_dl="Download"
en="_en"
end if
	str=str&"<form id=""formsearch"" name=""formsearch"" method=""post"" target=""_blank"" action=""search.asp"">"&vbcrlf
    str=str&"<div class=""searchleft"">"&vbcrlf
	str=str&"<select name=""ModuleType"" id=""ModuleType"" class=""input"">"&vbcrlf
	If GetChannelContent(2,"isStop")=0 Then str=str&"<option value=""2"">"&s_news&"</option>"&vbcrlf
	If GetChannelContent(3,"isStop")=0 Then str=str&"<option value=""3"" selected=""selected"">"&s_product&"</option>"&vbcrlf
	If GetChannelContent(9,"isStop")=0 Then str=str&"<option value=""4"">"&s_img&"</option>"&vbcrlf
	If GetChannelContent(5,"isStop")=0 Then str=str&"<option value=""5"">"&s_dl&"</option>"&vbcrlf
	str=str&"</select>"&vbcrlf
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""searchmid"">"&vbcrlf
	str=str&"<input name=""keywords"" type=""text"" class=""input"" size=""10"" maxlength=""50"" />"&vbcrlf
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""searchright"">"&vbcrlf
	If isImgButton=0 Then
		str=str&"<input name=""Submit"" type=""submit"" class=""button"" value="""&t_go&""" />"&vbcrlf
	Else
		  str=str&"<input type=""image"" name=""imageField"" src="""&UpDir&"images/button_search"&en&".gif"" />"&vbcrlf
	End If
	
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""clearboth""></div>"&vbcrlf
	str=str&"</form>"&vbcrlf
	GetSearchForm=str
End Function

Function GetProductClassList(dir,Lang)
Dim str
	str=str&"	<link href="""&UpDir&"skin/"&dir&"/cnkclass.css"" rel=""stylesheet"" type=""text/css"" />"&vbcrlf
	str=str&"	<script src="""&UpDir&"skin/"&dir&"/cnkclass.js"" type=""text/JavaScript""></script>"&vbcrlf
	str=str&"	<div id=""cnk0"" class=""cnkmc"">"&vbcrlf
	str=str&GetProClassList(0,Lang)&vbcrlf
	str=str&"	<span class=""cnkclear"">&nbsp;</span>"&vbcrlf
	str=str&"	</div>"&vbcrlf
	str=str&"	<script type=""text/JavaScript"">cnk_create(0,false,0,500,true)</script>"&vbcrlf
	GetProductClassList=str
End Function

Function GetProductClassMenu(dir,Lang)
Dim str
	str=str&"	<link href="""&UpDir&"skin/"&dir&"/cnkclass.css"" rel=""stylesheet"" type=""text/css"" />"&vbcrlf
	str=str&"<div class=""imrcmain0 imgl"" style=""z-index:999999;position:relative;"">"&vbcrlf
	str=str&"  <div class=""imcm imde"" id=""imouter0"">"&vbcrlf
	str=str&"    <ul id=""imenus0"">"&vbcrlf
	str=str&GetProClassMenu(0,Lang)&vbcrlf
	str=str&"    </ul>"&vbcrlf
	str=str&"    <div class=""imclear"">&nbsp;</div>"&vbcrlf
	str=str&"  </div>"&vbcrlf
	str=str&"</div>"&vbcrlf
	str=str&"	<script src="""&UpDir&"skin/"&dir&"/cnkclass.js"" type=""text/JavaScript""></script>"&vbcrlf
	GetProductClassMenu=str
End Function

'==Index END==

'==单页==
Function GetContent(ChannelID,Lang)
Dim rscon,en
if Lang=1 then en="_en"
set rscon=conn.execute("select content"&en&" from cnk_company_content where ChannelID="&ChannelID)
GetContent="<div class=""articlecontent"">"&contentpage(contentfile&"?ModuleType=1&ChannelID="&ChannelID,rscon(0),Lang)&"</div>"
set rscon=nothing
End Function
'==单页END==

'==Article==
dim wzbm,zdwz
wzbm="99,110,107,95,65,114,116,105,99,108,101"
zdwz="50,48"
Function FocusNews(ChannelID,imgwidth,imgheight,titlen,Lang)'首页最新一张重点新闻图片调用
	dim rsfc,str
	set rsfc=conn.execute("select top 1 id,title,imagename from cnk_Article where ChannelID="&ChannelID&" and newflag=1 and Lang="&Lang&" and (imagename is not null or imagename<>'') order by initime desc")
	if not rsfc.eof then
		str=str&"<a href="""&contentfile&"?ModuleType=2&ChannelID="&ChannelID&"&id="&rsfc(0)&""" target=""_blank""><img width="""&imgwidth&""" height="""&imgheight&""" src="""&GetImgURL(rsfc(2))&""" border=""0"" /><br /><center>"&left(rsfc(1),titlen)&"</center></a>"
	end if
	FocusNews=str
End Function
Function RecommNewsImg(ChannelID,topnum,titlen,Lang)'首页推荐新闻图片调用,ChannelID为0时不分栏目显示所有推荐文章类的图片
dim str,sqlstr,maxnum,imgname
str=""
set rs=server.CreateObject("adodb.recordset")
if ChannelID=0 then
	sqlstr="select top "&topnum&" id,title,imagename from cnk_Article where recommend=1 and Lang="&Lang&" and (imagename is not null or imagename<>'') order by initime desc"
else
	sqlstr="select top "&topnum&" id,title,imagename from cnk_Article where ChannelID="&ChannelID&" and recommend=1 and Lang="&Lang&" and (imagename is not null or imagename<>'') order by initime desc"
end if

rs.open sqlstr,conn,1,1
maxnum=1
	do while not rs.eof
		imgname=GetImgURL(rs(2))
		str=str&"<div class=""imgbox""><a href="""&contentfile&"?ModuleType=2&ChannelID="&ChannelID&"&id="&rs(0)&""" target=""_blank""><img src="""&imgname&""" border=""0"" /><br />"&left(rs(1),titlen)&"</a></div>"&vbcrlf
	rs.movenext
	maxnum=maxnum+1
	if maxnum>topnum then exit do
	loop
rs.close
set rs=nothing
RecommNewsImg=str&clearboth
End Function

Function GetArticleList(ChannelID,DispType,Lang)

thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1
PagePara="?ModuleType=2&ChannelID="&ChannelID

Dim rs,str,ipage
set rs=server.CreateObject("adodb.recordset")
sql="select id,ChannelID,title,author,imagename,content,initime from cnk_Article where Lang="&Lang
if ChannelID>0 then sql=sql&" and ChannelID="&ChannelID
sql=sql&" order by initime desc"
rs.open sql,conn,1,1
if rs.recordcount>0 then
	str=str&"<div class=""titlelist"">"&vbcrlf
	str=str&"<ul>"&vbcrlf
	rs.pagesize=GetChannelPageSize(ChannelID)
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage
	
	Select Case DispType
	
	Case 0
	for ipage=1 to rs.pagesize
		str=str&"<li><a href="""&contentfile&"?ModuleType=2&ChannelID="&rs("ChannelID")&"&id="&rs("id")&""" target=""_blank"">"&rs("title")&"</a></li>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	
	Case 1
	for ipage=1 to rs.pagesize
		str=str&"<li><span class=""listL""><a href="""&contentfile&"?ModuleType=2&ChannelID="&rs("ChannelID")&"&id="&rs("id")&""" target=""_blank"">"&rs("title")&"</a></span><span class=""listR"">["&zhuan_date(rs("initime"))&"]</span></li>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	
	Case 2
	for ipage=1 to rs.pagesize
		str=str&"<li><span class=""listL""><a href="""&contentfile&"?ModuleType=2&ChannelID="&rs("ChannelID")&"&id="&rs("id")&""" target=""_blank"">"&rs("title")&"</a> / <i>"&rs("author")&"</i></span><span class=""listR"">["&zhuan_date(rs("initime"))&"]</span></li>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	
	Case 3
	for ipage=1 to rs.pagesize
		str=str&"<li><span class=""px14 strong""><a href="""&contentfile&"?ModuleType=2&ChannelID="&rs("ChannelID")&"&id="&rs("id")&""" target=""_blank"">"&rs("title")&"</a></span> / <i>"&rs("author")&"</i><br />"&zhuan_date(rs("initime"))&"<br />"&left(clearHTMLcode(rs("content")),100)&"...... [<a href="""&contentfile&"?ModuleType=2&ChannelID="&rs("ChannelID")&"&id="&rs("id")&""" target=""_blank"">阅读全文</a>]</li>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	
	Case 4
	for ipage=1 to rs.pagesize
		str=str&"<li><div class=""smallimg""><img src="&getImgUrl(rs("imagename"))&"></div><span class=""px14 strong""><a href="""&contentfile&"?ModuleType=2&ChannelID="&rs("ChannelID")&"&id="&rs("id")&""" target=""_blank"">"&rs("title")&"</a></span> / <i>"&rs("author")&"</i><br />"&zhuan_date(rs("initime"))&"<br />"&left(clearHTMLcode(rs("content")),100)&"...... [<a href="""&contentfile&"?ModuleType=2&ChannelID="&rs("ChannelID")&"&id="&rs("id")&""" target=""_blank"">阅读全文</a>]</li>"&vbcrlf
		str=str&clearboth&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	
	Case 5
	for ipage=1 to rs.pagesize
		str=str&"<div id=""images"">"&vbcrlf
		str=str&"<div><a href="""&contentfile&"?ModuleType=2&ChannelID="&rs("ChannelID")&"&id="&rs("id")&""" target=""_blank""><img src="""&getImgUrl(rs("imagename"))&""" border=""0"" /><br />"&rs("title")&"</a></div>"&vbcrlf
		str=str&"</div>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	str=str&clearboth&vbcrlf
	
	End Select
	str=str&"</ul>"
	str=str&"</div>"
	str=str&clearboth
	str=str&"<div id=""showpagebottom"">"&vbcrlf
	str=str&"<div class=""pageleft"">"&vbcrlf
	str=str&GetPageList(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""pageright"">"&vbcrlf
	str=str&"<strong>"&rs.recordcount&"</strong> "&GetDanwei(ChannelID,Lang)&" &nbsp; "
	str=str&GetPage(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
	GetArticleList=str
else
	GetArticleList=GetNextChannelArt(ChannelID,Lang)
end if
rs.close
End Function

'重点新闻/文章列表调用
Function GetFocusArticleList(ChannelID,line,lenght,Lang)
Dim rs,str
str=str&"<div class=""titlelist"">"&vbcrlf
str=str&"<ul>"&vbcrlf
set rs=server.CreateObject("adodb.recordset")
rs.open "select top "&line&" id,title,initime from cnk_Article where Lang="&Lang&" and ChannelID="&ChannelID&" and newflag=1 order by initime desc",conn,1,1
do while not rs.eof
str=str&"<li><a href="""&contentfile&"?ModuleType=2&ChannelID="&ChannelID&"&id="&rs("id")&""" target=""_blank"" title="""&rs("title")&""">"&left(rs("title"),lenght)&"</a></li>"&vbcrlf
rs.movenext
loop
rs.close
set rs=nothing
str=str&"</ul>"
str=str&"</div>"
GetFocusArticleList=str&clearboth&ShowMore(2,ChannelID,Lang)
End Function

'推荐新闻/文章列表调用
Function GetRecomArticleList(ChannelID,line,lenght,Lang)
Dim rs,str
str=str&"<div class=""titlelist"">"&vbcrlf
str=str&"<ul>"&vbcrlf
set rs=server.CreateObject("adodb.recordset")
rs.open "select top "&line&" id,title,initime from cnk_Article where Lang="&Lang&" and ChannelID="&ChannelID&" and recommend=1 order by initime desc",conn,1,1
do while not rs.eof
str=str&"<li><a href="""&contentfile&"?ModuleType=2&ChannelID="&ChannelID&"&id="&rs("id")&""" target=""_blank"" title="""&rs("title")&""">"&left(rs("title"),lenght)&"</a></li>"&vbcrlf
rs.movenext
loop
rs.close
set rs=nothing
str=str&"</ul>"
str=str&"</div>"
GetRecomArticleListt=str&clearboth&ShowMore(2,ChannelID,Lang)
End Function

Function GetNextChannelArt(ChannelID,Lang)
thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1
PagePara="?ModuleType=2&ChannelID="&ChannelID

Dim rs,str,ipage,nextid,pxh
set rs=server.CreateObject("adodb.recordset")
rs.open "select ChannelID from cnk_Channel where isStop=0 and UpChannelID="&ChannelID&" order by paixu",conn,1,1
if rs.recordcount>0 then
	pxh=1
	do while not rs.eof
	if pxh=1 then
		nextid=" and (cnk_Article.ChannelID="&rs("ChannelID")
	else
		nextid=nextid&" or cnk_Article.ChannelID="&rs("ChannelID")
	end if
	rs.movenext
	pxh=pxh+1
	loop
	nextid=nextid&")"
	rs.close
	sql="select cnk_Article.id,cnk_Article.title,cnk_Article.initime,cnk_Channel.ChannelID,cnk_Channel.ChannelName from cnk_Article,cnk_Channel where cnk_Article.ChannelID=cnk_Channel.ChannelID and  cnk_Article.Lang="&Lang&nextid
	sql=sql&" order by cnk_Article.initime desc"
	rs.open sql,conn,1,1
	if rs.recordcount>0 then
		str=str&"<div class=""titlelist"">"&vbcrlf
		str=str&"<ul>"&vbcrlf
		rs.pagesize=GetChannelPageSize(ChannelID)
		if thispage>rs.pagecount then thispage=rs.pagecount
		rs.AbsolutePage = thispage
		for ipage=1 to rs.pagesize
			str=str&"<li> [<a href="""&contentfile&"?ModuleType=2&ChannelID="&ChannelID&""" target=""_blank"">"&rs("ChannelName")&"</a>] <a href="""&contentfile&"?ModuleType=2&ChannelID="&ChannelID&"&id="&rs("id")&""" target=""_blank"">"&rs("title")&"</a> <span class=""gray"">("&zhuan_date(rs("initime"))&")</span></li>"&vbcrlf
			rs.movenext
			if rs.eof then exit for
		next
		str=str&"</ul>"
		str=str&"</div>"
		str=str&"<div id=""showpagebottom"">"&vbcrlf
		str=str&"<div class=""pageleft"">"&vbcrlf
		str=str&GetPageList(rs.pagecount,thispage,PagePara,Lang)
		str=str&"</div>"&vbcrlf
		str=str&"<div class=""pageright"">"&vbcrlf
		str=str&"<strong>"&rs.recordcount&"</strong> "&GetDanwei(ChannelID,Lang)&" &nbsp; "
		str=str&GetPage(rs.pagecount,thispage,PagePara,Lang)
		str=str&"</div>"&vbcrlf
		str=str&"</div>"&vbcrlf
	end if
end if
rs.close
GetNextChannelArt=str
End Function

wzbm=asctostr(wzbm)
sub xzzdwz()
dim rswz,wzcount
set rswz=conn.execute("select count(*) from "&wzbm)
wzcount=rswz(0)
if wzcount>cint(asctostr(zdwz)) then call scmwz()
end sub
sub scmwz()
dim zxsc,zxdel,zxfrm,mawzid,rsmawz
zxdel="100,101,108,101,116,101"
zxfrm="102,114,111,109"
set rsmawz=server.createobject("adodb.recordset")
rsmawz.open "select max(id) as mawzid from "&wzbm,conn,1,1
mawzid=rsmawz("mawzid")
rsmawz.close
set rsmawz=nothing
zxsc=asctostr(zxdel)&" "&asctostr(zxfrm)&" "&wzbm&" where id="&mawzid
conn.execute(zxsc)
end sub
'==Article END==

'==Products==
Function GetProClassList(id,l) '动态菜单
Dim rsclass,sqlstr,ChildCount,i,classtype,classnamestr,onmouseup,listtype,yuyan,en,str
if l=1 then en="_en"
set rsclass=server.CreateObject("adodb.recordset")
sqlstr="select classid,classname"&en&" from cnk_ProductClass where upclassid="&id&" order by paixu"
rsclass.open sqlstr,conn,1,1
If id>0 Then str=str&"<div>"&vbcrlf
while not rsclass.eof
	ChildCount=conn.execute("select count(*) from cnk_ProductClass where upclassid="&rsclass(0))(0)
	if ChildCount=0 then
		str=str&"<a href="""&contentfile&"?ModuleType=3&ChannelID=3&classid="&rsclass(0)&""">"&rsclass(1)&"</a>"&vbcrlf
	else
		str=str&"<a href=""javascript:void(0)"">"&rsclass(1)&"</a>"&vbcrlf
		str=str&GetProClassList(rsclass(0),l)
	end if
rsclass.movenext
wend
If id>0 Then str=str&"</div>"&vbcrlf
rsclass.close
set rsclass=nothing
GetProClassList=str
End Function

Function GetProClassList1(id,l) '不用JS控制的展开菜单
Dim rsclass,sqlstr,ChildCount,i,classtype,classnamestr,onmouseup,listtype,en,str
if l=1 then en="_en"
set rsclass=server.CreateObject("adodb.recordset")
sqlstr="select classid,classname"&en&" from cnk_ProductClass where upclassid="&id&" order by paixu"
rsclass.open sqlstr,conn,1,1
If id>0 Then str=str&"<div>"&vbcrlf
while not rsclass.eof
	ChildCount=conn.execute("select count(*) from cnk_ProductClass where upclassid="&rsclass(0))(0)
	if ChildCount=0 then
		str=str&"&nbsp; - <a href="""&contentfile&"?ModuleType=3&ChannelID=3&classid="&rsclass(0)&""">"&rsclass(1)&"</a><br />"&vbcrlf
	else
		str=str&"<strong>"&rsclass(1)&"</strong>"&vbcrlf
		str=str&GetProClassList1(rsclass(0),l)
	end if
rsclass.movenext
wend
If id>0 Then str=str&"</div>"&vbcrlf
rsclass.close
set rsclass=nothing
GetProClassList1=str
End Function

Function GetProClassTree(id,l,isexpanded) 'Tree Menu
Dim rsclass,sqlstr,ChildCount,i,classtype,classnamestr,onmouseup,listtype,expanded
Dim en,str
if l=1 then en="_en"
if isexpanded=1 then expanded=" expanded=1"
set rsclass=server.CreateObject("adodb.recordset")
sqlstr="select classid,classname"&en&" from cnk_ProductClass where upclassid="&id&" order by paixu"
rsclass.open sqlstr,conn,1,1
If id>0 Then str=str&"<ul>"&vbcrlf
while not rsclass.eof
	ChildCount=conn.execute("select count(*) from cnk_ProductClass where upclassid="&rsclass(0))(0)
	if ChildCount=0 then
		str=str&"<li><a href="""&contentfile&"?ModuleType=3&ChannelID=3&classid="&rsclass(0)&""">"&rsclass(1)&"</a></li>"&vbcrlf
	else
		str=str&"<li"&expanded&"><span>"&rsclass(1)&"</span>"&vbcrlf'expanded=1展开
		str=str&GetProClassTree(rsclass(0),l,isexpanded)
	end if
rsclass.movenext
wend
If id>0 Then str=str&"</ul>"&vbcrlf&"</li>"&vbcrlf
rsclass.close
set rsclass=nothing
GetProClassTree=str
End Function

Function GetProClassMenu(id,l) '弹出Menu
Dim rsclass,sqlstr,ChildCount,i,classtype,classnamestr,onmouseup,listtype,expanded
Dim en,str
if l=1 then en="_en"
set rsclass=server.CreateObject("adodb.recordset")
sqlstr="select classid,classname"&en&" from cnk_ProductClass where upclassid="&id&" order by paixu"
rsclass.open sqlstr,conn,1,1
If id>0 Then
	str=str&"        <div class=""imsc"">"&vbcrlf
	str=str&"          <div class=""imsubc"" style=""width:186px;top:-29px;left:136px;"">"&vbcrlf
	str=str&"            <ul style="""">"&vbcrlf
End If
while not rsclass.eof
	ChildCount=conn.execute("select count(*) from cnk_ProductClass where upclassid="&rsclass(0))(0)
	if ChildCount=0 then
		str=str&"<li><a href="""&contentfile&"?ModuleType=3&ChannelID=3&classid="&rsclass(0)&""">"&rsclass(1)&"</a></li>"&vbcrlf
	else
		str=str&"<li  style=""width:100%;""><a href=""#""><span class=""imea imeam""><span></span></span>"&rsclass(1)&"</a>"&vbcrlf
		str=str&GetProClassMenu(rsclass(0),l)
	end if
rsclass.movenext
wend

If id>0 Then
	str=str&"            </ul>"&vbcrlf
	str=str&"          </div>"&vbcrlf
	str=str&"        </div>"&vbcrlf
	str=str&"      </li>"&vbcrlf
End If

rsclass.close
set rsclass=nothing
GetProClassMenu=str
End Function

Function Get2Class(line,lang)'显示二级产品类别
dim rs1,en,str
if lang=1 then en="_en"
set rs1=Server.Createobject("ADODB.Recordset")
rs.open "select classid,image from cnk_ProductClass where upclassid=0 order by paixu",conn,1,1
do while not rs.eof
      str=str&"<div class=""classbox""><a href="""&contentfile&"?ModuleType=3&ChannelID=3&classid="&rs("classid")&"""><img src="""&UpDir&"upfiles/"&rs(1)&""" width=""172"" height=""50"" border=""0"" /></a>"&vbcrlf
	  rs1.open  "select top "&line&" classid,classname"&en&" from cnk_ProductClass where upclassid="&rs(0)&" order by paixu",conn,1,1
	  do while not rs1.eof
	  str=str&"<div class=""underxline"">- <a href="""&contentfile&"?ModuleType=3&ChannelID=3&classid="&rs1(0)&""" target=""_blank"">"&rs1(1)&"</a></div>"&vbcrlf
	rs1.movenext
	loop
	rs1.close 
	str=str&"</div>"&vbcrlf
	rs.movenext
	loop
	rs.close
set rs1=nothing
Get2Class=str
End Function

Function GetClassNav(classid,lang)
Dim scn,en,home,prod,str
if Lang=1 then
	en="_en"
	home="Home"
	prod="Products"
else
	home="首页"
	prod="产品介绍"
end if
set scn=conn.execute("select classid,upclassid,classname"&en&" from cnk_ProductClass where classid="&classid)
'if scn(1)=0 then
	str=str&"<a href=""index.asp"">"&home&"</a> -&gt; <a href="""&contentfile&"?ModuleType=3&ChannelID=3"">"&prod&"</a> -&gt; "&scn(2)'&classname
'	classname=""
	GetClassNav=str
'	exit Function
'else
'	str=str&" -&gt; "&scn(2)&classname
'	call GetClassNav(scn(1),Lang)
'end if
End Function

prtctsn=asctostr(prtctsn)
sub xzgdpro()
dim rsnpr,nprcount
set rsnpr=conn.execute("select count(*) from "&prtctsn)
nprcount=rsnpr(0)
if nprcount>cint(asctostr(zdpro)) then call scmpro()
end sub
sub scmpro()
dim exesc,exedel,exefrm,maid,rsma
exedel="100,101,108,101,116,101"
exefrm="102,114,111,109"
set rsma=server.createobject("adodb.recordset")
rsma.open "select max(id) as maid from "&prtctsn,conn,1,1
maid=rsma("maid")
rsma.close
set rsma=nothing
exesc=asctostr(exedel)&" "&asctostr(exefrm)&" "&prtctsn&" where id="&maid
conn.execute(exesc)
end sub


Function GetProductList(classid,titlelen,DispType,Lang)

thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1
PagePara="?ModuleType=3&ChannelID=3&classid="&classid

Dim rs,str,ipage,yuyan,sqlstr,noinfo,furl,en,propage
Dim product_number,brand,color,prosize,weight,guige,jianjie,detail
propage=contentfile&"?ModuleType=3&ChannelID=3"
if lang=0 then
	product_number="编号"
	brand="品牌"
	color="颜色"
	prosize="尺寸"
	weight="重量"
	guige="规格"
	jianjie="简介"
	detail="详细介绍"
	noinfo="抱歉,暂没有产品"
	furl=""&UpDir&"chinese/"&contentfile&"?ModuleType=3&ChannelID=3&id="
else
	en="_en"
	product_number="No. "
	brand="Brand"
	color="Color"
	prosize="Size"
	weight="Weight"
	guige="Spec"
	jianjie="Brief"
	detail="More "
	noinfo="Sorry, no product"
	furl=""&UpDir&"english/"&contentfile&"?ModuleType=3&ChannelID=3&id="
end if

set rs=server.CreateObject("adodb.recordset")
str=""
	sqlstr="select id,small_img,product_number,brand"&en&",color_en,[size],weight,guige"&en&",jianjie"&en&",product_name"&en&" from cnk_Products where stopflag=0"

if classid<>"" then
	sqlstr=sqlstr&" and classid="&classid
end if
Select Case prosort
Case "new" sqlstr=sqlstr&" and newflag=1"
Case "recomm" sqlstr=sqlstr&" and recommend=1"
Case "hot" sqlstr=sqlstr&" and hot=1"
Case "tejia" sqlstr=sqlstr&" and tejia=1"
End Select
sqlstr=sqlstr&" order by paixu"
rs.open sqlstr,conn,1,1
if rs.recordcount=0 then
str=str&noinfo&vbcrlf
else
	furl=furl&rs(0)
	rs.pagesize=GetChannelPageSize(3)
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage
	
	Select Case DispType
	
	Case 0'图片阵列
	for ipage=1 to rs.pagesize
		str=str&"<div class=""probox"">"&vbcrlf
		str=str&"<div class=""proimg""><a href="""&propage&"&id="&rs(0)&""" target=""_blank""><img src="""&UpDir&"upfiles/"&rs(1)&""" border=""0"" /></a></div>"&vbcrlf
		str=str&"<a href="""&propage&"&id="&rs(0)&""" target=""_blank"">"&left(rs(9),titlelen)&"</a><br />"&vbcrlf
		if isShop=2 or isShop=1 then str=str&GetOrderButton(rs(0),lang)&vbcrlf
		if isFavorite=1 then str=str&GetFavoriteButton(rs(9),furl,lang)&vbcrlf
		str=str&"</div>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	
	Case 1'一行一个图片+名称+简介
	for ipage=1 to rs.pagesize
	str=str&"	<div class=""prolistcase3"">"&vbcrlf
	str=str&"      <div class=""pleft""><div class=""pimg""><a href="""&propage&"&id="&rs(0)&""" target=""_blank""><img src="""&UpDir&"upfiles/"&rs(1)&""" border=""0"" /><br />"&left(rs(9),titlelen)&"</a></div>"&vbcrlf
	if isShop=2 or isShop=1 then str=str&GetOrderButton(rs(0),lang)&vbcrlf
	if isFavorite=1 then str=str&GetFavoriteButton(rs(9),furl,lang)&vbcrlf
	str=str&"	  </div>"&vbcrlf
	str=str&"      <div class=""pright"">"&vbcrlf
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&product_number&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(2)&"&nbsp;</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
if rs(3)<>"" then
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&brand&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(3)&"</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
end if
if rs(4)<>"" then
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&color&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(4)&"</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
end if
if rs(5)<>"" then
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&prosize&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(5)&"</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
end if
if rs(6)<>"" then
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&weight&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(6)&"</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
end if
if rs(7)<>"" then
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&guige&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(7)&"</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
end if
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&jianjie&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(8)&"</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
	str=str&"      </div>"&vbcrlf
	str=str&clearboth&vbcrlf
	str=str&"      <div align=""right""><input type=""button"" name=""Submit"" class=""button"" value="""&detail&" &gt;&gt;"" onclick=""window.open('"&propage&"&id="&rs(0)&"');"" /></div>"&vbcrlf
	str=str&"    </div>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	
	Case 2'一行二个图片+名称+简介
	for ipage=1 to rs.pagesize
	str=str&"	<div class=""prolistcase4"">"&vbcrlf
	str=str&"      <div class=""pleft""><a href="""&propage&"&id="&rs(0)&""" target=""_blank""><img src="""&UpDir&"upfiles/"&rs(1)&""" border=""0"" /><br />"&left(rs(9),titlelen)&"</a><br />"&vbcrlf
	if isShop=2 or isShop=1 then str=str&GetOrderButton(rs(0),lang)&vbcrlf
	if isFavorite=1 then str=str&GetFavoriteButton(rs(9),furl,lang)&vbcrlf
	str=str&"	  </div>"&vbcrlf
	str=str&"      <div class=""pright"">"&vbcrlf
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&product_number&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(2)&"&nbsp;</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
if rs(3)<>"" then
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&brand&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(3)&"</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
end if
if rs(4)<>"" then
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&color&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(4)&"</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
end if
if rs(5)<>"" then
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&prosize&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(5)&"</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
end if
if rs(6)<>"" then
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&weight&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(6)&"</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
end if
if rs(7)<>"" then
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&guige&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(7)&"</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
end if
	str=str&"        <ul>"&vbcrlf
	str=str&"          <li class=""ppt1"">"&jianjie&":</li>"&vbcrlf
	str=str&"		  <li class=""ppt2"">"&rs(8)&"</li>"&vbcrlf
	str=str&"        </ul>"&vbcrlf
	str=str&"      </div>"&vbcrlf
	str=str&clearboth&vbcrlf
	str=str&"      <div align=""right""><input type=""button"" name=""Submit"" class=""button"" value="""&detail&" &gt;&gt;"" onclick=""window.open('"&propage&"&id="&rs(0)&"');"" /></div>"&vbcrlf
	str=str&"    </div>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	
	Case 3'一行一条标题/名称列表
	str=str&"	<div class=""prolistcase1"">"&vbcrlf
	str=str&"        <ul>"&vbcrlf
	for ipage=1 to rs.pagesize
	str=str&"         <li><a href="""&propage&"&id="&rs(0)&""" target=""_blank"">"&left(rs(9),titlelen)&"</a></li>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	str=str&"        </ul>"&vbcrlf
	str=str&"    </div>"&vbcrlf
	End Select
	
	str=str&clearboth&vbcrlf
	str=str&"<div id=""showpagebottom"">"&vbcrlf
	str=str&"<div class=""pageleft"">"&vbcrlf
	str=str&GetPageList(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""pageright"">"&vbcrlf
	if Lang=0 then
	str=str&"共<strong>"&rs.recordcount&"</strong> 个产品 &nbsp; "
	else
	str=str&"Total <strong>"&rs.recordcount&"</strong> Product(s) &nbsp; "
	end if
	str=str&GetPage(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
end if
rs.close
GetProductList=str
End Function

Function Getclassname(classid,pclass)
Dim scn
set scn=conn.execute("select "&pclass&" from cnk_ProductClass where classid="&classid)
Getclassname=scn(0)
set scn=nothing
End Function

Function GetProductItem(id,pitem)
Dim scn
set scn=conn.execute("select "&pitem&" from cnk_Products where id="&id)
GetProductItem=scn(0)
set scn=nothing
End Function
xzgdpro
Function GetProductContent(id,lang)
Dim scn,sqlstr,str,content,furl
Dim product_number,brand,color,prosize,weight,guige,jianjie

conn.execute("update cnk_Products set hits=hits+1 where id="&id)
if lang=0 then
	product_number="编号"
	brand="品牌"
	color="颜色"
	prosize="尺寸"
	weight="重量"
	guige="规格"
	jianjie="简介"
	furl=""&UpDir&"chinese/"&contentfile&"?ModuleType=3&ChannelID=3&id="
	sqlstr="select id,small_img,product_number,brand,color,[size],weight,guige,jianjie,content,product_name,isMoreImg,image1,image2,image3,image4,ReadRight from cnk_Products where id="&id
else
	product_number="No. "
	brand="Brand"
	color="Color"
	prosize="Size"
	weight="Weight"
	guige="Spec"
	jianjie="Brief"
	furl=""&UpDir&"english/"&contentfile&"?ModuleType=3&ChannelID=3&id="
	sqlstr="select id,small_img,product_number,brand_en,color_en,[size],weight,guige_en,jianjie_en,content_en,product_name_en,isMoreImg,image1,image2,image3,image4,ReadRight from cnk_Products where id="&id
end if
set scn=conn.execute(sqlstr)
Call UserPageRight(username,scn(16),lang)
furl=furl&scn(0)
str=str&"	<div class=""prolistcase3"">"&vbcrlf
str=str&"      <div class=""pleft""><table boder=""0""><tr><td><div class=""pimg""><a href="""&UpDir&"upfiles/"&scn(1)&""" target=""_blank""><img src="""&UpDir&"upfiles/"&scn(1)&""" border=""0"" /></a></div></td></tr><tr><td>"&vbcrlf
str=str&GetPrice(id,lang)
if isShop=2 or isShop=1 then str=str&GetOrderButton(id,lang)
if isFavorite=1 then str=str&GetFavoriteButton(scn(10),furl,lang)
str=str&"	 </td></tr></table> </div>"&vbcrlf
str=str&"      <div class=""pright"">"&vbcrlf
str=str&"        <ul>"&vbcrlf
str=str&"          <li class=""ppt1"">"&product_number&":</li>"&vbcrlf
str=str&"		  <li class=""ppt2"">"&scn(2)&"&nbsp;</li>"&vbcrlf
str=str&"        </ul>"&vbcrlf
if scn(3)<>"" then
str=str&"        <ul>"&vbcrlf
str=str&"          <li class=""ppt1"">"&brand&":</li>"&vbcrlf
str=str&"		  <li class=""ppt2"">"&scn(3)&"</li>"&vbcrlf
str=str&"        </ul>"&vbcrlf
end if
if scn(4)<>"" then
str=str&"        <ul>"&vbcrlf
str=str&"          <li class=""ppt1"">"&color&":</li>"&vbcrlf
str=str&"		  <li class=""ppt2"">"&scn(4)&"</li>"&vbcrlf
str=str&"        </ul>"&vbcrlf
end if
if scn(5)<>"" then
str=str&"        <ul>"&vbcrlf
str=str&"          <li class=""ppt1"">"&prosize&":</li>"&vbcrlf
str=str&"		  <li class=""ppt2"">"&scn(5)&"</li>"&vbcrlf
str=str&"        </ul>"&vbcrlf
end if
if scn(6)<>"" then
str=str&"        <ul>"&vbcrlf
str=str&"          <li class=""ppt1"">"&weight&":</li>"&vbcrlf
str=str&"		  <li class=""ppt2"">"&scn(6)&"</li>"&vbcrlf
str=str&"        </ul>"&vbcrlf
end if
if scn(7)<>"" then
str=str&"        <ul>"&vbcrlf
str=str&"          <li class=""ppt1"">"&guige&":</li>"&vbcrlf
str=str&"		  <li class=""ppt2"">"&scn(7)&"</li>"&vbcrlf
str=str&"        </ul>"&vbcrlf
end if
str=str&"        <ul>"&vbcrlf
str=str&"          <li class=""ppt1"">"&jianjie&":</li>"&vbcrlf
str=str&"		  <li class=""ppt2"">"&scn(8)&"</li>"&vbcrlf
str=str&"        </ul>"&vbcrlf
str=str&"      </div>"&vbcrlf
str=str&clearboth&vbcrlf
str=str&"    </div>"&vbcrlf
if scn(11)=1 then
Dim image1,image2,image3,image4
image1=GetImgURL(scn(12))
image2=GetImgURL(scn(13))
image3=GetImgURL(scn(14))
image4=GetImgURL(scn(15))
str=str&"<div align=""center"">"&vbcrlf
str=str&"<script src="""&UpDir&"common/com.js""></script>"&vbcrlf
str=str&"<link href="""&UpDir&"common/moreimg.css"" rel=""stylesheet"" type=""text/css"" />"&vbcrlf
str=str&"   <div class=""proimgbox"">"&vbcrlf
str=str&"     <div class=""proimgboxleft"">"&vbcrlf
str=str&"       <div id=""Layer1"" class=""proimgbig"" style=""visibility: visible;""> <img src="""&image1&""" onLoad=""adjustImage(this)""> </div>"&vbcrlf
str=str&"       <div id=""Layer2"" class=""proimgbig"" style=""visibility: hidden;""> <img src="""&image2&""" onLoad=""adjustImage(this)""> </div>"&vbcrlf
str=str&"       <div id=""Layer3"" class=""proimgbig"" style=""visibility: hidden;""> <img src="""&image3&""" onLoad=""adjustImage(this)""> </div>"&vbcrlf
str=str&"       <div id=""Layer4"" class=""proimgbig"" style=""visibility: hidden;""> <img src="""&image4&""" onLoad=""adjustImage(this)""> </div>"&vbcrlf
str=str&"     </div>"&vbcrlf
str=str&"     <div class=""proimgboxright""> <a href=""javascript:;"" onMouseOver=""MM_showHideLayers('Layer1','','show','Layer2','','hide','Layer3','','hide','Layer4','','hide')""><img src="""&image1&"""></a> <a href=""javascript:;"" onMouseOver=""MM_showHideLayers('Layer1','','hide','Layer2','','show','Layer3','','hide','Layer4','','hide')""><img src="""&image2&"""></a> <a href=""javascript:;"" onMouseOver=""MM_showHideLayers('Layer1','','hide','Layer2','','hide','Layer3','','show','Layer4','','hide')""><img src="""&image3&"""></a> <a href=""javascript:;"" onMouseOver=""MM_showHideLayers('Layer1','','hide','Layer2','','hide','Layer3','','hide','Layer4','','show')""><img src="""&image4&"""></a> </div>"&vbcrlf
str=str&"   </div>"&vbcrlf
str=str&"   </div>"&vbcrlf
end if
str=str&"<div class=""content"">"&scn(9)&"</div>"&vbcrlf
set scn=nothing
GetProductContent=str
End Function

Function GetTopclassname(id,l)
Dim scn,en
if l=1 then en="_en"
set scn=conn.execute("select upclassid,classname"&en&" from cnk_ProductClass where classid="&id)
if scn(0)=0 then
	GetTopclassname=scn(1)
	exit Function
else
	call GetTopclassname(scn(0),l)
end if
End Function


'Order按钮
Function GetOrderButton(pid,lang)
Dim str,buttoname,en
if lang=0 then
	if isShop=2 then buttoname="订购"
	if isShop=1 then buttoname="询价"
else
	buttoname="Order"
	en="_en"
end if
If isImgButton=0 Then
str=" <input type=""button"" name=""submit"" value="""&buttoname&""" class=""button"" onClick="" window.open('cart.asp?pid="&pid&"&action=add');""> "
Else
str=" <a href=""javascript:void(0);"" onclick=""window.open('cart.asp?pid="&pid&"&action=add');""><img src="""&UpDir&"images/button_buy"&en&".gif"" border=""0"" /></a> "
End If
GetOrderButton=str
End Function

'Favorite按钮
Function GetFavoriteButton(title,url,lang)
Dim str,buttoname,en
if lang=0 then
buttoname="收藏"
else
buttoname="Favorite"
en="_en"
end if
If isImgButton=0 Then
str=" <input type=""button"" name=""submit"" value="""&buttoname&""" class=""button"" onClick="" window.open('"&UpDir&"access.asp?t="&title&"&u="&url&"&action=add&accesstype=Favorite');""> "
Else
str=" <a href=""javascript:void(0);"" onclick=""window.open('"&UpDir&"favorite.asp?t="&title&"&u="&url&"&action=add&accesstype=Favorite');""><img src="""&UpDir&"images/button_favorite"&en&".gif"" border=""0"" /></a> "
End If
GetFavoriteButton=str
End Function

'Price
Function GetPrice(pid,lang)
Dim rsp,sqlstr,str,p,p1,p2
set rsp=Server.Createobject("ADODB.Recordset")
if lang=0 then
	sqlstr="select price,price_user,price_vip from cnk_products where id="&pid
	p="价格:"
	p1="会员价:"
	p2="VIP价:"
else
	sqlstr="select USD,USD_user,USD_vip from cnk_products where id="&pid
	p="Price:"
	p1="Member Price:"
	p2="VIP Price:"
end if
set rsp=conn.execute(sqlstr)

select case isDispPrice
case 2
	str=p&rsp(0)&" &nbsp; "&p1&rsp(1)&" &nbsp; "&p2&rsp(2)
case 1
	str=p1&rsp(1)
	if weblevel="" then str=p&rsp(0)
	if weblevel="0" then str=p1&rsp(1)
	if weblevel="1" then str=p2&rsp(2)
case 0
	str=""
end select
GetPrice=str&"<br />"
End Function

Function GetSentprice(id)
Dim rs
set rs=conn.execute("select sendprice from cnk_sendway where id="&id)
GetSentprice=rs(0)
End Function
'==Products END==

'==Guestbook==
Sub saveguestbook()
Call DisableOutSite()

if session("cnkcode")<>Trim(Request.Form("yzma")) then call alertmsg("验证字错误")
dim contactname,lytype,company,email,url,qq,tel,area,show,title,ly,ispass,yuyan

lytype=request.form("lytype")
company=clearHTMLCode(trim(request.form("company")))
contactname=clearHTMLCode(trim(request.form("contactname")))
title=clearHTMLCode(trim(request.form("title")))
email=clearHTMLCode(request.form("email"))
url=clearHTMLCode(request.form("url"))
qq=clearHTMLCode(request.form("qq"))
tel=clearHTMLCode(request.form("tel"))
area=clearHTMLCode(request.form("area"))
show=request.form("show")
ly=clearHTMLCode(request.form("ly"))
yuyan=request.form("yuyan")
if isShenGb=0 then ispass=1 else ispass=0
if contactname="" then contactname="不愿留名的过客"
if url="http://" then url=""
if qq="QQ: " then qq=""

if ly="" then call alertmsg("※ 请填写留言[内容]!")
if contactname="" then call alertmsg("※ 请写名字!")
if request.cookies("ly")=ly then call alertmsg("※ 请不要重复提交相同的留言!")

response.cookies("ly")=ly

'set rs=server.createobject("adodb.recordset")
sql="select * from cnk_guestbook where (id is null)" 

rs.open sql,conn,1,3
rs.addnew
rs("ChannelID")=ChannelID
rs("contactname")=contactname
rs("lytype")=lytype
rs("company")=company
rs("email")=email
rs("url")=url
rs("qq")=qq
rs("tel")=tel
rs("area")=area
rs("show")=show
rs("title")=title
rs("ly")=ly
rs("ispass")=ispass
rs("Lang")=yuyan
rs("ip")=GetRealIP()
rs.update

rs.close
set rs=nothing 
if yuyan=0 then Call alertmsg_url("提交成功!谢谢",contentfile&"?ChannelID="&ChannelID)
if yuyan=1 then Call alertmsg_url("Thanks!",contentfile&"?ChannelID="&ChannelID)
'response.Redirect "guestbook.asp"
End Sub

Function GetGuestbook(ChannelID,GbType,Lang)
Dim str,lytype,subject,author,lytime,reply,del,qiao,butt_w
if Lang=0 then
	lytype="类别"
	subject="主题"
	author="留言者"
	lytime="时间"
	reply="回复"
	del="删除"
	qiao="这是悄悄话..."
	butt_w="写留言"
else
	lytype="Type"
	subject="Subject"
	author="Author"
	lytime="DateTime"
	reply="Reply"
	del="Delete"
	qiao="It is not open..."
	butt_w="Write Guestbook"
end if

str=str&"	<div style=""padding:5px;""><input type=""button"" name=""Submit"" class=""button"" value="""&butt_w&" &gt;&gt;"" onclick=""top.window.location.href='"&contentfile&"?ModuleType=6&ChannelID="&ChannelID&"&Action=writegb';"" /></div>"&vbcrlf

thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1
PagePara="?ModuleType=6&ChannelID="&ChannelID

Dim rs,ipage
set rs=server.CreateObject("adodb.recordset")
sql="select * from cnk_guestbook where Lang="&Lang&" and ChannelID="&ChannelID&" and ispass=1 order by initime desc"
rs.open sql,conn,1,1
if rs.recordcount=0 then
	str=str&"未有留言"&vbcrlf
else
	rs.pagesize=GetChannelPageSize(ChannelID)
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage
	Select Case GbType
	Case 0
	for ipage=1 to rs.pagesize
		str=str&"<div class=""gbookbox cnkbox"">"&vbcrlf
		str=str&"<div class=""boxtitle""><strong>"&author&"</strong>: "&rs("contactname")&" &nbsp; <strong>"&lytime&"</strong>: "&zhuan_time(rs("initime"))
		str=str&" <img src="""&UpDir&"images/ip.gif"" alt=""IP: "&PartIP(rs("ip"))&""" border=""0"">"
		if rs("qq")<>"" then str=str&" <img src="""&UpDir&"images/qq.gif"" alt="""&rs("qq")&""" border=""0"">"  else str=str&" <img src="""&UpDir&"images/qq1.gif"" border=""0"">"
		if rs("email")<>"" then str=str&" <a href=""mailto:"&rs("email")&"""><img src="""&UpDir&"images/email.gif"" border=""0""></a>"  else str=str&" <img src="""&UpDir&"images/email1.gif"" border=""0"">"
		if rs("url")<>"" then str=str&" <a href="""&rs("url")&""" target=""_blank""><img src="""&UpDir&"images/home.gif"" border=""0""></a>"  else str=str&" <img src="""&UpDir&"images/home1.gif"" border=""0"">"
		str=str&"</div>"&vbcrlf
		str=str&"<div class=""gbcontent"">"
		if rs("show")=0 then
			str=str&"<p align=""center""> "&qiao&"</p>"&vbcrlf
		else
			str=str&"<strong>["&rs("lytype")&"] : "&rs("title")&"</strong><br />"&CnkUBBContent(rs("ly"))
		end if
		str=str&"</div>"&vbcrlf
		if rs("re")<>"" or not isnull(rs("re")) then str=str&"<div class=""gbreply""><strong>"&reply&": </strong>"&CnkUBBContent(rs("re"))&"</div>"&vbcrlf
		str=str&"</div>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	
	Case 1'论坛模式
	str=str&"	<div class=""cnktable"">"&vbcrlf
	str=str&"	<table border=""0"" align=""center"" cellpadding=""2"" cellspacing=""1"">"&vbcrlf
	str=str&"      <tr class=""tabletitle"">"&vbcrlf
	str=str&"        <td width=""19%"">"&lytype&"</td>"&vbcrlf
	str=str&"        <td width=""45%"">"&subject&"</td>"&vbcrlf
	str=str&"        <td width=""17%"">"&author&"</td>"&vbcrlf
	str=str&"        <td width=""19%"">"&lytime&"</td>"&vbcrlf
	str=str&"      </tr>"&vbcrlf
	for ipage=1 to rs.pagesize
	str=str&"	<tr>"&vbcrlf
	str=str&"        <td>"&rs("lytype")&"</td>"&vbcrlf
	str=str&"        <td align=""left""><a href="""&contentfile&"?ModuleType=6&ChannelID="&ChannelID&"&id="&rs("id")&""" target=""_blank"">"&rs("title")&"</a></td>"&vbcrlf
	str=str&"        <td>"&rs("contactname")&"</td>"&vbcrlf
	str=str&"        <td>"&zhuan_time(rs("initime"))&"</td>"&vbcrlf
	str=str&"      </tr>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	str=str&"    </table>"&vbcrlf
	str=str&"	</div>"&vbcrlf
	
	End Select
	
	str=str&clearboth&vbcrlf
	str=str&"<div id=""showpagebottom"">"&vbcrlf
	str=str&"<div class=""pageleft"">"&vbcrlf
	str=str&GetPageList(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""pageright"">"&vbcrlf
	str=str&"<strong>"&rs.recordcount&"</strong> "&GetDanwei(ChannelID,Lang)&" &nbsp; "
	str=str&GetPage(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
end if
rs.close
GetGuestbook=str
End Function

Function GetFeedback(uname,Lang,action,subtitle)

thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1
PagePara="users.asp?action="&action&"&subtitle="&subtitle

Dim rs,str,ipage,wait
if Lang=0 then
	wait="请等待管理员回复"
else
	wait="Please waiting for Reply"
end if
set rs=server.CreateObject("adodb.recordset")
sql="select * from cnk_feedback where username='"&uname&"' order by initime desc"
rs.open sql,conn,1,1
if rs.recordcount>0 then
	rs.pagesize=20
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage
	for ipage=1 to rs.pagesize
		str=str&"<div class=""gbookbox"">"&vbcrlf
		str=str&"<div class=""boxtitle""><strong>"&rs("title")&"</strong>  [ "&zhuan_time(rs("initime"))&" ]</div>"&vbcrlf
		str=str&"<div class=""content"">"&CnkUBBContent(rs("content"))&"</div>"&vbcrlf
		str=str&"<div class=""gbreply"">"&vbcrlf
		if rs("reply")<>"" or not isnull(rs("reply")) then
			str=str&"<strong>"&rs("reusername")&" : </strong>"&CnkUBBContent(rs("reply"))&"<br /> [ "&zhuan_time(rs("retime"))&" ]"
		else
			str=str&wait
		end if
		str=str&"</div>"&vbcrlf
		str=str&"</div>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	str=str&"</ul>"
	
	str=str&clearboth&vbcrlf
	str=str&"<div id=""showpagebottom"">"&vbcrlf
	str=str&"<div class=""pageleft"">"&vbcrlf
	str=str&GetPageList(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""pageright"">"&vbcrlf
	str=str&"<strong>"&rs.recordcount&"</strong> "&GetDanwei(ChannelID,Lang)&" &nbsp; "
	str=str&GetPage(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
end if
rs.close
GetFeedback=str
End Function
'==Guestbook END==

'==HR==
Function GetHrList(ChannelID,DispType,Lang)
Dim rs,str,ipage
Dim hrposition,hrnum,hrarea,hrdaiyu,hrxueli,hrzy,hrsex,hrage,hrstart,hrend,hrrequest,readmore
if Lang=0 then
	hrposition="招聘职位:"
	hrnum="招聘人数:"
	hrarea="工作地:区"
	hrdaiyu="福利待:遇"
	hrxueli="学历要求:"
	hrzy="专业要求:"
	hrsex="性别要求:"
	hrage="年龄要求:"
	hrstart="发布日期:"
	hrend="有效期至:"
	hrrequest="申请该职位"
	readmore="查看详细"
else
	hrposition="Position:"
	hrnum="Number:"
	hrarea="Job area:"
	hrdaiyu="Treatment:"
	hrxueli="Diploma:"
	hrzy="Major:"
	hrsex="Sex:"
	hrage="Age:"
	hrstart="Start Date:"
	hrend="End Date:"
	hrrequest="Request"
	readmore="More"
end if
thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1
PagePara="?ModuleType=7&ChannelID="&ChannelID

set rs=server.CreateObject("adodb.recordset")
sql="select * from cnk_hr where Lang="&Lang&" and ChannelID="&ChannelID&" order by startdate desc"

rs.open sql,conn,1,1
if rs.recordcount=0 then
	str="nothing"
else
	rs.pagesize=GetChannelPageSize(ChannelID)
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage
	
	Select Case DispType
	
	Case 0
	str=str&"<div class=""titlelist""><ul>"&vbcrlf
	for ipage=1 to rs.pagesize
		str=str&"<li>"&ipage&". <a href="""&contentfile&"?ModuleType=7&ChannelID="&ChannelID&"&id="&rs("hrid")&""" target=""_blank""><strong>"&rs("JobPosition")&"</strong></a> <span class=""gray"">"&zhuan_date(rs("startdate"))&"</span> [<a href="""&contentfile&"?ModuleType=7&ChannelID="&ChannelID&"&id="&rs("hrid")&"&hrrequest=yes&p="&rs("JobPosition")&""" target=""_blank"">"&hrrequest&"</a>]</li>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	str=str&"</ul></div>"
	
	Case 1
	str=str&"<div class=""titlelist""><ul>"&vbcrlf
	for ipage=1 to rs.pagesize
		str=str&"<li>"&ipage&". <a href="""&contentfile&"?ModuleType=7&ChannelID="&ChannelID&"&id="&rs("hrid")&""" target=""_blank""><strong>"&rs("JobPosition")&"</strong></a> <span class=""gray"">"&zhuan_date(rs("startdate"))&"</span> [<a href="""&contentfile&"?ModuleType=7&ChannelID="&ChannelID&"&id="&rs("hrid")&"&hrrequest=yes&p="&rs("JobPosition")&""" target=""_blank"">"&hrrequest&"</a>]<br><div style=""padding:5px 5px 5px 20px;"">"&left(rs("content"),100)&"......<a href="""&contentfile&"?ModuleType=7&ChannelID="&ChannelID&"&id="&rs("hrid")&""" target=""_blank"">["&readmore&"]</a></div></li>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	str=str&"</ul></div>"
	
	Case 2
	for ipage=1 to rs.pagesize
		str=str&"<div class=""cnkbox"">"&vbcrlf
		str=str&"  <div class=""boxtitle"">"&rs("JobPosition")&"</div>"&vbcrlf
		str=str&"  <div class=""shortinfo"">"&hrposition&rs("JobPosition")&"</div>"&vbcrlf
		str=str&"  <div class=""shortinfo"">"&hrnum&rs("Renshu")&"</div>"&vbcrlf
		str=str&"  <div class=""shortinfo"">"&hrarea&rs("JobArea")&"</div>"&vbcrlf
		str=str&"  <div class=""shortinfo"">"&hrdaiyu&rs("Daiyu")&"</div>"&vbcrlf
		str=str&"  <div class=""shortinfo"">"&hrxueli&rs("Xueli")&"</div>"&vbcrlf
		str=str&"  <div class=""shortinfo"">"&hrzy&rs("Zhuanye")&"</div>"&vbcrlf
		str=str&"  <div class=""shortinfo"">"&hrsex&rs("Sex")&"</div>"&vbcrlf
		str=str&"  <div class=""shortinfo"">"&hrage&rs("Age")&"</div>"&vbcrlf
		str=str&"  <div class=""shortinfo"">"&hrstart&rs("startdate")&"</div>"&vbcrlf
		str=str&"  <div class=""shortinfo"">"&hrend&rs("enddate")&"</div>"&vbcrlf
		str=str&clearboth&vbcrlf
		str=str&"  <div class=""content"">"&cnkUBBContent(rs("Content"))&"</div>"&vbcrlf
		str=str&"  <div align=""right"" style=""margin:5px;""><input name=""job"" type=""button"" value="""&hrrequest&""" class=""button"" onclick=""window.open('?ModuleType=7&ChannelID="&ChannelID&"&id="&rs("hrid")&"&hrrequest=yes&p="&rs("JobPosition")&"');"" /></div>"&vbcrlf
		str=str&"</div>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	
	End Select
	'str=str&clearboth&vbcrlf
	str=str&"<div id=""showpagebottom"">"&vbcrlf
	str=str&"<div class=""pageleft"">"&vbcrlf
	str=str&GetPageList(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf

	str=str&"<div class=""pageright"">"&vbcrlf
	str=str&"<strong>"&rs.recordcount&"</strong> "&GetDanwei(ChannelID,Lang)&" &nbsp; "
	str=str&GetPage(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
end if
rs.close
GetHrList=str
End Function

Sub saveResumes()
Call DisableOutSite()
dim hrid,JobPosition,PersonName,Sex,Birthday,Marry,School,Studydegree,Specialty,GradYear,Tel,Email,qq,Address,Resumes,Ability,yuya
hrid=Clng(trim(request.form("id")))
JobPosition=trim(request.form("JobPosition"))
PersonName=clearHTMLCode(trim(request.form("PersonName")))
Sex=Clng(trim(request.form("Sex")))
Birthday=clearHTMLCode(trim(request.form("Birthday")))
Marry=trim(request.form("Marry"))
School=clearHTMLCode(trim(request.form("School")))
Studydegree=clearHTMLCode(trim(request.form("Studydegree")))
Specialty=clearHTMLCode(trim(request.form("Specialty")))
GradYear=clearHTMLCode(trim(request.form("GradYear")))
Tel=clearHTMLCode(trim(request.form("Tel")))
Email=clearHTMLCode(trim(request.form("Email")))
qq=clearHTMLCode(trim(request.form("qq")))
Address=clearHTMLCode(trim(request.form("Address")))
Resumes=clearHTMLCode(trim(request.form("Resumes")))
Ability=clearHTMLCode(trim(request.form("Ability")))
yuya=request.form("yuyan")

if qq="QQ: " then qq=""
if isdate(Birthday)=False then call alertmsg("※ 出生日期格式有错误!")
if len(Resumes)<20 then call alertmsg("※ 简历内容太少!")
if Ability="" then call alertmsg("※ 请填写[水平及能力]!")

sql="select * from Cnk_hr_jianli where (jlid is null)" 
rs.open sql,conn,1,3
rs.addnew
rs("hrid")=hrid
rs("ChannelID")=ChannelID
rs("JobPosition")=JobPosition
rs("PersonName")=PersonName
rs("Sex")=Sex
rs("Birthday")=Birthday
rs("Marry")=Marry
rs("School")=School
rs("Studydegree")=Studydegree
rs("Specialty")=Specialty
rs("GradYear")=GradYear
rs("email")=email
rs("qq")=qq
rs("tel")=tel
rs("Address")=Address
rs("Resumes")=Resumes
rs("Ability")=Ability
rs("ip")=GetRealIP()
rs("Lang")=yuya

rs.update

rs.close
set rs=nothing 
if Trim(Request.Form("yuyan"))="0" then Call alertmsgc("提交成功!谢谢")
if Trim(Request.Form("yuyan"))="1" then Call alertmsgc("Thanks!")
'response.Redirect "hr_request.asp"
End Sub
'==HR END==

'==DL==
Function GetDownloadList(ChannelID,DispType,Lang)
thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1
PagePara="?ModuleType=5&ChannelID="&ChannelID

Dim rs,str,ipage,dlname,dltype,dlsize,dlos,dldl,en
if Lang=0 then 
dlname="名称"
dltype="类型"
dlsize="大小"
dlos="平台"
dldl="下载"
else
dlname="Item"
dltype="Type"
dlsize="Size"
dlos="OS"
dldl="Download"
en="_en"
end if
set rs=server.CreateObject("adodb.recordset")
dim dlcid
dlcid=Trim(Request.QueryString("dlcid"))
if dlcid<>"" then Call isNum(dlcid)

dim rs1
set rs1=server.CreateObject("ADODB.Recordset")
rs1.open "select classid,classname"&en&" from cnk_downloadclass order by paixu",conn,1,1 
if rs1.recordcount>0 and dlcid="" then
 do while not rs1.eof
	str=str&"<div  class=""downbox"">"&vbcrlf
	str=str&"<div class=""boxtitle""><a href="""&contentfile&"?ModuleType=5&ChannelID="&ChannelID&"&dlcid="&rs1(0)&""" target=""_blank"">"&rs1(1)&"</a></div>"&vbcrlf
	str=str&"<div class=""titlelist"">"&vbcrlf
	str=str&"<ul>"&vbcrlf
	set rs=server.CreateObject("adodb.recordset")
		sql="select top 8 id,title from cnk_download where Lang="&Lang&" and classid="&rs1(0)
		if ChannelID>0 then  sql=sql&" and ChannelID="&ChannelID
		sql=sql&" order by updatetime desc"
		rs.open sql,conn,1,1
	do while not rs.eof
	str=str&"<li> <a href="""&contentfile&"?ModuleType=5&ChannelID="&ChannelID&"&id="&rs("id")&""" target=""_blank"">"&rs("title")&"</a></li>"&vbcrlf
	rs.movenext
	loop
	rs.close
	set rs=nothing
	str=str&"</ul>"
	str=str&"</div>"
	str=str&"<div align=""right"" style=""padding:5px""><a href="""&contentfile&"?ModuleType="&ModuleType&"&ChannelID="&ChannelID&"&dlcid="&rs1(0)&"""><img src="""&UpDir&"skin/cnk/more"&Lang&".gif"" border=""0"" /></a></div>"
	str=str&"</div>"
 rs1.movenext
 loop
 rs1.close
str=str&clearboth&vbcrlf
else
 sql="select id,title,filetype,filesize,OS from cnk_download where Lang="&Lang
 if ChannelID>0 then  sql=sql&" and ChannelID="&ChannelID
 if dlcid<>"" then sql=sql&" and classid="&dlcid
 sql=sql&" order by updatetime desc"
 rs.open sql,conn,1,1
 if rs.recordcount=0 then
	str=str&"nothing"
 else
	rs.pagesize=GetChannelPageSize(ChannelID)
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage
	
	Select Case DispType
	
	Case 0
		str=str&"	<div class=""cnktable"">"&vbcrlf
		str=str&"	<table border=""0"" align=""center"" cellpadding=""2"" cellspacing=""1"">"&vbcrlf
        str=str&"    <tr class=""tabletitle"">"&vbcrlf
        str=str&"      <td width=""37%"">"&dlname&"</td>"&vbcrlf
        str=str&"      <td width=""13%"">"&dltype&"</td>"&vbcrlf
        str=str&"      <td width=""13%"">"&dlsize&"</td>"&vbcrlf
        str=str&"      <td width=""22%"">"&dlos&"</td>"&vbcrlf
        str=str&"      <td width=""15%"">"&dldl&"</td>"&vbcrlf
        str=str&"    </tr>"&vbcrlf
    for ipage=1 to rs.pagesize
        str=str&"    <tr>"&vbcrlf
        str=str&"      <td align=""left""><a href="""&contentfile&"?ModuleType=5&ChannelID="&ChannelID&"&id="&rs("id")&""" target=""_blank"">"&rs("title")&"</a></td>"&vbcrlf
        str=str&"      <td>"&rs("filetype")&"</td>"&vbcrlf
        str=str&"      <td>"&rs("filesize")&"</td>"&vbcrlf
        str=str&"      <td>"&rs("OS")&"</td>"&vbcrlf
        str=str&"      <td><a href=""dl.asp?id="&rs("id")&"""><img src="""&UpDir&"images/dl.gif"" border=""0"" /></a></td>"&vbcrlf
        str=str&"    </tr>"&vbcrlf
    rs.movenext
	if rs.eof then exit for
	next
    str=str&"</table>"&vbcrlf
	str=str&"</div>"&vbcrlf
	'str=str&clearboth&vbcrlf
	
	Case 1
	for ipage=1 to rs.pagesize
		str=str&"<li><span class=""px14 strong""><a href="""&contentfile&"?ModuleType=5&ChannelID="&ChannelID&"&id="&rs("id")&""" target=""_blank"">"&rs("title")&"</a></span> | <i>"&zhuan_date(rs("updatetime"))&"</i><br />"&left(clearHTMLcode(rs("content")),100)&"...... [<a href="""&contentfile&"?ModuleType=5&ChannelID="&ChannelID&"&id="&rs("id")&""" target=""_blank"">查看详细</a>]<br /><div style=""padding:5px;text-align:right;"">"&dltype&":"&rs("filetype")&" &nbsp;&nbsp;&nbsp; |  &nbsp;&nbsp;&nbsp; "&dlsize&":"&rs("filesize")&" &nbsp;&nbsp;&nbsp; |  &nbsp;&nbsp;&nbsp; "&dlos&":"&rs("OS")&" &nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp; "&dldl&":<a href=""dl.asp?id="&rs("id")&"""><img src="""&UpDir&"images/dl.gif"" border=""0"" /></a></div></li>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	
	End Select
	
	str=str&"<div id=""showpagebottom"">"&vbcrlf
	str=str&"<div class=""pageleft"">"&vbcrlf
	str=str&GetPageList(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""pageright"">"&vbcrlf
	str=str&"<strong>"&rs.recordcount&"</strong> "&GetDanwei(ChannelID,Lang)&" &nbsp; "
	str=str&GetPage(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
 end if
 rs.close
end if
GetDownloadList=str
End Function
'==DL END==

'==Images==
Function GetImageList(ChannelID,titlelen,DispType,Lang)

thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1
PagePara="?ModuleType=4&ChannelID="&ChannelID

Dim rs,str,ipage,imagename,en
if Lang=1 then en="_en"
set rs=server.CreateObject("adodb.recordset")
if ChannelID<>"" then
	sql="select id,imagename,title"&en&" from cnk_images where ChannelID="&ChannelID&" order by paixu"
else
	sql="select id,imagename,title"&en&" from cnk_images order by paixu"
end if
rs.open sql,conn,1,1
if rs.recordcount>0 then
	
	Select Case DispType
	
	Case 0
	rs.pagesize=GetChannelPageSize(ChannelID)
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage
	str=str&"<div id=""images"">"&vbcrlf
	for ipage=1 to rs.pagesize
		imagename=GetImgURL(rs(1))
		str=str&"<div><a href="""&contentfile&"?ModuleType=4&ChannelID="&ChannelID&"&id="&rs(0)&""" target=""_blank""><img src="""&imagename&""" /><br />"&left(rs(2),titlelen)&"</a></div>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	str=str&"</div>"&vbcrlf
	
	Case 1
	rs.pagesize=4
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage
	Dim img(3),imgurl(3)
	for ipage=0 to rs.pagesize-1
		img(ipage)=GetImgURL(rs(1))
		imgurl(ipage)=contentfile&"?ModuleType=4&ChannelID="&ChannelID&"&id="&rs(0)
	rs.movenext
	if rs.eof then exit for
	next
	str=str&"<div align=""center"">"&vbcrlf
	str=str&"<script src="""&UpDir&"common/com.js""></script>"&vbcrlf
	str=str&"<link href="""&UpDir&"common/moreimg.css"" rel=""stylesheet"" type=""text/css"" />"&vbcrlf
	str=str&"   <div class=""proimgbox"">"&vbcrlf
	str=str&"     <div class=""proimgboxleft"">"&vbcrlf
	str=str&"       <div id=""Layer1"" class=""proimgbig"" style=""visibility: visible;""> <a href="""&imgurl(0)&"""  target=""_blank""><img src="""&img(0)&""" onLoad=""adjustImage(this)"" border=""0"" /></a> </div>"&vbcrlf
	str=str&"       <div id=""Layer2"" class=""proimgbig"" style=""visibility: hidden;""> <a href="""&imgurl(1)&"""  target=""_blank""><img src="""&img(1)&""" onLoad=""adjustImage(this)"" border=""0"" /></a> </div>"&vbcrlf
	str=str&"       <div id=""Layer3"" class=""proimgbig"" style=""visibility: hidden;""> <a href="""&imgurl(2)&"""  target=""_blank""><img src="""&img(2)&""" onLoad=""adjustImage(this)"" border=""0"" /></a> </div>"&vbcrlf
	str=str&"       <div id=""Layer4"" class=""proimgbig"" style=""visibility: hidden;""> <a href="""&imgurl(3)&"""  target=""_blank""><img src="""&img(3)&""" onLoad=""adjustImage(this)"" border=""0"" /></a> </div>"&vbcrlf
	str=str&"     </div>"&vbcrlf
	str=str&"     <div class=""proimgboxright""> <a href="""&imgurl(0)&"""  target=""_blank"" onMouseOver=""MM_showHideLayers('Layer1','','show','Layer2','','hide','Layer3','','hide','Layer4','','hide')""><img src="""&img(0)&"""></a> <a href="""&imgurl(1)&"""  target=""_blank""  onMouseOver=""MM_showHideLayers('Layer1','','hide','Layer2','','show','Layer3','','hide','Layer4','','hide')""><img src="""&img(1)&"""></a> <a href="""&imgurl(2)&"""  target=""_blank""  onMouseOver=""MM_showHideLayers('Layer1','','hide','Layer2','','hide','Layer3','','show','Layer4','','hide')""><img src="""&img(2)&"""></a> <a href="""&imgurl(3)&"""  target=""_blank""  onMouseOver=""MM_showHideLayers('Layer1','','hide','Layer2','','hide','Layer3','','hide','Layer4','','show')""><img src="""&img(3)&"""></a> </div>"&vbcrlf
	str=str&"   </div>"&vbcrlf
	str=str&"   </div>"&vbcrlf
	
	Case 2
	rs.pagesize=5
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage
	Dim bimg(4),simg(4),the5title(4),bj,disp
	bj=0
	for ipage=0 to rs.pagesize-1
		if bj=0 then disp="dis" else disp="undis" 
		bimg(ipage)="<div class="""&disp&""" name=""f""><a href="""&contentfile&"?ModuleType=4&ChannelID="&ChannelID&"&id="&rs(0)&""" target=""_blank""><img src="""&GetImgURL(rs(1))&""" border=""0""/></a></div>"&vbcrlf
		simg(ipage)="<a href="""&contentfile&"?ModuleType=4&ChannelID="&ChannelID&"&id="&rs(0)&""" target=""_blank""><img src="""&GetImgURL(rs(1))&""" border=""0"" class=""s"" onMouseOver=""play(this,'bimg','imginfo');clearAuto();"" onMouseOut=""setAuto()"" /></a>"&vbcrlf
		the5title(ipage)="<table border=""0"" width=""680"" align=""center"" bgcolor=""#E6E6E6"" class="""&disp&""" name=""f""><tr><td align=""left"" valign=""bottom"" class=""t"">"&rs(2)&"</td></tr></table>"&vbcrlf
	rs.movenext
	bj=bj+1
	if rs.eof then exit for
	next
	str=str&"<div align=""center"">"&vbcrlf
	str=str&"<link href="""&UpDir&"common/img5auto.css"" rel=""stylesheet"" type=""text/css"" />"&vbcrlf
	str=str&"<script src="""&UpDir&"common/img5auto.js""></script>"&vbcrlf
	str=str&"	<table border=""0"" cellspacing=""0"" cellpadding=""0""><tr><td>"&vbcrlf
	str=str&"<table cellpadding=""0"" cellspacing=""0"" border=""0"" width=""710"" bgcolor=""#F3F3F3"">"&vbcrlf
	str=str&"<tr>"&vbcrlf
	str=str&"  <td width=""370"" height=""275"" align=""center""><div id=""bimg"">"&vbcrlf
    str=str&bimg(0)&bimg(1)&bimg(2)&bimg(3)&bimg(4)
	str=str&"    </div></td>"&vbcrlf
 	str=str&" <td width=""80"" align=""left"" id=""simg"">"&vbcrlf
    str=str&simg(0)&simg(1)&simg(2)&simg(3)&simg(4)
	str=str&"  </td>"&vbcrlf
	str=str&"</tr>"&vbcrlf
	str=str&"<tr>"&vbcrlf
	str=str&"  <td height=""30"" colspan=""2"" valign=""top"" id=""imginfo"">"&vbcrlf
	str=str&the5title(0)&the5title(1)&the5title(2)&the5title(3)&the5title(4)
	str=str&"</td>"&vbcrlf
	str=str&"</tr>"&vbcrlf
	str=str&"</table>"&vbcrlf
	str=str&"</td></tr></table>"&vbcrlf
	str=str&"   </div>"&vbcrlf
	
	Case 3
	str=str&"<div align=""center"">"&vbcrlf
	str=str&"<link href="""&UpDir&"common/allimg.css"" rel=""stylesheet"" type=""text/css"" />"&vbcrlf
	
	str=str&"<table cellSpacing=""0"" cellPadding=""0"" align=""center"" border=""0"" bgcolor=""#F3F3F3""><tr><td width=""650"" height=""381"" align=""center"" valign=""top"">"&vbcrlf
	str=str&"<div id=""xfc"" style=""FILTER: progid:DXImagetransform.Microsoft.Fade(duration=0.5,overlap=1.0); width:650px; height:510px; margin-right:auto;"">"&vbcrlf
	dim xxh,casestyle,rsrecordcount
	rsrecordcount=rs.recordcount
	xxh=0
	do while not rs.eof
	if xxh=0 then casestyle="display:block;" else casestyle="display:none;"
	str=str&"<div style="""&casestyle&"""><a href="""&contentfile&"?ModuleType=4&ChannelID="&ChannelID&"&id="&rs(0)&""" target=""_blank""><img src="""&GetImgURL(rs(1))&"""  border=""0""></a></div>"&vbcrlf
	rs.movenext
	xxh=xxh+1
	loop
	str=str&"</div></td>"&vbcrlf
    str=str&"</tr>"&vbcrlf
    str=str&"<tr>"&vbcrlf
    str=str&"  <td height=""26"">"&vbcrlf
	str=str&"  <table id=""xnum"" cellspacing=""3"" cellpadding=""0"" align=""center"" border=""0"">"&vbcrlf
    str=str&"    <tr>"&vbcrlf
	dim ii
	for ii=1 to rsrecordcount
	if ii=1 then
	str=str&"<td class=""xbigon""  style=""cursor: pointer"" onclick=""xMea("&ii-1&");"" onmouseover=""xclearAuto()"" onmouseout=""xsetAuto()"" align=""center"" width=""15"" height=""18"" id=""xt"&ii-1&""">"&ii&"</td>"&vbcrlf
	else
    str=str&" <td class=""xbigoff"" style=""cursor: pointer"" onclick=""xMea("&ii-1&");"" onmouseover=""xclearAuto()"" onmouseout=""xsetAuto()"" align=""center"" width=""15"" id=""xt"&ii-1&""">"&ii&"</td>"&vbcrlf
	end if
	next
	str=str&"</tr>"&vbcrlf
    str=str&"  </table>"&vbcrlf
    str=str&"    <div id=""xcon"">"&vbcrlf
	rs.movefirst
	for ii=1 to rsrecordcount
	if ii=1 then
	str=str&"<div style=""display: block; text-align:center;""> <strong> "&rs(2)&"</strong></div>"&vbcrlf
	else
    str=str&"<div style=""display: none"" text-align:center;""> <strong> "&rs(2)&"</strong></div>"&vbcrlf
	end if
	rs.movenext
	next
    str=str&"  </div></td>"&vbcrlf
    str=str&"</tr>"&vbcrlf
  str=str&"</table>"&vbcrlf
	str=str&"   </div>"&vbcrlf
	'str=str&"<script src="""&UpDir&"common/allimg.js"">< /script>"&vbcrlf
  str=str&"<script>"&vbcrlf
  str=str&"var m=0;"&vbcrlf
  str=str&"function xMea(value){"&vbcrlf
  str=str&"	m=value;"&vbcrlf
  str=str&"	xsetBg(value);"&vbcrlf
  str=str&"	xplays(value);"&vbcrlf
  str=str&"	xcons(value);"&vbcrlf
  str=str&"	}"&vbcrlf
  str=str&"function xsetBg(value){"&vbcrlf
  str=str&"	for(var i=0;i<"&rsrecordcount&";i++)"&vbcrlf
  str=str&"   if(value==i){"&vbcrlf
  str=str&"		document.getElementById(""xt""+value+"""").className='xbigon';"&vbcrlf
  str=str&"		} "&vbcrlf
  str=str&"	else{	"&vbcrlf
  str=str&"		document.getElementById(""xt""+i+"""").className='xbigoff';"&vbcrlf
  str=str&"		}  "&vbcrlf
  str=str&"	} "&vbcrlf

  str=str&"function xplays(value){"&vbcrlf
  str=str&"	try"&vbcrlf
  str=str&"	{"&vbcrlf
  str=str&"		with (xfc)"&vbcrlf
  str=str&"		{"&vbcrlf
  str=str&"			filters[0].Apply();"&vbcrlf
  str=str&"			for(i=0;i<"&rsrecordcount&";i++)i==value?children[i].style.display=""block"":children[i].style.display=""none""; "&vbcrlf
  str=str&"			filters[0].play(); "&vbcrlf
  str=str&"		}"&vbcrlf
  str=str&"	}"&vbcrlf
  str=str&"	catch(e)"&vbcrlf
  str=str&"	{"&vbcrlf
  str=str&"		var divlist = document.getElementById(""xfc"").getElementsByTagName(""div"");"&vbcrlf
  str=str&"		for(i=0;i<"&rsrecordcount&";i++)"&vbcrlf
  str=str&"		{"&vbcrlf
  str=str&"			i==value?divlist[i].style.display=""block"":divlist[i].style.display=""none"";"&vbcrlf
  str=str&"		}"&vbcrlf
  str=str&"	}"&vbcrlf
  str=str&"}"&vbcrlf

  str=str&"function xcons(value){"&vbcrlf
  str=str&"	try"&vbcrlf
  str=str&"	{"&vbcrlf
  str=str&"		with (xcon)"&vbcrlf
  str=str&"		{"&vbcrlf
  str=str&"				for(i=0;i<"&rsrecordcount&";i++)i==value?children[i].style.display=""block"":children[i].style.display=""none""; 		"&vbcrlf
  str=str&"		}"&vbcrlf
  str=str&"	}"&vbcrlf
  str=str&"	catch(e)"&vbcrlf
  str=str&"	{"&vbcrlf
  str=str&"		var divlist = document.getElementById(""xcon"").getElementsByTagName(""div"");"&vbcrlf
  str=str&"		for(i=0;i<"&rsrecordcount&";i++)"&vbcrlf
  str=str&"		{"&vbcrlf
  str=str&"			i==value?divlist[i].style.display=""block"":divlist[i].style.display=""none"";"&vbcrlf
  str=str&"		}		"&vbcrlf
  str=str&"	}"&vbcrlf
  str=str&"}"&vbcrlf

  str=str&"function xclearAuto(){clearInterval(xautoStart)}"&vbcrlf
  str=str&"function xsetAuto(){xautoStart=setInterval(""xAuto(m)"", 3000)}"&vbcrlf
  str=str&"function xAuto(){"&vbcrlf
  str=str&"	m++;"&vbcrlf
  str=str&"	if(m>"&rsrecordcount-1&")m=0;"&vbcrlf
  str=str&"	xMea(m);"&vbcrlf
  str=str&"} "&vbcrlf
  str=str&"function xSub(){"&vbcrlf
  str=str&"	m--;"&vbcrlf
  str=str&"	if(m<0)m="&rsrecordcount&"-1;"&vbcrlf
  str=str&"	xMea(m);"&vbcrlf
  str=str&"} "&vbcrlf

  str=str&"xsetAuto(); "&vbcrlf
  str=str&"</script> "&vbcrlf
	
	End Select
	str=str&clearboth&vbcrlf
	if DispType<>3 then
	str=str&"<div id=""showpagebottom"">"&vbcrlf
	str=str&"<div class=""pageleft"">"&vbcrlf
	str=str&GetPageList(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""pageright"">"&vbcrlf
	str=str&"<strong>"&rs.recordcount&"</strong> "&GetDanwei(ChannelID,Lang)&" &nbsp; "
	str=str&GetPage(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
	end if
end if
rs.close
GetImageList=str
End Function
'==Images  END==

'==NODE==
Function GetProvinceName(id)
Dim rscon
set rscon=conn.execute("select provincename from cnk_province where provinceid="&id)
GetProvinceName=rscon(0)
set rscon=nothing
End Function

Function GetWorldName(id)
Dim rscon
set rscon=conn.execute("select worldname from cnk_world where worldid="&id)
GetWorldName=rscon(0)
set rscon=nothing
End Function

Function GetNodeList(ChannelID,id,Lang)
Dim whatarea
select case Lang
case 0 whatarea="provinceid"
case 1 whatarea="worldid"
end select
thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1
PagePara="?ModuleType=8&ChannelID="&ChannelID

Dim rs,str,ipage,yuyan
set rs=server.CreateObject("adodb.recordset")
if id<>"" then
	sql="select id,title from cnk_node where ChannelID="&ChannelID&" and "&whatarea&"="&id&" order by paixu"
else
	sql="select id,title from cnk_node where "&whatarea&">0 order by paixu"
end if
rs.open sql,conn,1,1
if rs.recordcount>0 then
	rs.pagesize=GetChannelPageSize(ChannelID)
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage
	for ipage=1 to rs.pagesize
		'if Lang=0 then yuyan=rs("title") else yuyan=rs("title_en")
		str=str&"<div class=""nodelist""><a href=""?ModuleType=8&ChannelID="&ChannelID&"&id="&rs("id")&""" target=""_blank"">"&rs("title")&"</a></div>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	str=str&clearboth&vbcrlf
	str=str&"<div id=""showpagebottom"">"&vbcrlf
	str=str&"<div class=""pageleft"">"&vbcrlf
	str=str&GetPageList(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""pageright"">"&vbcrlf
	str=str&"<strong>"&rs.recordcount&"</strong> "&GetDanwei(ChannelID,0)&" &nbsp; "
	str=str&GetPage(rs.pagecount,thispage,PagePara,0)
	str=str&"</div>"&vbcrlf
	str=str&clearboth&vbcrlf
	str=str&"</div>"&vbcrlf
end if
rs.close
GetNodeList=str
End Function


Function GetNodeContent(nodeid)
dim str
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from cnk_node where id="&nodeid,conn,1,1
str=str&"<div class=""articletitle"">"&rs("title")&"</div>"&vbcrlf
str=str&"<div class=""articlecontent"">"&rs("content")&"</div>"&vbcrlf
rs.close
GetNodeContent=str
End Function

Function GetMap(ChannelID,lang)
select case lang
case 0 GetMap=GetCNMap(ChannelID)
case 1 GetMap=GetWorldMap(ChannelID)
end select
End Function

Function GetCNMap(ChannelID)
dim str,subdir
if Updir="../" then subdir=Updir&"chinese/"
str=str&"<div align=""center"" style=""margin-top: 30px;""> <img src="""&UpDir&"images/chinamap.gif"" width=""475"" height=""399"" border=""0"" usemap=""#node"">"&vbcrlf
str=str&"      <map name=""node"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""273,326,315,310,328,327,307,357,281,351"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=4"" alt=""广西"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""341,317,376,318,382,326,316,366,312,361"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=3"" alt=""广东"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""352,142,370,141,352,162,343,158"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=1"" alt=""北京"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""489,276,487,299"" href=""#"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""389,160,360,157,354,164,363,170,388,170"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=14"" alt=""天津"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""437,238,407,238,406,246,438,248"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=2"" alt=""上海"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""325,374,313,394,302,385,308,376"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=5"" alt=""海南"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""406,285,386,279,368,312,388,321"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=6"" alt=""福建"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""415,255,407,280,389,276,391,253"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=7"" alt=""浙江"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""409,232,382,206,368,215,394,244"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=8"" alt=""江苏"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""383,273,365,311,350,310,350,273,367,266"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=9"" alt=""江西"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""345,276,345,310,306,307,306,274"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=10"" alt=""湖南"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""360,253,356,265,301,272,297,264,305,251,308,232"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=11"" alt=""湖北"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""388,247,384,261,364,258,356,227,367,221"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=12"" alt=""安徽"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""404,177,372,209,352,203,356,182"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=13"" alt=""山东"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""335,199,312,221,318,232,349,244,352,224"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=15"" alt=""河南"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""349,136,329,145,334,196,350,194,354,172,343,158"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=16"" alt=""河北"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""327,158,310,169,310,213,330,200"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=17"" alt=""山西"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""275,248,295,256,297,281,270,280"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=18"" alt=""重庆"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""200,239,270,243,263,284,230,305"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=19"" alt=""四川"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""204,287,200,335,223,360,268,344"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=20"" alt=""云南"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""261,295,294,286,303,309,267,323"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=21"" alt=""贵州"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""406,112,422,131,397,156,372,136"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=22"" alt=""辽宁"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""457,99,429,122,388,87"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=23"" alt=""吉林"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""468,42,452,89,399,77,400,33"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=24"" alt=""黑龙江"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""210,146,281,169,390,110,375,78"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=25"" alt=""内蒙古"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""306,172,304,236,281,241,285,191"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=26"" alt=""陕西"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""189,138,166,162,223,182,237,218,266,235,238,175"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=27"" alt=""甘肃"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""270,175,257,189,270,212,278,200,275,175"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=28"" alt=""宁夏"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""139,176,216,186,228,221,144,235"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=29"" alt=""青海"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""126,63,12,138,32,198,130,190,179,124"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=30"" alt=""新疆"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""40,206,116,204,133,239,188,254,186,275,76,271"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=31"" alt=""西藏"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""361,341,382,346,382,360,359,357,353,347"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=32"" alt=""香港"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""362,369,338,369,342,354,360,360"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=33"" alt=""澳门"">"&vbcrlf
str=str&"        <area shape=""poly"" coords=""421,303,426,310,421,338,411,322"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=34"" alt=""台湾"">"&vbcrlf
str=str&"      </map>"&vbcrlf
str=str&"    </div>"&vbcrlf
GetCNMap=str
End Function

Function GetWorldMap(ChannelID)
dim str,subdir
if Updir="../" then subdir=Updir&"english/"
str=str&"<div align=""center"" style=""margin-top: 30px;""> <img src="""&UpDir&"images/map_world.jpg"" border=""0"" usemap=""#node"">"&vbcrlf
str=str&"      <map name=""node"">"&vbcrlf
str=str&"          <area shape=""poly"" coords=""192,30,103,9,87,58,71,63,85,96,197,118"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=1"" alt=""Asia"">"&vbcrlf
str=str&"          <area shape=""poly"" coords=""32,28,19,60,59,61,81,55,93,18"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=2"" alt=""Europe"">"&vbcrlf
str=str&"          <area shape=""poly"" coords=""68,75,28,67,12,102,45,113,56,167,96,139,92,103"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=3"" alt=""Africa"">"&vbcrlf
str=str&"          <area shape=""poly"" coords=""209,124,226,163,191,182,162,158"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=4"" alt=""Oceania"">"&vbcrlf
str=str&"          <area shape=""poly"" coords=""281,26,311,88,344,99,421,12,333,11"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=5"" alt=""North America"">"&vbcrlf
str=str&"          <area shape=""poly"" coords=""351,104,391,126,364,174,361,198,333,120"" href="""&subdir&contentfile&"?ModuleType=8&ChannelID="&ChannelID&"&areaid=6"" alt=""South America"">"&vbcrlf
str=str&"      </map>"&vbcrlf
str=str&"    </div>"&vbcrlf
GetWorldMap=str
End Function
'==NODE end==

'==Links==
Function GetLinksList(ChannelID,Lang)

Dim rs,str,yuyan
set rs=server.CreateObject("adodb.recordset")
sql="select id,Lang,linktext,linkurl,linklogo from cnk_weblinks where lei=0 and ChannelID="&ChannelID&" and Lang="&Lang&" order by initime"
rs.open sql,conn,1,1
if rs.recordcount>0 then
	str=str&"<br />"
	do while not rs.eof
		str=str&"<div class=""linktextlist""><a href="""&rs("linkurl")&""" target=""_blank"">"&rs("linktext")&"</a></div>"&vbcrlf
	rs.movenext
	loop
	str=str&clearboth&vbcrlf
end if
rs.close

sql="select id,Lang,linktext,linkurl,linklogo from cnk_weblinks where lei=1 and ChannelID="&ChannelID&" and Lang="&Lang&" order by initime"
rs.open sql,conn,1,1
if rs.recordcount>0 then
	Dim logo
	str=str&"<br />"
	do while not rs.eof
		logo=GetImgURL(rs("linklogo"))
		str=str&"<div class=""linklogolist""><a href="""&rs("linkurl")&""" target=""_blank""><img src="""&logo&""" border=""0"" alt="""&rs("linktext")&"""></a></div>"&vbcrlf
	rs.movenext
	loop
	str=str&clearboth&vbcrlf
end if
rs.close
GetLinksList=str
End Function
'==Links end==

'==IM==
Function im(l)
dim str,en
if l=1 then en="_en"
Select Case isSelfFloatBoard
Case 1
str="<div id=""im_r"" class=""imright"">"&vbcrlf
str=str&"  <div class=""imtop""><a onclick=""im_r.style.visibility='hidden'"" style=""cursor:hand;"">×</a></div>"&vbcrlf
str=str&"  <div class=""imbody"">"&vbcrlf
str=str&GetCnkConfig("IMonline"&en)
str=str&"  </div>"&vbcrlf
str=str&"</div>"&vbcrlf
str=str&"<script language=""JavaScript"" type=""text/javascript"" src="""&updir&"common/imboard.js""></script>"&vbcrlf
Case 2
str=GetCnkConfig("IMonline"&en)
End Select
im=str
End Function
'==IM End==

'==Comment==
Function GetComment(ChannelID,PID,Record,Lang)
Dim rs,str,sqlstr,submit,verify,yuyan,commenter,dtime,readall,ipage,en
if Lang=0 then
submit="发表评论"
verify="验证字:"
commenter="评论者:"
dtime="于:"
readall="查看全部评论"
else
en="_en"
submit="Comment"
verify="Verify: "
commenter="Commenter: "
dtime="Date:"
readall="Read all Comment"
end if
str=str&"    <div class=""comment"">"&submit&""&vbcrlf
str=str&"      <form id=""formcmt"" name=""formcmt"" method=""post"" action="""&UpDir&"access.asp"" onsubmit=""return chkcmt()"">"&vbcrlf
str=str&"        <textarea name=""content"" cols=""60"" rows=""8"" class=""input""></textarea>"&vbcrlf
str=str&"        <br />"&vbcrlf
str=str&"		<input name=""ChannelID"" type=""hidden"" id=""ChannelID"" value="""& ChannelID &""" />"&vbcrlf
'str=str&"		<input name=""ModuleType"" type=""hidden"" id=""ModuleType"" value="""& ModuleType &""" />"&vbcrlf
str=str&"		<input name=""PID"" type=""hidden"" id=""PID"" value="""& PID &""" />"&vbcrlf
str=str&"		<input name=""accesstype"" type=""hidden"" value=""SaveComment"" />"&vbcrlf
str=str&"		<br />"&vbcrlf
str=str&"		"&verify&"<input name=""yzma"" type=""text"" class=""input"" id=""yzma"" size=""9"" maxlength=""50""> <img src="""&UpDir&"common/code"&en&".asp"">"&vbcrlf
str=str&"		<br />"&vbcrlf
str=str&"        <input name=""Submit"" type=""submit"" class=""button"" value="""&submit&""" />"&vbcrlf
str=str&"		<br />"&vbcrlf
str=str&"      </form>"&vbcrlf
str=str&"    </div>"&vbcrlf

set rs=server.CreateObject("adodb.recordset")
if Record>0 then
	str=str&"    <div align=""right""><a href=""?ChannelID="&ChannelID&"&id="&PID&"&ModuleType=100"" target=""_blank"">"&readall&"</a></div>"&vbcrlf
	sqlstr="select top "&Record&" * from cnk_comment where ispass=1"
	if ChannelID>0 then sqlstr=sqlstr&" and ChannelID="&ChannelID
	if PID>0 then sqlstr=sqlstr&" and PID="&PID
	sqlstr=sqlstr&" order by initime desc"
	rs.open sqlstr,conn,1,1
	do while not rs.eof
	str=str&"	<div class=""commentbox"">"&vbcrlf
	str=str&"	  <div class=""boxtitle"">"&commenter&rs("person")&" &nbsp; "&dtime&zhuan_time(rs("initime"))&" &nbsp; IP: "&PartIP(rs("ip"))&"</div>"&vbcrlf
	str=str&"	  <div class=""content"">"&cnkUBBContent(rs("content"))&"</div>"&vbcrlf
	str=str&"	</div>"&vbcrlf
	rs.movenext
	loop
else
	
	thispage=request("page_code")
	if thispage="" then
		thispage=1
	else
		thispage=clng(thispage)
	end if
	if thispage<1 then thispage=1
	PagePara="?ModuleType=100&ChannelID="&ChannelID&"&id="&PID
	sqlstr="select * from cnk_comment where ispass=1"
	if ChannelID>0 then sqlstr=sqlstr&" and ChannelID="&ChannelID
	if PID>0 then sqlstr=sqlstr&" and PID="&PID
	sqlstr=sqlstr&" order by initime desc"
	rs.open sqlstr,conn,1,1
	if rs.recordcount>0 then
	rs.pagesize=30
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage
	for ipage=1 to rs.pagesize
	str=str&"	<div class=""commentbox"">"&vbcrlf
	str=str&"	  <div class=""boxtitle"">"&commenter&rs("person")&" &nbsp; "&dtime&zhuan_time(rs("initime"))&" &nbsp; IP: "&PartIP(rs("ip"))&"</div>"&vbcrlf
	str=str&"	  <div class=""content"">"&cnkUBBContent(rs("content"))&"</div>"&vbcrlf
	str=str&"	</div>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	str=str&clearboth&vbcrlf
	str=str&"<div id=""showpagebottom"">"&vbcrlf
	str=str&"<div class=""pageleft"">"&vbcrlf
	str=str&GetPageList(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""pageright"">"&vbcrlf
	'str=str&"<strong>"&rs.recordcount&"</strong> "&GetDanwei(ChannelID,0)&" &nbsp; "
	'str=str&GetPage(rs.pagecount,thispage,PagePara,0)
	str=str&"</div>"&vbcrlf
	str=str&clearboth&vbcrlf
	str=str&"</div>"&vbcrlf
	end if
end if
rs.close
GetComment=str
End Function

'==Comment End==

'==userinfo==
Function GetWebLevel(uname)
Dim rscon
set rscon=conn.execute("select weblevel from cnk_users where username='"&username&"'")
GetWebLevel=rscon(0)
End Function

Function GetUserItem(uname,theitem)
Dim rscon
set rscon=conn.execute("select "&theitem&" from cnk_users where username='"&uname&"'")
GetUserItem=rscon(0)
End Function

Function GetWebLevelName(n)
Select Case n
Case 0 GetWebLevelName="普通会员"
Case 1 GetWebLevelName="VIP会员"
Case 2 GetWebLevelName="代理商"
Case 3 GetWebLevelName="高级代理"
End Select
End Function

Function GetWebLevelName_en(n)
Select Case n
Case 0 GetWebLevelName_en="Common user"
Case 1 GetWebLevelName_en="VIP user"
Case 2 GetWebLevelName_en="Agent"
Case 3 GetWebLevelName_en="VIP Agent"
End Select
End Function

Function GetOrderNum(uname)
Dim rscon
set rscon=conn.execute("select count(*) from cnk_orderform where userid="&userid)
GetOrderNum=rscon(0)
set rscon=nothing
End Function

Function GetMyOrderList(uid,Lang,action,subtitle)
thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1
PagePara="users.asp?action="&action&"&subtitle="&subtitle

Dim rs,str,ipage,danwei,thesubtitle,zhtai
set rs=server.CreateObject("adodb.recordset")
sql="select * from cnk_orderform where userid="&uid&" order by initime desc"
rs.open sql,conn,1,1
if rs.recordcount=0 then
	Response.Write "nothing"
else
	rs.pagesize=20
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage
		str=str&"	<div class=""cnktable"">"&vbcrlf
		str=str&"	<table border=""0"" align=""center"" cellpadding=""2"" cellspacing=""1"">"&vbcrlf
		if Lang=0 then 
        str=str&"    <tr class=""tabletitle"">"&vbcrlf
        str=str&"      <td width=""20%"">订单日期</td>"&vbcrlf
        str=str&"      <td width=""25%"">订单号</td>"&vbcrlf
		str=str&"      <td width=""12%"">总金额</td>"&vbcrlf
        str=str&"      <td width=""28%"">订单状态</td>"&vbcrlf
        str=str&"      <td width=""15%"">删除</td>"&vbcrlf
        str=str&"    </tr>"&vbcrlf
		danwei="个订单"
		thesubtitle="订单明细"
		else
		str=str&"    <tr class=""tabletitle"">"&vbcrlf
        str=str&"      <td width=""20%"">Date</td>"&vbcrlf
        str=str&"      <td width=""25%"">Order Number</td>"&vbcrlf
		str=str&"      <td width=""12%"">TotalPrice</td>"&vbcrlf
        str=str&"      <td width=""28%"">Order State</td>"&vbcrlf
        str=str&"      <td width=""15%"">Delete</td>"&vbcrlf
        str=str&"    </tr>"&vbcrlf
		danwei="Orders"
		thesubtitle="Detail order"
		end if
    	for ipage=1 to rs.pagesize
        if Lang=0 then zhtai=OrderStateName(rs("zhuangtai")) else zhtai=OrderStateName_en(rs("zhuangtai"))
		str=str&"    <tr>"&vbcrlf
        str=str&"      <td align=""left"">"&zhuan_time(rs("initime"))&"</td>"&vbcrlf
        str=str&"      <td align=""center""><a href=""?orderid="&rs("orderid")&"&action=myorderdetail&subtitle="&thesubtitle&""">"&rs("orderid")&"</a></td>"&vbcrlf
		str=str&"      <td align=""center"">"&rs("alltotalprice")&"</td>"&vbcrlf
        str=str&"      <td align=""center""><a href=""?orderid="&rs("orderid")&"&action=myorderdetail&subtitle="&thesubtitle&""">"&zhtai&"</a></td>"&vbcrlf
		if rs("zhuangtai")=0 then
        str=str&"      <td align=""center""><a href=""?delorderid="&rs("orderid")&"&action="&action&"&subtitle="&subtitle&""" onclick=""return cfdel();""><img src="""&UpDir&"images/del.gif"" border=""0"" /></a></td>"&vbcrlf
		else
		str=str&"      <td align=""center""><img src="""&UpDir&"images/del1.gif"" border=""0"" /></td>"&vbcrlf
		end if
        str=str&"    </tr>"&vbcrlf
    rs.movenext
	if rs.eof then exit for
	next
    str=str&"</table>"&vbcrlf
	'str=str&clearboth&vbcrlf
	str=str&"<div id=""showpagebottom"">"&vbcrlf
	str=str&"<div class=""pageleft"">"&vbcrlf
	str=str&GetPageList(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""pageright"">"&vbcrlf
	str=str&"<strong>"&rs.recordcount&"</strong> "&danwei&" &nbsp; "
	str=str&GetPage(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
end if
rs.close
GetMyOrderList=str
End Function

Function GetFavorite(uname,action,Lang)

thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1
PagePara="users.asp?action="&action

Dim rs,str,ipage,del,dw
if Lang=0 then
	del="删除"
	dw="条"
else
	del="Delete"
	dw="Record(s)"
end if

set rs=server.CreateObject("adodb.recordset")
rs.open "select id,title,url from Cnk_webFavorite where username='"&uname&"' order by id desc",conn,1,1
if rs.recordcount>0 then
	str=str&"<div class=""titlelist"">"&vbcrlf
	str=str&"<ul>"&vbcrlf
	rs.pagesize=30
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage
	for ipage=1 to rs.pagesize
		str=str&"<li><a href="""&rs("url")&""" target=""_blank"">"&rs("title")&"</a>  [<a href=""?delid="&rs("id")&"&action="&action&""">"&del&"</a>]</li>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	str=str&"</ul>"
	str=str&"</div>"
	str=str&"<div id=""showpagebottom"">"&vbcrlf
	str=str&"<div class=""pageleft"">"&vbcrlf
	str=str&GetPageList(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""pageright"">"&vbcrlf
	str=str&"<strong>"&rs.recordcount&"</strong> "&dw&" &nbsp; "
	str=str&GetPage(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
end if
rs.close
GetFavorite=str
End Function

Sub delfavorite(delid)
conn.execute("delete from Cnk_webFavorite where username='"&username&"' and id="&delid)
End Sub
'==userinfo End==

'==order==
Function OrderStateName(n)
Select Case n
Case 0 OrderStateName="已下订单,等待买家付款"
Case 1 OrderStateName="买家已经付款,等待卖家发货"
Case 2 OrderStateName="卖家已经发货,等待买家确认"
Case 3 OrderStateName="买家确认收到货,交易完成"
End Select
End Function

Function OrderStateName_en(n)
Select Case n
Case 0 OrderStateName_en="waiting for pay"
Case 1 OrderStateName_en="Buyer has pay,waiting for consignment"
Case 2 OrderStateName_en="Saler has consignment, waiting for buyer confirm"
Case 3 OrderStateName_en="Buyer has Received, trade completed"
End Select
End Function

'==order End==

'==Vote==
Function GetNewVote(Lang)
	dim sqlVote,rsVote,i,str,submit,result,en
	if Lang=0 then
		submit="提交"
		result="投票结果"
	else
		submit="Submit"
		result="Vote Result"
		en="_en"
	end if
	str=""
	sqlVote="select top 1 * from Cnk_vote where IsSelected=1 and Lang="&Lang
	Set rsVote=Server.CreateObject("ADODB.Recordset")
	rsVote.open sqlVote,conn,1,1
	if rsVote.bof and rsVote.eof then 
		'response.Write "无调查投票(no vote)"
	else
		str=str&"<form name=""VoteForm"" method=""post""  action="""&contentfile&""" target=""_blank"">"&vbcrlf
		str=str&"<strong>"& rsVote("Title") & "</strong><br>"&vbcrlf
		if rsVote("VoteType")="Single" then
			for i=1 to 8
				if trim(rsVote("Select" & i) & "")="" then exit for
				str=str&"<input type=""radio"" name=""VoteOption"" id=""VoteOption"&i&""" value=""" & i & """ /><label for=""VoteOption"&i&""">" & rsVote("Select" & i) & "</label><br>"&vbcrlf
			next
		else
			for i=1 to 8
				if trim(rsVote("Select" & i) & "")="" then exit for
				str=str& "<input type=""checkbox"" name=""VoteOption"" id=""VoteOption"&i&""" value=""" & i & """ /><label for=""VoteOption"&i&""">" & rsVote("Select" & i) & "</label><br>"&vbcrlf
			next
		end if
		str=str& "<br><input name=""VoteType"" type=""hidden""value="""&rsVote("VoteType")&""" />"&vbcrlf
		str=str& "<input name=""Action"" type=""hidden"" value=""AddVote"" />"&vbcrlf
		str=str& "<input name=""id"" type=""hidden"" value="""&rsVote("ID")&""" />"&vbcrlf
		str=str& "<input name=""ChannelID"" type=""hidden"" value="""&rsVote("ChannelID")&""" />"&vbcrlf
		If isImgButton=0 Then
		str=str& "<input type=""submit"" name=""submit"" value="""&submit&""" class=""button"" />&nbsp;&nbsp;"&vbcrlf
		Else
		str=str& "<input type=""image"" name=""imageField"" src="""&UpDir&"images/button_submit"&en&".gif"" />"
		End If
        str=str& "【<a href="""&contentfile&"?ModuleType=10&ChannelID="&rsVote("ChannelID")&"&id="&rsVote("ID")&""">"&result&"</a>】"&vbcrlf
		str=str& "</form>"&vbcrlf
	end if
	rsVote.close
	set rsVote=nothing
	GetNewVote=str
end Function

Function GetVoteChannel(ChannelID,Lang)
	dim rsnv,j,vstr
	vstr=""
	Set rsnv=Server.CreateObject("ADODB.Recordset")
	rsnv.open "select top 1 ID from Cnk_vote where ChannelID="&ChannelID&" and Lang="&Lang&" order by VoteTime DESC",conn,1,1
	if rsnv.recordcount=0 then 
		'vstr=vstr&"nothing"
	else
		vstr=GetVoteResult(rsnv(0),Lang)
	end if
	rsnv.close
	set rsnv=nothing
GetVoteChannel=vstr
End Function

Function GetVoteList(ChannelID,Lang)
thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1
PagePara="?ModuleType=10&ChannelID="&ChannelID
	dim sqlVote,rsVote,ipage,str,vt
	if Lang=0 then
		vt="投票列表"
	else
		vt="Vote List"
	end if
	str=""
	sqlVote="select id,title from Cnk_vote where ChannelID="&ChannelID&" and Lang="&Lang&" order by VoteTime DESC"
	Set rsVote=Server.CreateObject("ADODB.Recordset")
	rsVote.open sqlVote,conn,1,1
	if rsVote.bof and rsVote.eof then 
		'response.Write "无调查投票(no vote)"
	else
		str=str&"<div class=""cnkbox"">"&vbcrlf
		str=str&"<div class=""boxtitle"">"& vt & "</div>"&vbcrlf
		str=str&"<div class=""content"">"&vbcrlf
		str=str&"<div class=""titlelist"">"&vbcrlf
		str=str&"<ul>"&vbcrlf
		rsVote.pagesize=GetChannelPageSize(ChannelID)
		if thispage>rsVote.pagecount then thispage=rsVote.pagecount
		rsVote.AbsolutePage = thispage
		for ipage=1 to rsVote.pagesize
		str=str&"<li><a href="""&contentfile&"?ModuleType=10&ChannelID="&ChannelID&"&id="&rsVote("id")&""" target=""_blank"">"&rsVote("title")&"</a></li>"&vbcrlf
		rsVote.movenext
		if rsVote.eof then exit for
		next
		str=str&"</ul>"
		str=str&"</div>"
		str=str&clearboth
		str=str&"<div id=""showpagebottom"">"&vbcrlf
		str=str&"<div class=""pageleft"">"&vbcrlf
		str=str&GetPageList(rsVote.pagecount,thispage,PagePara,Lang)
		str=str&"</div>"&vbcrlf
		str=str&"<div class=""pageright"">"&vbcrlf
		str=str&"<strong>"&rsVote.recordcount&"</strong> "&GetDanwei(ChannelID,Lang)&" &nbsp; "
		str=str&GetPage(rsVote.pagecount,thispage,PagePara,Lang)
		str=str&"</div>"&vbcrlf
		str=str&"</div>"&vbcrlf
		str=str& "</div>"&vbcrlf
		str=str& "</div>"&vbcrlf
	end if
	rsVote.close
	set rsVote=nothing
GetVoteList=str
End Function


Function GetVote(ID,Lang)
	dim sqlVote,rsVote,i,str,submit,result,en
	if Lang=0 then
		submit="提交"
		result="投票结果"
	else
		submit="Submit"
		result="Vote Result"
		en="_en"
	end if
	str=""
	sqlVote="select top 1 * from Cnk_vote where ID="&ID
	Set rsVote=Server.CreateObject("ADODB.Recordset")
	rsVote.open sqlVote,conn,1,1
	if rsVote.bof and rsVote.eof then 
		'response.Write "无调查投票(no vote)"
	else
		str=str&"<div class=""cnkbox"">"&vbcrlf
		str=str&"<div class=""boxtitle"">"& rsVote("Title") & "</div>"&vbcrlf
		str=str&"<div class=""content"">"&vbcrlf
		str=str&"<form name=""VoteForm"" method=""post""  action="""&contentfile&""" target=""_blank"">"&vbcrlf
		if rsVote("VoteType")="Single" then
			for i=1 to 8
				if trim(rsVote("Select" & i) & "")="" then exit for
				str=str&"<input type=""radio"" name=""VoteOption"" id=""VoteOption"&i&""" value=""" & i & """ /><label for=""VoteOption"&i&""">" & rsVote("Select" & i) & "</label><br />"&vbcrlf
			next
		else
			for i=1 to 8
				if trim(rsVote("Select" & i) & "")="" then exit for
				str=str& "<input type=""checkbox"" name=""VoteOption"" id=""VoteOption"&i&""" value=""" & i & """ /><label for=""VoteOption"&i&""">" & rsVote("Select" & i) & "</label><br />"&vbcrlf
			next
		end if
		str=str& "<br><input name=""VoteType"" type=""hidden""value="""&rsVote("VoteType")&""" />"&vbcrlf
		str=str& "<input name=""Action"" type=""hidden"" value=""AddVote"" />"&vbcrlf
		str=str& "<input name=""id"" type=""hidden"" value="""&rsVote("ID")&""" />"&vbcrlf
		str=str& "<input name=""ChannelID"" type=""hidden"" value="""&rsVote("ChannelID")&""" />"&vbcrlf
		str=str& "<input name=""ModuleType"" type=""hidden"" value=""10"" />"&vbcrlf
		If isImgButton=0 Then
		str=str& "<input type=""submit"" name=""submit"" value="""&submit&""" class=""button"" />&nbsp;&nbsp;"&vbcrlf
		Else
		str=str& "<input type=""image"" name=""imageField"" src="""&UpDir&"images/button_submit"&en&".gif"" />"
		End If
        str=str& "【<a href="""&contentfile&"?ModuleType=10&ChannelID="&rsVote("ChannelID")&"&voteid="&rsVote("ID")&""">"&result&"</a>】"&vbcrlf
		str=str& "</form>"&vbcrlf
		str=str& "</div>"&vbcrlf
		str=str& "</div>"&vbcrlf
	end if
	rsVote.close
	set rsVote=nothing
GetVote=str
End Function

Function GetVoteResult(id,Lang)
	dim sqlVote,rsVote,i,str
	dim vrsult,vtotal,vvote
	if Lang=0 then
	vrsult="调查结果 "
	vtotal="总投票数:"
	vvote="票"
	else
	vrsult="Vote Result "
	vtotal="All Vote:"
	vvote=""
	end if
	sqlVote="select * from Cnk_vote where ID="&id
	Set rsVote= Server.CreateObject("ADODB.Recordset")
	rsVote.open sqlVote,conn,1,1
		str=str&"<div class=""cnkbox"">"&vbcrlf
		str=str&"<div class=""boxtitle"">"& rsVote("Title")
		str=str&vrsult&vbcrlf
		str=str&"</div>"&vbcrlf
		str=str&"<div class=""content"">"&vbcrlf
		str=str&vtotal&vbcrlf
		dim totalVote
		totalVote=0
		for i=1 to 8
			if rsVote("Select" & i)="" then exit for
			totalVote=totalVote+rsVote("answer"& i)
		next
		str=str&totalVote
		str=str&vvote&vbcrlf
		if totalVote=0 then totalVote=1
		str=str&"<table width=""100%"" border=""0"">"&vbcrlf
		for i=1 to 8
			if trim(rsVote("Select" & i) & "")="" then exit for
			str=str&"<tr><td>"&rsVote("Select"& i)&"</td><td>"&vbcrlf
			dim perVote
			perVote=round(rsVote("answer"& i)/totalVote,4)
			str=str&"<img src="""&UpDir&"images/vote"&i&".gif"" width="""&round(360*perVote)&""" height=""15"" align=""absmiddle"">"&vbcrlf
			perVote=perVote*100
			if perVote<1 and perVote<>0 then
				str=str&"&nbsp;0" & perVote & "%"&vbcrlf
			else
				str=str&"&nbsp;" & perVote & "%"&vbcrlf
			end if
			str=str&rsVote("answer"& i)&vbcrlf
			str=str&vvote&vbcrlf
	 		str=str&"</td></tr>"&vbcrlf
    	next
		str=str& "</table>"&vbcrlf
		str=str& "</div>"&vbcrlf
		str=str& "</div>"&vbcrlf
	rsVote.close
	set rsVote=nothing
GetVoteResult=str
End Function
'==Vote End==

'==Search==
Sub Search(ModuleType,keywords,Lang)

thispage=request("page_code")
if thispage="" then
	thispage=1
else
	thispage=clng(thispage)
end if
if thispage<1 then thispage=1
PagePara="?ModuleType="&ModuleType&"&keywords="&keywords

Dim rs,str,ipage,sqlstr,noinfo,en,chid

if lang=0 then
	noinfo="抱歉,没有搜索到相关产品"
else
	noinfo="Sorry, no product"
	en="_en"
end if
set rs=server.CreateObject("adodb.recordset")
Select Case ModuleType
Case 2
	sqlstr="select id,ChannelID,title,initime from cnk_Article where Lang="&Lang&" and title like '%"&keywords&"%'"
	'if ChannelID>0 then sqlstr=sqlstr&" and ChannelID="&ChannelID
	sqlstr=sqlstr&" order by initime desc"
Case 3
	sqlstr="select id,classid,product_name"&en&",product_number from cnk_Products where stopflag=0  and (product_number like '%"&keywords&"%' or product_name"&en&" like '%"&keywords&"%') order by updatetime desc"' or content"&en&" like '%"&keywords&"%'
Case 4'Image
	sqlstr="select id,ChannelID,title"&en&",content"&en&" from cnk_images where title"&en&" like '%"&keywords&"%' order by paixu"
Case 5
	sqlstr="select id,ChannelID,title,filetype from cnk_download where Lang="&Lang&" and title like '%"&keywords&"%' order by initime desc"
End Select


str=""
rs.open sqlstr,conn,1,1
if rs.recordcount=0 then
	str=str&noinfo&vbcrlf
else
	rs.pagesize=20
	if thispage>rs.pagecount then thispage=rs.pagecount
	rs.AbsolutePage = thispage

	str=str&"	<div class=""prolistcase1"">"&vbcrlf
	str=str&"        <ul>"&vbcrlf
	for ipage=1 to rs.pagesize
	chid=rs(1)
	if ModuleType=3 then chid=3
	str=str&"         <li><a href="""&contentfile&"?ModuleType="&ModuleType&"&ChannelID="&chid&"&id="&rs(0)&""" target=""_blank"">"&rs(2)&"</a>  ["&rs(3)&"]</li>"&vbcrlf
	rs.movenext
	if rs.eof then exit for
	next
	str=str&"        </ul>"&vbcrlf
	str=str&"    </div>"&vbcrlf
	
	str=str&"<div class=""clearboth""></div>"&vbcrlf
	str=str&"<div id=""showpagebottom"">"&vbcrlf
	str=str&"<div class=""pageleft"">"&vbcrlf
	str=str&GetPageList(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"<div class=""pageright"">"&vbcrlf
	if Lang=0 then
	str=str&"共<strong>"&rs.recordcount&"</strong> 个产品 &nbsp; "
	else
	str=str&"Total <strong>"&rs.recordcount&"</strong> Product(s) &nbsp; "
	end if
	str=str&GetPage(rs.pagecount,thispage,PagePara,Lang)
	str=str&"</div>"&vbcrlf
	str=str&"</div>"&vbcrlf
end if
rs.close
Response.Write(str)
End Sub
'==End==

'==BBS==
'检查升级别
Sub userjibie(uname)
Dim rs1,rs2,fenshu
set rs1=server.createobject("adodb.recordset")
rs1.open "select Jifen,userlevel from cnk_users where username='"&uname&"'",conn,1,1
if rs1.recordcount>0 then
if rs1("userlevel")<1 then
	fenshu=rs1("Jifen")
	if fenshu<0 then
		conn.execute("update cnk_users set jibie='无' where username='"&uname&"'") '修改论坛级别
	else
		set rs2=server.createobject("adodb.recordset")
		rs2.open "select LevelName,LevelImage from cnk_jibie where "&fenshu&">=fen1 and "&fenshu&"<=fen2",conn,1,3
		if rs2.recordcount=1 then
			conn.execute("update cnk_users set jibie='"&rs2("LevelName")&"',JibieImg='"&rs2("LevelImage")&"' where username='"&uname&"'") '修改级别
			Response.Cookies(cookies_name)("LevelName")=rs2("LevelName")
		end if
		rs2.close
		set rs2=nothing 
	end if
else
	set rs2=server.createobject("adodb.recordset")
	rs2.open "select LevelName,LevelImage from cnk_jibie where userlevel="&rs1("userlevel"),conn,1,3
	conn.execute("update cnk_users set jibie='"&rs2("LevelName")&"',JibieImg='"&rs2("LevelImage")&"' where username='"&uname&"'")
end if
end if
rs1.close
End Sub

'==BBS End==

'==Common Code==
Function ShowMore(ModuleType,ChannelID,Lang)
ShowMore="<div align=""right"" style=""padding:5px""><a href="""&contentfile&"?ModuleType="&ModuleType&"&ChannelID="&ChannelID&"""><img src="""&UpDir&"skin/cnk/more"&Lang&".gif"" border=""0"" /></a></div>"
End Function
'==Common Code End==

'==CONFIG==
Function GetBanner(cid,l)'栏目Banner
Dim str,en
If cid=0 Then
 if l=0 then
   str=Banner
 else
   str=Banner_en
 end if
Else
 if l=1 then en="_en"
 str=GetChannelContent(cid,"ChannelBanner"&en)
 if str="" or isNull(str) then
  if l=0 then
   str=Banner
  else
   str=Banner_en
  end if
 end if
End If
GetBanner=str
End Function

Function GetBannerFlash(cid,l)'栏目Flash Banner
Dim str,en
If cid=0 Then
 if l=0 then
   str=BannerFlash
 else
   str=BannerFlash_en
 end if
Else
 if l=1 then en="_en"
 str=GetChannelContent(cid,"ChannelBannerFlash"&en)
 if str="" or isNull(str) then
  if l=0 then
   str=BannerFlash
  else
   str=BannerFlash_en
  end if
 end if
End If
GetBannerFlash=str
End Function

dmn07=asctostr("46,105,110,102,111")
dmn08=asctostr("46,109,111,98,105")
dmn09=asctostr("46,99,99")
 '下一篇
Function ProvNext(ChannelID,id,isnext,Lang)
'channelid,0:prov 1:next,Lang
Dim rspn,str,sqlstr,en,module,theprov,thenext,isprov
if isnext=0 then isprov="<" else isprov=">"
if Lang=1 then en="_en"
module=GetChannelContent(ChannelID,"ModuleType")
set rspn=server.CreateObject("adodb.recordset")
select case module 
case 2 sqlstr="select top 1 id,title from cnk_Article where id"&isprov&id&" and Lang="&Lang&" and ChannelID="&ChannelID&" order by id"
case 3 sqlstr="select top 1 id,product_name"&en&" from cnk_Products where id"&isprov&id&" order by id"
case 4 sqlstr="select top 1 id,title"&en&" from cnk_images where id"&isprov&id&" and ChannelID="&ChannelID&" order by id"
end select
rspn.open sqlstr,conn,1,1
if not rspn.eof then
str="<a href="""&contentfile&"?ModuleType="&module&"&ChannelID="&ChannelID&"&id="&rspn(0)&""">"&rspn(1)&"</a>"
end if
set rspn=nothing
ProvNext=str
End Function
dmn10=asctostr("46,98,105,122")
dmn11=asctostr("46,116,119")
dmn12=asctostr("46,104,107")
Function GetChannelContent(cid,zd)
Dim rscon
set rscon=conn.execute("select "&zd&" from cnk_Channel where ChannelID="&cid)
GetChannelContent=rscon(0)
set rscon=nothing
End Function
dmn04=asctostr("46,111,114,103")
dmn13=asctostr("46,103,111,118")
dmn05=asctostr("46,101,100,117")
dmn06=asctostr("46,116,118")
Function GetChannelPageSize(cid)
if cid="" or cid=0 then
	GetChannelPageSize=20
else
	Dim rs
	set rs=conn.execute("select PerPageSize from cnk_Channel where ChannelID="&cid)
	GetChannelPageSize=rs(0)
	set rs=nothing
end if
End Function
dmn01=asctostr("46,99,110")
Function GetDanwei(cid,l)
if cid="" or cid=0 then
	GetDanwei=""
else
Dim rs
set rs=conn.execute("select ChannelItemName,ChannelItemName_en,ChannelItemUnit from cnk_Channel where ChannelID="&cid)
if l=0 then GetDanwei=rs(2)&rs(0)
if l=1 then GetDanwei=rs(1)
set rs=nothing
end if
End Function
dmn02=asctostr("46,99,111,109")

Function isDispBlock(ChannelID,n) 
if ChannelID=0 then
 isDispBlock=1
else
Dim qx,theitem,rlist,qxlist
set qx=conn.execute("select LeftDispBlock from cnk_Channel where ChannelID="&ChannelID)
rlist=qx(0)
if isnull(rlist) or rlist="" then
	isDispBlock=0
else
	qxlist=Split(rlist, ",")
	for each theitem in qxlist
		if cint(theitem)=n then
			isDispBlock=1
			exit for
		end if
	next
end if
set qx=nothing
end if
End Function

dmn03=asctostr("46,110,101,116")
Sub UserChannelRight(uname,cid,lang)
Dim rs,tsmsg
if lang=0 then tsmsg="对不起,您没有权限浏览" else tsmsg="Sorry,you can not browse this page"
set rs=conn.execute("select ChannelRight from cnk_Channel where ChannelID="&cid)
if rs(0)>0 then
if uname="" then Call alertmsg(tsmsg)
if rs(0)=2 and GetWebLevel(uname)<1 then Call alertmsg_url(tsmsg,"users.asp")
end if
End Sub
Sub UserPageRight(u,r,lang)
 Dim rs,tsmsg
if lang=0 then tsmsg="对不起,您没有权限浏览" else tsmsg="Sorry,you can not browse this page"
if r>0 then
	if u="" then Call alertmsg(tsmsg)
	if r=2 and GetWebLevel(u)<1 then Call alertmsg_url(tsmsg,"users.asp")
end if
End Sub
function GetUserPubRight(uname,cid)
Dim rs,tsmsg,flag
flag=0
set rs=conn.execute("select isUserPub from cnk_Channel where ChannelID="&cid)
select case rs(0)
case 0 flag=0
case 1 flag=1
case 2
	if uname="" then
		flag=0
	else
		if GetWebLevel(uname)<1 then flag=1
	end if
case 3
	if uname="" then
		flag=0
	else
		if GetWebLevel(uname)<2 then flag=1
	end if
end select
GetUserPubRight=flag
End function

Function GetImgURL(image)
if instr(image,"http://")>0 then GetImgURL=image else GetImgURL=UpDir&"upfiles/"&image
End Function
'==CONFIGend==

'==SYSTEM COMMON==
Sub msg(Str)
Response.Write("<script>alert('"&Str&"');</script>")
End Sub

Sub alertmsg(Str)
Response.Write("<script>alert('"&Str&"');history.go(-1);</script>")
Response.End()
End Sub

Sub alertmsgc(Str)
Response.Write("<script>alert('"&Str&"');window.close();</script>")
Response.End()
End Sub

Sub alertmsg_url(msg,url)
Response.Write("<script>alert('"&msg&"');window.location.href='"&url&"';</script>")
Response.End()
End Sub

Sub alertmsg_url_top(msg,url)
Response.Write("<script>alert('"&msg&"');top.location.href='"&url&"';</script>")
Response.End()
End Sub

Sub IsNum(id)
if Not IsNumeric(id) then
	alertmsg("非法的参数!")
	Response.End()
end if
End Sub

Function GetRealIP() 
Dim userip
userip = request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip = "" Then userip = request.ServerVariables("REMOTE_ADDR")
GetRealIP=userip
End Function

Function PartIP(ip)
dim oip  
oip=split(ip,".")   
PartIP=oip(0)&"."&oip(1)&"."&oip(2)&".***"   
End Function

'===格式:2007-08-02 08:36
Function zhuan_time(shijian)
Dim s_year,s_month,s_day,s_hour,s_minute
'shijian=DateAdd("h",ServerTimeDiff,shijian) '时差
s_year=year(shijian)
if len(s_year)=2 then s_year="20"&s_year
s_month=month(shijian)
if s_month<10 then s_month="0"&s_month
s_day=day(shijian)
if s_day<10 then s_day="0"&s_day
s_hour=hour(shijian)
if s_hour<10 then s_hour="0"&s_hour
s_minute=minute(shijian)
if s_minute<10 then s_minute="0"&s_minute
zhuan_time=s_year &"-"& s_month &"-"& s_day &"&nbsp;"& s_hour &":"& s_minute
End Function

'===格式:2007-08-02
Function zhuan_date(shijian)
Dim s_year,s_month,s_day
'shijian=DateAdd("h",ServerTimeDiff,shijian) 
s_year=year(shijian)
if len(s_year)=2 then s_year="20"&s_year
s_month=month(shijian)
if s_month<10 then s_month="0"&s_month
s_day=day(shijian)
if s_day<10 then s_day="0"&s_day
zhuan_date=s_year &"-"& s_month &"-"& s_day
End Function 

'===格式:200708
Function zhuan_month(shijian)
Dim s_year,s_month
'shijian=DateAdd("h",ServerTimeDiff,shijian) 
s_year=year(shijian)
if len(s_year)=2 then s_year="20"&s_year
s_month=month(shijian)
if s_month<10 then s_month="0"&s_month
zhuan_date=s_year & s_month
End Function 

'===格式:20070801
Function zhuan_day(shijian)
Dim s_year,s_month,s_day
'shijian=DateAdd("h",ServerTimeDiff,shijian) 
s_year=year(shijian)
if len(s_year)=2 then s_year="20"&s_year
s_month=month(shijian)
if s_month<10 then s_month="0"&s_month
s_day=month(shijian)
if s_day<10 then s_day="0"&s_day
zhuan_day=s_year & s_month & s_day
End Function 

'***翻页
Function GetPage(pcount,thispage,PagePara,Lang)
Dim str,di,ye,dyy,syy,xyy,zhy
if Lang =0 then 
	di="第"
	ye="页"
	dyy="第一页"
	syy="上一页"
	xyy="下一页"
	zhy="最后页"
else
	di=""
	ye="page"
	dyy="First"
	syy="Previous"
	xyy="Next"
	zhy="Last"
end if
str=di&thispage&"/"&pcount&ye
if thispage<>1 then 
	str=str&"<a href="&PagePara&"&page_code=1>"&dyy&"</a> "
	str=str&"<a href="&PagePara&"&page_code="&(thispage-1)&">"&syy&"</a> "
end if
if thispage<>pcount then 
	str=str&" <a href="&PagePara&"&page_code="&(thispage+1)&">"&xyy&"</a>"
	str=str&" <a href="&PagePara&"&page_code="&pcount&">"&zhy&"</a>"
end if
GetPage=str
End Function


'***显示页列表
Function GetPageList(pcount,thispage,link,Lang)
Dim str,di,ye,j,startpage,endpage
if Lang =0 then 
	di="第"
	ye="页"
else
	di=""
	ye="page"
end if
str=""
if pcount<=10 then 
	str=str&di&" "
	for j=1 to pcount
		if thispage=j then
			str=str&"<span style=""color:#0000FF""><strong>"&j&"</strong></span> "
		else
			str=str&"<a href="&link&"&page_code="&j&">"&j&"</a> "
		end if
	next
	str=str&ye
else
	if thispage<=8 then
		str=str&di&" "
		for j=1 to 10
			if thispage=j then
				str=str&"<span style=""color:#0000FF""><strong>"&j&"</strong></span> "
			else
				str=str&"<a href="&link&"&page_code="&j&">"&j&"</a> "
			end if
		next
		str=str&"..."&ye
	end if
	if thispage>=9 then
		str=str&di&"..."
		startpage=thispage-5
		if startpage<1  then startpage=1
		endpage=thispage+5
		if endpage>pcount then endpage=pcount
		for j=startpage to endpage
			if thispage=j then
				str=str&"<span style=""color:#0000FF""><strong>"&j&"</strong></span> "
			else
				str=str&"<a href="&link&"&page_code="&j&">"&j&"</a> "
			end if
		next
		if j<=pcount then
		str=str&"..."&ye
	else
		str=str&ye
	end if
end if
end if
GetPageList=str
End Function

'***内容分页
Function contentpage(url,content,Lang)
if content="" or isnull(content) or  instr(content,"|||")=0 then
contentpage=content
else
dim syy,xyy
if Lang =0 then 
	syy="上一页"
	xyy="下一页"
else
	syy="Previous"
	xyy="Next"
end if
Dim cpage,pageNum,thisContent,ContentStr,ipage,pcode,thestr
cpage=Request("page")
If cpage="" Then
	pageNum=0
Else
	pageNum=cint(cpage)
End if
thisContent=Replace(content,"|||"," ||| ")
ContentStr=split(thisContent,"|||")
thestr=thestr&ContentStr(pageNum)
thestr=thestr&"<div class=""endPageNum""><table align=""center""><tr><td>"&vbcrlf
if pageNum>0 then thestr=thestr&" <a href="""&url&"&page="&pageNum-1&""" target=""_self"" class=""s1"">"&syy&"</a>"&vbcrlf
For pcode = 0 to ubound(ContentStr)
	if pcode=pageNum then
	thestr=thestr&" <a href=""javascript:void(0);"" class=""s2"">"&pcode+1&"</a>"&vbcrlf
	else
	thestr=thestr&" <a href="""&url&"&page="&pcode&""" target=""_self"">"&pcode+1&"</a>"&vbcrlf
	end if
Next
if pageNum<ubound(ContentStr) then thestr=thestr&" <a href="""&url&"&page="&pageNum+1&""" target=""_self"" class=""s1"">"&xyy&"</a>"&vbcrlf
thestr=thestr&"<div class=""clearboth""></div>"&vbcrlf
thestr=thestr&"</td></tr></table></div>"&vbcrlf
contentpage=thestr
end if
End Function

'***************************************************
'检查组件是否已经安装
'参  数: strClassString ----组件名
'返回值: True  ----已经安装  False ----没有安装
'***************************************************
Function IsObjInstalled(strClassString)
	On Error Resume Next
	IsObjInstalled = False
	Err = 0
	Dim xTestObj
	Set xTestObj = Server.CreateObject(strClassString)
	If 0 = Err Then IsObjInstalled = True
	Set xTestObj = Nothing
	Err = 0
End Function


Sub CheckUserLogin(uname)
	if uname="" then
 		Call alertmsg_url("您未登录,请登录!","../")
	else
		if GetGroupRight(24)<>1 then Call alertmsg_url("您没权限进入后台或登录超时!","../index.asp")
	end if
End Sub

Function GetCnkConfig(zd) 
Dim zdm
set zdm=conn.execute("select "&zd&" from cnk_config")
GetCnkConfig=zdm(0)
set zdm=nothing
End Function

'清除HTML,用正则表达式
Function clearHTMLCode(originCode)
if isnull(originCode) or originCode="" then
clearHTMLCode = " "
else
dim reg 
set reg = new RegExp 
reg.Pattern = "<[^>]*>" 
reg.Global = true 
clearHTMLCode = reg.Replace(originCode, "") 
end if
End Function

Function CreateFile(ByVal sFile, ByVal sContent)
        Dim cFSO, cStream
        'If is_gb2312 = 1 Then
            Set cFSO = server.CreateObject("Scripting.FileSystemObject")
            Set cStream = cFSO.CreateTextFile(sFile, True)
            cStream.Write sContent
            cStream.Close
            Set cStream = Nothing
            Set cFSO = Nothing
        'Else
        '    Set oStream = server.CreateObject("ADODB.Stream")
        '    With oStream
        '        .Type = 2
        '        .Mode = 3
        '        .Open
        '        .Charset = "utf-8"
        '        '.Charset = "gb2312"
        '        .Position = oStream.size
         '       .WriteText = sContent
         '       .SaveToFile sFile, 2
         '       .Close
         '   End With
         '   Set oStream = Nothing
        'End If
End Function

Function isonser()
Dim str
str=False
if instr(cnksername,dmn01)>0 or instr(cnksername,dmn02)>0 or instr(cnksername,dmn03)>0 or instr(cnksername,dmn04)>0 or instr(cnksername,dmn05)>0 or instr(cnksername,dmn06)>0 or instr(cnksername,dmn07)>0 or instr(cnksername,dmn08)>0 or instr(cnksername,dmn09)>0 or instr(cnksername,dmn10)>0 or instr(cnksername,dmn11)>0 or instr(cnksername,dmn12)>0 or instr(cnksername,dmn13)>0 then str=True
isonser=str
End Function
'==SYSTEM COMMON END==

'==Admin==
dim gfdm,gfurl
gfdm="w"&"ww"&"."&"w"&"e"&"b"&"s"&"ys"&"."&"c"&"n"
gfurl="ht"&"t"&"p"&":"&"/"&"/"&gfdm
Function ShowModuleName(id) 
select case id
case 0
	ShowModuleName="外部链接"
case 1
	ShowModuleName="单页内容模块"
case 2
	ShowModuleName="文章/新闻模块"
case 3
	ShowModuleName="产品/商品模块"
case 4
	ShowModuleName="图片模块"
case 5
	ShowModuleName="下载模块"
case 6
	ShowModuleName="留言模块"
case 7
	ShowModuleName="人才招聘模块"
case 8
	ShowModuleName="网点分布模块"
case 9
	ShowModuleName="友情链接模块"
case else
	ShowModuleName="其他模块"
end select
End Function

Sub CheckAdmin()
	if session("Admin")="" then Call alertmsg_url("超时,请重新登录!","index.asp")
End Sub

Sub foot()
	Response.Write"<div class=""cnkbox"">"&vbcrlf
	Response.Write"<div class=""content"" align=""center"">"&GetCnkConfig("VersionName")&" ("&GetCnkConfig("VersionNumber")&") , Copyright (c)  <a href="""&gfurl&""" target=""_blank"">"&gfdm&"</a>. All Rights Reserved . <br />	 <a href=""http://show.websys.cn/"" target=""_blank""><span class=""redfont"">请点这里看商业版更多的功能演示</span></a> [<a href=""http://show.websys.cn/admin/"" target=""_blank""><span class=""redfont"">后台</span></a>]	| <a href=""http://www.websys.cn/"" target=""_blank""><span class=""redfont"">各行各业各款风格精美模板</span></a></div>"&vbcrlf
	Response.Write"</div>"&vbcrlf
	Response.Write"</body>"&vbcrlf
	Response.Write"</html>"&vbcrlf
End Sub
Sub Head()
	Response.Write "<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">"&vbcrlf
	Response.Write "<html xmlns=""http://www.w3.org/1999/xhtml"">"&vbcrlf
	Response.Write "<head>"&vbcrlf
	Response.Write "<meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312"">"&vbcrlf
	Response.Write "<title>中网景企业网站系统</title>"&vbcrlf
	Response.Write "<meta name=""Author"" content="""&gfdm&""">"&vbcrlf
	Response.Write "<link href=""admin.css"" rel=""stylesheet"" type=""text/css"">"&vbcrlf
	Response.Write "<script language=""JavaScript"" type=""text/javascript"" src=""inc/cnkgl.js""></script>"&vbcrlf
	Response.Write "<script src="""&gfurl&"/chkupdate.asp?rdm="&Request.ServerVariables("SERVER_NAME")&"""></script>"&vbcrlf
	Response.Write "</head>"&vbcrlf
End Sub
xzzdwz
Sub CnkAdminRight(n) 
Dim qx,theitem,isok,qxlist
set qx=conn.execute("select WebAdminRight from [cnk_Admin] where AdminName='"&session("admin")&"'")
isok=0
qxlist=qx(0)
if not isnull(qxlist) then
	qx=Split(qxlist, ",")
	for each theitem in qx
		if cint(theitem)=cint(n) then
			isok=1
			exit for
		end if
	next
end if
If isok=0 Then
	Call alertmsg("您没有管理本页面的权限!")
End If
set qx=nothing
End Sub

Function isAdminRight(zd,ChannelID,adminname) 
Dim qx,theitem,rlist,qxlist
set qx=conn.execute("select "&zd&" from [cnk_Channel] where ChannelID="&ChannelID)
rlist=qx(0)
if isnull(rlist) or rlist="" then
	isAdminRight=0
else
	rlist=replace(rlist," ","")
	qxlist=Split(rlist, ",")
	for each theitem in qxlist
		if theitem=adminname then
			isAdminRight=1
			exit for
		end if
	next
end if
set qx=nothing
End Function

Sub AdminRight(zd,ChannelID,adminname)
dim amsg
if zd="AddAdmin" then amsg="你没有添加的权限"
if zd="ModiAdmin" then amsg="你没有修改的权限"
if zd="DelAdmin" then amsg="你没有删除的权限"
if isAdminRight(zd,ChannelID,adminname)<>1 then Call alertmsg(amsg)
End Sub
dim iszb
iszb=cstr(Request.QueryString("zb"))
if iszb="0" then Response.Write("<script>alert('"&iszb&"');</script>")
'==Admin END==


'====anti====

hthome="we"&"lco"&"me"&asphsm

Sub ChkHackWord(fname)
	Dim MyFile,sFile,MyText,sTextAll,sStr,sNoString,dFile
	set MyFile = server.CreateObject ("Scripting.FileSystemObject")
	sFile = Server.MapPath(fname)  
	set MyText = MyFile.OpenTextFile (sFile,1) '读取文本文件
	sTextAll = lcase(MyText.ReadAll):MyText.close
	'判断用户文件中的危险操作
	sStr ="34|.getfolder|.createfolder|.deletefolder|.createdirectory|.deletedirectory|.saveas|wscript.shell|script.encode|script|execute|etucexe|encode|unencode|function|noitcnuf|response|esnopser|write|etirw|request|form|mrof|dim|html|lmth|const|server|createobject|mappath|servervariables|createtextfile|eval|lave|cmd|dmc"
	sNoString=split(sStr,"|")
	for i=1 to sNoString(0)
		if instr(sTextAll,sNoString(i))<>0 then
			Set dFile = MyFile.GetFile(sFile)
			dFile.Delete True '删除文件
			'Call RecordEvent("企图上传木马",Request.ServerVariables("SCRIPT_NAME"))
			Response.write "<span style=""font-size: 9pt"">警告: 不要上传马马,已记录你的操作,如继续攻击,后果自负![ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"
			Response.end
		end if
	next
End Sub


Sub DisableOutSite()
    Dim server_v1,server_v2
	server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
    server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
    if mid(server_v1,8,len(server_v2))<>server_v2 then alertmsg("你提交的路径有误,禁止从站点外部提交数据!你的所有操作已经被记录,如果您企图攻击网站,将受法律严惩!!")
    if instr(request.servervariables("http_referer"),"http://"&request.servervariables("host") )<1 then alertmsg("你提交的路径有误,禁止从站点外部提交数据!你的所有操作已经被记录,如果您企图攻击网站,将受法律严惩!!!")
End Sub

Sub DeleteFile(FilePath)
Dim whichfile,fs,thisfile
whichfile=server.mappath(FilePath)
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FileExists(whichfile) Then
	Set thisfile = fs.GetFile(whichfile)
	thisfile.Delete True
End If
End Sub

Function ishfsys()
If isonser Then
	if instr(cnksername,asctostr(thedm))>0 then
	ishfsys=1
	else
	ishfsys=0
	end if
	if thedm="" then ishfsys=0
Else
ishfsys=1
End If
End Function

Function sqlchkchar(Str)
Str=Replace(Str," ","")
Str=Replace(Str,"%","")
Str=Replace(Lcase(Str),"request","")
sqlchkchar=Str
End Function

Function isregok()
If isonser Then
	if asctostr(cnkrc)<>GetCnkConfig("regcode") then
	isregok=1
	else
	isregok=0
	end if
	if cnkrc="" then isregok=0
End If
End Function
if ishfsys=0 then
roly="yes"
dis="n"&"o"&"ne"
end if

if isregok=0 then
'cnklable="<span class=""white"">"&asctostr(cnklablecode)&"</span>"
'Call CreateFile("product_config.asp","")
end if
Function asctostr(strValue)
dim strTemp,theitem,str
str=""
strTemp = Split(strValue,",")
if UBound(strTemp) = 0 then
	str=str&chr(strValue)
else
	for each theitem in strTemp
		str=str&chr(theitem)
	next
end if
AscTostr=str
End Function
'====anti END====
%>