 diffTime=datediff("s","2005-8-4 15:39:18",now)
 dim companyID,fullxmlfile,chxmlfile, m_language,oddskind
dim company(16)
dim xml1_xml,loaded
dim riseColor,fallColor
dim i,html,A()
dim flash_sound(2)'变水声，临场速变声，进球声
dim kk,matchcount
dim leaguecount

dim matchData()  '保存比赛信息、赔率
dim tr_html()
dim html0(25)
dim GoalCn(20) '让球盘口
dim Goal_T_Cn(40)'大小盘盘口

oddskind=1
company(0)="澳赔"
company(1)="澳彩"
company(2)="波音"
company(3)="王冠"
company(4)="立博"
company(5)="博迎"
company(8)="BET365"
company(11)="马来西亚"
company(12)="易胜博"
'company(14)="韦德"
'company(16)="三S"
'company(17)="发达"
'company(23)="利记"
'company(24)="IBC沙巴"

xml1_xml=""
riseColor="#FF8080"
fallColor="#00FF44"
flash_sound(0) = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='0' height='0' id='image1'><param name='movie' value='image/oddssound.swf'><param name='quality' value='high'><param name=LOOP value='false'></object>"
flash_sound(1) = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='0' height='0' id='image1'><param name='movie' value='image/leap.swf'><param name='quality' value='high'><param name=LOOP value='false'></object>"

GoalCn(0)="平手"
GoalCn(1)="平手/半球"
GoalCn(2)="半球"
GoalCn(3)="半球/一球"
GoalCn(4)="一球"
GoalCn(5)="一球/球半"
GoalCn(6)="球半"
GoalCn(7)="球半/两球"
GoalCn(8)="两球"
GoalCn(9)="两球/两球半"
GoalCn(10)="两球半"
GoalCn(11)="两球半/三球"
GoalCn(12)="三球"
GoalCn(13)="三球/三球半"
GoalCn(14)="三球半"
GoalCn(15)="三球半/四球"
GoalCn(16)="四球"
GoalCn(17)="四球/四球半"
GoalCn(18)="四球半"
GoalCn(19)="四球半/五球"
GoalCn(20)="五球"

Goal_T_Cn(0)="0"
Goal_T_Cn(1)="0/0.5"
Goal_T_Cn(2)="0.5"
Goal_T_Cn(3)="0.5/1"
Goal_T_Cn(4)="1"
Goal_T_Cn(5)="1/1.5"
Goal_T_Cn(6)="1.5"
Goal_T_Cn(7)="1.5/2"
Goal_T_Cn(8)="2"
Goal_T_Cn(9)="2/2.5"
Goal_T_Cn(10)="2.5"
Goal_T_Cn(11)="2.5/3"
Goal_T_Cn(12)="3"
Goal_T_Cn(13)="3/3.5"
Goal_T_Cn(14)="3.5"
Goal_T_Cn(15)="3.5/4"
Goal_T_Cn(16)="4"
Goal_T_Cn(17)="4/4.5"
Goal_T_Cn(18)="4.5"
Goal_T_Cn(19)="4.5/5"
Goal_T_Cn(20)="5"
Goal_T_Cn(21)="5/5.5"
Goal_T_Cn(22)="5.5"
Goal_T_Cn(23)="5.5/6"
Goal_T_Cn(24)="6"
Goal_T_Cn(25)="6/6.5"
Goal_T_Cn(26)="6.5"
Goal_T_Cn(27)="6.5/7"
Goal_T_Cn(28)="7"
Goal_T_Cn(29)="7/7.5"
Goal_T_Cn(30)="7.5"
Goal_T_Cn(31)="7.5/8"
Goal_T_Cn(32)="8"
Goal_T_Cn(33)="8/8.5"
Goal_T_Cn(34)="8.5"
Goal_T_Cn(35)="8.5/9"
Goal_T_Cn(36)="9"
Goal_T_Cn(37)="9/9.5"
Goal_T_Cn(38)="9.5"
Goal_T_Cn(39)="9.5/10"
Goal_T_Cn(40)="10"

sub selCompany(ID) 
	'if companyID<>ID then 	document.getElementById("net"&companyID).innerhtml="<a href='javascript:selCompany("&companyID&")'>["&company(companyID)&"]</a>"	
	companyID=ID
	fullxmlfile="xmlscript/odds"&ID&".xml"
	chxmlfile="xmlscript/ch_xml"&ID&".xml"
	document.getElementById("loading").style.display=""
	document.getElementById("odds").innerhtml=""	
	setTimeout "loadodds("&m_language&")",10
	writeCookie "Bet007_odds_SelCompanyID", companyID
	writeCookie "Bet007_odds_SelLanguage", m_language
	call setbgcolor(2)
	'document.getElementById("net"&ID).innerhtml="<img src='image/net_"&ID&".gif'>"	
	oddskind=1
end sub

sub selRealOrCc(kind) '//打开早餐盘或即时盘，0则为早餐，1为即时，-1为完场'
	if kind=0 then 
		fullxmlfile="xml/odds"&companyID&"_cc.xml"
		chxmlfile="xml/ch_xml"&companyID&"_cc.xml"
	else
		fullxmlfile="xml/odds"&companyID&".xml"
		chxmlfile="xml/ch_xml"&companyID&".xml"
	end if
	oddskind=kind '//标记是即时盘还是早餐盘'
	document.getElementById("loading").style.display=""
	document.getElementById("odds").innerhtml=""	
	setTimeout "loadodds("&m_language&")",10
end sub

sub setbgcolor(kind)
	document.getElementById("oddsKind1").style.backgroundColor=""
	document.getElementById("oddsKind2").style.backgroundColor=""
	document.getElementById("oddsKind1").style.Color="#000000"
	document.getElementById("oddsKind2").style.Color="#000000"
	document.getElementById("oddsKind"&kind).style.backgroundColor="#0000ff"
	document.getElementById("oddsKind"&kind).style.Color="#FFFFFF"
end sub

sub HistoryOdds() '//打开历史胜负几率页面'
	if companyid=2 or companyid=3  or companyid=5 or companyid=7 or companyid=16 then
		window.open "history/3in1Odds.php?companyid=" & companyID &"&oddsKind=" & oddskind &"&company=" & company(companyid)
	else
		window.open "history/AsianOdds.php?companyid=" & companyID &"&oddsKind=" & oddskind &"&company=" & company(companyid)
	end if
end sub

'---以下是赔率相关
function Goal2GoalCn(goal)
	'数字盘口转汉汉字
	if goal>=0 then Goal2GoalCn=GoalCn(cint(goal*4)) else Goal2GoalCn="受让"& GoalCn(abs(cint(goal*4)))
end function

sub loadodds(language)
	loaded=0
	document.getElementById("company").innerhtml=company(companyid)
	m_language=language
	myxml.async = false
	myxml.load fullxmlfile
	set kk=myxml.childNodes.item(1).childNodes.item(0)
	matchcount=kk.childNodes.length
	redim tr_html(matchcount-1)
	redim matchData(matchcount,22)
	If matchcount>0 Then
		if companyid=2 or companyid=3  or companyid=5 or companyid=7 or companyid=16 then
			Call bbin_MakeTable()
		else
			Call MakeTable()
		end if
	else
		document.getElementById("odds").innerhtml="<p align=center class=f1>暂无相关数据！</p>"
	end if
	call matkeleague()
	writeCookie "Bet007_odds_SelLanguage", m_language  '记录所选的语言
 	document.getElementById("hiddencount").innerText=0
	document.getElementById("loading").style.display="none"
