on error resume next dim i,kk,matchcount,datecount dim leaguecount dim loaded,gsID gsID="," & CompanyID1 & "," datecount=0 dim matchdata(),oddsdata() '保存比赛时间等信息 dim tr_xml() dim html0(25) dim GoalCn(20) 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)="五球" function Goal2GoalCn(goal) '数字盘口转汉汉字 on error resume next if goal>=0 then Goal2GoalCn=GoalCn(cint(goal*4)) else Goal2GoalCn="受"& GoalCn(abs(cint(goal*4))) end function call loadodds(1) sub loadodds(language) loaded=0 m_language=language myxml.async = false myxml.load "/cache/betball.xml" set kk=myxml.childNodes.item(1).childNodes.item(0) matchcount=kk.childNodes.length redim tr_xml(matchcount-1) redim matchdata(matchcount-1,14) '赛事数据 redim oddsdata(matchcount-1,14,6)'赔率数据 If matchcount>=0 Then Call MakeTable() end if call matkeleague() document.getElementById("loadtext").innerhtml="数据加载完毕,程序会自动刷新。

感谢观看,祝您愉快!" settimeout "NotDisplay()",2000 end sub '隐藏加载提示 sub NotDisplay() document.getElementById("loading").style.display="none" end sub '语言转换 sub selLanguage(language) document.getElementById("loadtext").innerhtml="系统正在转换语言,请稍候……" document.getElementById("loading").style.display="" settimeout "loadodds("&language&")",10 end sub sub MakeTable() dim ii ii=0 dim j dim bgcolor oddsHead="" oddsHead=oddsHead&"类型" oddsHead=oddsHead&"球 队" for i=0 to companyCount-1 oddsHead=oddsHead&""&company(i,2) & "" document.getElementById("CompanyID_" & company(i,1)).checked=true next oddsHead=oddsHead& "" for i=0 to matchcount-1 matchdata(i,0)=kk.childNodes.item(i).childNodes.item(0).Text 'ID matchdata(i,1)=kk.childNodes.item(i).childNodes.item(1).Text '类型背景色 matchdata(i,2)=split(kk.childNodes.item(i).childNodes.item(2).Text,",")(m_language)'选择的语言对类的类型名 matchdata(i,3)=kk.childNodes.item(i).childNodes.item(3).Text'开赛时间 matchdata(i,4)=split(kk.childNodes.item(i).childNodes.item(4).Text,",")(m_language)'主队名 matchdata(i,5)=split(kk.childNodes.item(i).childNodes.item(5).Text,",")(m_language)'客队名 matchdata(i,6)=split(kk.childNodes.item(i).childNodes.item(6).Text,",")(0) '主队ID matchdata(i,7)=split(kk.childNodes.item(i).childNodes.item(6).Text,",")(1) '客队ID Neutrality=kk.childNodes.item(i).childNodes.item(7).Text'中立场 matchdata(i,8)=kk.childNodes.item(i).childNodes.item(8).Text'上盘 if matchdata(i,8)="2" then matchdata(i,9)=matchdata(i,5) '上盘 matchdata(i,10)=matchdata(i,4) '下盘 else matchdata(i,9)=matchdata(i,4) matchdata(i,10)=matchdata(i,5) end if arr=split(kk.childNodes.item(i).childNodes.item(9).Text,";") '各公司赔率 for j=LBound(arr) To UBound(arr) oddsdata(i,j+1,0)=split(arr(j),",")(0) '赔率ID oddsdata(i,j+1,1)=split(arr(j),",")(2) '盘口 oddsdata(i,j+1,2)=split(arr(j),",")(3)'上盘水位 oddsdata(i,j+1,3)=split(arr(j),",")(4)'下盘水位 oddsdata(i,j+1,4)=split(arr(j),",")(1)'初盘口 next matchdata(i,11)=true '是否显示 matchdata(i,12)=true '是否到时 if bgcolor="#F5F5F5" then bgcolor="#EBF0FC" else bgcolor="#F5F5F5" html0(0) = "" html0(1) = ""&matchdata(i,2)&"
"&formatdatetime(matchdata(i,3),vbshorttime)&"
" if matchdata(i,8)="2" then '判断哪个队是上盘球队,2:客上盘 html0(2) = "" if Neutrality="True" then html0(2) = html0(2) & "" html0(3) = "
"& matchdata(i,5)&"(中)
"& matchdata(i,4)&"
" else html0(2) = html0(2) & ""& matchdata(i,5)&"" html0(3) = ""& matchdata(i,4)&"" end if else html0(2) = "" if Neutrality="True" then html0(2) = html0(2) & "" html0(3) = "
"& matchdata(i,4)&"(中)
"& matchdata(i,5)&"
" else html0(2) = html0(2) & ""& matchdata(i,4)&"" html0(3) = ""& matchdata(i,5)&"" end if end if html0(5) = " " ' html0(4)="" for j=0 to companyCount-1 html0(4)=html0(4)&"" html0(4)=html0(4)&"" html0(4)=html0(4)&"" html0(4)=html0(4)&"" html0(4)=html0(4)&"" html0(4)=html0(4)&"
"&oddsdata(i,company(j,3),2)&"
" if oddsdata(i,company(j,3),1)<>"" then html0(4)=html0(4)& Goal2GoalCn(oddsdata(i,company(j,3),1)) html0(4)=html0(4)&"" if oddsdata(i,company(j,3),1)<>"" then if oddsdata(i,company(j,3),1)=oddsdata(i,company(j,3),4) then html0(4)=html0(4)& "" if cdbl(oddsdata(i,company(j,3),4))升" if cdbl(oddsdata(i,company(j,3),4))>cdbl(oddsdata(i,company(j,3),1)) then html0(4)=html0(4)& " " else html0(4)=html0(4)& "" end if html0(4)=html0(4)&"
"&oddsdata(i,company(j,3),3)&"
" next tr_xml(i) = (html0(0) & html0(1) & html0(2) & html0(5) & html0(3) & html0(4) ) if i=0 then tr_xml(i) =tr_xml(i) & "广告:" end if if i=1 then tr_xml(i) =tr_xml(i) & "广告:" end if if i=2 then tr_xml(i) =tr_xml(i) & "广告:" end if If InStr(matchdate1, formatdatetime(matchdata(i,3),vbshortdate)) <= 0 Then tr_xml(i) = ""&formatdatetime(matchdata(i,3),vblongdate)&" " & tr_xml(i) datecount=datecount+1 matchdate1=matchdate1 & formatdatetime(matchdata(i,3),vbshortdate) matchdate = matchdate & "
" End If if i mod 10=0 then tr_xml(i)=oddsHead & tr_xml(i) next document.getElementById("scheduleDate").innerhtml=matchdate if 195+companycount*55<778 then tableWidth=778 else tableWidth=195+companycount*58 oddshtml="" '& oddsHead For ii = 0 To matchcount-1 oddshtml=oddshtml& tr_xml(ii) Next oddsHead=oddsHead& "
" document.getElementById("odds").innerhtml=oddshtml end sub '联赛/杯赛名列表 sub matkeleague() dim l dim kk1 dim st dim leaguehtml set kk1=myxml.childNodes.item(1).childNodes.item(1) l=kk1.childNodes.length leaguecount=l leaguehtml="" for i=0 to l-1 st=split(kk1.childNodes.item(i).Text,",")(m_language) leaguehtml=leaguehtml & "" next leaguehtml="" & leaguehtml & "
" document.getElementById("myleague").innerHTML=leaguehtml end sub dim xmlOdds Set xmlOdds = CreateObject("Microsoft.XMLDOM") dim xml1_xml dim notify notify="" xml1_xml="" dim riseColor,fallColor,GoalColor riseColor="#FECCCB" fallColor="#CDFFCC" GoalColor="#FFFF00" '----------------------------------------------------------------------------------------- dim FlashSound FlashSound = "" sub getxml() on error resume next xmlOdds.load "/cache/change2.xml" xmlOdds.onreadystatechange =GetRef("refresh") window.setTimeout "getxml()",10000 end sub sub refresh() on error resume next if xmlOdds.readyState<>4 then exit sub if xmlOdds.parseError.errorCode<>0 Then exit sub if xmlOdds.xml = "" then exit sub xml1.XMLDocument.async = false xml1.XMLDocument.loadXML xmlOdds.xml if xml1.xml= xml1_xml or xml1.xml="" then exit sub xml1_xml=xml1.xml dim i dim j dim match_id,company_id dim leap dim match_odds(4),match_closepan dim upoddschange, downoddschange, oddschange dim win(30,2),haveWin,havechange For i = 0 To xml1.childNodes.Item(1).childNodes.length - 1 arr=split(xml1.childNodes.Item(1).childNodes.Item(i).Text,",") match_id=arr(0) if instr(gsID,arr(1))>0 then if typename(document.getElementById("upodds_" & arr(1) &"_"&match_id))<>"Nothing" then '对象存在 match_index=document.getElementById("tr_" & match_id).index shangpan=matchdata(match_index,8) '上盘 company_id=arr(1) '公司的ID号 company_order=companyOrder(company_id) '公司的排列序号 match_odds(0)=arr(2) '赔率ID match_odds(1)=arr(3) '盘口 match_odds(2)=arr(4)'上盘水位 match_odds(3)=arr(5)'下盘水位 match_time=matchdata(match_index,3) havechange=false '判断上盘水位是否有变化 upoddschange=false oldgoal=oddsData(match_index,company_order,1) oldupodds=oddsData(match_index,company_order,2) olddownodds=oddsData(match_index,company_order,3) if oldupodds<>match_odds(2) then if oldupodds>match_odds(2) then document.getElementById("odds_" &company_id&"_"&match_id).style.backgroundColor=fallColor else document.getElementById("odds_" &company_id&"_"&match_id).style.backgroundColor=riseColor end if document.getElementById("upodds_" & company_id &"_"&match_id).innertext=match_odds(2) oddsData(match_index,company_order,2)=match_odds(2) upoddschange=true end if '判断下盘水位是否有变化 downoddschange=false if olddownodds<>match_odds(3) then document.getElementById("downodds_" &company_id &"_"&match_id).innertext=match_odds(3) oddsData(match_index,company_order,3)=match_odds(3) downoddschange=true end if '判断盘口是否有变化 goalchange=false if oldgoal<>match_odds(1) then goalchange=true if match_odds(1)<>""then if cdbl(oldgoal)cdbl(match_odds(1)) then document.getElementById("goal_" & company_id & "_" & match_id).innerHTML= Goal2GoalCn(match_odds(1))&"" else goalchange=false end if if oldgoal<>match_odds(1) and oldgoal<>"" then '与初盘不同,显示初盘 if oldgoalmatch_odds(1) then document.getElementById("F_goal_" & company_id &"_" & match_id).innerText="降" document.getElementById("F_goal_" & company_id &"_" & match_id).style.display="" else document.getElementById("F_goal_" & company_id &"_" & match_id).style.display="none"'与初盘同,不显示初盘 end if else document.getElementById("goal_" & company_id & "_" & match_id).innertext="" end if oddsData(match_index,company_order,0)=match_odds(0) oddsData(match_index,company_order,1)=match_odds(1) end if if upoddschange or downoddschange or goalchange then call ShowFlash_water(match_index,company_id) if goalchange then '变盘提示 notify=notify&""&companyName(company_id)&"变盘:"& matchdata(match_index,9) &" "& match_odds(2) &" "& Goal2GoalCn(match_odds(1)) &" "& match_odds(3) &" "& matchdata(match_index,10) &" | " end if havechange=havechange or upoddschange or downoddschange or goalchange end if end if next if notify<>"" then document.getElementById("notify").innerhtml=notify end sub '水位盘口变化时声音提示 sub ShowFlash_water(match_index,companyID) on error resume next dim addHtml,n if soundCheck and matchData(match_index,11) then '水位变了并且选择了声音提示 document.getElementById("sound").innerhtml=FlashSound end if window.setTimeout "colors_water(" & match_index & ","& companyID&")",80000 end sub sub colors_water(match_index,companyID) '恢复背景颜色 dim j on error resume next matchid=matchdata(match_index,0) document.getElementById("goal_"&companyID&"_"&matchid).innerHtml=document.getElementById("goal_"&companyID&"_"&matchid).innerText document.getElementById("odds_"&companyID&"_"&matchid).style.backgroundColor="" document.getElementById("notify").innerhtml="            点击收藏本站网址:www.22878.com" notify="" end sub sub ChangeDetail(match_index,companyOrder,companyName) dim oddsid,team1,team2 team1=matchdata(match_index,9) team2=matchdata(match_index,10) oddsid=oddsdata(match_index,companyOrder,0) window.open "xml2/ypchdetail.aspx?ID="&oddsid&"&t1="&team1&"&t2="&team2&"&company="&companyName,"","width=380,height=300,left=150,top=50,resizable=yes,scrollbars=yes" end sub sub hidematch(match_index) document.getElementById("tr_" & matchdata(match_index,0)).style.display="none" document.getElementById("checkbox_" & matchdata(match_index,0)).checked=True matchdata(match_index,11)=false document.getElementById("hiddencount").innerText=document.getElementById("hiddencount").innerText+1 end sub sub showallmatch()'今天所有的赛事,但不包括到了时间自动隐藏的赛事 dim i for i= 0 to matchcount-1 if matchdata(i,12) then '没有到开场时间 document.getElementById("tr_" & matchdata(i,0)).style.display="" matchdata(i,11)=true end if next for i=1 to leaguecount document.getElementById("checkboxleague_" & i).checked=true next document.getElementById("hiddencount").innerText=0 end sub sub SelectOtherLeague() dim i,j,hh hh=0 for i=1 to leaguecount document.getElementById("checkboxleague_" & i).checked= not document.getElementById("checkboxleague_" & i).checked next 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,12) and matchdata(j,2)=sclass then '没有到开场时间 document.getElementById("tr_" & matchdata(j,0)).style.display="" matchdata(j,11)=true end if next else for j=0 to matchcount-1 if matchdata(j,12) and matchdata(j,2)=sclass then '没有到开场时间 document.getElementById("tr_" & matchdata(j,0)).style.display="none" matchdata(j,11)=false hh=hh+1 end if next end if next document.getElementById("hiddencount").innerText=hh end sub sub CheckLeague(i) dim j,sclass,hh hh=document.getElementById("hiddencount").innerText sclass=document.getElementById("labelleague_" & i).innertext if document.getElementById("checkboxleague_" & i).checked=true then for j=0 to matchcount-1 if matchdata(j,12) and matchdata(j,2)=sclass then '没有到开场时间 if document.getElementById("tr_" & matchdata(j,0)).style.display="none" then hh=hh-1 document.getElementById("tr_" & matchdata(j,0)).style.display="" matchdata(j,11)=true end if next else for j=0 to matchcount-1 if matchdata(j,12) and matchdata(j,2)=sclass then '没有到开场时间 if document.getElementById("tr_" & matchdata(j,0)).style.display="" then hh=hh+1 document.getElementById("tr_" & matchdata(j,0)).style.display="none" matchdata(j,11)=false end if next end if document.getElementById("hiddencount").innerText=hh end sub sub CheckDate(matchdate,i) dim j,hh hh=document.getElementById("hiddencount").innerText if document.getElementById("checkboxdate_" & i).checked=true then for j=0 to matchcount-1 if matchdata(j,12) and formatdatetime(matchdata(j,3),vbshortdate)=matchdate then '所选日期 if document.getElementById("tr_" & matchdata(j,0)).style.display="none" then hh=hh-1 document.getElementById("tr_" & matchdata(j,0)).style.display="" matchdata(j,11)=true end if next else for j=0 to matchcount-1 if matchdata(j,12) and formatdatetime(matchdata(j,3),vbshortdate)=matchdate then '所选日期 if document.getElementById("tr_" & matchdata(j,0)).style.display="" then hh=hh+1 document.getElementById("tr_" & matchdata(j,0)).style.display="none" matchdata(j,11)=false end if next end if document.getElementById("hiddencount").innerText=hh end sub sub autoHide()'到了开场时间,自动隐葳赛事 dim nowtime,matchindex nowtime = now() for i=0 to matchcount-1 if matchdata(i,12) and dateadd("s", diffTime,matchdata(i,3))