on error resume next dim xmlScore Set xmlScore = CreateObject("Microsoft.XMLDOM") dim i,html0(20),html,m_language dim xml1_xml,loaded, LoadTime,nofityTimer LoadTime=0 dim flash_sound flash_sound = "" dim lastUpdateTime, oldUpdateTime oldUpdateTime="" dim lastUpdateFileTime lastUpdateFileTime=0 dim state_ch(17) state_ch(0)="推迟,推遲,Defer" state_ch(1)="中断,中斷,Halt" state_ch(2)="腰斩,腰斬,Halt" state_ch(3)="待定,待定,Wait" state_ch(13)="完,完,Over" state_ch(14)="未,未," state_ch(15)="上,上,Part1" state_ch(16)=",,Half" state_ch(17)="下,下,Part2" sub loadodds(language) m_language=language Call MakeTable() call MakeSclass() document.getElementById("loading").style.display="none" end sub i=instr(location.href,"?") if(i<>0) then lang=mid(location.href,i+1) loadodds(lang) else loadodds(1) end if sub MakeTable() on error resume next bg1="#F5F5F5" bg2="#F5F4EB" html="" select case m_language case 1 '繁体 html=html& ("") case 2 '英文 html=html& "" html=html& "" html=html& "" html=html& "" html=html& "" html=html& "" html=html& "" html=html& "" case else '简体 html=html& "" html=html& "" html=html& "" html=html& "" html=html& "" html=html& "" html=html& "" html=html& "" end select for i=1 to matchcount Select Case A(i,6) Case 0 if A(i,23)="1" then match_score = "阵容" else match_score = " - " match_half = "-" Case 1 match_score = A(i,12) & " - " & A(i,13) match_half = "-" Case -11,-12,-13,-14 match_score = "" match_half = "" Case Else match_score = A(i,12) & " - " & A(i,13) match_half=A(i,14) & "-" & A(i,15) End Select If A(i,16) <> 0 Then H_redcard = "" Else H_redcard = "" If A(i,17) <> 0 Then G_redcard ="" Else G_redcard = "" if i mod 2=0 then bg=bg1 else bg=bg2 html0(0) = "" html0(1) = "" html0(2) = "" html0(3) = "" If A(i,6) =-1 Then classx1 = "td_statusR" classx2 = "td_scoreR" Else classx1 = "td_status" classx2 = "td_score" End If html0(4) = "" else html0(5) = split(state_ch(A(i,6)+14),",")(m_language)&"" end if html0(6) = "" html0(7) = "" html0(8) = "" Select case A(i,6) Case 0,1,-11,-12,-13,-14 classx = "td_half" Case else classx = "td_halfR" End Select html0(9) = "" if A(i,22) Then 'html0(10) = "" else html0(10) = "" end if If A(i,19) = "" Then classx = "none" Else classx = "none" End If html0(11) = "" '广告开始 if (i=2 and live_txt_1<>"") then html0(11) = html0(11) & "" elseif (i=4 and live_txt_2<>"") then html0(11) = html0(11) & "" elseif (i=7 and live_txt_3<>"") then html0(11) = html0(11) & "" elseif (i=9 and live_txt_4<>"") then html0(11) = html0(11) & "" elseif (i=11 and live_txt_5<>"") then html0(11) = html0(11) & "" end if html=html & (html0(0) & html0(1) & html0(2) & html0(3) & html0(4) & html0(5) & html0(6) & html0(7) & html0(8) & html0(9) & html0(10) & html0(11)) next if matchcount=0 then html=html& "" html=html& "
" & month(matchdate) & "月" & day(matchdate) & "日开賽時間主场球隊比分客场球隊半場数据
Sel" & month(matchdate) & "-" & day(matchdate) & "K OTeam AScoreTeam BHTInfo
" & month(matchdate) & "月" & day(matchdate) & "日开赛时间主场球队比分客场球队半场数据
" & split(A(i,3),",")(m_language) & "" & formatdatetime(A(i,4),vbshorttime) & "" If A(i,6) =1 Or A(i,6) =3 Or A(i,6) =0 Then html0(5) = " " & H_redcard & "" & split(A(i,8),",")(m_language) & "" & match_score & "" & split(A(i,9),",")(m_language)& "" & G_redcard & "" & match_half & " 资料 推介" html0(10) = " " if A(i,18)="True" then html0(10) = html0(10) +" " end if if A(i,28)<>"" then html0(10) = html0(10) +" " end if if A(i,27)<>"" then html0(10) = html0(10) +" " end if html0(10) = html0(10) +"
 