end sub

sub MakeTable() '澳门类赔率对阵
    on error resume next
    dim ii
    ii=0
    dim j
    dim match_id
    dim match_leagues
    dim match_typecolor
    dim match_hometeamID
    dim match_guestteamID
    dim match_homeorder,match_guestorder,tv

	for i=0 to matchcount-1
		match_id=kk.childNodes.item(i).childNodes.item(0).Text 'ID
		match_typecolor=kk.childNodes.item(i).childNodes.item(1).Text '类型背景色
		match_leagues=kk.childNodes.item(i).childNodes.item(2).Text'类型名称
		matchData(i,0)=match_id
		matchData(i,1)=kk.childNodes.item(i).childNodes.item(3).Text '开赛时间
		matchData(i,2)=split(match_leagues,",")(m_language)'选择的语言对类的类型名		
		matchData(i,19)=split(kk.childNodes.item(i).childNodes.item(4).Text,",")(m_language)'主队名
		matchData(i,20)=split(kk.childNodes.item(i).childNodes.item(5).Text,",")(m_language)'主队名
		match_hometeamID=split(kk.childNodes.item(i).childNodes.item(6).Text,",")(0)
		match_guestteamID=split(kk.childNodes.item(i).childNodes.item(6).Text,",")(1)
		Neutrality=kk.childNodes.item(i).childNodes.item(7).Text'中立场
		matchData(i,5)=kk.childNodes.item(i).childNodes.item(8).Text'上盘
		if matchData(i,5)="2" then
			matchData(i,21)=matchData(i,20) '上盘
			matchData(i,22)=matchData(i,19) '下盘
		else
			matchData(i,21)=matchData(i,19)
			matchData(i,22)=matchData(i,20)
		end if
		tmp=kk.childNodes.item(i).childNodes.item(9).Text
		matchData(i,6)=split(tmp,",")(0) '赔率ID
		matchData(i,7)=split(tmp,",")(1)'初盘盘口
		matchData(i,8)=split(tmp,",")(2)'盘口
		matchData(i,9)=split(tmp,",")(3) '上盘水位
		matchData(i,10)=split(tmp,",")(4) '下盘水位

		tmp=kk.childNodes.item(i).childNodes.item(10).Text
		matchData(i,11)=split(tmp,",")(0) 'oddsid_s
		matchData(i,12)=split(tmp,",")(1) '主胜
		matchData(i,13)=split(tmp,",")(2) '客胜
		matchData(i,14)=split(tmp,",")(3) '和
		
		match_homeorder=trim(split(kk.childNodes.item(i).childNodes.item(11).Text,",")(0)) '主队排名
		match_guestorder=trim(split(kk.childNodes.item(i).childNodes.item(11).Text,",")(1)) '客队排名
		tv=kk.childNodes.item(i).childNodes.item(12).Text
		
		if match_homeorder<>"" then match_homeorder="<font color=#444444><sup>["&match_homeorder&"]</sup></font>"
		if match_guestorder<>"" then match_guestorder="<font color=#444444><sup>["&match_guestorder&"]</sup></font>"
		matchData(i,4)=false
		if dateadd("s", diffTime,matchData(i,1))>now() then '还没有到开场时间
			matchData(i,4)=true '是否隐藏
			html0(0) = "<table width='100%' border=0 align=center cellpadding=0 cellspacing=1 bgcolor=#666666 id='table_" & match_id & "' index='" & i &"' style='margin:-1px;'>"
			html0(1) = "<tr align=center bgcolor='#FFFFFF' class=font12>"
			html0(2) = "<td width='11%' align=center bgcolor=" & match_typecolor & " style='color:white'>" & matchData(i,2) & "</td>"
			html0(3) = "<td width='15%' align=center nowrap><font color=#666666>" & Month(matchData(i,1)) & "-" & Day(matchData(i,1)) & " " & FormatDateTime(matchData(i,1), vbShortTime) & "</font><br>"
			html0(4) = "<font color=#FF0000>[<a href=""javascript:AsianOdds('"&match_id&"')"">亚</A>][<A href=""javascript:EuropeOdds("&match_id&")"" target=_self>欧</A>][<A href=""javascript:analysis("&match_id&")"">析</A>]</font></td>"
			html0(5) = "<td width='27%' align=center id='up_" & match_id & "'>" 
			if matchData(i,5)="2" then '判断哪个队是上盘球队
				if Neutrality="True" then
					html0(6) = match_guestorder &"<a style='color:#000000' href=javascript:teaminfo('" & match_id & "')>"&  matchData(i,20)&"<font color=#666666>(中)</font></a><br>"
				else
					html0(6) = match_guestorder &"<a style='color:#000000' href=javascript:teaminfo('" & match_id & "')>"&  matchData(i,20)&"</a><br>"
				end if
			else
				if Neutrality="True" then
					html0(6) =match_homeorder & "<a style='color:#000000' href=javascript:teaminfo('" & match_id & "')>"& matchData(i,19)&"<font color=#666666>(中)</font></a><br>"
				else
					html0(6) =match_homeorder & "<a style='color:#000000' href=javascript:teaminfo('" & match_id & "')>"& matchData(i,19)&"<font color=#666666>(主)</font></a><br>"
				end if
			end if
			html0(6) = html0(6) & "<a href=""javascript:ChangeDetail("&i&",'"&company(companyid)&"')"" class=pl><span id='upodds_" & match_id & "'>"&matchData(i,9)&"</span></a>"
			
			html0(7) = "</td><td width='20%' align=center id=goal_" & match_id &">"
			html0(8) ="<a href=""javascript:ChangeDetail_p("&i&",'"&company(companyid)&"')"" class=pk>"
			if matchData(i,8)<>""then 
				html0(9)= "<span id='R_goal_" & match_id & "'>"&Goal2GoalCn(matchData(i,8))&"</span></a>"
			else
				html0(9)= "<span id='R_goal_" & match_id & "'></span></a>"
			end if
			'盘口是否有变 显示初盘
			if matchData(i,7)=matchData(i,8) then display="none" else display=""
			if matchData(i,7)<>""then 
				html0(10) ="<span id='F_goal_" & match_id & "' style='display:"&display&"' title='初盘盘口:"&Goal2GoalCn(matchData(i,7))&"'><font color=#BB0000>初</font></span><br>"
			else
				html0(10) ="<span id='F_goal_" & match_id & "' style='display:none'></span><br>"
			end if
			if matchData(i,5)="2" then '客队上盘
				html0(11) ="<a href=""javascript:ChangeDetail_s("&i&",'"&company(companyid)&"')"" style='color:#000022'><span id=gw_" & match_id &">"& matchData(i,13) & "</span> <span id=st_" & match_id &">"& matchData(i,14) & "</span> <span id=hw_" & match_id &">"& matchData(i,12) & "</span></a></td>"
			else
				html0(11) ="<a href=""javascript:ChangeDetail_s("&i&",'"&company(companyid)&"')"" style='color:#000022'><span id=hw_" & match_id &">"& matchData(i,12) & "</span> <span id=st_" & match_id &">"& matchData(i,14) & "</span> <span id=gw_" & match_id &">"& matchData(i,13) & "</span></a></td>"
			end if
			html0(12) = "<td width='27%' align=center id='down_" & match_id & "'><table width='100%'  border=0 cellspacing=0 cellpadding=0><tr><td colspan=2 align=center>"

			if matchData(i,5)="2" then '判断哪个队是上盘球队
 				if Neutrality="True" then
					html0(13) =match_homeorder & "<a style='color:#000000' href=javascript:teaminfo('" & match_id & "')>" & matchData(i,19)& "</a></td></tr>"
				else
					html0(13) =match_homeorder & "<a style='color:#000000' href=javascript:teaminfo('" & match_id & "')>" & matchData(i,19)& "<font color=#666666>(主)</font></a></td></tr>"
				end if
			else
				html0(13) =match_guestorder & "<a style='color:#000000' href=javascript:teaminfo('" & match_id & "')>"& matchData(i,20)& "</a></td></tr>"
			end if

			html0(14) = "<tr><td width='65%' align=right class=odds id='downodds_" & match_id & "'>"&matchData(i,10)&"</td><td width='35%' align=center>"
			if tv<>"" then html0(14)=html0(14)& " <img src='image/tv_1.gif' alt='"&tv&"' height=14 width=12>"
			html0(15) ="</td></tr></table></td></tr></table>"			
			For j = 0 To 15
				tr_html(i) = tr_html(i) & vbCrLf & html0(j)
			Next
		end if
	next
	oddshtml=""
	For ii = 0 To matchcount-1
		oddshtml=oddshtml& tr_html(ii)
	Next
	if companyid=0 then oddshtml="<div align=center><font color=red size=3><b>中国足彩即时指数<b></font></div>"& oddshtml
	document.getElementById("odds").innerhtml=oddshtml
