<%
'==========================
' File: Exsm_Plus_Const.asp
' writer: cnxk
' Qq: 29510683
' Web: http://www.czie.com
'==========================
Exsm.St_Setting
Class Cls_Stock
	Public PlaceName,UserIP,ScriptName
	Public StockHolder,StockAdmin,HideName,AssignWidth,ExsmUserInfo
	Public Reloadtime,StockData,Stock_Setting,Setting_Info,Members,UserFreeze,UserID,UserCash
	Public Errmess,Sucmess
	Private LocalPlaceName,Cache_Data
	Private Sub Class_Initialize()
		Reloadtime=14400
		PlaceName=Replace(Replace(Replace(Server.MapPath("Exsm_Plus_Gupiao.asp"),"Exsm_Plus_Gupiao.asp",""),":",""),"\","")
		UserIP=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
		If UserIP="" Then UserIP=Request.ServerVariables("REMOTE_ADDR")
		Dim Tmpstr,i
		Tmpstr=Request.ServerVariables("PATH_INFO")
		Tmpstr=Split(Tmpstr,"/")
		i=UBound(Tmpstr)
		i=Replace(i,"$","")
		i=Replace(i,"'","")
		ScriptName=Lcase(Tmpstr(i))
	End Sub
	Private Sub UserSession()
		Dim TempUserID,AutoRndA,AutoRndB,AutoTime,ExsmTempSave
		'Exsm_sn=Lcase(Replace(Request.ServerVariables("SERVER_NAME")&Request.ServerVariables("URL"),Split(request.ServerVariables("SCRIPT_NAME"),"/")(ubound(Split(request.ServerVariables("SCRIPT_NAME"),"/"))),""))
		TempUserID=Replace(Request.Cookies("Exsm_sn")("AutoUserID"),"'","")
		If TempUserID="" Then
			Randomize
			AutoRndA=Cint(Rnd*197)+33
			Randomize
			AutoRndB=Cint(Rnd*133)+97
			AutoTime=Replace(Tetime,".","")
			Response.Cookies("Exsm_sn").Expires=Date+7
			Response.Cookies("Exsm_sn")("AutoUserID")=AutoRndA*AutoRndB+AutoTime
			TempUserID=AutoRndA*AutoRndB+AutoTime
		End if
		ExsmTempSave="Exsm$$$"&Now()&"$$$"&Now()&"$$$"&TempUserID&"$$$"&Now()&"$$$"&ScriptName&"$$$"&Now()&"$$$"&Now()&"$$$"&Now()&""
		Session(PlaceName&"ExsmTeUserID")=Split(ExsmTempSave,"$$$")
	End Sub
	Public Property Let Name(ByVal DataName)
		LocalPlaceName=LCase(DataName)
	End Property
	Public Property Let Value(ByVal DataContent)
		If LocalPlaceName<>"" Then
			ReDim Cache_Data(2)
			Cache_Data(0)=DataContent
			Cache_Data(1)=Now()
			Application.Lock
			Application(PlaceName&"_"&LocalPlaceName)=Cache_Data
			Application.unLock
		Else
			Response.Write "ReadInDataError"
			Response.End
		End If
	End Property
	Public Property Get Value()
		If LocalPlaceName<>"" Then
			Cache_Data=Application(PlaceName&"_"&LocalPlaceName)
			If IsArray(Cache_Data) Then
				Value=Cache_Data(0)
			Else
				Response.Write "ReadInDataError"
				Response.End
			End If
		Else
			Response.Write "ReadInDataError"
			Response.End
		End If
	End Property
	Public Function InspectIsData()
		InspectIsData=True
		Cache_Data=Application(PlaceName&"_"&LocalPlaceName)
		If Not IsArray(Cache_Data) Then Exit Function
		If Not IsDate(Cache_Data(1)) Then Exit Function
		If DateDiff("s",CDate(Cache_Data(1)),Now())<(60*Reloadtime) Then InspectIsData=False
	End Function
	Public Sub St_Setting()
		StockHolder=Replace(Request.cookies("username"),"'","")
		StockAdmin=false
		If membercode>4 Then StockAdmin=true
		HideName=request.cookies("eremite")	
		If HideName="" Then HideName=2
		AssignWidth="97%"			'股市宽度
		Name="Exsm_Imitate_Info"
		If InspectIsData() Then GetSetting
		StockData=Value
		Name="Exsm_Imitate_Quotations"
		If InspectIsData() Then Call GetReload(1,1)
		If Not IsArray(Session(PlaceName&"ExsmTeUserID")) Then UserSession
		ExsmUserInfo=Session(PlaceName&"ExsmTeUserID")
		Name="Exsm_Imitate_Date"
		If InspectIsData() Then
			Value=Date()
			Exsm_Reset
		Else
			If Cstr(Value)<>Cstr(Date()) Or Cstr(StockData(5,0))<>Cstr(Date()) Then Exsm_Reset
		End If
		Stock_Setting=Split(StockData(6,0),"|||")
		Setting_Info=Split(Stock_Setting(0),",")
		Set Rs=stock_conn.execute("select ID,LockUser,UserWealth from EX_User Where UserName='"&StockHolder&"'")
		If not Rs.eof Then
			Members=true
			UserFreeze=false
			If Rs(1)=1 Then UserFreeze=true
			UserID=Rs(0)
			UserCash=Rs(2)
		Else
			Members=false
			UserFreeze=false
			UserID=0
			UserCash=0
		End if
		If Not StockAdmin Then GetStockStatus
	End Sub
	Private Sub GetStockStatus()
		If Setting_Info(5)=0 And StockHolder="" Then
			Errmess="<li>对不起，股市未对游客开放请您先登录论坛。"
			Call Endinfo(1)
			Exit Sub
		End if
		If UserFreeze Then
			Errmess="<li>您的股市帐户被冻结！请联系管理员。"
			Call Endinfo(1)
			Exit Sub
		End if
		If Setting_Info(1)=0 Then
			Errmess="<li>当前股市状态["&Stock_Setting(6)&"]"
			Call Endinfo(1)
			Exit Sub
		End if
		If Setting_Info(2)=1 Then
			If hour(time)<Cint(split(Setting_Info(3),"||")(0)) or hour(time)>=Cint(split(Setting_Info(3),"||")(1)) Then
				Errmess="<li>亲爱的股民您好！现在股市已经收市了，请每天的["&split(Setting_Info(3),"||")(0)&":00～"&split(Setting_Info(3),"||")(1)&":00]再来。谢谢合作！"
				Call Endinfo(1)
				Exit Sub
			End if
		End if
		If Cint(Setting_Info(7))=1 Then
			Dim DoReflashPage
			DoReflashPage=false
			If Not DateDiff("s",Session(PlaceName&"ExsmTeUserID")(1),Now())<0.1 Then
				If Trim(Setting_Info(9))<>"" And InStr(LCase(Setting_Info(9)),ScriptName)>0 Then DoReflashPage=true
				If (Not IsEmpty(Session(PlaceName&"ExsmTeUserID")(1))) And Cint(Setting_Info(6))>0 And DoReflashPage Then
					If DateDiff("s",Session(PlaceName&"ExsmTeUserID")(1),Now())<Cint(Setting_Info(8)) Then
						Response.write "<title>"&dvbbs.Forum_info(0)&"-"&Setting_Info(0)&"</title>"
						Response.write "<meta http-equiv=content-type content=text/html; charset=gb2312><meta http-equiv=refresh content="&Setting_Info(8)&">请不要连续刷新本页面，"&Setting_Info(8)&"秒之后将会自动打开页面，请稍后……"
						Response.End
					Else
						ExsmUserInfo(1)=Now()
						Session(PlaceName&"ExsmTeUserID")=ExsmUserInfo
					End If
				Elseif IsEmpty(Session(PlaceName&"ExsmTeUserID")(1)) And Cint(Setting_Info(8))>0 And DoReflashPage Then
					ExsmUserInfo(1)=Now()
					Session(PlaceName&"ExsmTeUserID")=ExsmUserInfo
				End If
			End if
		End if
	End Sub
	Public Sub GetSetting()
		Set Rs=stock_conn.execute("Select * from EX_Config")
		Value=Rs.GetRows(1)
		Set Rs=Nothing
	End Sub
	Public Sub GetReload(Quota,Online)
		Dim Quotations,QRs
		If Quota=1 And Online=1 Then
			Set QRs=stock_conn.execute("select top 1 TodayBuy,TodaySell,TodayTotal,ExColExp from EX_Config order by id")
			Quotations=""&QRs(0)&"|"&QRs(1)&"|"&QRs(2)&"|"&QRs(3)&"|"&RegUserNum&"|"&GuestUserNum&"|"&Now()&""
			Value=Split(Quotations,"|")
			Set QRs=Nothing
		Else
			Quotations=Value
			If Quota=1 Then
				Set QRs=stock_conn.execute("select top 1 TodayBuy,TodaySell,TodayTotal,ExColExp from EX_Config order by id")
				Quotations(0)=QRs(0):Quotations(1)=QRs(1):Quotations(2)=QRs(2):Quotations(3)=QRs(3)
				Value=Quotations
			End if
			If Online>=1 Then
				Quotations(4)=RegUserNum:Quotations(5)=GuestUserNum
				If Online>1 Then Quotations(6)=Now()
				Value=Quotations
			End if
		End if
	End Sub
	Public Sub DelStockCahe(StockCahe)
		Application.Lock
		Application.Contents.Remove(PlaceName&"_"&LCase(StockCahe))
		Application.unLock
	End Sub
	Private Sub NowAnalyse(InName)
		Dim AutoUserID,Quotations
		AutoUserID=Clng(ExsmUserInfo(3))
		If AutoUserID="" Then Exit Sub
		If UserID="" Then UserID=0
		Name="Exsm_Imitate_Quotations"
		Quotations=Value
		If StockHolder="" Then
			Set Rs=stock_conn.execute("select * from EX_Analyse where StatUserID='"&AutoUserID&"'")
			If Rs.eof Then
				stock_conn.execute("insert into EX_Analyse(username,userip,usertime,nowseat,userid,movetime,hideuser,StatUserID) values ('客人','"&UserIP&"',"&SqlSmNowString&",'"&replace(InName,"'","")&"','"&UserID&"',"&SqlSmNowString&",'"&HideName&"','"&AutoUserID&"')")
				Call GetReload(0,1)
			Else
				stock_conn.execute("update EX_Analyse set username='客人',movetime="&SqlSmNowString&",nowseat='"&replace(InName,"'","")&"',userid='"&UserID&"',hideuser='"&HideName&"' where StatUserID='"&AutoUserID&"'")
			End if
		Else
			Set Rs=stock_conn.execute("select * from EX_Analyse where UserID="&Ccur(UserID)&"")
			If Rs.eof Then
				stock_conn.execute("delete from EX_Analyse where StatUserID='"&AutoUserID&"'")
				stock_conn.execute("insert into EX_Analyse(username,userip,usertime,nowseat,userid,movetime,hideuser,StatUserID) values ('"&StockHolder&"','"&UserIP&"',"&SqlSmNowString&",'"&replace(InName,"'","")&"','"&UserID&"',"&SqlSmNowString&",'"&HideName&"','"&AutoUserID&"')")
				Call GetReload(0,1)
			Else
				stock_conn.execute("update EX_Analyse set username='"&StockHolder&"',movetime="&SqlSmNowString&",nowseat='"&replace(InName,"'","")&"',userid='"&UserID&"',hideuser='"&HideName&"' where UserID="&Ccur(UserID)&"")
			End if
		End if
		If DateDiff("s",Quotations(6),Now())>Clng(Setting_Info(10))*10 Then
			If IsSqlSmDataBase=1 Then
				stock_conn.execute("delete from EX_Analyse where datediff(s,movetime,"&SqlSmNowString&") > "&Setting_Info(10)&"*60")
			Else
				stock_conn.execute("delete from EX_Analyse where datediff('s',movetime,"&SqlSmNowString&") > "&Setting_Info(10)&"*60")
			End if
			Call GetReload(0,2)
		End if
	End Sub
	Public Sub Title(Dist,InName)
		Dim ExsmJava
		ExsmJava="<Script language=""JavaScript"" src=""plus/Ex_Stock/Exsm_Plus_Function.js""></Script><Script language=""JavaScript"" src=""plus/Ex_Stock/Exsm_Plus_Top.js""></Script>"
		Response.Write "<title>"&ClubName&"-"&InName&"</title>"
		Top
		Response.Write "<table class=a2 width="""&AssignWidth&""" align=center cellspacing=1 cellpadding=4 border=0>"
		Response.Write "<tr class=a3>"
		Response.Write "<td height=25>&nbsp;<img src=images/Forum_nav.gif>&nbsp;"
		ClubTree
		If Dist=0 Then
			Response.Write " → "&InName&"</td>"
		Elseif Dist=1 Then
			Response.Write " → <a href=""Exsm_Plus_GuPiao.asp"">"&Setting_Info(0)&"</a> → "&InName&"</td>"
		End if
		Response.Write "</tr>"
		Response.Write "</table><br>"
		Response.Write ExsmJava
		If Dist=1 Then AdminHead
		If Cint(Setting_Info(10))>0 Then
			Dim ActivePageLastTime,LastTempPage
			ActivePageLastTime=Session(PlaceName&"ExsmTeUserID")(2)
			LastTempPage=Session(PlaceName&"ExsmTeUserID")(5)
			If Not IsDate(ActivePageLastTime) Then ActivePageLastTime=Now()
			If DateDiff("s",ActivePageLastTime,Now())<60 And LastTempPage=ScriptName Then Exit Sub
			ExsmUserInfo(2)=Now()
			ExsmUserInfo(5)=ScriptName
			Session(PlaceName&"ExsmTeUserID")=ExsmUserInfo
			Call NowAnalyse(InName)
		End if
	End Sub
	Public Sub Exsm_Reset()
		Dim Rst,NewTradeSum,Statement,HighPrice,LowPrice
		Set Rst=stock_conn.execute("select top 1 TodayDate from EX_Config order by id")
		If Not Datediff("D",Rst(0),Now())<>0 Then Exit Sub
		Name="Exsm_Imitate_Quotations"
		stock_conn.execute("update Ex_User Set TodayBuy=0,TodaySell=0")
		stock_conn.execute("update EX_Config Set TodayBuy=0,TodaySell=0,TodayTotal=0,ExColExp=0,TodayDate='"&date()&"'")
		Call GetReload(1,0)
		set Rst=stock_conn.execute("select Sid,TradePrice,SurplusShare,TodayTradeSum,TodayPermitTradeSum,Statement from EX_Stock Where TradePrice<>ClosingPrice Or TodayAdTradeSum>0 order by sid")
		If Not Rst.eof Then
			Do while Not Rst.eof
				If Rst(2)>Rst(3) Then
					NewTradeSum="TodayPermitTradeSum=TodayTradeSum"
				Elseif Rst(2)>0 Then
					NewTradeSum="TodayPermitTradeSum=SurplusShare"
				Else
					NewTradeSum="TodayPermitTradeSum=0,LockStock=1"
				End if
				Statement=Rst(5)
				If Statement="" Or isnull(Statement) Then Statement="0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0"
				Statement=mid(Statement,instr(Statement,"|")+1)&"|"&Formatnumber(Rst(1),2,-1)
				stock_conn.execute("update EX_Stock set ClosingPrice=TradePrice,OqPrice=0,TodayAdTradeSum=0,TodayBuyNumber=0,TodaySellNumber=0,TodayWave=0,"&NewTradeSum&",Statement='"&Statement&"' Where Sid="&Rst(0))
			rst.movenext
			loop
		End if
		Name="Exsm_Imitate_Date"
		Value=Date()
	End Sub
	Public Sub CalculateFund(TradeUserId,StockId)
		Dim SUserId,SId,RsUser,RsStnum,TotalFund,StockTypeNum,CurrentPrice,AgvInPrice,MyGupiaoNum,MyGupiaoValue,MyGupiaoCost,StockStatistic,NewStockPriceA,NewStockPriceB
		SId=StockId
		If isnumeric(TradeUserId) Then
			SUserId="LockUser=0"
			If TradeUserId>0 Then SUserId="ID="&TradeUserId&""
			Set RsUser=stock_conn.execute("select ID from Ex_User Where "&SUserId&" order by id")
			If not RsUser.eof Then
				Do while not RsUser.eof
					TotalFund=0 :	StockTypeNum=0	:	CurrentPrice=0	:	AgvInPrice=0	:	MyGupiaoNum=0 :	MyGupiaoValue=0 :	MyGupiaoCost=0
					SQL="select d.*,g.ClosingPrice,g.TradePrice from EX_Customer d inner join EX_stock g on d.Sid=g.Sid Where d.UserId="&RsUser(0)&""
					Set RsStnum=stock_conn.execute(SQL)
					Do while not RsStnum.eof
						CurrentPrice=formatnumber(RsStnum("TradePrice"),2,-1)
						AgvInPrice=formatnumber(RsStnum("AveragePrice"),2,-1)
						MyGupiaoNum=MyGupiaoNum+RsStnum("PossessStockSum")
						MyGupiaoValue=MyGupiaoValue+(RsStnum("PossessStockSum"))*CurrentPrice
						MyGupiaoCost=MyGupiaoCost+(RsStnum("PossessStockSum"))*AgvInPrice
						TotalFund=TotalFund+(RsStnum("PossessStockSum"))*RsStnum("TradePrice")
						StockTypeNum=StockTypeNum+1
					RsStnum.movenext
					Loop
					StockStatistic=""&MyGupiaoNum&"|||"&MyGupiaoValue&"|||"&MyGupiaoCost&""
					stock_conn.execute("update Ex_User set UserAssets=UserWealth+"&Round(TotalFund,2)&",PossessSort="&StockTypeNum&",UserStatistic='"&StockStatistic&"' Where ID="&RsUser(0)&"")
				RsUser.movenext
				Loop
			End if
		End if
		If SId>0 Then
			set Rs=stock_conn.execute("select TradePrice,LowestPrice,HighestPrice from EX_Stock Where Sid="&SId&"")
			If not Rs.eof Then
				If Rs(0)>Rs(2) Then
					NewStockPriceA="HighestPrice=TradePrice"
				Else
					NewStockPriceA="HighestPrice=HighestPrice"
				End if
				If Rs(0)<Rs(1) Then
					NewStockPriceB="LowestPrice=TradePrice"
				Else
					NewStockPriceB="LowestPrice=LowestPrice"
				End if
				stock_conn.execute("update EX_Stock set "&NewStockPriceA&","&NewStockPriceB&" Where Sid="&SId&"")
			End if
			Name="Exsm_Imitate_Quotations"
			Call GetReload(1,0)
			DelStockCahe("Exsm_Imitate_News")
		End if
	End Sub
	Private Function RegUserNum()
		Dim RegRs
		RegRs=stock_conn.execute("Select count(*) from EX_Analyse Where UserId>0")
		RegUserNum=RegRs(0)
		set RegRs=nothing
		If isnull(RegUserNum) Then RegUserNum=0
	End Function
	Private Function GuestUserNum()
		Dim GuestRs
		GuestRs=stock_conn.execute("Select count(*) from EX_Analyse Where UserId=0")
		GuestUserNum=GuestRs(0)
		set GuestRs=nothing
		If isnull(GuestUserNum) Then GuestUserNum=0
	End Function
	Public Function Syllable(str)
		ON ERROR RESUME NEXT
		Dim WINNT_CHINESE
		WINNT_CHINESE=(len("例子")=2)
		If WINNT_CHINESE then
		Dim l,t,c,i
		l=len(str)
		t=l
		for i=1 to l
			c=asc(mid(str,i,1))
			if c<0 then c=c+65536
			if c>255 then
			t=t+1
		End if
		next
			Syllable=t
		Else
			Syllable=len(str)
		End if
		If err.number<>0 then err.clear
	End Function
	Public Function SiftName(BBSName)
		Dim Ex_BBSName,Exi
		Ex_BBSName=split("$,"&Split(Stock_Setting(4),"|")(6)&"",",")
		For Exi=0 To ubound(Ex_BBSName)
			If not isnull(Ex_BBSName(Exi)) Then
				BBSName=Replace(BBSName,Ex_BBSName(Exi),"")
				SiftName=BBSName
			End if
		Next
	End Function
	Public Function htmlsetting(setting)
		If Not isnull(setting) Then
			setting=Replace(setting,"\","\\")
			setting=Replace(setting,chr(10),"\n")
			setting=Replace(setting,chr(13),"\r")
			setting=Replace(setting,chr(34),"\""")
			setting=Replace(setting,chr(39),"\'")
			setting=Replace(setting,"VbCrLf","\n")
			htmlsetting=setting
		End if
	End Function
	Public Function htmlencode(fString)
		If not isnull(fString) Then
			fString=Replace(fString,">","&gt;")
			fString=Replace(fString,"<","&lt;")
			fString=Replace(fString,CHR(9),"&nbsp;")
			fString=Replace(fString,CHR(10),"<br>")
			fString=Replace(fString,CHR(13),"")
			fString=Replace(fString,CHR(32),"&nbsp;")
			fString=Replace(fString,CHR(34),"&quot;")
			fString=Replace(fString,CHR(39),"&#39;")
			fString=Replace(fString,CHR(44),"&#44;")
			HTMLEncode=fString
		End if
	End Function
	Public Function UbbCode(Content)
		Dim Re
		If StockAdmin Then
			Content=Replace(Content,"[ExU]","<a title=""使用了用户名保护模式""><u>")
			Content=Replace(Content,"[/ExU]","</u></a>")
		Elseif InStr(Content,"[ExU]")>0 Then
			Set Re=New RegExp
			Re.Pattern="\[ExU\](.[^\[]*)(\[\/ExU\])"
			Content=Re.Replace(Content,"<a title=""使用了用户名保护模式"">***</a>")
			Set Re=Nothing
		End if
		UbbCode=Content
	End Function
	Public Sub AdminHead()
		Response.Write "<Script Language=JavaScript>"
		Response.Write "var exstockname='"&htmlencode(Setting_Info(0))&"';"
		Response.Write "var assignwidth='"&AssignWidth&"';"
		Response.Write "var exstockadminmenu="&LCase(StockAdmin)&";"
		Response.Write "var exstockuser="&LCase(Members)&";"
		Response.Write "ex_index_menu();"
		Response.Write "</Script>"
	End Sub
	Private Sub GetStockAnn()
		Set Rs=stock_conn.execute("select top 5 Title,Color from EX_Announcement order by id desc")
		If not Rs.eof Then
			Exsm.value=Rs.GetRows(5)
		Else
			Exsm.value=""
		End if
		Set Rs=Nothing
	End Sub
	Public Sub Nav()
		Dim Exsm_Ann
		Name="Exsm_Imitate_Ann"
		If InspectIsData() Then GetStockAnn
		Exsm_Ann=Value
		Response.Write "<Script Language=JavaScript>"
		Response.Write "var exstockname='"&htmlencode(Setting_Info(0))&"';"
		Response.Write "var assignwidth='"&AssignWidth&"';"
		Response.Write "ex_index_top();"
		If Not IsArray(Exsm_Ann) Then
			Response.Write "messages[0]=""欢迎光临“"&htmlencode(Setting_Info(0))&"”"";"
			Response.Write "mescolor[0]=""blue"";"
			Response.Write "messages[1]=""证监会提醒：股市风险莫测，谨慎入市！"";"
			Response.Write "mescolor[1]=""red"";"
		Else
			For i=0 To Ubound(Exsm_Ann,2)
				Response.Write "messages["&i&"]="""&htmlencode(Server.HtmlEncode(left(Exsm_Ann(0,i),25)))&"…"";"
				Response.Write "mescolor["&i&"]="""&Exsm_Ann(1,i)&""";"
			next
			Response.Write "messages["&i&"]=""证监会提醒：股市风险莫测，谨慎入市！"";"
			Response.Write "mescolor["&i&"]=""blue"";"
		End if
		Response.Write "Gp_Time();Announcement();"
		Response.Write "</Script>"
	End Sub
	Public Sub Endinfo(Flag)
		Title 1,"操作信息提示"
		Response.Write "<table class=a2 width="""&AssignWidth&""" cellspacing=1 cellpadding=3 align=center border=0>"
		Response.Write "<tr><td valign=center height=25 class=a1>操作信息提示</td></tr>"
		Response.Write "<tr><td class=a3>"
		If Errmess<>"" Then
			Response.Write "<b>产生错误的可能原因：</b><br><br><li>您是否仔细阅读了[<a href=Exsm_Plus_Help.asp>股市帮助</a>]，可能您还没有登录或者不具有使用当前功能的权限"
			Response.Write "<font color=red>"&Errmess&"</font>"
		Else
			Response.Write "<b>操作成功：</b><br><br><li>欢迎光临“"&Setting_Info(0)&"”，请返回进行其它操作"
			Response.Write "<font color=navy>"&Sucmess&"</font>"
		End if
		Response.Write "</td></tr>"
		Response.Write "<tr><td class=a4 align=center>"
		If Flag=0 then
			Response.Write "<a href=""index.asp""><< 返回论坛</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=""#"" onclick=""window.close()"">关闭本页</a>"
		Else 
			If Flag=2 then
				Response.Write "<a href=""Exsm_Plus_GuPiao.asp""><< 返回股市大厅</a>&nbsp;&nbsp;&nbsp;&nbsp;"	
			Else
				Response.Write "<a href=""Exsm_Plus_GuPiao.asp""><< 返回股市大厅</a>&nbsp;&nbsp;&nbsp;&nbsp;"	
				Response.Write "<a href=""javascript:history.go(-1)""><< 返回上一页</a>"
			End if
		End if
		Response.Write "</td></tr>"
		Response.Write "</table>"
		RootShow
		Response.End
	End sub
	Public Function RndColor()
		Dim SelColor,ColorNum
		Randomize
		ColorNum=Cint(Rnd*11)
		If ColorNum=0 Then
			SelColor="blue"
		Elseif ColorNum=1 Then
			SelColor="black"
		Elseif ColorNum=2 Then
			SelColor="Fuchsia"
		Elseif ColorNum=3 Then
			SelColor="olive"
		Elseif ColorNum=4 Then
			SelColor="red"
		Elseif ColorNum=5 Then
			SelColor="maroon"
		Elseif ColorNum=6 Then
			SelColor="navy"
		Elseif ColorNum=7 Then
			SelColor="gray"
		Elseif ColorNum=8 Then
			SelColor="green"
		Elseif ColorNum=9 Then
			SelColor="teal"
		Elseif ColorNum=10 Then
			SelColor="Purple"
		Elseif ColorNum=11 Then
			SelColor="lime"
		Else
			SelColor="black"
		End if
		RndColor=SelColor
	End Function
	Public Sub DispPageNum(CurPage, PageCount, URLPrefix, URLPostfix)
		Dim p,ii
		If PageCount=0 Then
			response.write "无"
		Else
			p=(CurPage-1) \ 10
			If CurPage=1 Then
			response.write "<span><font face=webdings color=ff0000>9</font></span> "
		Else
		response.write "<span><a href="&URLPrefix&"1"&URLPostfix&" title=首页><font face=webdings>9</font></a></span> "
		End if
		If p>0 Then response.write "<span><a href="&URLPrefix&Cstr(p*10)&URLPostfix&" title=上十页><font face=webdings>7</font></a></span> "
			response.write "<b>"
			for ii=p*10+1 to P*10+10
				If ii=CurPage Then
					response.write "<span><b><font color=ff0000>"+Cstr(ii)+"</font></b></span> "
				Else
					response.write "<span><a href="&URLPrefix&Cstr(ii)&URLPostfix&">"+Cstr(ii)+"</a></span> "
				End if
				If ii=PageCount Then exit for
			Next
			If ii>p*10+10 Then ii=ii-1
				response.write "</b>"
			If ii<PageCount Then response.write "<span><a href="&URLPrefix&Cstr(ii+1)&URLPostfix&" title=下十页><font face=webdings>8</font></a></span> "
			If CurPage=PageCount Then
				response.write "<span><font face=webdings color=ff0000>:</font></span>"
			Else
				response.write "<span><a href="&URLPrefix&Cstr(PageCount)&URLPostfix&" title=尾页><font face=webdings>:</font></a></span>"
			End if
		End if
	End Sub
	Public Sub RootShow()
		Response.Write "<br>"
		Response.Write "<table class=a2 cellspacing=1 cellpadding=3 align=center border=0 width="""&AssignWidth&""">"
		Response.Write "<tr><td class=a4 width=""100%"">"
		Response.Write "<table cellspacing=0 cellpadding=0 align=center border=0 width=""100%"">"
		Response.Write "<tr>"
		Response.Write "<td align=left width=""35%"">&nbsp;&nbsp;&#27426;&#36814;&#24744;:"
		If StockHolder="" Then
			Response.Write "&#23458;&#20154;"
		Else
			Response.Write StockHolder&"</td>"
		End if
		Response.Write "<td align=center width=""30%"">"&ClubName&"-"&Setting_Info(0)&"</td>"
		Response.Write "<td align=right width=""35%"">&#25191;&#34892;&#26102;&#38388;:"&FormatNumber((timer()-Tetime)*1000,3)&"&#27627;&#31186;&nbsp;&nbsp;</td>"
		Response.Write "</tr>"
		Response.Write "</table></td>"
		Response.Write "</tr>"
		Response.Write "</table>"
		Response.Write "<Script Language=""JavaScript"">var WinReload="&Setting_Info(10)*60&";ExReload();</Script>"
		Call HtmlEnd()
	End Sub
	Public Sub RootShowA()
		Call HtmlEnd()
	End Sub
End Class
%>