" & A(i,19) & "
" + live_txt_1 + "
" + live_txt_2 + "
" + live_txt_3 + "
" + live_txt_4 + "
" + live_txt_5 + "
服务器忙,请重新刷新本页面。”
" document.getElementById("live").innerHTML=html end sub '联赛/杯赛名列表 sub MakeSclass() dim st dim leaguehtml leaguehtml="" for i=1 to sclasscount st=split(B(i),",")(m_language) leaguehtml=leaguehtml & ("") next leaguehtml=leaguehtml & "
" document.getElementById("myleague").innerHTML=leaguehtml end sub sub getxml() on error resume next LoadTime=(LoadTime+1) mod 60 if LoadTime=0 then xmlScore.load "xml/change2.xml" else xmlScore.load "xml/change.xml" end if xmlScore.onreadystatechange =GetRef("refresh") window.setTimeout "getxml()",1000 end sub sub refresh() on error resume next if xmlScore.readyState<>4 then exit sub if xmlScore.parseError.errorCode<>0 Then exit sub if xmlScore.xml = "" then exit sub xml1.XMLDocument.async = false xml1.XMLDocument.loadXML xmlScore.xml lastUpdateTime=now if xml1.xml= xml1_xml or xml1.xml="" then exit sub xml1_xml=xml1.xml if loaded<> -1 then loaded=-1 exit sub else if xml1.childNodes.item(1).Attributes(0).text<>"0" then Randomize window.setTimeout "winReload()",Int(20000 * Rnd) exit sub end if end if if cdbl(xml1.childNodes.item(1).Attributes(1).text)<=lastUpdateFileTime then exit sub lastUpdateFileTime=cdbl(xml1.childNodes.item(1).Attributes(1).text) dim i, j,n,k dim xml_id dim xml_matchstate,xml_status dim xml_score1, xml_score2 dim xml_half1, xml_half2 dim xml_card1,xml_card2 dim xml_other,lineup dim xml_matchtime,xml_matchtime1 dim colorx dim AddHTML dim score1change, score2change, scorechange For i = 0 To xml1.childNodes.Item(1).childNodes.length - 1 D=split(xml1.childNodes.Item(1).childNodes.Item(i).Text,"^") xml_id=D(0) xml_matchstate=cint(D(1)) xml_status=split(state_ch(xml_matchstate+14),",")(m_language) xml_score1=cint(D(2)) xml_score2=cint(D(3)) xml_half1=D(4) xml_half2=D(5) xml_card1=D(6) xml_card2=D(7) xml_matchtime=D(8) xml_matchtime1=D(9) xml_other=D(10) lineup=D(11) if typename(document.getElementById("tr1_" & xml_id))="Nothing" then tmp=false else tmp=true if tmp then '对象存在 matchindex=document.getElementById("tr1_" & xml_id).index score1change=false if A(matchindex,12)<>xml_score1 then A(matchindex,12)=xml_score1 score1change=true colorx=1 document.getElementById("td_team1_" & xml_id).style.backgroundColor="#FF00FF" document.getElementById("td_score_" & xml_id).style.backgroundColor="#FFFF80" end if score2change=false if A(matchindex,13)<>xml_score2 then A(matchindex,13)=xml_score2 score2change=true colorx=2 document.getElementById("td_team2_" & xml_id).style.backgroundColor="#FF00FF" document.getElementById("td_score_" & xml_id).style.backgroundColor="#FFFF80" end if scorechange=score1change or score2change '附加说明改时变了' if A(matchindex,19)<> xml_other then A(matchindex,19)= xml_other document.getElementById("other_" + xml_id).innerhtml=xml_other if xml_other="" then document.getElementById("tr2_" + xml_id).style.display="none" else document.getElementById("tr2_" + xml_id).style.display="none" end if end if '红牌变化了 if xml_card1<>A(matchindex,16) then A(matchindex,16) =xml_card1 if xml_card1=0 then document.getElementById("redcard1_" & xml_id).innerhtml="" else document.getElementById("redcard1_" & xml_id).innerhtml= " " end if end if if xml_card2<>A(matchindex,17) then A(matchindex,17) =xml_card2 if xml_card2=0 then document.getElementById("redcard2_" & xml_id).innerhtml="" else document.getElementById("redcard2_" & xml_id).innerhtml= " " end if end if '开赛时间方面的变化 if A(matchindex,4)<>xml_matchtime then document.getElementById("mt_" & xml_id).innerhtml=formatdatetime(xml_matchtime,vbshorttime) A(matchindex,4)=xml_matchtime A(matchindex,5)=xml_matchtime1 '半场比分变化 A(matchindex,14)=xml_half1 A(matchindex,15)=xml_half2 '状态变化 if A(matchindex,6)<> xml_matchstate then A(matchindex,6)=xml_matchstate document.getElementById("time_" & xml_id).style.color="red" select case A(matchindex,6) case 0 document.getElementById("time_" & xml_id).innerHTML="" case -11,-12,-13,-14 document.getElementById("time_" & xml_id).innerHTML=xml_status call MoveToBottom(xml_id) case 2 document.getElementById("time_" & xml_id).innerHTML=xml_status case -1 document.getElementById("time_" & xml_id).innerHTML=xml_status document.getElementById("time_" & xml_id).style.fontWeight = "bold" document.getElementById("score_" & xml_id).style.color = "red" window.setTimeout "MoveToBottom(" & xml_id & ")",25000 case 1 goTime = datediff("n",dateadd("s",difftime,A(matchindex,4)),now) if goTime>45 then goTime = "45+" if goTime<1 then goTime = "1" document.getElementById("time_" & xml_id).innerHTML = goTime & "" case 3 goTime = datediff("n",dateadd("s",difftime,A(matchindex,5)),now)+46 goTime = goTime-63 if goTime>90 then goTime = "90+" if goTime<46 then goTime = "46" document.getElementById("time_" & xml_id).innerHTML = goTime & "" end select end if 'score select case A(matchindex,6) case -11,-12,-13,-14 document.getElementById("score_" & xml_id).innertext="" document.getElementById("half_" & xml_id).innertext="" case 0 if lineup="1" then document.getElementById("score_" & xml_id).innertext="阵容" else document.getElementById("score_" & xml_id).innertext=" - " case 1 document.getElementById("score_" & xml_id).innertext=A(matchindex,12) & " - " & A(matchindex,13) case else '2 3 -1 document.getElementById("score_" & xml_id).innertext=A(matchindex,12) & " - " & A(matchindex,13) document.getElementById("half_" & xml_id).innertext=A(matchindex,14) & "-" & A(matchindex,15) document.getElementById("half_" & xml_id).style.color="red" end select if scorechange then call showflash(xml_id,matchindex) if document.getElementById("tr1_" & xml_id).style.display<>"none" then hometeam=split(a(matchindex,8),",")(m_language) guestteam=split(a(matchindex,9),",")(m_language) sclassname=split(a(matchindex,3),",")(m_language) if score1change then hometeam="" & hometeam &"" if score2change then guestteam="" & guestteam &"" window.clearTimeout(nofityTimer) if document.getElementById("notify").innerHTML="" then document.getElementById("notify").innerHTML="入球提示:" document.getElementById("notify").innerHTML=document.getElementById("notify").innerHTML & sclassname &":"& hometeam & " " & xml_score1 &"-" & xml_score2 & " " &guestteam &"   " nofityTimer=window.setTimeout("clearNotify()",20000) if document.getElementById("windowCheck").checked and xml_matchstate>=-1 then '动态创建窗口方式 call ShowCHWindow(sclassname,hometeam,guestteam,xml_score1,xml_score2 ,document.getElementById("time_" & xml_id).innertext ,colorx) end if end if end if end if next end sub sub ShowFlash(m,n) on error resume next dim addHtml if A(n,6)>=-1 then if document.getElementById("tr1_" & m).style.display<>"none" then 'addHtml=flash_sound 'document.getElementById("half_" & m).innerhtml=addHtml playSound() end if end if window.setTimeout "timecolors(" & m &","& n & ")",120000 end sub sub timecolors(matchid,n) on error resume next if A(n,6)=0 then document.getElementById("score_" & matchid).innertext=" - " document.getElementById("td_team1_" & matchid).style.backgroundColor="" document.getElementById("td_team2_" & matchid).style.backgroundColor="" document.getElementById("td_score_" & matchid).style.backgroundColor="" select case A(n,6) case 0,1 document.getElementById("half_" & matchid).innerhtml="-" case 2,3,-1 document.getElementById("half_" & matchid).innerhtml=A(n,14) & "-" & A(n,15) case -11,-12,-13,-14 document.getElementById("half_" & matchid).innerhtml="" end select end sub sub clearNotify() document.getElementById("notify").innerhtml="" end sub sub ShowAllMatch() dim i,j for i=1 to sclasscount document.getElementById("checkboxleague_" & i).checked=true next for j=1 to matchcount document.getElementById("tr1_" & A(j,1)).style.display="" if document.getElementById("tr2_" & A(j,1)).cells(0).innerhtml<>"" then 'document.getElementById("tr2_" & A(j,1)).style.display="" end if next document.getElementById("hiddencount").innerText=0 end sub sub SelectOtherLeague() dim i,j,hh dim matchid hh=0 for i=1 to sclasscount if document.getElementById("checkboxleague_" & i).checked then document.getElementById("checkboxleague_" & i).checked=false for j=1 to matchcount if split(A(j,3),",")(0)=split(B(i),",")(0) then document.getElementById("tr1_" & A(j,1)).style.display="none" document.getElementById("tr2_" & A(j,1)).style.display="none" hh=hh+1 end if next else document.getElementById("checkboxleague_" & i).checked=true for j=1 to matchcount if split(A(j,3),",")(0)=split(B(i),",")(0) then document.getElementById("tr1_" & A(j,1)).style.display="" if document.getElementById("tr2_" & A(j,1)).cells(0).innerhtml<>"" then 'document.getElementById("tr2_" & A(j,1)).style.display="" end if end if next end if next document.getElementById("hiddencount").innerText=hh end sub sub ShowMatch(n) select case n case 0 call ShowAllMatch() case else ShowMatchByMatchState(n) end select end sub sub ShowMatchByMatchState(n) dim i,j hh=0 Set trs=document.getElementById("table_live").getElementsByTagName("tr") for i=1 to trs.Length-1 if not isnull(trs(i).getAttribute("index")) then trs(i).style.display="none" trs(i+1).style.display="none" end if next select case n case 1 '正在进行中 for j=1 to matchcount if A(j,6)>0 then document.getElementById("tr1_" & A(j,1)).style.display="" if A(j,19)<>"" then 'document.getElementById("tr2_" & A(j,1)).style.display="" end if hh=hh+1 end if next case 2 '完场 for j=1 to matchcount if A(j,6)=-1 then document.getElementById("tr1_" & A(j,1)).style.display="" if A(j,19)<>"" then 'document.getElementById("tr2_" & A(j,1)).style.display="" end if hh=hh+1 end if next case 3 '未开场 for j=1 to matchcount if A(j,6)=0 then document.getElementById("tr1_" & A(j,1)).style.display="" if A(j,19)<>"" then 'document.getElementById("tr2_" & A(j,1)).style.display="" end if hh=hh+1 end if next case 4 '走地 for j=1 to matchcount if A(j,18)="True" then document.getElementById("tr1_" & A(j,1)).style.display="" if A(j,19)<>"" then 'document.getElementById("tr2_" & A(j,1)).style.display="" end if hh=hh+1 end if next end select document.getElementById("hiddencount").innerText=matchcount -hh end sub sub CheckLeague(i) dim j dim matchid hh=document.getElementById("hiddencount").innerText if document.getElementById("checkboxleague_" & i).checked=true then for j=1 to matchcount if split(A(j,3),",")(0)=split(B(i),",")(0) then document.getElementById("tr1_" & A(j,1)).style.display="" if document.getElementById("tr2_" & A(j,1)).cells(0).innerhtml<>"" then 'document.getElementById("tr2_" & A(j,1)).style.display="" end if hh=hh-1 end if next else for j=1 to matchcount if split(A(j,3),",")(0)=split(B(i),",")(0) then document.getElementById("tr1_" & A(j,1)).style.display="none" document.getElementById("tr2_" & A(j,1)).style.display="none" hh=hh+1 end if next end if document.getElementById("hiddencount").innerText=hh end sub sub showgoallist(i) window.open "http://www.totou.com/live/liveDetail.jsp?mId=" & (Number(A(i,1))+102030), "","top=50,left=300,scrollbars=no,resizable=no,width=350, height=330" end sub sub sms(i) window.open "http://live.totou.com/sms.aspx?id=" & A(i,1) &"&team=" & split(A(i,8),",")(m_language) &" VS " & split(A(i,9),",")(m_language), "","scrollbars=no,resizable=no,width=420, height=360" end sub sub analysis(ID) window.open "/jsp/data.jsp?dId=" & (Number(ID)+102030), "","top=0,left=0,scrollbars=yes,resizable=yes,width=800, height=600" end sub sub hidematch(i) dim matchindex document.getElementById("tr1_" & A(i,1)).style.display="none" document.getElementById("tr2_" & A(i,1)).style.display="none" document.getElementById("hiddencount").innerText=document.getElementById("hiddencount").innerText+1 end sub sub MoveToBottom(m) on error resume next document.getElementById("tr1_" & m).parentElement.insertAdjacentElement "BeforeEnd",document.getElementById("tr1_" & m) document.getElementById("tr2_" & m).parentElement.insertAdjacentElement "BeforeEnd",document.getElementById("tr2_" & m) document.getElementById("table_live").rows(4).insertAdjacentElement "BeforeBegin", document.getElementById("tr_ad1") document.getElementById("table_live").rows(9).insertAdjacentElement "BeforeBegin", document.getElementById("tr_ad2") document.getElementById("table_live").rows(14).insertAdjacentElement "BeforeBegin", document.getElementById("tr_ad3") document.getElementById("table_live").rows(19).insertAdjacentElement "BeforeBegin", document.getElementById("tr_ad4") end sub sub AsianOdds(ID) theURL="/jsp/odds.jsp?aId=" & (Number(ID)+8888) 'window.open theURL,"","width=620,height=560,top=20,left=90,resizable=yes,scrollbars=yes" end sub sub EuropeOdds(ID) theURL="/jsp/odds2.jsp?oId=" & (Number(ID)+8888) 'window.open theURL,"","width=650,height=520,top=40,left=40,resizable=yes,scrollbars=yes" end sub sub TeamPanlu_10(ID) theURL="/jsp/panlu.jsp?tId=" & (Number(ID)+8888) 'window.open theURL,"","width=580,height=596,top=10,left=100,resizable=yes,scrollbars=yes" end sub '更新比赛进行的时间 sub setMatchTime() on error resume next for i =1 to matchcount if A(i,6)=1 then '上半场进行中 goTime = datediff("n",dateadd("s",difftime,A(i,4)),now) if goTime>45 then goTime = "45+" if goTime<1 then goTime = "1" document.getElementById("time_" & A(i,1)).innerHTML = goTime & "" elseif A(i,6)=3 then'下半场进行中 goTime = datediff("n",dateadd("s",difftime,A(i,5)),now)+46 goTime = goTime-63 if goTime > 90 then goTime = "90+" if goTime < 46 then goTime = "46" document.getElementById("time_" & A(i,1)).innerHTML = goTime & "" end if next window.setTimeout "setMatchTime()" , 30000 end sub sub check() if (oldUpdateTime = lastUpdateTime and oldUpdateTime <> "") then if (confirm("由于服务器忙或者网络问题,你已经和服务器断开连接超过 2 分钟,是否要重新连接观看比分?")) then window.location.reload end if oldUpdateTime = lastUpdateTime window.setTimeout "check()" , 120000 end Sub sub ChangeBgColor(color) for j=1 to matchcount if j mod 2 = 0 then document.getElementById("tr1_" & A(j,1)).style.backgroundColor = color end if next end sub sub winReload() window.location.reload end sub call setMatchTime() window.setTimeout "getxml()",2000 window.setTimeout "check()" , 120000