end sub


sub bbin_MakeTable() '新宝类赔率对阵
	on error resume next
    dim ii
    ii=0
    dim j
    dim match_id
    dim match_leagues
    dim match_typecolor
	dim match_hometeamID
    dim match_guestteamID
	dim goal_cn
	dim oldmatch_type
	dim match_homeorder,match_guestorder,tv
	dim ADflag
	ADflag=false
	oldmatch_type=""
	for i=0 to matchcount-1
		match_id=kk.childNodes.item(i).childNodes.item(0).Text 'ID
		match_typecolor=kk.childNodes.item(i).childNodes.item(1).Text '类型背景色
		match_leagues=kk.childNodes.item(i).childNodes.item(2).Text'类型名称
		matchData(i,0)=match_id
		matchData(i,1)=kk.childNodes.item(i).childNodes.item(3).Text'开赛时间
		matchData(i,2)=split(match_leagues,",")(m_language)'选择的语言对类的类型名
		
		matchData(i,19)=split(kk.childNodes.item(i).childNodes.item(4).Text,",")(m_language)'主队名
		matchData(i,20)=split(kk.childNodes.item(i).childNodes.item(5).Text,",")(m_language)'主队名
		match_hometeamID=split(kk.childNodes.item(i).childNodes.item(6).Text,",")(0)
		match_guestteamID=split(kk.childNodes.item(i).childNodes.item(6).Text,",")(1)

		Neutrality=kk.childNodes.item(i).childNodes.item(7).Text'中立场
		matchData(i,5)=kk.childNodes.item(i).childNodes.item(8).Text'上盘
		if matchData(i,5)="2" then
			matchData(i,21)=matchData(i,20) '上盘
			matchData(i,22)=matchData(i,19) '下盘
		else
			matchData(i,21)=matchData(i,19)
			matchData(i,22)=matchData(i,20)
		end if

		matchData(i,6)=split(kk.childNodes.item(i).childNodes.item(9).Text,",")(0)'赔率ID
		matchData(i,7)=split(kk.childNodes.item(i).childNodes.item(9).Text,",")(1)'初盘口
		matchData(i,8)=split(kk.childNodes.item(i).childNodes.item(9).Text,",")(2)'盘口
		matchData(i,9)=split(kk.childNodes.item(i).childNodes.item(9).Text,",")(3) '上盘水位
		matchData(i,10)=split(kk.childNodes.item(i).childNodes.item(9).Text,",")(4) '下盘水位
	
		matchData(i,11)=split(kk.childNodes.item(i).childNodes.item(10).Text,",")(0)'赔率ID
		matchData(i,12)=split(kk.childNodes.item(i).childNodes.item(10).Text,",")(1)'主胜
		matchData(i,13)=split(kk.childNodes.item(i).childNodes.item(10).Text,",")(2) '客胜
		matchData(i,14)=split(kk.childNodes.item(i).childNodes.item(10).Text,",")(3) '走水
	
		matchData(i,15)=split(kk.childNodes.item(i).childNodes.item(11).Text,",")(0)'赔率ID
		matchData(i,16)=split(kk.childNodes.item(i).childNodes.item(11).Text,",")(1)'盘口
		matchData(i,17)=split(kk.childNodes.item(i).childNodes.item(11).Text,",")(2) '上盘水位
		matchData(i,18)=split(kk.childNodes.item(i).childNodes.item(11).Text,",")(3) '下盘水位
	
		matchData(i,3)=kk.childNodes.item(i).childNodes.item(12).Text '是否走地
	
		match_homeorder=trim(split(kk.childNodes.item(i).childNodes.item(13).Text,",")(0)) '主队排名
		match_guestorder=trim(split(kk.childNodes.item(i).childNodes.item(13).Text,",")(1)) '客队排名
		tv=kk.childNodes.item(i).childNodes.item(14).Text
		if match_homeorder<>"" then match_homeorder="<font color=#444444><sup>["&match_homeorder&"]</sup></font>"
		if match_guestorder<>"" then match_guestorder="<font color=#444444><sup>["&match_guestorder&"]</sup></font>"
		matchData(i,4)=false
		if dateadd("s", diffTime,matchData(i,1))>now() then '还没有到开场时间
			matchData(i,4)=true '是否隐藏
			html0(0)="<table width='100%' border=0 align=center cellpadding=0 cellspacing=1 class=b_tab id='table_" & match_id & "' index="& i &">"
			if oldmatch_type<>matchData(i,2) then 
				html0(0) =html0(0)& "<tr align=center><td colSpan=5 bgcolor="&match_typecolor&"><font color=#FFFFFF><b>"&matchData(i,2)&"</b></font></td></tr>"
				oldmatch_type=matchData(i,2)
			end if

			html0(1) = "<tr class=b_cen id='tr_" & match_id &"'><td rowSpan=3 width=50>"& Month(matchData(i,1)) & "-" & Day(matchData(i,1)) & " " & FormatDateTime(matchData(i,1), vbShortTime)
			if match_zoudi="True" then html0(1) = html0(1) &"<br><span style='background-color: #FF0000'>走地</span>"
			html0(1) = html0(1) &"</td>"
			
			html0(2) ="<td align=left rowSpan=2 width=160><table width='100%'  border=0 cellspacing=0 cellpadding=0><tr id='hometeam_"&match_id&"'>"
			if Neutrality="True" then
				html0(2) =html0(2)& "<td width='90%'><a style='color:#000000' href=javascript:teaminfo('" & match_id & "')>"&matchData(i,19)&"(中)</a>"&match_homeorder&"</td>"
			else
				html0(2) =html0(2)& "<td width='90%'><a style='color:#000000' href=javascript:teaminfo('" & match_id & "')>"&matchData(i,19)&"(主)</a>"&match_homeorder&"</td>"
			end if
			
			html0(2) =html0(2)& "<td width='10%' style='color:red'>"
			if tv<>"" then		html0(2) =html0(2)& "<img src='image/tv_1.gif' alt='"&tv&"'>"
			html0(2) =html0(2)& "</td></tr><tr id='guestteam_"&match_id&"'>"
			
			html0(2) =html0(2)& "<td><a style='color:#000000' href=javascript:teaminfo('" & match_id & "')>"&matchData(i,20)&"</a>"&match_guestorder&"</td>"
			html0(2) =html0(2)& "<td></td></tr></table></td>"
  
			html0(3) = "<td width=45><a href=""javascript:ChangeDetail_s("&i&",'"&company(companyid)&"')"" class=sb><span id='HomeWin_" & match_id & "'>"&matchData(i,12)&"</span></a></td>"
			html0(4) = "<td width=120>"
			html0(5) = "<table cellSpacing=0 cellPadding=0 width='100%' border=0><tr>"
	
			if matchData(i,8)<>""then 
				goal_cn =Goal2GoalCn(matchData(i,8))
			else
				goal_cn = ""
			end if        
			
			if matchData(i,5)="2" then '客队是上盘球队
				html0(6) = "<td align=center width='68%'></td>"
				html0(7) = "<td bgcolor=#ffffff><a href=""javascript:ChangeDetail("&i&",'"&company(companyid)&"')"" class=sb><span id='downodds_" & match_id & "'>"&matchData(i,10)&"</span></a></td>"
			else
				html0(6) = "<td align=center width='68%'><a href=""javascript:ChangeDetail_p("&i&",'"&company(companyid)&"')"" class=pk><span id='goal_" & match_id & "'>"&goal_cn&"</span></a></td>"
				html0(7) = "<td bgcolor=#ffffff><a href=""javascript:ChangeDetail("&i&",'"&company(companyid)&"')"" class=sb><span id='upodds_" & match_id & "'>"&matchData(i,9)&"</span></a></td>"
			end if
			
			html0(8) = "</tr></table>"		
			html0(9) = "</td>"
	
			if matchData(i,16)="" then
				html0(10) = "<td bgcolor=#ffffff align=right width=100>大<span id='goal_t1_" & match_id & "'></span>"
			else
				html0(10) = "<td bgcolor=#ffffff align=right width=100>大<span id='goal_t1_" & match_id & "'>"&Goal_T_Cn(matchData(i,16)*4)&"</span>"
			end if
			html0(11) = "  &nbsp;<a href=""javascript:ChangeDetail_t("&i&",'"&company(companyid)&"')"" class=sb><span id='upodds_t_" & match_id & "'>"&matchData(i,17)&"</span></a>&nbsp;</td></tr>"
			html0(12) = "<tr class=b_cen id='tr2_" & match_id & "'>"
			html0(13) = "<td><a href=""javascript:ChangeDetail_s("&i&",'"&company(companyid)&"')"" class=sb><span id='GuestWin_" & match_id & "'>"&matchData(i,13)&"</span></a></td>"
			html0(14) = "<td><table cellSpacing=0 cellPadding=0 width='100%' border='0'><tr>"
			
			if matchData(i,5)="2" then '客队是上盘球队
				html0(15) = "<td align=center width='68%'><a href=""javascript:ChangeDetail_p("&i&",'"&company(companyid)&"')"" class=pk><span id='goal_" & match_id & "'>"&goal_cn&"</span></a></td>"
				html0(16) = "<td bgcolor=#ffffff><a href=""javascript:ChangeDetail("&i&",'"&company(companyid)&"')"" class=sb><span id='upodds_" & match_id & "'>"&matchData(i,9)&"</span></td>"
			else
				html0(15) = "<td align=center width='68%'></td>"
				html0(16) = "<td bgcolor=#ffffff><a href=""javascript:ChangeDetail("&i&",'"&company(companyid)&"')"" class=sb><span id='downodds_" & match_id & "'>"&matchData(i,10)&"</span></a></td>"
			end if
			html0(17) = "</tr></table></td>"
	
			if matchData(i,16)="" then
				html0(18) = "<td bgcolor=#ffffff align=right>小<span id='goal_t2_" & match_id & "'> </span>  &nbsp;<a href=""javascript:ChangeDetail_t("&i&",'"&company(companyid)&"')"" class=sb><span id='downodds_t_" & match_id & "'>"&matchData(i,18)&"</span></a>&nbsp;</td>"
			else
				html0(18) = "<td bgcolor=#ffffff align=right>小<span id='goal_t2_" & match_id & "'>"&Goal_T_Cn(matchData(i,16)*4)&"</span>  &nbsp;<a href=""javascript:ChangeDetail_t("&i&",'"&company(companyid)&"')"" class=sb><span id='downodds_t_" & match_id & "'>"&matchData(i,18)&"</span></a>&nbsp;</td>"
			end if
	
			html0(19) = "</tr>"
			
			html0(20) = "<tr class=b_cen id='tr3_" & match_id & "'>"
			html0(21) = "<td align=left>和局</td>"
			html0(22) = "<td><a href=""javascript:ChangeDetail_s("&i&",'"&company(companyid)&"')"" class=sb><span id='Standoff_" & match_id & "'>"&matchData(i,14)&"</span></td>"
			if oddskind=1 then 
				html0(23) = "<td colSpan=2 align=right>"
				if match_firstgoal<>match_goal then html0(23) = html0(23) & "<span title='亚赔初盘口'><font color=#888888>" & Goal2GoalCn(matchData(i,7)) & "</font></span> &nbsp; &nbsp;"
				html0(23) = html0(23) & "<a href=""javascript:AsianOdds("&match_id&")"" style='color:#000000'>亚指</A> &nbsp; <A href=""javascript:EuropeOdds("&match_id&")"" target=_self style='color:#000000'>欧指</A> &nbsp; <A href=""javascript:analysis("&match_id&")"" style='color:#000000'>分析</A></td></tr></table>"
			else
				html0(23) = "<td colSpan=2>&nbsp; </td></tr></table>"
			end if
			For j = 0 To 23
				tr_html(i) = tr_html(i) & vbCrLf & html0(j)
			Next
			if not ADflag then
				tr_html(i) =tr_html(i) 
				ADflag=true
			end if
		end if
	next
	
	oddshtml="<table width='100%'  border=0 align=center cellpadding=0 cellspacing=1 class=b_tab>"
	oddshtml=oddshtml& " <tr bgcolor=#DDDDDD align=center>"
	oddshtml=oddshtml& "    <td width=50>時間</td>"
	oddshtml=oddshtml& "    <td width=160 align=left>主客隊伍</td>"
	oddshtml=oddshtml& "    <td width=45>獨贏</td>"
	oddshtml=oddshtml& "    <td width=120>讓球</td>"
	oddshtml=oddshtml& "    <td width=100>大小</td>"
	oddshtml=oddshtml& " </tr></table>"
	
	For ii = 0 To matchcount-1
		oddshtml=oddshtml&vbCrLf & tr_html(ii)
	Next
	document.getElementById("odds").innerhtml=oddshtml
