//************************************************************* //即时比分 wwl@mso.com.cn QQ:2530521 //*************************************************************/ self.onError=null; function stoperror(){return true;}; window.onerror=stoperror; var nCount_score =0; var nErrorCount_score =0; var nDiffSecoend_score=2; var last_update_xml_score=new Date(); var diffTime=0; var xmlDocTopic = new ActiveXObject("Microsoft.XMLDOM"); function reload_xml_score() { var cur_d = new Date(); diffTime=(cur_d.getTime() - last_update_xml_score.getTime())/ 1000 ; if (diffTime>= nDiffSecoend_score) { getSlash_score(); } else { window.status="waitting..." +GetScoreCount window.setTimeout(reload_xml_score, 1000); } } //alert("Loading..."); function getSlash_score() { xmlDocTopic.async = true; xmlDocTopic.onreadystatechange = xmlDocTopiconreadystatechange; if(typeof(window['SERVER_TIME$live_score_new']) == 'undefined') window['SERVER_TIME$live_score_new'] = 1215249361288; else window['SERVER_TIME$live_score_new'] += 1; xmlDocTopic.load(scoreXML + '?' + window['SERVER_TIME$live_score_new']); window.status="Loading..." +GetScoreCount } //判断是否是整数 /* ================================================================== LTrim(string):去除左边的空格 ================================================================== */ function LTrim(str) { var whitespace = new String(" \t\n\r"); var s = new String(str); if (whitespace.indexOf(s.charAt(0)) != -1) { var j=0, i = s.length; while (j < i && whitespace.indexOf(s.charAt(j)) != -1) { j++; } s = s.substring(j, i); } return s; } /* ================================================================== RTrim(string):去除右边的空格 ================================================================== */ function RTrim(str) { var whitespace = new String(" \t\n\r"); var s = new String(str); if (whitespace.indexOf(s.charAt(s.length-1)) != -1) { var i = s.length - 1; while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) { i--; } s = s.substring(0, i+1); } return s; } function Trim(str) { return RTrim(LTrim(str)); } function isNum(s) { if(s=="null"||s=="undefined"||s.length<1) return false; s=Trim(s); if(isNaN(parseInt(s))) return false; else if((parseInt(s)+"").length!=s.length) return false; else return true; } var OldXML var matchTime = new Array() var matchScore = new Array() var matchState = new Array() var halfScore = new Array() var redcard1 = new Array() var redcard2 = new Array() var matchEvent = new Array() var isLoading = 0 //setTimeout("setMatchTime()" , 3000) function ShowSpecialEven(){//显示特殊事件部分 var i=0; for (i = 0; i < recordCount; i++){ if(getCookie(document.all["tr_" + i].matchid)==1 && document.all["tr_" + i].style.display == "block"){ document.all["tr_matchevent_" + document.all["tr_" + i].matchid].style.display = "block" document.all["pic"+i].src="images/minus.gif" } } } //ShowSpecialEven() /**选择联赛部分结束****************************************/ /**展开特殊事件*****************************************************/ function outliner(ExpandedPic,DispNum) { //显示特殊事件 var i=0; for (i = 0; i = msShowScore / 1000) { TotalVsDataArray[indexOfMatch][20]=0; TotalVsDataArray[indexOfMatch][21]=d.getTime() / 1000;//LastUpdate TotalVsDataArray[indexOfMatch][15]=TotalVsDataArray[indexOfMatch][23]+ " - " +TotalVsDataArray[indexOfMatch][24];//strScores } else { bg_color=tr_change_score_color; } } halfscore_flag=""; isChange=1; //---------------------------- if (TotalVsDataArray[indexOfMatch][12] == "上") { matchTime = TotalVsDataArray[indexOfMatch][10]; matchTimeArray=matchTime.split(","); matchTime = new Date(matchTimeArray[0], matchTimeArray[1] - 1, matchTimeArray[2], matchTimeArray[3], matchTimeArray[4], 0) GoneTime = Math.round((d - matchTime) / 1000 / 60 + diffTime) + 1 GoneTimeSTR=GoneTime+""; if (GoneTime > 45) GoneTimeSTR = "45+" strMatchTime = GoneTimeSTR + "'" } else if (TotalVsDataArray[indexOfMatch][12] == "下") { matchTime = TotalVsDataArray[indexOfMatch][10]; //alert(indexOfMatch); matchTimeArray=matchTime.split(","); matchTime = new Date(matchTimeArray[0], matchTimeArray[1] - 1, matchTimeArray[2], matchTimeArray[3], matchTimeArray[4], 0) GoneTime = Math.round((d - matchTime) / 1000 / 60 + diffTime) + 46 GoneTimeSTR=GoneTime+""; if (GoneTime > 90) GoneTimeSTR = "90+" strMatchTime = GoneTimeSTR + "'" } else if (TotalVsDataArray[indexOfMatch][12] == "加") { matchTime = TotalVsDataArray[indexOfMatch][10]; matchTimeArray=matchTime.split(","); matchTime = new Date(matchTimeArray[0], matchTimeArray[1] - 1, matchTimeArray[2], matchTimeArray[3], matchTimeArray[4], 0) GoneTime = Math.round((d - matchTime) / 1000 / 60 + diffTime) + 91 GoneTimeSTR=GoneTime+""; if (GoneTime > 120) GoneTimeSTR = "120+" strMatchTime = GoneTimeSTR + "'" } if(bg_color==bg_color1) bg_color=bg_color2; else bg_color=bg_color1; TotalVsDataArray[indexOfMatch][11]=MakeTrData(indexOfMatch,matchid,strMatchTime,halfscore_flag,strScores,strState,strhalfscore,redCard1,redCard2); /* if(TotalVsDataArray[indexOfMatch][7]==Old_Lmc_Code) { bg_color=bg_color2; } else { bg_color=bg_color1; } Old_Lmc_Code=TotalVsDataArray[indexOfMatch][7]; */ } //-------------------------------- } if(isChange) { //alert("setMatchTime()"); document.all["MatchData"].innerHTML=TableHead+GetScoreTable()+TableEnd; } window.setTimeout("setMatchTime()" , 30000) } /**开赛时间的设定结束***************************************************/ function xmlDocTopiconreadystatechange() { if (xmlDocTopic.parseError.errorCode != 0) { var myErr = xmlDocTopic.parseError; nErrorCount_score=nErrorCount_score+1; window.status=(nErrorCount_score+" :You have error " + myErr.reason); // alert(nErrorCount_score+" :You have error " + myErr.reason); window.setTimeout(reload_xml_score, 100); return; } if(xmlDocTopic.readyState != 4) { } else { last_update_xml_score=new Date(); window.status="Load ok..." +GetScoreCount var d = new Date() if(document.all["lastUpdateTime"]) document.all["lastUpdateTime"].innerText = FormatNumber(d.getHours()) + ":" + FormatNumber(d.getMinutes()) //alert(Math.round((d - matchTime) / 1000 / 60 + diffTime) + 1); try { xmlDoc.XMLDocument.async = "true" xmlDoc.XMLDocument.loadXML(xmlDocTopic.xml) rs = xmlDoc.recordset if (xmlDocTopic.xml == "") { isLoading =0 window.setTimeout(reload_xml_score, 100); return } //if (rs("i") != recordCount && GetScoreCount > 5) location.reload(true) if (rs("s") != msGetScoreXML && rs("s") > 1000) msGetScoreXML = rs("s").value // clipboardData.setData('text', OldXML + '\r\n\r\n\r\n' + xmlDocTopic.xml); if (OldXML == xmlDocTopic.xml) { isLoading =0 window.setTimeout(reload_xml_score, 100); return } oldScoreArray = new Array() newScoreArray = new Array() var strHtml=""; var GoneTime=0; var GoneTimeSTR=""; rs.MoveNext() while (!rs.EOF) { matchid = rs("i").value thisMatch = rs("s").Value thisMatchArray = thisMatch.split("*") // window.status="Load SCORE..." +matchid indexOfMatch=GetVsDataIndex(matchid); var strMatchTime,halfscore_flag,strScores,strState,strhalfscore strMatchTime=halfscore_flag=strScores=strState=strhalfscore=""; if(indexOfMatch>=0) { if(TotalVsDataArray[indexOfMatch][22] !=thisMatch) //--TotalVsDataArray---------------------------- { TotalVsDataArray[indexOfMatch][10] = thisMatchArray[0]; if (thisMatchArray[1] == "上") { matchTime = TotalVsDataArray[indexOfMatch][10]; matchTimeArray=matchTime.split(","); matchTime = new Date(matchTimeArray[0], matchTimeArray[1] - 1, matchTimeArray[2], matchTimeArray[3], matchTimeArray[4], 0) GoneTime = Math.round((d - matchTime) / 1000 / 60 + diffTime) + 1 GoneTimeSTR=GoneTime+""; if (GoneTime > 45) GoneTimeSTR = "45+" strMatchTime = GoneTimeSTR + "'" } else if (thisMatchArray[1] == "下") { matchTime = TotalVsDataArray[indexOfMatch][10]; matchTimeArray=matchTime.split(","); matchTime = new Date(matchTimeArray[0], matchTimeArray[1] - 1, matchTimeArray[2], matchTimeArray[3], matchTimeArray[4], 0) GoneTime = Math.round((d - matchTime) / 1000 / 60 + diffTime) + 46 GoneTimeSTR=GoneTime+""; if (GoneTime > 90) GoneTimeSTR = "90+" strMatchTime = GoneTimeSTR + "'" } else if (thisMatchArray[1] == "加") { matchTime = TotalVsDataArray[indexOfMatch][10]; matchTimeArray=matchTime.split(","); matchTime = new Date(matchTimeArray[0], matchTimeArray[1] - 1, matchTimeArray[2], matchTimeArray[3], matchTimeArray[4], 0) GoneTime = Math.round((d - matchTime) / 1000 / 60 + diffTime) + 91 GoneTimeSTR=GoneTime+""; if (GoneTime > 120) GoneTimeSTR = "120+" strMatchTime = GoneTimeSTR + "'" } else { strMatchTime = thisMatchArray[0] } TotalVsDataArray[indexOfMatch][12]=thisMatchArray[1]; if (thisMatchArray[1] == "完" || thisMatchArray[1] == "延") { strState=""+thisMatchArray[1]+""; } else { strState=thisMatchArray[1]; } //--------------aaa-------------- newScore = thisMatchArray[2] strScores="" strScores=thisMatchArray[2]; newScoreArray = newScore.split("-") if (newScoreArray.length == 2 && (newScoreArray[0] > 0 || newScoreArray[1] > 0)) { HomeOrAwayGoal=0 if (isNum(newScoreArray[0])) { strScores=""; if(newScoreArray[0]>TotalVsDataArray[indexOfMatch][23] && GetScoreCount > 0 && thisMatchArray[1] != "完") { HomeOrAwayGoal=1 strScores=""+newScoreArray[0]+" - "; } else { strScores=newScoreArray[0]+" - "; } TotalVsDataArray[indexOfMatch][23]=newScoreArray[0];//homescore if(newScoreArray[1]>TotalVsDataArray[indexOfMatch][24] && GetScoreCount > 0 && thisMatchArray[1] != "完") { strScores=strScores+""+newScoreArray[1]+""; HomeOrAwayGoal=2 } else { strScores=strScores+newScoreArray[1]; } TotalVsDataArray[indexOfMatch][24]=newScoreArray[1];//awayscore } if(HomeOrAwayGoal>0) { if (document.all("SoundSwitch").checked && ifShowLeague(TotalVsDataArray[indexOfMatch][2]) && TotalVsDataArray[indexOfMatch][25] ==1) halfscore_flag = flash_Goal_Animation_1; else halfscore_flag= flash_Goal_Animation_2; TotalVsDataArray[indexOfMatch][20]=1;//IsChange TotalVsDataArray[indexOfMatch][21]=d.getTime() / 1000;//LastUpdate LastUpdateScore(matchid,indexOfMatch,newScoreArray[0],newScoreArray[1],HomeOrAwayGoal); bg_color=tr_change_score_color; } } //--------------aaa-------------- strhalfscore=thisMatchArray[3]; //alert(GoneTime + "f"); // if ((thisMatchArray[1] == "完" || thisMatchArray[1] == "延") && GoneTime.length>5 ) strMatchTime = strMatchTime.replace(GoneTime, GoneTime.substr(6, 5)) TotalVsDataArray[indexOfMatch][13]=strMatchTime;//strMatchTime TotalVsDataArray[indexOfMatch][14]=halfscore_flag;//halfscore_flag TotalVsDataArray[indexOfMatch][15]=strScores;//strScores TotalVsDataArray[indexOfMatch][16]=strState;//strState TotalVsDataArray[indexOfMatch][17]=strhalfscore;//strhalfscore TotalVsDataArray[indexOfMatch][18]=thisMatchArray[4];//redCard1 TotalVsDataArray[indexOfMatch][19]=thisMatchArray[5];//redCard2 TotalVsDataArray[indexOfMatch][11]=MakeTrData(indexOfMatch,matchid,strMatchTime,halfscore_flag,strScores,strState,strhalfscore,thisMatchArray[4],thisMatchArray[5]); if(bg_color==bg_color1) bg_color=bg_color2; else bg_color=bg_color1; }//--------TotalVsDataArray-------------------- }//>0 rs.MoveNext() }//WHILE RS document.all["MatchData"].innerHTML=TableHead+GetScoreTable()+TableEnd; //alert(strHtml); GetScoreCount++ } catch(e) { document.title = e.name + ' : ' + e.message; } OldXML = xmlDocTopic.xml isLoading =0 window.setTimeout(reload_xml_score, 100); } } function FormatNumber(n) { if (n < 10) return ("0" + n) else return n } function ifShowLeague(leagueName) { var i=0; for (i = 0; i < nLeague; i++) { if (leagueName == document.all["league_" + i].leaguename) { if (document.all["input_league_" + i].checked) return true else return false break } } } setTimeout("getSlash_score()", 2000) window.setTimeout("setMatchTime()" , 30000)