var company = new Array(32); company[1] = "澳门,澳門"; company[2] = "易胜博,易勝博"; company[3] = "Crown,Crown"; company[8] = "BET365,BET365"; company[9] = "韦德,韋德"; company[31] = "利记,利記"; var zXml = { useActiveX: (typeof ActiveXObject != "undefined"), useXmlHttp: (typeof XMLHttpRequest != "undefined") }; zXml.ARR_XMLHTTP_VERS = ["MSXML2.XmlHttp.6.0", "MSXML2.XmlHttp.3.0"]; function zXmlHttp() { } zXmlHttp.createRequest = function() { if (zXml.useXmlHttp) return new XMLHttpRequest(); if (zXml.useActiveX) //IE < 7.0 = use ActiveX { if (!zXml.XMLHTTP_VER) { for (var i = 0; i < zXml.ARR_XMLHTTP_VERS.length; i++) { try { new ActiveXObject(zXml.ARR_XMLHTTP_VERS[i]); zXml.XMLHTTP_VER = zXml.ARR_XMLHTTP_VERS[i]; break; } catch (oError) { } } } if (zXml.XMLHTTP_VER) return new ActiveXObject(zXml.XMLHTTP_VER); } alert("Sorry,XML object unsupported by your computer,please setup XML object or change explorer."); }; function Hashtable() { this._hash = new Object(); this.add = function(key, value) { if (typeof (key) != "undefined") { this._hash[key] = typeof (value) == "undefined" ? null : value; return true; } else return false; } this.remove = function(key) { delete this._hash[key]; } this.keys = function() { var keys = new Array(); for (var key in this._hash) { keys.push(key); } return keys; } this.count = function() { var i = 0; for (var k in this._hash) { i++; } return i; } this.items = function(key) { return this._hash[key]; } this.contains = function(key) { return typeof (this._hash[key]) != "undefined"; } this.clear = function() { for (var k in this._hash) { delete this._hash[k]; } } } var hsOddsPostion = new Hashtable(); function BgColor(odds1, odds2) { var bg = "normal"; if (odds1 < odds2) bg = "up"; if (odds1 > odds2) bg = "down"; return bg; } function TdBgColor(odds1, odds2) { var bg = ""; if (odds1 < odds2) bg = "#ff8888"; if (odds1 > odds2) bg = "#88ff88"; return bg; } function TdBgColorOld(odds1, odds2) { var bg = ""; if (odds1 < odds2) bg = "#FFB0B0"; if (odds1 > odds2) bg = "#00FF44"; return bg; } var multiSCIDList = "", concernId = "_"; var week = new Array("(日)", "(一)", "(二)", "(三)", "(四)", "(五)", "(六)"); var state_ch = new Array(56); state_ch[0] = "推迟,推迟,Postponed"; state_ch[1] = "取消,取消,Cancel"; state_ch[2] = "中断,中断,Pause"; state_ch[3] = "待定,待定,Undecided"; state_ch[4] = ",,FT"; state_ch[5] = ",,"; state_ch[6] = "第1节,第1節,1st"; state_ch[7] = "第2节,第2節,2nd"; state_ch[8] = "第3节,第3節,3rd"; state_ch[9] = "第4节,第4節,4th"; state_ch[10] = "第1'OT,第1'OT,1'OT"; state_ch[11] = "第2'OT,第2'OT,2'OT"; state_ch[12] = "第3'OT,第3'OT,3'OT"; state_ch[15] = "上半场,下半場,1st"; state_ch[16] = "下半场,下半場,2nd"; state_ch[17] = "下半场,下半場,2nd"; state_ch[55] = "中场,中場,Half"; var riseColor = "#FFB0B0"; var fallColor = "#00FF44"; var changePkColor = "#D06666"; var matchType = 0; var countId = "1,2,5"; //有统计的联赛 var qbId = "[1],[5],[34],[2],[42],[10]"; //有情报的联赛 var nofityTimer = ""; var strDataList=""; String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); } //定义namespace var _glodds = new Object(); //公共变量 _glodds.SplitDomain = "$"; _glodds.SplitRecord = ";"; _glodds.SplitColumn = ","; //通用列表类 _glodds.List = function() { this.items = new Array(); this.keys = new Object(); this.Add = function(key, value) { if (typeof (key) != "undefined") { var vv = typeof (value) == "undefined" ? null : value; var idx = this.keys[key]; if (idx == null) { idx = this.items.length; this.keys[key] = idx; } this.items[idx] = vv; } } this.Get = function(key) { var idx = this.keys[key]; if (idx != null) return this.items[idx]; return null; } this.Clear = function() { for (var k in this.keys) { delete this.keys[k]; } delete this.keys; this.keys = null; this.keys = new Object(); for (var i = 0; i < this.items.length; i++) { delete this.items(i); } delete this.items; this.items = null; this.items = new Array(); } this.GetMaxNum = function (key) { var num = 1; var count = 0; for (var k in this.keys) { if (k.indexOf(key) != -1) { var idx = this.keys[k]; if (idx != null) { count++; var item = this.items[idx]; var num2 = parseInt(item.num); if (num2 > num) num = num2; } else if (count > 0) break; } } return num; } this.getSumNum = function (key) { var hsNum = new Hashtable2(); var sum = 0; var count = 0; for (var k in this.keys) { if (k.indexOf(key) != -1) { var arrK = k.split('_'); var companyID = arrK[1]; var idx = this.keys[k]; if (idx != null) { var item = this.items[idx]; var num2 = parseInt(item.num); if (hsNum.contains(companyID)) { var num = parseInt(hsNum.items(companyID)); if (num < num2) hsNum.add(companyID, num2); } else hsNum.add(companyID, num2); } } } for (var j = 0; j < hsNum.keys().length; j++) { count++; sum += parseInt(hsNum.items(hsNum.keys()[j])); } return sum + (SelCompany.length - count); } } //联赛项类 _glodds.League = function(infoStr) {//2,1,#446DAB,美国女子职业篮球联赛,美國女子職業籃球聯賽,WNBA if(infoStr!='') { var infoArr = infoStr.split(_glodds.SplitColumn); this.lId = infoArr[0]; this.kind = infoArr[1]; //1:联赛;2:杯赛 this.color = infoArr[2]; this.cnName = infoArr[3]; //this.trName = infoArr[4]; // this.enName = infoArr[5]; this.matchNum = 0; this.show = infoArr[4]; this.type = infoArr[5]; //2:二节;4:四节 this.showNum = 0; this.getName = function() { return this.cnName; } } } //比赛项类 _glodds.Match = function(infoStr) { if(infoStr!='') { var infoArr = infoStr.split(_glodds.SplitColumn); //102617,167,1315571400000,732,西班牙,西班牙,Spain,,2079,塞尔维亚,塞爾維亞,Serbia,,0,,,,0; this.mId = infoArr[0].trim(); this.lId = infoArr[1].trim(); // this.time = new Date(parseInt(infoArr[2])); this.time = AmountTimeDiff(infoArr[2]); var d = AmountTimeDiff(infoArr[2]); d.setTime(d.getTime() - 8 * 3600 * 1000); //方便当天4点后的显示到前一天的页面 this.t1Id = infoArr[3]; this.t1CnName = infoArr[4]; this.t1TrName = infoArr[5]; this.t1EnName = infoArr[6]; this.t1Position = infoArr[7] != "" ? "[" + infoArr[7] + "]" : ""; this.t2Id = infoArr[8]; this.t2CnName = infoArr[9]; this.t2TrName = infoArr[10]; this.t2EnName = infoArr[11]; this.t2Position = infoArr[12] != "" ? "[" + infoArr[12] + "]" : ""; this.state = infoArr[13]!=""?infoArr[13]:"0"; this.homeScore = infoArr[14]; this.guestScore = infoArr[15]; this.tv = infoArr[16]; this.flag = ""; if (infoArr[17] == "1") this.flag = "(中)"; this.haslottery = infoArr[18]; this.getT1Name = function() { if (lang == "2") return this.t1EnName; else if (lang == "1") return this.t1TrName; else return this.t1CnName; } this.getT2Name = function() { if (lang == "2") return this.t2EnName; else if (lang == "1") return this.t2TrName; else return this.t2CnName; } } } //亚指信息 _glodds.OddsAsian = function(infoStr) { if(infoStr!='') { var infoArr = infoStr.split(_glodds.SplitColumn); //100028,1,4.5,0.85,0.85,4.5,0.95,0.75,,,; this.mId = infoArr[0].toString().trim(); this.cId = infoArr[1].trim(); this.goalF = infoArr[2]; this.homeF = infoArr[3]; this.awayF = infoArr[4]; this.goal = infoArr[5];//开场后停止更新 this.home = infoArr[6]; this.away = infoArr[7]; this.goalR = infoArr[8]; //滚球 this.homeR = infoArr[9]; this.awayR = infoArr[10]; this.num = infoArr[11]; this.maxNum = infoArr[12]; this.zoudi = false; } } //欧指信息 _glodds.Odds1x2 = function(infoStr) { if(infoStr!='') { var infoArr = infoStr.split(_glodds.SplitColumn); //209092,8,0.5,0.95,0.95,0.5,1.025,0.875 this.mId = infoArr[0].trim(); this.cId = infoArr[1].trim(); this.hwF = infoArr[2]; this.awF = infoArr[3]; this.hw = infoArr[4]; this.aw = infoArr[5]; this.num = infoArr[6]; } } //大小指数信息 _glodds.OddsOU = function(infoStr) { if(infoStr!='') { var infoArr = infoStr.split(_glodds.SplitColumn); //102643,12,161.5,0.909,0.909,160.5,1.00,0.80,,, this.mId = infoArr[0].trim(); this.cId = infoArr[1].trim(); this.goalF = infoArr[2]; this.overF = infoArr[3]; this.underF = infoArr[4]; this.goal = infoArr[5];//开场后停止更新 this.over = infoArr[6]; this.under = infoArr[7]; this.goalR = infoArr[8];//滚球 this.overR = infoArr[9]; this.underR = infoArr[10]; this.num = infoArr[11]; } } var _oddsUitl = new Object(); var matchdata = new Object(); _oddsUitl.getDayStr = function(dt) { return (dt.getMonth() + 1) + "-" + dt.getDate(); } _oddsUitl.getTimeStr = function(dt) { return dt.getHours() + ":" + (dt.getMinutes() < 10 ? "0" : "") + dt.getMinutes(); } _oddsUitl.getOnlyDate = function(dt) { return dt.getFullYear() + "-" + (dt.getMonth() + 1) + "-" + dt.getDate(); } _oddsUitl.getDtStr = function(dt) { return (dt.getMonth() + 1) + "-" + dt.getDate() + " " + (dt.getHours() < 10 ? "0" : "") + dt.getHours() + ":" + (dt.getMinutes() < 10 ? "0" : "") + dt.getMinutes(); } _oddsUitl.getDtStr2 = function(dt) { return (dt.getHours() < 10 ? "0" : "") + dt.getDate() + "日" + (dt.getHours() < 10 ? "0" : "") + dt.getHours() + ":" + (dt.getMinutes() < 10 ? "0" : "") + dt.getMinutes(); } _oddsUitl.getDateTimeStr = function(dt) { return dt.getFullYear() + "-" + (dt.getMonth() + 1) + "-" + dt.getDate() + " " + (dt.getHours() < 10 ? "0" : "") + dt.getHours() + ":" + (dt.getMinutes() < 10 ? "0" : "") + dt.getMinutes(); } _oddsUitl.getDate = function(str) { var p = str.split("-"); return new Date(p[0], parseInt(p[1], 10) - 1, p[2]); } function SetLevel(m) { matchType = m; LoadData(); } function SelectNBA() { //SelectAll(false); var i, inputs; inputs = document.getElementById("league").getElementsByTagName("input"); for (var i = 0; i < inputs.length; i++) { if (inputs[i].type != "checkbox") continue; if (!(inputs[i].value == "1")) { inputs[i].checked = false; inputs[i].parentElement.style.backgroundColor = "white"; inputs[i].parentElement.style.display = "none"; } else { inputs[i].checked = true; inputs[i].parentElement.style.backgroundColor = "#ffeeee"; inputs[i].parentElement.style.display = "block"; } } } function CheckFirstOdds(isCheck) { if (isCheck) { writeCookie("nowscoreFirstodds", 1); } else { writeCookie("nowscoreFirstodds", 0); } LoadData(); } function SetLanguage(l) { document.getElementById("Language" + lang).className = ""; lang = l; writeCookie("lang", lang); LoadData(); document.getElementById("Language" + l).className = "selected"; } function CheckSoundCheck(isCheck) { if (isCheck) { writeCookie("nowscoreSoundCheck", 1); } else { writeCookie("nowscoreSoundCheck", 0); } soundCheck = isCheck; } function SetDataType(sortby) { if (sortby == 1) { document.getElementById("SortBy1").style.display = "none"; document.getElementById("SortBy2").style.display = "block"; } else if (sortby == 2) { document.getElementById("SortBy1").style.display = "block"; document.getElementById("SortBy2").style.display = "none"; } datatype = sortby; writeCookie("datatype", sortby); LoadData(); } var xml1 = zXmlHttp.createRequest(); var xmlBf = zXmlHttp.createRequest(); var oldXML = "", oldBfXML = ""; var isOld = window.location.href.toLocaleLowerCase().indexOf("odds.aspx") != -1; function getxml() { try { //xml1.open("get", (isOld ? "../data/ch_oddsBsk.xml?" : "../data/ch_oddsBsk_m.xml?") + Date.parse(new Date()), true); xml1.open("get", "../data/ch_oddsBsk_m.xml?" + Date.parse(new Date()), true); if(pageType == 3) xml1.onreadystatechange = refreshOld; else xml1.onreadystatechange = refresh; xml1.send(null); } catch (e) { } window.setTimeout("getxml()", 6000); } function refresh() { if (xml1.readyState != 4 || (xml1.status != 200 && xml1.status != 0)) return; if (oldXML == xml1.responseText) return oldXML = xml1.responseText; var arr; var changeIDList = ","; var playFlash = false; //亚指 var root = xml1.responseXML.documentElement.childNodes[0]; var playSound = false; var numTd = ""; for (i = 0; i < root.childNodes.length; i++) { arr = root.childNodes[i].childNodes[0].nodeValue.split(",");//matchid,companyid,goal,home,away,close,zoudi if (strCompanyId.indexOf("," + arr[1] + ",") < 0) continue; var tr = document.getElementById("odds_" + arr[0] + "_" + arr[1] + "_" + arr[5]); if (tr == null) continue; oddsItem = matchdata.Odds1List.Get(arr[0] + "_" + arr[1] + "_" + arr[5]); if (oddsItem == null) { //开盘 if (parseInt(arr[5]) > 1) continue;//页面只自动添加主盘显示,其它盘刷新页面才显示 var tmp = arr[0] + "," + arr[1] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[5] + "," + arr[6]; oddsItem = new _glodds.OddsAsian(tmp); matchdata.Odds1List.Add(oddsItem.mId + "_" + oddsItem.cId + "_" + oddsItem.num, oddsItem); if (showFirstOdds) { tr.cells[1].innerHTML = "
" + oddsItem.homeF + "
" + oddsItem.home + "
"; tr.cells[2].innerHTML = "
" + oddsItem.goalF + "
" + oddsItem.goal + "
"; tr.cells[3].innerHTML = "
" + oddsItem.awayF + "
" + oddsItem.away + "
"; } else { tr.cells[1].innerHTML = "
" + oddsItem.home + "
"; tr.cells[2].innerHTML = "
" + oddsItem.goal + "
"; tr.cells[3].innerHTML = "
" + oddsItem.away + "
"; } tr.cells[0].innerHTML = company[arr[1]] + (oddsItem.zoudi == "True" ? "" : ""); if (changeIDList.indexOf("," + arr[0] + "_" + arr[1] + "_" + arr[5] + ",") < 0) changeIDList += arr[0] + "_" + arr[1] + "_" + arr[5] + ","; } if (oddsItem.goal != arr[2] || oddsItem.home != arr[3] || oddsItem.away != arr[4]) { tr.cells[2].style.backgroundColor = TdBgColor(oddsItem.goal, arr[2]); tr.cells[1].style.backgroundColor = TdBgColor(oddsItem.home, arr[3]); tr.cells[3].style.backgroundColor = TdBgColor(oddsItem.away, arr[4]); oddsItem.goal = arr[2]; oddsItem.home = arr[3]; oddsItem.away = arr[4]; if (showFirstOdds) { tr.cells[1].innerHTML = "
" + oddsItem.homeF + "
" + oddsItem.home + "
"; tr.cells[2].innerHTML = "
" + oddsItem.goalF + "
" + oddsItem.goal + "
"; tr.cells[3].innerHTML = "
" + oddsItem.awayF + "
" + oddsItem.away + "
"; } else { tr.cells[1].innerHTML = "
" + oddsItem.home + "
"; tr.cells[2].innerHTML = "
" + oddsItem.goal + "
"; tr.cells[3].innerHTML = "
" + oddsItem.away + "
"; } if (changeIDList.indexOf("," + arr[0] + "_" + arr[1] + "_" + arr[5] + ",") < 0) changeIDList += arr[0] + "_" + arr[1] + "_" + arr[5] + ","; } if (soundCheck && playFlash == false && document.getElementById("table_" + arr[0]).style.display == "") playFlash = true; } //欧指 root = xml1.responseXML.documentElement.childNodes[1]; for (i = 0; i < root.childNodes.length; i++) { arr = root.childNodes[i].childNodes[0].nodeValue.split(",");//matchid,companyid,hw,st,gw if (strCompanyId.indexOf("," + arr[1] + ",") < 0) continue; var tr = document.getElementById("odds_" + arr[0] + "_" + arr[1] + "_1"); if (tr == null) continue; oddsItem = matchdata.Odds2List.Get(arr[0] + "_" + arr[1]); if (oddsItem == null) { //开盘 var tmp = arr[0] + "," + arr[1] + "," + arr[2] + "," + arr[3] + "," + arr[2] + "," + arr[3]; oddsItem = new _glodds.Odds1x2(tmp); matchdata.Odds2List.Add(oddsItem.mId + "_" + oddsItem.cId, oddsItem); if (showFirstOdds) { tr.cells[4].innerHTML = "
" + oddsItem.hwF + "
" + oddsItem.hw + "
"; tr.cells[5].innerHTML = "
" + oddsItem.awF + "
" + oddsItem.aw + "
"; } else{ tr.cells[4].innerHTML = "
" + oddsItem.hw + "
"; tr.cells[5].innerHTML = "
" + oddsItem.aw + "
"; } if (changeIDList.indexOf("," + arr[0] + "_" + arr[1] + ",") < 0) changeIDList += arr[0] + "_" + arr[1] + ","; } if (oddsItem.hw != arr[2] || oddsItem.gw != arr[3]) { tr.cells[4].style.backgroundColor = TdBgColor(oddsItem.hw, arr[2]); tr.cells[5].style.backgroundColor = TdBgColor(oddsItem.aw, arr[3]); oddsItem.hw = arr[2]; oddsItem.aw = arr[3]; if (showFirstOdds) { tr.cells[4].innerHTML = "
" + oddsItem.hwF + "
" + oddsItem.hw + "
"; tr.cells[5].innerHTML = "
" + oddsItem.awF + "
" + oddsItem.aw + "
"; } else{ tr.cells[4].innerHTML = "
" + oddsItem.hw + "
"; tr.cells[5].innerHTML = "
" + oddsItem.aw + "
"; } if (changeIDList.indexOf("," + arr[0] + "_" + arr[1] + ",") < 0) changeIDList += arr[0] + "_" + arr[1] + ","; } if (soundCheck && playFlash == false && document.getElementById("table_" + arr[0]).style.display == "") playFlash = true; } //大小 root = xml1.responseXML.documentElement.childNodes[2]; for (i = 0; i < root.childNodes.length; i++) { arr = root.childNodes[i].childNodes[0].nodeValue.split(","); //matchid,companyid,goal,over,under var cid = (parseInt(arr[1]) - 3); if (strCompanyId.indexOf("," + cid + ",") < 0) continue; var tr = document.getElementById("odds_" + arr[0] + "_" + cid + "_" + arr[5]); if (tr == null) continue; oddsItem = matchdata.Odds3List.Get(arr[0] + "_" + cid + "_" + arr[5]); if (oddsItem == null) { //开盘 if (parseInt(arr[5]) > 1) continue;//页面只自动添加主盘显示,其它盘刷新页面才显示 var tmp = arr[0] + "," + cid + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[5]; oddsItem = new _glodds.OddsOU(tmp); matchdata.Odds3List.Add(oddsItem.mId + "_" + oddsItem.cId + "_" + oddsItem.num, oddsItem); if (showFirstOdds) { tr.cells[6].innerHTML = "
" + oddsItem.overF + "
" + oddsItem.over + "
"; tr.cells[7].innerHTML = "
" + oddsItem.goalF + "
" + oddsItem.goal + "
"; tr.cells[8].innerHTML = "
" + oddsItem.underF + "
" + oddsItem.under + "
"; } else { tr.cells[6].innerHTML = "
" + oddsItem.over + "
"; tr.cells[7].innerHTML = "
" + oddsItem.goal + "
"; tr.cells[8].innerHTML = "
" + oddsItem.under + "
"; } if (changeIDList.indexOf("," + arr[0] + "_" + cid + "_" + arr[5] + ",") < 0) changeIDList += arr[0] + "_" + cid + "_" + arr[5] + ","; } if (oddsItem.goal != arr[2] || oddsItem.over != arr[3] || oddsItem.under != arr[4]) { tr.cells[6].style.backgroundColor = TdBgColor(oddsItem.over, arr[3]); tr.cells[7].style.backgroundColor = TdBgColor(oddsItem.goal, arr[2]); tr.cells[8].style.backgroundColor = TdBgColor(oddsItem.under, arr[4]); oddsItem.goal = arr[2]; oddsItem.over = arr[3]; oddsItem.under = arr[4]; if (showFirstOdds) { tr.cells[6].innerHTML = "
" + oddsItem.overF + "
" + oddsItem.over + "
"; tr.cells[7].innerHTML = "
" + oddsItem.goalF + "
" + oddsItem.goal + "
"; tr.cells[8].innerHTML = "
" + oddsItem.underF + "
" + oddsItem.under + "
"; } else{ tr.cells[6].innerHTML = "
" + oddsItem.over + "
"; tr.cells[7].innerHTML = "
" + oddsItem.goal + "
"; tr.cells[8].innerHTML = "
" + oddsItem.under + "
"; } if (changeIDList.indexOf("," + arr[0] + "_" + cid + "_" + arr[5] + ",") < 0) changeIDList += arr[0] + "_" + cid + "_" + arr[5] + ","; } if (soundCheck && playFlash == false && document.getElementById("table_" + arr[0]).style.display == "") playFlash = true; } window.setTimeout("colors_water('" + changeIDList + "')", 30000); if (playFlash) audioHelper.play("oddsFlashSound"); } if (typeof audioHelper != "undefined") { audioHelper.init("flashsound", pageType == 3 ? '/files/audio/nba/score' : '/files/audio/nba/sound'); audioHelper.init("oddsFlashSound", '/files/audio/oddssound'); } function refreshOld() { if (xml1.readyState != 4 || (xml1.status != 200 && xml1.status != 0)) return; if (oldXML == xml1.responseText) return oldXML = xml1.responseText; var arr; var changeIDList = ","; var playFlash = false; //亚指 var root = xml1.responseXML.documentElement.childNodes[0]; var playSound = false; for (i = 0; i < root.childNodes.length; i++) { arr = root.childNodes[i].childNodes[0].nodeValue.split(","); //matchid,companyid,goal,home,away,close,zoudi if (strCompanyId.indexOf("," + arr[1] + ",") < 0) continue; var tr = document.getElementById("tr_" + arr[0]); var tr2 = document.getElementById("tr2_" + arr[0]); var tr3 = document.getElementById("tr3_" + arr[0]); if (tr == null || tr2 == null || tr3 == null) continue; var postion = parseInt(hsOddsPostion.items(arr[1])); oddsItem = matchdata.Odds1List.Get(arr[0] + "_" + arr[1]); if (oddsItem == null) { //开盘 var tmp = arr[0] + "," + arr[1] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[5] + "," + arr[6]; oddsItem = new _glodds.OddsAsian(tmp); matchdata.Odds1List.Add(oddsItem.mId + "_" + oddsItem.cId, oddsItem); tr.cells[postion + 1].innerHTML = oddsItem.home; tr2.cells[postion].innerHTML = "" + oddsItem.goal + ""; tr3.cells[postion].innerHTML = oddsItem.away; if (changeIDList.indexOf("," + arr[0] + ",") < 0) changeIDList += arr[0] + ","; } if (oddsItem.goal != arr[2] || oddsItem.home != arr[3] || oddsItem.away != arr[4]) { tr2.cells[postion].style.backgroundColor = TdBgColor(oddsItem.goal, arr[2]); tr.cells[postion + 1].style.backgroundColor = TdBgColorOld(oddsItem.home, arr[3]); tr3.cells[postion].style.backgroundColor = TdBgColorOld(oddsItem.away, arr[4]); var strGoal = (oddsItem.goal < arr[2] ? "↑" : "") + arr[2] + (oddsItem.goal > arr[2] ? "↓" : ""); oddsItem.goal = arr[2]; oddsItem.home = arr[3]; oddsItem.away = arr[4]; tr.cells[postion + 1].innerHTML = oddsItem.home; tr2.cells[postion].innerHTML = "" + strGoal + ""; tr3.cells[postion].innerHTML = oddsItem.away; if (changeIDList.indexOf("," + arr[0] + ",") < 0) changeIDList += arr[0] + ","; } if (playFlash == false && tr.style.display == "") playFlash = true; } //大小 root = xml1.responseXML.documentElement.childNodes[2]; for (i = 0; i < root.childNodes.length; i++) { arr = root.childNodes[i].childNodes[0].nodeValue.split(","); //matchid,companyid,goal,over,under var cid = (parseInt(arr[1]) - 3); if (strCompanyId.indexOf("," + cid + ",") < 0) continue; var tr = document.getElementById("tr_" + arr[0]); var tr2 = document.getElementById("tr2_" + arr[0]); var tr3 = document.getElementById("tr3_" + arr[0]); if (tr == null || tr2 == null || tr3 == null) continue; var postion = parseInt(hsOddsPostion.items(cid)) + 5; oddsItem = matchdata.Odds3List.Get(arr[0] + "_" + arr[1]); if (oddsItem == null) { //开盘 var tmp = arr[0] + "," + arr[1] + "," + arr[2] + "," + arr[3] + "," + arr[4] + "," + arr[2] + "," + arr[3] + "," + arr[4]; oddsItem = new _glodds.OddsOU(tmp); matchdata.Odds3List.Add(oddsItem.mId + "_" + oddsItem.cId, oddsItem); tr.cells[postion + 1].innerHTML = oddsItem.over; tr2.cells[postion].innerHTML = "" + oddsItem.goal + ""; tr3.cells[postion].innerHTML = oddsItem.under; if (changeIDList.indexOf("," + arr[0] + ",") < 0) changeIDList += arr[0] + ","; } if (oddsItem.goal != arr[2] || oddsItem.over != arr[3] || oddsItem.under != arr[4]) { tr.cells[postion + 1].style.backgroundColor = TdBgColorOld(oddsItem.over, arr[3]); tr2.cells[postion].style.backgroundColor = TdBgColor(oddsItem.goal, arr[2]); tr3.cells[postion].style.backgroundColor = TdBgColorOld(oddsItem.under, arr[4]); var strGoal = (oddsItem.goal < arr[2] ? "↑" : "") + arr[2] + (oddsItem.goal > arr[2] ? "↓" : ""); oddsItem.goal = arr[2]; oddsItem.over = arr[3]; oddsItem.under = arr[4]; tr.cells[postion + 1].innerHTML = oddsItem.over; tr2.cells[postion].innerHTML = "" + strGoal + ""; tr3.cells[postion].innerHTML = oddsItem.under; if (changeIDList.indexOf("," + arr[0] + ",") < 0) changeIDList += arr[0] + ","; //+ "_" + arr[1] + } if (soundCheck && playFlash == false && tr.style.display == "") playFlash = true; } window.setTimeout("colors_watgerOld('" + changeIDList + "')", 30000); if (playFlash) audioHelper.play("flashsound"); } function innerText(node) { var innerTextArr = []; var root = document.getElementById(node); var getChild = function(node) { var childs = node.childNodes; for (var i = 0; i < childs.length; i++) if (childs[i].nodeType == 3) innerTextArr.push(childs[i].nodeValue); else if (childs[i].nodeType == 1) getChild(childs[i]); } getChild(root); return innerTextArr; } function colors_water(IDList){ var A=IDList.split(","); var tr; for(var i=1;i"; score1 = "" + D[3] + ""; } if(score2change){ guestteam = "" + matchItem.getT2Name() + ""; score2 = "" + D[4] + ""; } window.clearTimeout(nofityTimer); if(notify=="") notify="得分提示:"; notify += hometeam + " " + score1 + "-" + score2 + " " + guestteam + "   "; nofityTimer=window.setTimeout("clearNotify()",20000); window.setTimeout("bfcolors_water('"+matchItem.mId+"')",20000); if (soundCheck) audioHelper.play("flashsound"); } } if (notify != "") document.getElementById("scoreNotify").innerHTML = notify; } function clearNotify(){ document.getElementById("scoreNotify").innerHTML=""; } function bfcolors_water(ID){ try{ document.getElementById("home_" + ID).style.backgroundColor = ""; document.getElementById("guest_" + ID).style.backgroundColor = ""; }catch(e){} } function MoveToBottom(id){ try{ document.getElementById("table_" + id).parentElement.insertAdjacentElement("BeforeEnd",document.getElementById("table_" + id)); //document.getElementById("table_" + id).style.display="none"; }catch(e){} } function CheckLeague(obj) { if (obj.checked) obj.parentElement.style.backgroundColor = "#ffeeee"; else obj.parentElement.style.backgroundColor = "white"; } function SelectAll(value) { var i, inputs; inputs = document.getElementById("league").getElementsByTagName("input"); for (var i = 0; i < inputs.length; i++) { if (inputs[i].type != "checkbox") continue; inputs[i].parentElement.style.display = "block"; inputs[i].checked = value; if (inputs[i].checked) { inputs[i].parentElement.style.backgroundColor = "#ffeeee"; } else { inputs[i].parentElement.style.backgroundColor = "white"; } } document.getElementById("selectLeague0").checked = true; document.getElementById("selectLeague1").checked = false; } function SelectOK(t) { var i, j, inputs; var hh = 0; var hiddenLeague = "_";; inputs = document.getElementById("league").getElementsByTagName("input"); if (t == 1) hiddenID = "_"; for (var i = 0; i < inputs.length; i++) { if (inputs[i].type != "checkbox") continue; if (inputs[i].checked) { for (var j = 0; j < matchdata.MatchNum; j++) { matchItem = matchdata.MatchList.items[j]; if (matchItem.lId == inputs[i].value) document.getElementById("table_" + matchItem.mId).style.display = ""; } } else { for (var j = 0; j < matchdata.MatchNum; j++) { matchItem = matchdata.MatchList.items[j]; if (matchItem.lId == inputs[i].value) { document.getElementById("table_" + matchItem.mId).style.display = "none"; if (t == 1) { hiddenID += matchItem.mId + "_"; hh++; } } } hiddenLeague += inputs[i].value+"_"; } } if (t == 1) { if (hh == 0) hiddenID = "_"; writeCookie("Bet007Odds_hiddenID", hiddenID); writeCookie("Bet007Odds_hiddenLeague", hiddenLeague); document.getElementById("hiddenCount").innerHTML = hh; MM_showHideLayers('LeagueDiv', '', 'hide'); } } function hidematch(id, t) { if (document.getElementById("table_" + id)) { document.getElementById("table_" + id).style.display = "none"; if (t == 1 && hiddenID.indexOf(id) == -1) { document.getElementById("hiddenCount").innerHTML = parseInt(document.getElementById("hiddenCount").innerHTML) + 1; hiddenID += id + "_"; writeCookie("Bet007Odds_hiddenID", hiddenID); } } } function ShowAllMatch(t) { SelectAll(true); SelectOK(t); } function SelectCompany() { var i, inputs; var j = 0; SelCompany = new Array(); strCompanyId = ","; inputs = document.getElementById("companyList").getElementsByTagName("input"); for (var i = 0; i < inputs.length; i++) { if (inputs[i].type == "checkbox" && inputs[i].checked) { SelCompany[j++] = inputs[i].value; strCompanyId += inputs[i].value + ","; } } writeCookie("BasCompany", strCompanyId.substring(1, strCompanyId.length - 1)); MM_showHideLayers('divMatchType5', '', 'hide'); LoadData(); } function DefaultCompany() { strCompanyId = "1,2,3,8,9,31"; SelCompany = strCompanyId.split(","); strCompanyId = "," + strCompanyId + ","; writeCookie("BasCompany", ""); LoadData(); inputs = document.getElementById("companyList").getElementsByTagName("input"); for (var i = 0; i < inputs.length; i++) { if (inputs[i].type != "checkbox") continue; inputs[i].checked = false; if (strCompanyId.indexOf("," + inputs[i].value + ",") >= 0) inputs[i].checked = true; } for (var i = 0; i < SelCompany.length; i++) document.getElementById("company" + SelCompany[i]).checked = true; } function changeToCn(l) { if (l == 0) { var name = location.href.substring(location.href.lastIndexOf("/") + 1); var para = ""; var num = location.href.indexOf("?"); if (num > 0) para = location.href.substring(num); name = name.split('_')[0]+".aspx" + para; location.href = name; } } function changeToBig(l) { if (l == 1) { var name = location.href.substring(location.href.lastIndexOf("/") + 1); var para = ""; var num = location.href.indexOf("?"); if (num > 0) para = location.href.substring(num); if (name.indexOf('.') != -1) name = name.split('.')[0] + "_big.aspx" + para; else name = "index_big.aspx"; location.href = name; } } function showOrHiddenMulti(sID, companyID) { var isShow = multiSCIDList.indexOf(sID + "_" + companyID) != -1; if (isShow) multiSCIDList = multiSCIDList.replace(sID + "_" + companyID + "_", ""); else multiSCIDList += sID + "_" + companyID + "_"; isShow = !isShow; var oddsItem, objTab; oddsItem = matchdata.Odds1List.Get(sID + "_" + companyID + "_1"); if (oddsItem != null) { if (oddsItem.maxNum <= 1) return; objTab = document.getElementById("odds_" + sID); for (var j = 0; j < objTab.rows.length; j++) { var row = objTab.rows[j]; if (row.id.indexOf("_" + companyID + "_1") != -1) { //row.cells[0].rowSpan = isShow ? oddsItem.maxNum : 1; //row.cells[1].rowSpan = isShow ? oddsItem.maxNum : 1; if (isShow) row.cells[1].innerHTML = row.cells[1].innerHTML.replace("jia", "jian"); else row.cells[1].innerHTML = row.cells[1].innerHTML.replace("jian", "jia"); row.style.backgroundColor = isShow ? "#f2f9fd" : "#fff"; for (var k = 2; k <= oddsItem.maxNum; k++) { objTab.rows[j + k - 1].style.display = isShow ? "" : "none"; } } } } } function addConcern(matchID, obj) { //var cCount = document.getElementById("concernCount").innerHTML; if (concernId.indexOf("_" + matchID + "_") == -1) concernId += matchID + "_"; else return; writeCookie("Bet007BskOdds_concernId", concernId); // cCount++; //var tr = document.getElementById("tr1_" + A[matchIndex][0]); obj.parentNode.innerHTML = obj.parentNode.innerHTML.replace("addConcern", "deleteConcern").replace("btn top", "btn top on").replace("添加", "取消"); var matchItem = matchdata.MatchList.Get(matchID); var weight = getWeight(matchItem); var isChange = false; for (var i = 0; i < matchdata.MatchNum; i++) { var matchItem2 = matchdata.MatchList.items[i]; if (concernId.indexOf("_" + matchItem2.mId + "_") != -1) { if (getWeight(matchItem2) > weight) { isChange = true; MovePlace(matchItem2.mId, matchItem.mId, true); break; } } } if (!isChange) { var arrs = concernId.substr(0, concernId.length - 1).split('-'); MovePlace(arrs.length > 1 ? arrs[arrs.length - 1] : 0, matchItem.mId, true); } //document.getElementById("concernCount").innerHTML = cCount; } function deleteConcern(matchId, obj) { if (concernId.indexOf("_" + matchId + "_") == -1) return; // var tr = document.getElementById("tr1_" + A[matchIndex][0]); obj.parentNode.innerHTML = obj.parentNode.innerHTML.replace("deleteConcern", "addConcern").replace("btn top on", "btn top").replace("取消", "添加"); var isChange = false; var lastmId = matchdata.MatchList.items[0].mId; var lastWeight = 0; var matchItem = matchdata.MatchList.Get(matchId); var curWeight = getWeight(matchItem); for (var i = 0; i < matchdata.MatchNum; i++) { var matchItem2 = matchdata.MatchList.items[i]; if (concernId.indexOf("_" + matchItem2.mId + "_") == -1 && hiddenID.indexOf("_" + matchItem2.mId + "_") == -1) { var weight = getWeight(matchItem2); if (weight < curWeight && (weight > lastWeight || lastWeight == 0)) { isChange = true; lastWeight = weight; lastmId = matchItem2.mId; } //if (weight2 < weight) { // isChange = true; // MovePlace(matchItem2.mId, matchItem.mId, false); // break; //} } } if (!isChange) MovePlace(0, matchItem.mId, false); else MovePlace(lastmId, matchItem.mId, false); concernId = concernId.replace("_" + matchId + "_", "_"); //var cCount = document.getElementById("concernCount").innerHTML; writeCookie("Bet007BskOdds_concernId", concernId); //cCount--; //document.getElementById("concernCount").innerHTML = cCount; } function SortData() { temp = new Array(); var j = 0; temp[0] = ","; var tempCount = matchDomain.length; for (var i = 0; i < tempCount; i++) { if (concernId.indexOf("_" + matchDomain[i].split(_glodds.SplitColumn)[0] + "_") != -1) { temp[j] = matchDomain[i]; matchDomain.splice(i, 1); tempCount--; i--; j++; } } if (temp.length > 0) { //document.getElementById("concernCount").innerHTML = temp.length - 1; matchDomain = temp.concat(matchDomain); } } function getWeight(matchItem) { var state = parseInt(matchItem.state); var ss = state > 0 ? 1 : state; if (ss >= 0 || ss == -1) ss = ss + 50; else { ss = 40;// -10~-14 sort by time } var monthStr = matchItem.time.getMonth().toString(); var dayStr = matchItem.time.getDay().toString(); var hoursStr = matchItem.time.getHours().toString(); var minutesStr = matchItem.time.getMinutes().toString(); if (dayStr.length == 1) dayStr = "0" + dayStr; if (monthStr.length == 1) monthStr = "0" + monthStr; if (hoursStr.length == 1) hoursStr = "0" + hoursStr; if (minutesStr.length == 1) minutesStr = "0" + minutesStr; var yearInt = new Date().getFullYear() - matchItem.time.getFullYear(); var matchTime = yearInt + monthStr + dayStr + hoursStr + minutesStr; return parseFloat(ss + (99999999 - parseInt(matchTime) + "." + (1000 - matchItem.oddsIndex))); } function MovePlace(newPos, oldPos, isadd) { try { if (newPos == 0) document.getElementById("odds").insertAdjacentElement(isadd ? "afterBegin" : "BeforeEnd", document.getElementById("table_" + oldPos)); else document.getElementById("table_" + newPos).insertAdjacentElement(isadd ? "afterEnd" : "BeforeBegin", document.getElementById("table_" + oldPos)); } catch (e) { } }