end sub

 '赔率联赛/杯赛名列表
sub matkeleague()
	on error resume next
	dim kk1
	dim st
	dim leaguehtml

	set kk1=myxml.childNodes.item(1).childNodes.item(1)
	leaguecount=kk1.childNodes.length
	leaguehtml=""
	for i=0 to leaguecount-1
		st=split(kk1.childNodes.item(i).Text,",")(m_language)
		leaguehtml=leaguehtml &  "<tr class=font12><td><input onclick='CheckLeague(" & i+1 & ")' checked type=checkbox id='checkboxleague_" & i+1 & "' value='" & st & "' NAME='checkboxleague_" & i+1 & "'/><label style='cursor:hand' for='checkboxleague_" & i+1 & "' id='labelleague_" & i+1 & "'>" & st & "</label></td></tr>"
	next
	leaguehtml="<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0>" & leaguehtml & "</TABLE>"
	document.getElementById("myleague").innerHTML=leaguehtml
end sub

sub getoddsxml()
	on error resume next
    xml1.async = false
    xml1.load chxmlfile
    window.setTimeout "getoddsxml()",4000
end sub

sub refresh() 
	on error resume next
    if xml1.readyState <>"complete" then exit sub
	If xml1.parseError.errorCode<>0 Then exit sub
	if xml1.xml= xml1_xml or xml1.xml="" then exit sub
	
    xml1_xml=xml1.xml   
    if loaded<> -1 then
       loaded=-1
    else
       if xml1.childNodes.item(1).Attributes(0).text<>"0" then
          call loadodds(m_language)
          exit sub
       end if
		if companyid=2 or companyid=3 or companyid=5 or companyid=7  or companyid=16 then
			Call bbin_refresh()
		else
			Call ao_refresh()
		end if
    end if
end sub
sub ao_refresh() 
	on error resume next
	dim i,j,match_id,matchtime,match_oddsid,match_shangpan,match_goal,match_upodds,match_downodds
	dim leap, tmp,match_index
	dim oddsid_s,match_homewin,match_guestwin,match_standoff

    dim upoddschange, downoddschange, oddschange
    For i = 0 To xml1.childNodes.Item(1).childNodes.length - 1
        match_id=xml1.childNodes.Item(1).childNodes.Item(i).childNodes(0).Text
        matchtime=xml1.childNodes.Item(1).childNodes.Item(i).childNodes(1).Text      
	    match_shangpan=xml1.childNodes.item(1).childNodes.item(i).childNodes(2).Text'上盘
		tmp=xml1.childNodes.item(1).childNodes.item(i).childNodes(3).text
		match_oddsid=split(tmp,",")(0)'赔率ID
    	match_goal=split(tmp,",")(1)'盘口
		match_upodds=split(tmp,",")(2) '上盘水位
    	match_downodds=split(tmp,",")(3) '下盘水位
		tmp=xml1.childNodes.item(1).childNodes.item(i).childNodes(4).text
		match_oddsid_s=split(tmp,",")(0)'欧赔ID
    	match_homewin=split(tmp,",")(1)'
		match_guestwin=split(tmp,",")(2)
    	match_standoff=split(tmp,",")(3)
		err.clear
		match_index=document.getElementById("table_" & match_id).index
		if err then tmp=false else tmp=true
		err.clear
		if tmp then  '对象存在
			if matchData(match_index,8)<>match_goal and matchData(match_index,8)="" then
				call loadodds(m_language)
				exit sub
			end if
			'判断上盘水位是否有变化
			upoddschange=false
			leap=false '临场急变
			
			if matchData(match_index,9)<>match_upodds then
				if matchData(match_index,9)>match_upodds then
					document.getElementById("up_" & match_id).style.backgroundColor=fallColor
				else
					document.getElementById("up_" & match_id).style.backgroundColor=riseColor
				end if

				if matchData(match_index,9)<>"" and dateadd("s", 10800-diffTime,now)>cdate(matchtime) and matchData(match_index,8)=match_goal then '临场两小时速变提示
				  if matchData(match_index,8)=match_goal then 
					  if matchData(match_index,9)-match_upodds>0.09  then '临场速变,降
						  document.getElementById("upodds_" & match_id).innerhtml=match_upodds+"<FONT color=#0000ff title='临场3小时内赔率速变提示,变化前赔率："&matchData(match_index,9)&"'>★</FONT>"
						  leap=true
					  elseif match_upodds-matchData(match_index,9)>0.09  then '临场速变,升
						  document.getElementById("upodds_" & match_id).innerhtml=match_upodds+"<FONT color=#FF0000 title='临场3小时内赔率速变提示,变化前赔率："&matchData(match_index,9)&"'>★</FONT>"
						  leap=true
					  else
						  document.getElementById("upodds_" & match_id).innertext=match_upodds
					  end if
					else
					  document.getElementById("upodds_" & match_id).innertext=match_upodds
					end if
				else
					document.getElementById("upodds_" & match_id).innertext=match_upodds
				end if
				upoddschange=true
			end if	
			'判断下盘水位是否有变化
			downoddschange=false
			if matchData(match_index,10)<>match_downodds then
				if matchData(match_index,10)>match_downodds then
					document.getElementById("down_" & match_id).style.backgroundColor=fallColor
				else
					document.getElementById("down_" & match_id).style.backgroundColor=riseColor
				end if
			   document.getElementById("downodds_" & match_id).innertext=match_downodds
			   matchData(match_index,10)=match_downodds
			   downoddschange=true
			end if
			'判断盘口是否有变化
			goalchange=false
			if matchData(match_index,8)<>match_goal then
				if match_goal<>""then
					if cdbl(matchData(match_index,8))<cdbl(match_goal) then '升盘
						document.getElementById("R_goal_" & match_id).innerHTML= "<img src='image/odds_up.gif' width=12 height=11 border=0>"&Goal2GoalCn(match_goal)
						document.getElementById("goal_" & match_id).style.backgroundColor="#FFFF88"
					elseif  cdbl(matchData(match_index,8))>cdbl(match_goal) then 
						document.getElementById("R_goal_" & match_id).innerHTML= Goal2GoalCn(match_goal)&"<img src='image/odds_down.gif' width=12 height=11 border=0>"
						document.getElementById("goal_" & match_id).style.backgroundColor="#8888FF"
					end if
					if matchData(match_index,7)<>match_goal and matchData(match_index,7)<>"" then '与初盘不同，显示初盘
						if matchData(match_index,7)<match_goal then document.getElementById("F_goal_" & match_id).innerText="升"
						if matchData(match_index,7)>match_goal then document.getElementById("F_goal_" & match_id).innerText="降"
						document.getElementById("F_goal_" & match_id).style.display=""
					else 
						document.getElementById("F_goal_" & match_id).style.display="none"'与初盘同，不显示初盘
					end if
				else
					document.getElementById("R_goal_" & match_id).innertext=""
				end if
			   matchData(match_index,6)=match_oddsid
			   goalchange=true
			   '小屏幕显示
			  if document.getElementById("windowCheck").checked=true then
				 if  document.getElementById("table_" & match_id).style.display<>"none" then
					 '动态创建窗口方式
					 call ShowGoalWindow(matchData(match_index,21),matchData(match_index,22),match_upodds,match_downodds ,Goal2GoalCn(match_goal))
				 end if
			  end if
			end if
			
			oddschange=upoddschange or downoddschange or goalchange
			if oddschange then  
				call Ch_Ao_odds(match_index,leap) '显示变盘声			
				 '显示变水文字提示
				if goalchange then
					if matchData(match_index,8)>match_goal then flag="<font color=green>↓</font>" else flag="<font color=red>↑</font>"
					document.getElementById("notify").innerHTML=document.getElementById("notify").innerHTML& matchData(match_index,21) & "：" & Goal2GoalCn(match_goal) &flag &" &nbsp; "
				else
					if matchData(match_index,9)>match_upodds then flag="<font color=green>↓</font>" else flag="<font color=red>↑</font>"
					document.getElementById("notify").innerHTML=document.getElementById("notify").innerHTML& matchData(match_index,21) & "：" & match_upodds &flag&" &nbsp; "
				end if
			   matchData(match_index,8)=match_goal
			   matchData(match_index,9)=match_upodds
			end if
			
			'判断标准盘
			standardoddschange=false
			if matchData(match_index,12)<>match_homewin then
				if matchData(match_index,12)>match_homewin then
					document.getElementById("hw_" & match_id).style.backgroundColor=fallColor
				else
					document.getElementById("hw_" & match_id).style.backgroundColor=riseColor
				end if
				document.getElementById("hw_" & match_id).innertext=match_homewin
				matchData(match_index,12)=match_homewin
				standardoddschange=true
			end if	
			if matchData(match_index,14)<>match_standoff then
				if matchData(match_index,14)>match_standoff then
					document.getElementById("st_" & match_id).style.backgroundColor=fallColor
				else
					document.getElementById("st_" & match_id).style.backgroundColor=riseColor
				end if
				document.getElementById("st_" & match_id).innertext=match_standoff
				matchData(match_index,14)=match_standoff
				standardoddschange=true
			end if	
			if matchData(match_index,13)<>match_guestwin then
				if matchData(match_index,13)>match_guestwin then
					document.getElementById("gw_" & match_id).style.backgroundColor=fallColor
				else
					document.getElementById("gw_" & match_id).style.backgroundColor=riseColor
				end if
				document.getElementById("gw_" & match_id).innertext=match_guestwin
				matchData(match_index,13)=match_guestwin
				standardoddschange=true
			end if
			if standardoddschange then  
				matchData(match_index,11)=match_oddsid_s
				if not oddschange then  call Ch_Ao_odds(match_index,leap) '显示变水声
				 '显示变水文字提示
				document.getElementById("notify").innerHTML=document.getElementById("notify").innerHTML& matchData(match_index,19) & " " & match_homewin &" " & match_standoff & " "& match_guestwin &" "& matchData(match_index,20)& " &nbsp; "
			end if			
		end if
    next   
end sub



sub bbin_refresh() 
	on error resume next
	dim i
    dim j
    dim match_id
    dim matchtime
    dim match_oddsid
    dim match_shangpan
    dim match_goal
    dim match_upodds
    dim match_downodds

    dim upoddschange, downoddschange, oddschange
	document.getElementById("notify").innerHTML= ""
    For i = 0 To xml1.childNodes.Item(1).childNodes.length - 1
        match_id=xml1.childNodes.Item(1).childNodes.Item(i).childNodes(0).Text
        matchtime=xml1.childNodes.Item(1).childNodes.Item(i).childNodes(1).Text  
		    
		match_oddsid=split(xml1.childNodes.Item(1).childNodes.Item(i).childNodes(2).Text,",")(0)'ID
		match_goal=split(xml1.childNodes.Item(1).childNodes.Item(i).childNodes(2).Text,",")(1)'盘口
		match_upodds=split(xml1.childNodes.Item(1).childNodes.Item(i).childNodes(2).Text,",")(2) '上盘水位
		match_downodds=split(xml1.childNodes.Item(1).childNodes.Item(i).childNodes(2).Text,",")(3) '下盘水位
	
		match_oddsID_s=split(xml1.childNodes.Item(1).childNodes.Item(i).childNodes(3).Text,",")(0)'ID
		homewin=split(xml1.childNodes.Item(1).childNodes.Item(i).childNodes(3).Text,",")(1)'主胜
		guestwin=split(xml1.childNodes.Item(1).childNodes.Item(i).childNodes(3).Text,",")(2) '客胜
		Standoff=split(xml1.childNodes.Item(1).childNodes.Item(i).childNodes(3).Text,",")(3) '走水
	
		match_oddsid_t=split(xml1.childNodes.Item(1).childNodes.Item(i).childNodes(4).Text,",")(0)'ID
		match_goal_t=split(xml1.childNodes.Item(1).childNodes.Item(i).childNodes(4).Text,",")(1)'盘口
		match_upodds_t=split(xml1.childNodes.Item(1).childNodes.Item(i).childNodes(4).Text,",")(2) '上盘水位
		match_downodds_t=split(xml1.childNodes.Item(1).childNodes.Item(i).childNodes(4).Text,",")(3) '下盘水位

		err.clear
		match_index=document.getElementById("table_" & match_id).index
		if err then tmp=false else tmp=true
		err.clear
		if tmp then  '对象存在
			oddschange_l=false  
			oddschange_s=false
			oddschange_t=false
			goalchange_l=false
			goalchange_t=false
			'判断让球盘上盘水位是否有变化
			if matchData(match_index,9)<>match_upodds then
				if matchData(match_index,9)>match_upodds then
					document.getElementById("upodds_" & match_id).style.backgroundColor="#00FF44"
				else
					document.getElementById("upodds_" & match_id).style.backgroundColor="#F8A7A3"
				end if
			   document.getElementById("upodds_" & match_id).innertext=match_upodds
			   oddschange_l=true
			end if
			'判断让球盘下盘水位是否有变化
			if matchData(match_index,10)<>match_downodds then
				if matchData(match_index,10)>match_downodds then
					document.getElementById("downodds_" & match_id).style.backgroundColor="#00FF44"
				else
					document.getElementById("downodds_" & match_id).style.backgroundColor="#F8A7A3"
				end if
			   document.getElementById("downodds_" & match_id).innertext=match_downodds
			   matchData(match_index,10)=match_downodds
			   oddschange_l=true
			end if

			'判断大小盘上盘水位是否有变化
			if matchData(match_index,17)<>match_upodds_t then
				if matchData(match_index,17)>match_upodds_t then
					document.getElementById("upodds_t_" & match_id).style.backgroundColor="#00FF44"
				else
					document.getElementById("upodds_t_" & match_id).style.backgroundColor="#F8A7A3"
				end if
			   document.getElementById("upodds_t_" & match_id).innertext=match_upodds_t
			   oddschange_t=true
			end if
			'判断大小盘下盘水位是否有变化
			if matchData(match_index,18)<>match_downodds_t then
				if matchData(match_index,18)>match_downodds_t then
					document.getElementById("downodds_t_" & match_id).style.backgroundColor="#00FF44"
				else
					document.getElementById("downodds_t_" & match_id).style.backgroundColor="#F8A7A3"
				end if
			   document.getElementById("downodds_t_" & match_id).innertext=match_downodds_t
			   matchData(match_index,18)=match_downodds_t
			   oddschange_t=true
			end if

			'判断标准盘主胜水位是否有变化
			if matchData(match_index,12)<>homewin then
				if matchData(match_index,12)>homewin then
					document.getElementById("homewin_" & match_id).style.backgroundColor="#00FF44"
				else
					document.getElementById("homewin_" & match_id).style.backgroundColor="#F8A7A3"
				end if
			   document.getElementById("homewin_" & match_id).innertext=homewin
			   matchData(match_index,12)=homewin
	   		   matchData(match_index,11)=match_oddsid_s
			   oddschange_s=true
			end if
			'判断标准盘客胜水位是否有变化
			if matchData(match_index,13)<>guestwin then
				if matchData(match_index,13)>guestwin then
					document.getElementById("guestwin_" & match_id).style.backgroundColor="#00FF44"
				else
					document.getElementById("guestwin_" & match_id).style.backgroundColor="#F8A7A3"
				end if
			   document.getElementById("guestwin_" & match_id).innertext=guestwin
			   matchData(match_index,13)=guestwin
			   oddschange_s=true
			end if
			'判断标准盘走水水位是否有变化
			if matchData(match_index,14)<>Standoff then
				if matchData(match_index,14)>Standoff then
					document.getElementById("Standoff_" & match_id).style.backgroundColor="#00FF44"
				else
					document.getElementById("Standoff_" & match_id).style.backgroundColor="#F8A7A3"
				end if
			   document.getElementById("Standoff_" & match_id).innertext=Standoff
			   matchData(match_index,14)=Standoff
			   oddschange_s=true
			end if
						
			'检查让球盘口
			goalchange=false
			if matchData(match_index,8)<>match_goal then
				if match_goal<>""then 
					if cdbl(matchData(match_index,8))<cdbl(match_goal) then '升盘
						document.getElementById("goal_" & match_id).innerHTML= "<img src='../image/odds_up.gif' width=12 height=11 border=0>"& Goal2GoalCn(match_goal)
					else
						document.getElementById("goal_" & match_id).innerHTML= Goal2GoalCn(match_goal)&"<img src='../image/odds_down.gif' width=12 height=11 border=0>"
					end if
				else
					document.getElementById("goal_" & match_id).innertext=""
				end if
	   		   matchData(match_index,6)=match_oddsid
			   goalchange_l=true
			end if

			'检查大小盘盘口
			if matchData(match_index,16)<>match_goal_t then
				if match_goal<>""then 
					if cdbl(matchData(match_index,16))<cdbl(match_goal_t) then '升盘
						document.getElementById("goal_t1_" & match_id).innerHTML= "<img src='../image/odds_up.gif' width=12 height=11 border=0>"&Goal_T_Cn(match_goal_t*4)
						document.getElementById("goal_t2_" & match_id).innerHTML= "<img src='../image/odds_up.gif' width=12 height=11 border=0>"&Goal_T_Cn(match_goal_t*4)
					else
						document.getElementById("goal_t1_" & match_id).innerHTML= Goal_T_Cn(match_goal_t*4)&"<img src='../image/odds_down.gif' width=12 height=11 border=0>"
						document.getElementById("goal_t2_" & match_id).innerHTML= Goal_T_Cn(match_goal_t*4)&"<img src='../image/odds_down.gif' width=12 height=11 border=0>"
					end if
				else
					document.getElementById("goal_t1_" & match_id).innertext=""
					document.getElementById("goal_t2_" & match_id).innertext=""
				end if
	   		   matchData(match_index,15)=match_oddsid_t
			   goalchange_t=true
			end if

			oddschange=oddschange_l or oddschange_s or oddschange_t
			goalchange=goalchange_l or goalchange_t
			if oddschange or goalchange  then
				call Ch_SB_odds(match_id,goalchange) '声音提示
				if goalchange_l then
					if matchData(match_index,8)>match_goal then flag="<font color=green>↓</font>" else flag="<font color=red>↑</font>"
					document.getElementById("notify").innerHTML=document.getElementById("notify").innerHTML&"<font color=#FF0000>让球:</font>"& matchData(match_index,21) & "：" & Goal2GoalCn(match_goal) &flag &" &nbsp; "
				else
					if matchData(match_index,9)>match_upodds then flag="<font color=green>↓</font>" else flag="<font color=red>↑</font>"
					document.getElementById("notify").innerHTML=document.getElementById("notify").innerHTML&"<font color=#FF0000>让球:</font>"& matchData(match_index,21) & "：" & match_upodds &flag&" &nbsp; "
				end if
				matchData(match_index,8)=match_goal
				matchData(match_index,9)=match_upodds
			end if
			if oddschange_t or goalchange_t then  '大小盘有变
				if goalchange_t then
					if matchData(match_index,16)>match_goal_t then flag="<font color=green>↓</font>" else flag="<font color=red>↑</font>"
					document.getElementById("notify").innerHTML=document.getElementById("notify").innerHTML&"<font color=#0000FF>大小:</font>"& matchData(match_index,21) & "：" & Goal_T_Cn(match_goal_t*4) &flag &" &nbsp; "
				else
					if matchData(match_index,17)>match_upodds_t then flag="<font color=green>↓</font>" else flag="<font color=red>↑</font>"
					document.getElementById("notify").innerHTML=document.getElementById("notify").innerHTML&"<font color=#0000FF>大小:</font>"& matchData(match_index,21) & "：" & match_upodds_t &flag&" &nbsp; "
				end if
				matchData(match_index,16)=match_goal_t
				matchData(match_index,17)=match_upodds_t
			end if
			if oddschange_s then  '标准盘有变
				document.getElementById("notify").innerHTML=document.getElementById("notify").innerHTML&"<font color=#00AA00>标准:</font>"&matchData(match_index,21) & ":(" & homewin &","& standoff&","& guestwin &")"& matchData(match_index,22)&" &nbsp; "
			end if
		end if
    next   
end sub

sub Ch_Ao_odds(i,leap)
	on error resume next
	if document.getElementById("soundCheck").checked then '盘口变了并且选择了声音提示
		if  document.getElementById("table_" & matchData(i,0)).style.display<>"none" then '赛事没被隐藏
		   if leap then '临场急变水位
			   document.getElementById("sound").innerhtml=flash_sound(1)
		   else'变水
			   document.getElementById("sound").innerhtml=flash_sound(0)
		   end if
		end if		
	end if
    window.setTimeout "ComebackAoOddsColor(" & i & ")",60000
end sub

sub ComebackAoOddsColor(i) '恢复背景颜色
	on error resume next
    document.getElementById("up_" & matchData(i,0)).style.backgroundColor=""
    document.getElementById("down_" & matchData(i,0)).style.backgroundColor=""
    document.getElementById("goal_" & matchData(i,0)).style.backgroundColor=""
    document.getElementById("hw_" & matchData(i,0)).style.backgroundColor=""
    document.getElementById("st_" & matchData(i,0)).style.backgroundColor=""
    document.getElementById("gw_" & matchData(i,0)).style.backgroundColor=""
	if matchData(i,8)<>"" then
		document.getElementById("R_goal_" & matchData(i,0)).innerHTML= Goal2GoalCn(matchData(i,8))
	else
		document.getElementById("R_goal_" & matchData(i,0)).innerHTML= ""
	end if
	document.getElementById("notify").innerHTML= ""
end sub

sub Ch_SB_odds(m,goalchange)
	on error resume next
    dim addHtml,n
	'赛事没被隐藏 并且选择了声音提示
	if document.getElementById("soundCheck").checked and document.getElementById("table_" & m).style.display<>"none" then 
	   document.getElementById("sound").innerhtml=flash_sound(0) 
	end if
    window.setTimeout "ComebackSBOddsColor(" & m & ")",6000
end sub

sub ComebackSBOddsColor(matchid) '恢复背景颜色
	on error resume next
    document.getElementById("upodds_" & matchid).style.backgroundColor=""
    document.getElementById("downodds_" & matchid).style.backgroundColor=""
    document.getElementById("upodds_t_" & matchid).style.backgroundColor=""
    document.getElementById("downodds_t_" & matchid).style.backgroundColor=""
    document.getElementById("homewin_" & matchid).style.backgroundColor=""
    document.getElementById("guestwin_" & matchid).style.backgroundColor=""
    document.getElementById("standoff_" & matchid).style.backgroundColor=""
    document.getElementById("goal_" & matchid).innerhtml=document.getElementById("goal_" & matchid).innertext
    document.getElementById("goal_t1_" & matchid).innerhtml=document.getElementById("goal_t1_" & matchid).innertext
    document.getElementById("goal_t2_" & matchid).innerhtml=document.getElementById("goal_t2_" & matchid).innertext
	document.getElementById("notify").innerHTML= ""
end sub

sub showallmatch()'今天所有的赛事
  on error resume next
  dim i
  for i= 0 to matchcount-1
     document.getElementById("table_" & matchData(i,0)).style.display="" 
  next
  for i=1 to leaguecount
    document.getElementById("checkboxleague_" & i).checked=true
  next
  document.getElementById("hiddencount").innerText=0
end sub 

sub SelectOtherLeague()
	on error resume next
    dim i,j,hh
	hh=0
    for i=1 to leaguecount
       document.getElementById("checkboxleague_" & i).checked=not document.getElementById("checkboxleague_" & i).checked
    next

    dim matchid
    for i=1 to leaguecount
		sclass=document.getElementById("labelleague_" & i).innertext
        if document.getElementById("checkboxleague_" & i).checked=true then
           for j=0 to matchcount-1
        	 if matchData(j,2)=sclass then
			   	document.getElementById("table_" & matchData(j,0)).style.display=""
	         end if
           next  
        else
           for j=0 to matchcount-1
              if matchData(j,2)=sclass then
		    	document.getElementById("table_" & matchData(j,0)).style.display="none"
				hh=hh+1
			  end if
           next 
        end if
    next
 	document.getElementById("hiddencount").innerText=hh
end sub

sub CheckLeague(SclassIndex)
	on error resume next
    dim j,sclass, matchid,hh
	sclass=document.getElementById("labelleague_" & SclassIndex).innertext
	hh=document.getElementById("hiddencount").innerText
    if document.getElementById("checkboxleague_" & SclassIndex).checked=true then
       for j=0 to matchcount-1
   	      if matchData(j,2)=sclass then
		  	document.getElementById("table_" & matchData(j,0)).style.display=""
			hh=hh-1
          end if
        next  
     else
        for j=0 to matchcount-1
          if matchData(j,2)=sclass then
		  	document.getElementById("table_" & matchData(j,0)).style.display="none"
			hh=hh+1
		  end if
         next 
     end if
 	document.getElementById("hiddencount").innerText=hh
end sub

sub ChangeDetail(i,companyName)'让球盘(澳门格式)
	if oddskind=0 then '早餐盘
		call window.open("xedh/AsianOdds_cc.php?ID="&matchData(i,6)&"&t1="&matchData(i,21)&"&t2="&matchData(i,22)&"&company="&companyName,"","width=500,height=300,resizable=yes,scrollbars=yes")
	else
		call window.open("xedh/AsianOdds.php?ID="&matchData(i,6)&"&t1="&matchData(i,21)&"&t2="&matchData(i,22)&"&company="&companyName,"","width=500,height=400,resizable=yes,scrollbars=yes")
	end if
end sub

sub ChangeDetail_p(matchid,companyID,team1,team2,companyName) '让球盘（图）
	dim oddsid
	oddsid=document.getElementById("tr_" & matchid).oddsID
	if oddskind=0 then '早餐盘
		call window.open("xedh/AsianOdds_cc_p.php?ID="&oddsid&"&t1="&team1&"&t2="&team2&"&company="&companyName&"&matchid="&matchid)
	else
		call window.open("xedh/AsianOdds_p.php?ID="&oddsid&"&t1="&team1&"&t2="&team2&"&company="&companyName&"&matchid="&matchid)
	end if
end sub

sub ChangeDetail_a(matchid,companyName)'让球盘(澳门格式)
	dim oddsid
	oddsid=document.getElementById("goal_" & matchid).oddsID
	team1=document.getElementByid("up_"&matchid).team1
	team2=document.getElementByid("down_"&matchid).team2
	if oddskind=0 then '早餐盘
		call window.open("xedh/AsianOdds_cc.php?ID="&oddsid&"&t1="&team1&"&t2="&team2&"&company="&companyName,"","width=500,height=300,resizable=yes,scrollbars=yes")
	else
		call window.open("xedh/AsianOdds.php?ID="&oddsid&"&t1="&team1&"&t2="&team2&"&company="&companyName,"","width=500,height=400,resizable=yes,scrollbars=yes")
	end if
end sub

sub ChangeDetail_p_a(matchid,companyID,companyName)'让球盘（澳门格式）图
	dim oddsid
	oddsid=document.getElementById("goal_" & matchid).oddsID
	team1=document.getElementByid("up_"&matchid).team1
	team2=document.getElementByid("down_"&matchid).team2
	if oddskind=0 then '早餐盘
		call window.open("xedh/AsianOdds_cc_p.php?ID="&oddsid&"&t1="&team1&"&t2="&team2&"&company="&companyName&"&matchid="&matchid)
	else
		call window.open("xedh/AsianOdds_p.php?ID="&oddsid&"&t1="&team1&"&t2="&team2&"&company="&companyName&"&matchid="&matchid)
	end if
end sub

sub ChangeDetail_t(matchid,hometeam,guestteam,companyName) '大小盘
	dim oddsid
	oddsid=document.getElementById("tr_" & matchid).oddsID_t
	if oddskind=0 then '早餐盘
		call window.open("xedh/OverDown_cc.php?ID="&oddsid&"&home="&hometeam&"&guest="&guestteam&"&company="&companyName,"","width=500,height=300,resizable=yes,scrollbars=yes")
	else
		call window.open("xedh/OverDown.php?ID="&oddsid&"&home="&hometeam&"&guest="&guestteam&"&company="&companyName,"","width=500,height=400,resizable=yes,scrollbars=yes")
	end if
end sub

sub ChangeDetail_t(matchid,companyName) '大小盘
	if oddskind=0 then '早餐盘
		call window.open("xedh/OverDown.php?ID="&matchData(i,15)&"&home="&matchData(i,19)&"&guest="&matchData(i,20)&"&company="&companyName,"","width=500,height=300,resizable=yes,scrollbars=yes")
	else
		call window.open("xedh/OverDown.php?ID="&matchData(i,15)&"&home="&matchData(i,19)&"&guest="&matchData(i,20)&"&company="&companyName,"","width=500,height=400,resizable=yes,scrollbars=yes")
	end if
end sub


sub ChangeDetail_p(i,companyName)'让球盘（澳门格式）图
	dim oddsid
	if oddskind=0 then '早餐盘
		call window.open("xedh/AsianOdds_p.php?ID="&matchData(i,6)&"&t1="&matchData(i,21)&"&t2="&matchData(i,22)&"&company="&companyName&"&matchid="&matchData(i,0))
	else
		call window.open("xedh/AsianOdds_p.php?ID="&matchData(i,6)&"&t1="&matchData(i,21)&"&t2="&matchData(i,22)&"&company="&companyName&"&matchid="&matchData(i,0))
	end if
end sub

sub ChangeDetail_s(i,companyName) '标准盘
	if oddskind=0 then '早餐盘
		call window.open("xedh/standard_cc.php?ID="&matchData(i,11)&"&home="&matchData(i,19)&"&guest="&matchData(i,20)&"&company="&companyName,"","width=500,height=200,resizable=yes,scrollbars=yes")
	else
		call window.open ("xedh/standard.php?ID="&matchData(i,11)&"&home="&matchData(i,19)&"&guest="&matchData(i,20)&"&company="&companyName,"","width=500,height=300,resizable=yes,scrollbars=yes")
	end if
end sub

sub autoHide()'到了开场时间，自动隐葳赛事
	for i=0 to matchcount-1
		if matchData(i,4) and dateadd("s", diffTime,matchData(i,1))<now() then '到了开场时间
			matchData(i,4)=false
	    	document.getElementById("table_" & matchData(i,0)).style.display="none"
		end if
	next
	setTimeout "autoHide()",120000
end sub

'companyid=getCookie("Bet007_odds_SelCompanyID")
'm_language=getCookie("Bet007_odds_SelLanguage")
m_language=1
companyid=1
call selCompany(companyid) '显示赔率对阵'
setTimeout "getoddsxml()",4000
setTimeout "autoHide()",6000