var filterHelper = new FilterHelper(); var loaded = 0, LoadTime = 0, nofityTimer, matchType = -1, runtimeTimer, getoddsxmlTimer, LoadLiveFileTimer;  var loadDetailFileTime = new Date(); var loadVideoFileTime = new Date(); var oldOddsXML; var lastUpdateTime, oldUpdateTime = "", oldXML = ""; var lastUpdateFileTime = 0; var oXmlHttp = zXmlHttp.createRequest(); var needSound = false; var orderby = "time"; var oldLetBig = 0; //判断让球 大小是否有切换 var strCompanyID = ",3,23,24,31,"; var concernIds = getCookie("concernIds").split(","); if (concernIds[0] === "") concernIds.splice(0, 1); var flashScheduleIDs = ""; var jcIdList = "", idList = ""; function GetXml(url, doSuccess) { $.ajax({ url: url, type: 'get', async: false, dataType: 'XML', success: doSuccess }); } function getXmlChildNodes_Text(childNodes, index) { return childNodes.length > index ? childNodes[index][document.all && parseInt(ieNum) < 10 ? "text" : "textContent"] : ""; } function ShowBf() { $("#hiddencount").html(0); loaded = 0; SortData(); var ifSortByLeague = orderby == "league"; if (ifSortByLeague) { $("#conditionBtn").hide(); MakeTableOrderByLeague(); document.getElementById("li_league").style.display = "none"; document.getElementById("li_time").style.display = ""; } else { $("#conditionBtn").show(); MakeTable(); document.getElementById("li_league").style.display = ""; document.getElementById("li_time").style.display = "none"; } $.when(showRecommend()).done(function (arr) { $.each(arr, function (i, one) { one.show() }); }); //联赛/杯赛名列表 makeMyLeague(); setTimeout(function () { filterHelper.linkData(); //国家列表 makeMyCountry(); //让球选择/查询 makeGoalTable(oldLetBig); //让球 filterHelper.initHtml(!ifSortByLeague); }, 500); var dataUrl = (Config.companyID == 3 ? "/data/goalbf3.xml" : "/data/goal.php?id=" + Config.companyID + "&t=" + Date.parse(new Date())); GetXml(dataUrl , function (data) { idList = getXmlChildNodes_Text(data.documentElement.childNodes, 1); showodds(false, data); window.clearTimeout(getoddsxmlTimer); getoddsxmlTimer = window.setTimeout("getoddsxml()", 3000); if (Config.companyID == 3){ GetXml("/data/goal3.xml", function (data) { jcIdList = getXmlChildNodes_Text(data.documentElement.childNodes, 2); }); }else{ jcIdList = getXmlChildNodes_Text(data.documentElement.childNodes, 2); } }); window.clearTimeout(runtimeTimer); runtimeTimer = window.setTimeout("setMatchTime()", 1000); if (Config.rank == 1) ShowTeamRank(); if (Config.explain == 0) ShowExplain(); document.getElementById("scoreLoading").style.display = "none"; window.setTimeout("showLeagueList(1)", 500); } function SortData() { if (concernIds.length == 0) return; var temp = []; var tempCount = matchcount; for (var i = 0; i < tempCount && concernIds.length > temp.length; i++) { if (concernIds.contains(A[i][0])) { temp.push(A[i]); A.splice(i, 1); tempCount--; i--; } } if (temp.length > 0) { A = temp.concat(A); } } function MakeTable() { var state, bg = "", hh = 0; var H_redcard, G_redcard, H_yellow, G_yellow; var html = new Array(); var isCreateTr = false; html.push(""); var advertTool = new Advert(matchcount, 14); var cid = Config.companyID; var ifAlias = Config.ifAlias; var lang = Config.language; for (var i = 0; i < matchcount; i++) { try { var data = A[i]; var schID = data[0]; var sclassArr = B[data[1]]; var sclassId = sclassArr[0]; var hn = getTeamName(ifAlias, data[4 + lang], T[data[2] + "_3"]); var gn = getTeamName(ifAlias, data[7 + lang], T[data[3] + "_3"]); sclassArr[8]++; var ifConcern = concernIds.contains(schID); if (!isCreateTr && !ifConcern) { html.push(""); isCreateTr = true; } var match_corner = ""; state = parseInt(data[12]); switch (state) { case 0: if (data[23] == "1") match_score = "阵容"; else match_score = "-"; match_half = "-"; match_corner = "-"; break; case 1: match_score = data[13] + "-" + data[14]; match_half = "-"; match_corner = data[34] + "-" + data[35]; break; case -11: case -14: match_score = ""; match_half = ""; match_corner = ""; break; default: match_score = data[13] + "-" + data[14]; if (data[15] == null) data[15] = ""; if (data[16] == null) data[16] = ""; match_half = data[15] + "-" + data[16]; match_corner = data[34] + "-" + data[35]; break; } if (data[17] != "0") H_redcard = ""; else H_redcard = ""; if (data[18] != "0") G_redcard = ""; else G_redcard = ""; if (data[19] != "0") H_yellow = ""; else H_yellow = ""; if (data[20] != "0") G_yellow = ""; else G_yellow = ""; if (bg != "ts1") bg = "ts1"; else bg = "ts2"; var classx = ""; if (classx == "none") hh++; html.push(""); html.push(""); var sName = sclassArr[1 + lang]; if (sclassArr[7] != "") html.push(""); else html.push(""); html.push(""); if (state == "-1") classx2 = "td_scoreR"; else classx2 = "td_score"; var classx3 = (state == "0" || state == "-1" ? "black" : "blue"); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); if (!ifConcern) html.push(""); else html.push(""); data[27] = removeTV(data[27], sclassId, sName); if (data[27] + data[32] == "" || classx == "none") classx = "none"; else classx = ""; html.push(""); if (isShowFlash) html.push(""); if (!ifConcern) { advertTool.Show(html, i); } } catch (e) {} } advertTool.ShowRemain(html); html.push("
" + matchdate + "时间状态主队比分客队角/半数据指数
" + sName + "" + sName + "" + data[10] + "" + state_ch[state + 14].split(",")[lang] + "" + H_yellow + "" + H_redcard + "" + hn + "" + match_score + "" + gn + "" + G_redcard + "" + G_yellow + "" + match_corner + "" + match_half + "" + ""); //html.push(""); html.push(""); html.push("   "); var isShowFlash = data[37] == 1; if (isShowFlash) { if (flashScheduleIDs != "" && parseInt(flashScheduleIDs) == schID) html.push(""); else html.push(""); } html.push("
" + showExplain(data[32], hn, gn) + (data[32] != "" && data[27] != "" ? "
" + data[27] : data[27] != "" ? data[27] : "") + "
") document.getElementById("ScoreDiv").innerHTML = html.join(""); document.getElementById("hiddencount").innerHTML = hh; $(".bts .p_concern").show(); } function MakeTableOrderByLeague() { var state, bg = "", hh = 0; var leagueIndex = -1, oldLeagueIndex = -1; var H_redcard, G_redcard, H_yellow, G_yellow; var html = new Array(); html.push(""); html.push(""); var advertTool = new Advert(matchcount, 12); var cid = Config.companyID; var ifAlias = Config.ifAlias; var lang = Config.language; for (var i = 0; i < matchcount; i++) { try { var data = A[i]; var schID = data[0]; var sclassArr = B[data[1]]; var sclassId = sclassArr[0]; var hn = getTeamName(ifAlias, data[4 + lang], T[data[2] + "_3"]); var gn = getTeamName(ifAlias, data[7 + lang], T[data[3] + "_3"]); leagueIndex = data[1]; sclassArr[8]++; var match_corner = ""; state = parseInt(data[12]); switch (state) { case 0: if (data[23] == "1") match_score = "阵容"; else match_score = "-"; match_half = "-"; match_corner = "-"; break; case 1: match_score = data[13] + "-" + data[14]; match_half = "-"; match_corner = data[34] + "-" + data[35]; break; case -11: case -14: match_score = ""; match_half = ""; match_corner = ""; break; default: match_score = data[13] + "-" + data[14]; if (data[15] == null) data[15] = ""; if (data[16] == null) data[16] = ""; match_half = data[15] + "-" + data[16]; match_corner = data[34] + "-" + data[35]; break; } if (data[17] != "0") H_redcard = ""; else H_redcard = ""; if (data[18] != "0") G_redcard = ""; else G_redcard = ""; if (data[19] != "0") H_yellow = ""; else H_yellow = ""; if (data[20] != "0") G_yellow = ""; else G_yellow = ""; if (bg != "ts1") bg = "ts1"; else bg = "ts2"; var classx = ""; if (classx == "none") hh++; if (oldLeagueIndex != leagueIndex) { oldLeagueIndex = leagueIndex; html.push(""); } html.push(""); html.push(""); html.push(""); html.push(""); if (state == "-1") classx2 = "td_scoreR"; else classx2 = "td_score"; var classx3 = (state == "0" || state == "-1" ? "black" : "blue"); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); data[27] = removeTV(data[27], sclassId, sclassArr[1 + lang]); if (data[27] + data[32] == "" || classx == "none") classx = "none"; else classx = ""; //data[27]=data[27].replace("310TV","赛事直播"); //data[27]=data[27].replace(/www.310tv.com/g,"v.nowscore.com"); html.push(""); if (isShowFlash) html.push(""); advertTool.Show(html, i); } catch (e) { } } advertTool.ShowRemain(html); html.push("
时间状态主队比分客队角/半数据指数
"); if (sclassArr[7] != "") html.push(""); else html.push(""); html.push(sclassArr[1 + lang] + " "); html.push("
" + data[10] + "" + state_ch[state + 14].split(",")[lang] + "" + H_yellow + "" + H_redcard + "" + hn + "" + match_score + "" + gn + "" + G_redcard + "" + G_yellow + "" + match_corner + "" + match_half + "" + ""); //html.push(""); html.push(""); html.push("   "); var isShowFlash = data[37] == 1; if (isShowFlash) { if (flashScheduleIDs != "" && parseInt(flashScheduleIDs) == schID) html.push(""); else html.push(""); } html.push("
" + showExplain(data[32], hn, gn) + (data[32] != "" && data[27] != "" ? "
" + data[27] : data[27] != "" ? data[27] : "") + "
") document.getElementById("ScoreDiv").innerHTML = html.join(""); document.getElementById("hiddencount").innerHTML = hh; $(".bts .p_concern").hide(); } function makeMyLeague() { var leaguehtml = new Array(); leaguehtml.push(""); $("#myleague").html(leaguehtml.join("")); } function makeMyCountry() { function cutStr(str, len) { var str_length = 0; var str_len = 0; var str_cut=""; var str_len = str.length; for (var i = 0; i < str_len; i++) { var a = str.charAt(i); str_length++; if (escape(a).length > 4) { str_length++; } if (str_length <= len) str_cut = str_cut.concat(a); if (str_length >= len) { return str_cut; } } return str; } //国家列表 var country = new Array(); country.push(""); document.getElementById("countryList").innerHTML = country.join(""); } function showodds(needSleep,xmlNode) //是否需显示一场之后暂停一会 { try { var root = xmlNode.documentElement.childNodes[0]; if (root.childNodes.length == 0) return; needSound = false; showodds2(root, 0, needSleep); } catch (e) { } } function showodds2(root, i, needSleep) { try { var odds, old = new Array(); odds = getXmlChildNodes_Text(root.childNodes, i);//id,oddsid,goal,home,away,oddsid,hw,st,gw,oddsid,up,goal,down var D = odds.split(","); var tr = document.getElementById("tr1_" + D[0]); if (tr != null) { var oldOdds = tr.attributes["odds"].value; var oldD = oldOdds.split(","); if (oldOdds !== odds || oldD.length != D.length) { var ifChange = false; var arr = [[2, Goal2GoalCn], 3, 4, 6, 7, 8, [10, Goal2GoalCn2], 11, 12] for (var j = 0; j < arr.length; j++) { var one = arr[j]; var fuc = null, index = one; if (one instanceof Array) { index = one[0]; fuc = one[1]; } if (index >= D.Length) break; var oldV = oldD[index], v = D[index]; if (typeof fuc === "function") v = fuc(v); if (oldV != D[index] && typeof oldV !== "undefined" && oldV != "") { if (D[index] > oldV) v = "" + v + ""; else v = "" + v + ""; ifChange = true; } D[index] = v; } if (ifChange) { window.setTimeout("restoreOddsColor(" + D[0] + ")", 30000); if (Config.oddsSound == 1) { if (tr.style.display != "none") needSound = true; } } var ifeng_yp = D[14] != "0", ifeng_op = D[15] != "0", ifeng_dx = D[16] != "0"; var tmp = ""; if (Config.yp == 1) tmp += "

" + (ifeng_yp ? " " : D[3]) + "

"; if (Config.op == 1) tmp += "

" + (ifeng_op ? " " : D[6]) + "

"; if (Config.dx == 1) tmp += "

" + (ifeng_dx ? " " : D[11]) + "

"; tr.cells[9].innerHTML = tmp; tmp = ""; if (Config.yp == 1) tmp += "

" + (ifeng_yp ? "封" : D[2]) + "

"; if (Config.op == 1) tmp += "

" + (ifeng_op ? "封" : D[7]) + "

"; if (Config.dx == 1) tmp += "

" + (ifeng_dx ? "封" : D[10]) + "

"; tr.cells[10].innerHTML = tmp; tmp = ""; if (Config.yp == 1) tmp += "

" + (ifeng_yp ? " " : D[4]) + "

"; if (Config.op == 1) tmp += "

" + (ifeng_op ? " " : D[8]) + "

"; if (Config.dx == 1) tmp += "

" + (ifeng_dx ? " " : D[12]) + "

"; tr.cells[11].innerHTML = tmp; tmp = ""; if (D[13] == "1") tmp = ""; if (D[13] == "2") tmp = ""; tr.cells[12].getElementsByTagName('span').item(0).innerHTML = tmp; tr.attributes["odds"].value = odds; } } } catch (e) { } i++; if (i < root.childNodes.length) { if (needSleep) setTimeout(function () { showodds2(root, i, needSleep); }, 1); else showodds2(root, i, needSleep); } else if (needSound) audioHelper.play("oddsFlashSound"); } function getoddsxml() { var chUrl = (Config.companyID == 3 ? "/data/ch_goalbf3.xml" : "/data/ch_goal.php?id="+ Config.companyID + "&t=" + Date.parse(new Date())); GetXml(chUrl , function (data) { var dataTxt = $(data).text(); if (typeof oldOddsXML != "undefined" && dataTxt == oldOddsXML) return; oldOddsXML = dataTxt; showodds(true, data); }); getoddsxmlTimer = window.setTimeout("getoddsxml()", 3000); } function PlayeddsSound(matchid) { if (Config.oddsSound == 1) { if (document.getElementById("tr1_" + matchid).style.display != "none") { audioHelper.play("oddsFlashSound"); } } window.setTimeout("restoreOddsColor(" + matchid + ")", 30000); } function restoreOddsColor(matchid) { var tr = document.getElementById("tr1_" + matchid); if (tr == null) return; tr.cells[9].innerHTML = tr.cells[9].innerHTML.toLowerCase().replace(//g, "").replace(//g, "").replace(/<\/span>/g, ""); tr.cells[10].innerHTML = tr.cells[10].innerHTML.toLowerCase().replace(//g, "").replace(//g, "").replace(/<\/span>/g, ""); tr.cells[11].innerHTML = tr.cells[11].innerHTML.toLowerCase().replace(//g, "").replace(//g, "").replace(/<\/span>/g, ""); } function gettime() { try { LoadTime = (LoadTime + 1) % 60; if (LoadTime == 0) oXmlHttp.open("get", "data/change2.xml", true); else oXmlHttp.open("get", "data/change.xml", true); oXmlHttp.onreadystatechange = refresh; oXmlHttp.send(null); } catch (e) { } window.setTimeout("gettime()", 2000); } function refresh() { try { if (oXmlHttp.readyState != 4 || (oXmlHttp.status != 200 && oXmlHttp.status != 0)) return; lastUpdateTime = new Date(); var root = oXmlHttp.responseXML.documentElement; if (oldXML == "" || oldXML == oXmlHttp.responseText) { oldXML = oXmlHttp.responseText; return; } oldXML = oXmlHttp.responseText; if (root.attributes[0].value != "0") { window.setTimeout("LoadLiveFile()", Math.floor(20000 * Math.random())); return; } var D = new Array(); var matchindex, score1change, score2change, scorechange; var goTime, hometeam, guestteam, sclassname, score1, score2, tr; var matchNum = 0; var winStr = ""; var notify = document.getElementById("notify").innerHTML = ""; var ifShow_odds = get_ifShow_odds(); //判断是否有显示SB详情指数浮动窗口 var lang = Config.language; for (var i = 0; i < root.childNodes.length; i++) { D = getXmlChildNodes_Text(root.childNodes, i).split("^");//0:ID,1:state,2:score1,3:score2,4:half1,5:half2,6:card1,7:card2,8:time1,9:time2,10:explain,11:lineup D[1] = parseInt(D[1]); tr = document.getElementById("tr1_" + D[0]); if (tr == null) continue; matchindex = tr.attributes["index"].value; var data = A[matchindex]; var sclassArr = B[data[1]]; var sclassId = sclassArr[0]; var sName = sclassArr[1 + lang]; score1change = false; if (data[13] != D[2]) { data[13] = D[2]; score1change = true; tr.cells[4].style.backgroundColor = "#bbbb22"; } score2change = false; if (data[14] != D[3]) { data[14] = D[3]; score2change = true; tr.cells[6].style.backgroundColor = "#bbbb22"; } scorechange = score1change || score2change; //角球 if (data[34] != D[16]) { data[34] = D[16]; } if (data[35] != D[17]) { data[35] = D[17]; } data[36] = D[18]; document.getElementById("corner_" + D[0]).style.display = (data[36] == "1" ? "" : "none"); //附加说明改时变了' //D[10]=D[10].toLowerCase().replace(//g,""); D[10] = removeTV(D[10], sclassId, sName); if (data[27] != D[10] || data[32] != D[15]) { data[27] = D[10]; data[32] = D[15]; var ex = showExplain(D[15], data[4 + lang], data[7 + lang]) + D[10]; document.getElementById("other_" + D[0]).innerHTML = ex; if (D[10] + D[15] == "") document.getElementById("tr2_" + D[0]).style.display = "none"; else if (filterHelper.ifShowSchByID(D[0])) document.getElementById("tr2_" + D[0]).style.display = ""; } if (Config.redcard == 1 && (D[6] != data[17] || D[7] != data[18]) && tr.style.display != "none") { hometeam = data[4 + lang].replace("(中)", " 中").substring(0, 7); guestteam = data[7 + lang].substring(0, 7); sclassname = B[data[1]][1 + lang]; if (D[6] != data[17]) { hometeam = "" + hometeam + ""; } if (D[7] != data[18]) { guestteam = "" + guestteam + ""; } winStr += "红牌 " + tr.cells[3].innerHTML + "" + hometeam + " " + (D[6] == "0" ? "" : "") + " vs" + guestteam + " " + (D[7] == "0" ? "" : "") + ""; matchNum = matchNum + 1; }//redcardChange //红牌变化了 if (D[6] != data[17]) { data[17] = D[6]; if (D[6] == "0") document.getElementById("redcard1_" + D[0]).innerHTML = ""; else document.getElementById("redcard1_" + D[0]).innerHTML = " "; if (Config.redcard == 1) tr.cells[4].style.backgroundColor = "#ff8888"; window.setTimeout("timecolors(" + D[0] + "," + matchindex + ")", 12000); } if (D[7] != data[18]) { data[18] = D[7]; if (D[7] == "0") document.getElementById("redcard2_" + D[0]).innerHTML = ""; else document.getElementById("redcard2_" + D[0]).innerHTML = " "; if (Config.redcard == 1) tr.cells[6].style.backgroundColor = "#ff8888"; window.setTimeout("timecolors(" + D[0] + "," + matchindex + ")", 12000); } //黄牌变化了 if (D[12] != data[19]) { data[19] = D[12]; if (D[12] == "0") document.getElementById("yellow1_" + D[0]).innerHTML = ""; else document.getElementById("yellow1_" + D[0]).innerHTML = " "; } if (D[13] != data[20]) { data[20] = D[13]; if (D[13] == "0") document.getElementById("yellow2_" + D[0]).innerHTML = ""; else document.getElementById("yellow2_" + D[0]).innerHTML = " "; } //开赛 if (data[11] != D[8]) tr.cells[2].innerHTML = D[8]; data[10] = D[8]; data[11] = D[9]; //半场比分 data[15] = D[4]; data[16] = D[5]; //状态 if (data[12] != D[1]) { var oldState = data[12]; data[12] = D[1]; //if (oldState > 3 || data[12] > 3 || oldState < 0) // console.log(D[0] + ":" + oldState + "->" + data[12]+"("+new Date()+")" ); switch (data[12]) { case 0: tr.cells[3].innerHTML = ""; break; case 1: var t = data[11].split(","); var t2 = new Date(t[0], t[1], t[2], t[3], t[4], t[5]); goTime = Math.floor((new Date() - t2 - difftime) / 60000); if (goTime > 45) goTime = "45+" if (goTime < 1) goTime = "1"; tr.cells[3].innerHTML = goTime + ""; break; case 2: case 4: case 5: case -11: tr.cells[3].innerHTML = state_ch[parseInt(D[1]) + 14].split(",")[lang]; break; case 3: var t = data[11].split(","); var t2 = new Date(t[0], t[1], t[2], t[3], t[4], t[5]); goTime = Math.floor((new Date() - t2 - difftime) / 60000) + 46; if (goTime > 90) goTime = "90+"; if (goTime < 46) goTime = "46"; tr.cells[3].innerHTML = goTime + ""; break; case -1: tr.cells[3].innerHTML = state_ch[parseInt(D[1]) + 14].split(",")[lang]; tr.cells[5].style.color = "red"; window.setTimeout("MoveToBottom(" + D[0] + ")", 25000); break; default: tr.cells[3].innerHTML = state_ch[parseInt(D[1]) + 14].split(",")[lang]; MoveToBottom(D[0]); break; } } //score switch (data[12]) { case 0: if (D[11] == "1") tr.cells[5].innerHTML = "阵容"; else tr.cells[5].innerHTML = "-"; break; case 1: tr.cells[5].innerHTML = data[13] + "-" + data[14]; showHtml(document.getElementById("corner_" + D[0]), data[34] + "-" + data[35]); break; case -11: case -14: tr.cells[5].innerHTML = "-"; showHtml(document.getElementById("half_" + D[0]), "-"); showHtml(document.getElementById("corner_" + D[0]), "-"); break; default: //2 3 -1 -12 -13 tr.cells[5].innerHTML = data[13] + "-" + data[14]; var halfNode = document.getElementById("half_" + D[0]); if (showHtml(halfNode, data[15] + "-" + data[16])) halfNode.style.color = "red"; showHtml(document.getElementById("corner_" + D[0]), data[34] + "-" + data[35]); break; } if (ifShow_odds) { var objScore = document.getElementById("ffScoreDetail"); var sid = objScore.attributes["sid"].value; if (parseInt(sid) == parseInt(data[0])) { objScore.innerHTML = "" + data[13] + " - " + data[14] + ""; } } if (scorechange) { ShowFlash(D[0], matchindex); if (tr.style.display != "none") { hometeam = data[4 + lang].replace("(中)", " 中").substring(0, 7); guestteam = data[7 + lang].substring(0, 7); sclassname = B[data[1]][1 + lang]; if (score1change) { hometeam = "" + hometeam + ""; score1 = "" + D[2] + ""; score2 = "" + D[3] + ""; } if (score2change) { guestteam = "" + guestteam + ""; score1 = "" + D[2] + ""; score2 = "" + D[3] + ""; } window.clearTimeout(nofityTimer); if (notify == "") notify = "入球提示:"; notify += sclassname + ":" + hometeam + " " + score1 + "-" + score2 + " " + guestteam + "   "; nofityTimer = window.setTimeout("clearNotify()", 20000); if (Config.winLocation >= 0 && parseInt(D[1]) >= -1) { if (matchNum % 2 == 0) winStr += "" + sclassname + " " + tr.cells[3].innerHTML + "" + hometeam + "" + score1 + "-" + score2 + "" + Goal2GoalCn(data[25]) + "" + guestteam + ""; else winStr += "" + sclassname + " " + tr.cells[3].innerHTML + "" + hometeam + "" + score1 + "-" + score2 + "" + Goal2GoalCn(data[25]) + "" + guestteam + ""; matchNum = matchNum + 1 } } }//scorechange } if (matchNum > 0) ShowCHWindow(winStr, matchNum); document.getElementById("notify").innerHTML = notify; } catch (e) { } } function ShowFlash(id, n) { try { if (Config.sound >= 0 && A[n][12] >= -1 && document.getElementById("tr1_" + id).style.display != "none") audioHelper.play("flashsound"); } catch (e) { }; window.setTimeout("timecolors(" + id + ")", 120000); } function timecolors(matchid) { try { var tr = document.getElementById("tr1_" + matchid); tr.cells[4].style.backgroundColor = ""; tr.cells[6].style.backgroundColor = ""; } catch (e) { } } function clearNotify() { document.getElementById("notify").innerHTML = ""; } function ShowAllMatch() { filterHelper.initValue(); filterHelper.save(); filterHelper.initHtml(); $("#liZC1,#liZC2,#liZC3").css("color", "#333"); $("#liZC").css("color", "#333").removeClass("selected"); showPopupBox('filterBox', true); } //'按比赛状态显示 function ShowMatchByMatchState(n) { filterHelper.updateStateKind(n); } function SetMatchType(m) { filterHelper.updateMatchType(m); } function hidematch(i) { filterHelper.updateSch(A[i][0]); } function seletcAllLeague() { $("#checkboxleague li:visible :checkbox").each(function (i, v) { var thisObj = $(this); if (!thisObj.is(":checked")) { thisObj.attr('checked', true); CheckLeague(thisObj.val()); } }); } function SelectOtherLeague() { $("#checkboxleague li:visible :checkbox").each(function (i, v) { var thisObj = $(this); var newCheck = !thisObj.is(":checked"); thisObj.attr('checked', newCheck); CheckLeague(thisObj.val()); }); } function CheckLeague(i) { filterHelper.updateSclass(i, $("#checkboxleague_" + i).is(":checked")); } function CloseLeague(i) { document.getElementById("checkboxleague_" + i).checked = false; CheckLeague(i); $(".Leaguestitle#tr_" + i).hide(); } function HiddenLeague(i, b) { document.getElementById("checkboxleague_" + i).checked = b; CheckLeague(i); } function seletcAllCountry() { $("#checkboxcountry li:visible :checkbox").each(function (i, v) { var thisObj = $(this); if (!thisObj.is(":checked")) { thisObj.attr('checked', true); CheckCountry(thisObj.val()); } }); } function SelectOtherCountry() { $("#checkboxcountry li:visible :checkbox").each(function (i, v) { var thisObj = $(this); var newCheck = !thisObj.is(":checked"); thisObj.attr('checked', newCheck); CheckCountry(thisObj.val()); }); } function CheckCountry(id) { filterHelper.updateCountry(id, $("#checkboxcountry_" + id).is(":checked")); } function MoveToBottom(m) { try { var dom = document.getElementById("tr1_" + m).parentElement; dom.insertAdjacentElement("BeforeEnd", document.getElementById("tr1_" + m)); dom.insertAdjacentElement("BeforeEnd", document.getElementById("tr2_" + m)); if (!!document.getElementById("tr3_" + m)) dom.insertAdjacentElement("BeforeEnd", document.getElementById("tr3_" + m)); changeTxtAdLocation(); } catch (e) { } } function setOrderby(a) { orderby = a writeCookie("orderby", orderby); LoadLiveFile(); showPopupBox("filterBox", true); } //更新比赛进行的时间 function setMatchTime() { for (var i = 0; i < matchcount; i++) { try { if (A[i][1] == -1) continue; var goTime = -1; if (A[i][12] == "1") { //上半场 var t = A[i][11].split(","); var t2 = new Date(t[0], t[1], t[2], t[3], t[4], t[5]); goTime = Math.floor((new Date() - t2 - difftime) / 60000); if (goTime > 45) goTime = "45+"; if (goTime < 1) goTime = "1"; document.getElementById("time_" + A[i][0]).innerHTML = goTime + ""; } if (A[i][12] == "3") { //下半场 var t = A[i][11].split(","); var t2 = new Date(t[0], t[1], t[2], t[3], t[4], t[5]); goTime = Math.floor((new Date() - t2 - difftime) / 60000) + 46; if (goTime > 90) goTime = "90+"; if (goTime < 46) goTime = "46"; document.getElementById("time_" + A[i][0]).innerHTML = goTime + ""; } if (goTime > -1 && flashScheduleIDs == A[i][0]) setStatusTimeLine(goTime, A[i][12], A[i][0]); } catch (e) { } } runtimeTimer = window.setTimeout("setMatchTime()", 30000); } function showdetail(n, event) { var matchArr = A[n]; var schID = matchArr[0]; if (Config.detail == 0) return; if (matchArr[12] == "0") return; var resultName = ["先开球", "第一个角球", "第一张黄牌", "射门", "射正", "犯规", "角球", "角球(加时)", "任意球", "越位", "乌龙球数", "黄牌", "黄牌数(加时)", "红牌", "控球时间", "头球", "救球", "守门员出击", "丟球", "成功抢断", "阻截", "长传", "短传", "助攻", "成功传中", "第一个换人", "最后换人", "第一个越位", "最后越位", "换人数", "最后角球", "最后黄牌", "换人数(加时)", " 越位(加时)", "射门不中", "中柱", "头球成功", "射门被挡", "铲球", "过人", "界外球", "传球", "传球成功率"] var language = Config.language; var homeTeam = matchArr[language + 4]; var guestTeam = matchArr[language + 7]; var detailNum = 0; var techNum = 0; try { if (Math.floor((new Date() - loadDetailFileTime) / 600) > 60) LoadDetailFile(); var R = new Array(); var temp = ""; var hasChange = false; for (var i = 0; i < rq.length; i++) { R = rq[i].split('^'); if (R[0] != schID) continue; if (!hasChange && R[2] == '11') hasChange = true; var pN = language == 1 ? R[4] : (R[6] != '' ? R[6] : R[4]); var showDetailName = R[2] == '11' ? pN.replace('↑', '').replace('↓', '') : pN; if (R[1] == "1") temp += "" + showDetailName + "" + R[3] + "'"; else temp += "" + R[3] + "'" + showDetailName + ""; detailNum++; } var html = ""; html += ""; html += ""; html += temp; html += "
初指参考:" + Goal2GoalCn(matchArr[25]) + "
" + matchArr[4 + Config.language] + "[" + matchArr[21] + "]时间" + matchArr[7 + Config.language] + "[" + matchArr[22] + "]
"; var technicCount = ""; //技术统计 for (var i = 0; i < tc.length; i++) { R = tc[i].split('^'); if (R[0] == schID) { technicCount = R[1]; break; } } var bgcolor1 = "#FFFFFF"; var bgcolor2 = "#F0F0FF"; var regex = new RegExp("\\*", "g"); var tempTechHtml = ""; var arrTc = technicCount.replace(regex, "").split(';'); var useTecList = ",3,4,14,"; for (var j = 0; j < arrTc.length; j++) { if (arrTc[j] == '' || parseInt(arrTc[j].split(',')[0]) > 43) continue; if (useTecList.indexOf(',' + arrTc[j].split(',')[0] + ',') == -1) continue; tempTechHtml += ""; tempTechHtml += "" + arrTc[j].split(',')[1] + ""; tempTechHtml += "" + resultName[parseInt(arrTc[j].split(',')[0])] + ""; tempTechHtml += "" + arrTc[j].split(',')[2] + ""; techNum++; } if (techNum > 0) { html += ""; html += ""; html += tempTechHtml; } if (j > 0) html += "
技术统计
"; var obj = document.getElementById('winScore'); obj.style.left = (document.body.clientWidth / 2 - (location.href.indexOf("old") != -1 ? 199 : 255)) + "px"; var trid = "tr1_" + schID; obj.style.top = getElementPos(trid).y + document.getElementById(trid).offsetHeight + "px" ; obj.innerHTML = html; obj.style.display = ""; } catch (e) { } } function getPageHeight() { var pageHeight = window.innerHeight; if (typeof pageWindth != "number") { if (document.compatMode == "CSS1Compat") { pageHeight = document.documentElement.clientHeight; } else { pageHeight = document.body.clientHeight; } } return pageHeight; } function showvideo(n, event) { try { if (Math.floor((new Date() - loadVideoFileTime) / 600) > 60) LoadVideoFile(); var html = ""; html += ""; var soft = ""; for (var i = 0; i < V[A[n][0]].length / 5; i++) { var j = i + i * 4; if (soft != V[A[n][0]][j + 1] || i == 0) { if (i > 0) html += ""; html += "
直播频道
" } if (V[A[n][0]][j + 1].indexOf("外部链接") != -1) { var urls = V[A[n][0]][j + 1].split('|'); if (urls.length > 1) html += "" + urls[0] + " "; } else //html+=""+V[A[n][0]][j+1]+" "; html += "" + V[A[n][0]][j + 1] + " "; soft = V[A[n][0]][j + 1]; } html += "
"; document.getElementById('videoInfo').style.left = (document.body.clientWidth / 2 + 50) + "px"; document.getElementById('videoInfo').style.top = (document.documentElement.scrollTop + event.clientY) + "px"; document.getElementById("videoInfo").innerHTML = html; showPopupBox('videoInfo'); } catch (e) { } } function showpaulu(n, event) { try { if (Config.vs == 0) return; var html = [], bg = ""; var bigNum = 0, victoryNum = 0, singleNum = 0, j = 0, win1; var win = 0, standoff = 0; var countInfo = ""; html.push("
"); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); var scheduleId = A[n][0]; for (var i = 0; i < p.length; i++) { var b = p[i]; if (!(b[3] == A[n][2] && b[4] == A[n][3] || b[4] == A[n][2] && b[3] == A[n][3])) continue; if (b[7] == null) b[7] = ""; if (b[8] == null) b[8] = ""; bg = (bg == "ts1") ? "ts2" : "ts1"; html.push(""); html.push(""); html.push(""); if (b[3] == A[n][2]) //主场 { html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); if (b[5] - b[9] > b[6]) { html.push(""); win++; } if (b[5] - b[9] == b[6]) { html.push(""); standoff++ } if (b[5] - b[9] < b[6]) html.push(""); if (b[5] > b[6]) html.push(""); if (b[5] == b[6]) html.push(""); if (b[5] < b[6]) html.push(""); if (b[5] > b[6]) victoryNum++; } else //客场 { html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); if (b[5] - b[9] < b[6]) { html.push(""); win++; } if (b[5] - b[9] == b[6]) { html.push(""); standoff++ } if (b[5] - b[9] > b[6]) html.push(""); if (b[5] < b[6]) html.push(""); if (b[5] == b[6]) html.push(""); if (b[5] > b[6]) html.push(""); if (b[5] < b[6]) victoryNum++; } if (b[5] + b[6] > 2.5) { html.push(""); bigNum++; } else html.push(""); if ((b[5] + b[6]) % 2 == 1) { html.push(""); singleNum++; } else html.push(""); html.push(""); j++; } if (j > 0) { if (j - standoff > 0) win1 = Math.round(win / (j - standoff) * 1000) / 10; else win1 = "0"; html.push(""); } html.push("
赛事时间主场球队比分客场球队半场让球盘路胜负大小单双
" + b[0] + "" + b[2] + "" + A[n][4 + Config.language] + "" + b[5] + "-" + b[6] + "" + A[n][7 + Config.language] + "" + b[7] + "-" + b[8] + "" + Goal2GoalCn(b[9]) + "" + A[n][7 + Config.language] + "" + b[5] + "-" + b[6] + "" + A[n][4 + Config.language] + "" + b[7] + "-" + b[8] + "" + Goal2GoalCn(b[9]) + "
最近[ " + j + " ]场,   胜率:" + Math.round(victoryNum / j * 1000) / 10 + "% 让胜率:" + win1 + "% 大球:" + Math.round(bigNum / j * 1000) / 10 + "% 单:" + Math.round(singleNum / j * 1000) / 10 + "%
"); var obj = document.getElementById('winScore'); var postPk = getElementPos("tr1_" + scheduleId); var contentHeight = j * 20; var scrollTop = Math.max(document.body.scrollTop, document.documentElement.scrollTop); var oddsY = postPk.y - scrollTop; if (scrollTop == 0) { var pos = getElementPos("sound"); if (event.clientY - pos.y < contentHeight) obj.style.top = postPk.y + "px"; else obj.style.top = (oddsY - contentHeight + 10) + "px"; } else { if (event.clientY < obj.clientHeight) obj.style.top = postPk.y + "px"; else obj.style.top = (postPk.y - contentHeight + 10) + "px"; } obj.style.left = (document.body.clientWidth / 2 - 455) + "px"; if (j == 0) { document.getElementById('winScore').style.left = (document.body.clientWidth / 2 - 50) + "px"; html = []; html.push("
无对战记录
"); } document.getElementById("winScore").innerHTML = html.join(""); $("#winScore").show(); } catch (e) { } } function check() { if (oldUpdateTime == lastUpdateTime && oldUpdateTime != "") { if (confirm("由于程序忙,或其他网络问题,你已经和服务器断开连接超过 5 分钟,是否要重新连接观看比分?")) window.location.reload(); } oldUpdateTime = lastUpdateTime; window.setTimeout("check()", 300000); } function LoadLiveFile() { var allDate = document.getElementById("allDate"); var s = document.createElement("script"); s.type = "text/javascript"; if (orderby == "league") //s.src = "data/bf1.js?t=" + Date.parse(new Date()); s.src = "data/bf1.js"; else //s.src = "data/bf.js?t=" + Date.parse(new Date()); s.src = "data/bf.js"; allDate.removeChild(allDate.firstChild); allDate.appendChild(s, "script"); window.clearTimeout(LoadLiveFileTimer); LoadLiveFileTimer = window.setTimeout("LoadLiveFile()", 3600 * 1000); } function LoadDetailFile() { var detail = document.getElementById("span_detail"); var s = document.createElement("script"); s.type = "text/javascript"; s.charset = "gb2312"; //s.src = "data/detail.js?t=" + Date.parse(new Date()); s.src = "data/detail.js"; detail.removeChild(detail.firstChild); detail.appendChild(s, "script"); loadDetailFileTime = new Date(); } function LoadVideoFile() { var videoData = document.getElementById("videoData"); var s = document.createElement("script"); s.type = "text/javascript"; s.src = "data/programs.js?t=" + Date.parse(new Date()); videoData.removeChild(videoData.firstChild); videoData.appendChild(s, "script"); loadVideolFileTime = new Date(); } function SetLanguage(l) { var oName = "alias"; if (l == oName) { if (Config.ifAlias) return; getEleById("Language" + Config.language).className = ""; Config.ifAlias = 1; Config.language = 0; } else { if (Config.ifAlias) { getEleById("Language" + oName).className = ""; Config.ifAlias = 0; } else if (Config.language == l) return; getEleById("Language" + Config.language).className = ""; Config.language = l; } getEleById("Language" + l).className = "selected"; LoadLiveFile(); Config.writeCookie(); } function showOrHideGoalSel(companyID) { if (companyID == 3) $(".selGoal").show(); else { $(".selGoal").hide(); checkGoalInput(1); //filterHelper.hashLetgoal=new Hash //filterHelper.hashTotalgoal=new Hash(); } } function SetCompany(id) { getEleById("company" + Config.companyID).className = ""; getEleById("company" + id).className = "selected"; Config.companyID = id; showOrHideGoalSel(id); sData = new Object(); LoadSbDetailFile(); LoadLiveFile(); Config.writeCookie(); } function CheckSound() { if (document.getElementById("soundCheck").checked) Config.sound = parseInt(document.getElementById("sound").value); else Config.sound = -1; audioHelper.init("flashsound", flash_sound[Config.sound]); Config.writeCookie(); } function CheckWindow() { if (document.getElementById("windowCheck").checked) Config.winLocation = parseInt(document.getElementById("winLocation").value) else Config.winLocation = -1; Config.writeCookie(); } function CheckExplain() { if (document.getElementById("explain").checked) Config.explain = 1; else Config.explain = 0; Config.writeCookie(); ShowExplain(); } function ShowExplain() { var value = "none"; if (Config.explain == 1) value = ""; for (var i = 0; i < matchcount; i++) if (A[i][1] != -1 && A[i][27] + A[i][32] != "") document.getElementById("tr2_" + A[i][0]).style.display = value; } function CheckTeamRank() { if (document.getElementById("rank").checked) Config.rank = 1; else Config.rank = 0; Config.writeCookie(); ShowTeamRank(); } function ShowTeamRank() { for (var i = 0; i < matchcount; i++) { if (A[i][1] == -1) continue; if (A[i][21] != "") document.getElementById("horder_" + A[i][0]).innerHTML = (Config.rank == 1 ? "[" + A[i][21] + "]" : ""); if (A[i][22] != "") document.getElementById("gorder_" + A[i][0]).innerHTML = (Config.rank == 1 ? "[" + A[i][22] + "]" : ""); } } function CheckFunction(obj) { if (document.getElementById(obj).checked) eval("Config." + obj + "=1"); else eval("Config." + obj + "=0"); Config.writeCookie(); if (obj = "yp" || obj == "op" || obj == "dx") LoadLiveFile(); } function changeFontSize(obj, size) { Config.fontsize = size; document.getElementById(obj).style.fontSize = size + "px"; Config.writeCookie(); } //赛程赛果 function ChangeSchedule(id, t) { var script = document.getElementById("scriptScsg"); var s = document.createElement("script"); s.type = "text/javascript"; s.src = "data/AjaxLeague.js?SclassID=" + id + "&SclassType=" + (t == 1 ? "s" : "c") + "&v=" + Date.parse(new Date()); script.removeChild(script.firstChild); script.appendChild(s, "script"); } function ChangeSchedule2(id, t, groupid) { var script = document.getElementById("scriptScsg"); var s = document.createElement("script"); s.type = "text/javascript"; s.src = "data/AjaxLeague.js?SclassID=" + id + "&SclassType=" + (t == 1 ? "s" : "c") + "&SubSclassID=" + groupid + "&v=" + Date.parse(new Date()); script.removeChild(script.firstChild); script.appendChild(s, "script"); } //积分 function ChangeScore(file) { var script = document.getElementById("scriptScore"); var s = document.createElement("script"); s.type = "text/javascript"; s.src = "data/IndexPage/score.js?file=" + file + "&t=" + Date.parse(new Date()); script.removeChild(script.firstChild); script.appendChild(s, "script"); } function ChangeJS(sclassID, kind) { sclassID2 = sclassID; kind2 = kind; ChangeSchedule(sclassID, kind); } function showLeagueList(type) { if (type == 1) { var leaguehtml = new Array(); leaguehtml.push(""); var c = -1; for (var i = 0; i < sclasscount; i++) { if (B[i][8] > 0 && B[i][7] != "") { if (++c % 10 == 0) leaguehtml.push(""); leaguehtml.push(""); if (c % 10 == 9) leaguehtml.push(""); if (c == 0) ChangeJS(B[i][0], B[i][6]); } } leaguehtml.push("
" + B[i][1 + Config.language] + "
"); document.getElementById("leagueList").innerHTML = leaguehtml.join(""); document.getElementById("leagueList").style.display = ""; document.getElementById("hotLeague").style.display = "none"; document.getElementById("hotCup").style.display = "none"; document.getElementById("LeagueKind1").className = "m_on"; document.getElementById("LeagueKind2").className = "m_off"; document.getElementById("LeagueKind3").className = "m_off"; } if (type == 2) { document.getElementById("leagueList").style.display = "none"; document.getElementById("hotLeague").style.display = ""; document.getElementById("hotCup").style.display = "none"; document.getElementById("LeagueKind1").className = "m_off"; document.getElementById("LeagueKind2").className = "m_on"; document.getElementById("LeagueKind3").className = "m_off"; ChangeJS(36, 1); } if (type == 3) { document.getElementById("leagueList").style.display = "none"; document.getElementById("hotLeague").style.display = "none"; document.getElementById("hotCup").style.display = ""; document.getElementById("LeagueKind1").className = "m_off"; document.getElementById("LeagueKind2").className = "m_off"; document.getElementById("LeagueKind3").className = "m_on"; ChangeJS(75, 2); } } function SetLevel(m) { if (filterHelper.oddsLevel == m) m = -1; $("#liZC1,#liZC2,#liZC3,#liZC").css("color", "#333"); if (m > 0) $("#liZC" + m).css("color", "red"); else { $("#liZC").css("color", m > -1 ? "red" : "#333"); } if (m > -1) $("#liZC").addClass("selected"); else $("#liZC").removeClass("selected"); filterHelper.updateOddsLevel(m); } function makeGoalTable(t) { document.getElementById("selectGoals_div").style.display = ""; var sC = (Config.language == 1 ? "沒開" : "没开"); function showGoal(goal, hashObj, t) { if (!!goal) { var goalObj = hashObj.get(goal); var ifShow = filterHelper.ifFromHash((t == 0 ? filterHelper.hashLetgoal : filterHelper.hashTotalgoal), goal); var str = ''; var strGoal = (goal == "NaN" ? sC : (t == 0 ? Goal2GoalCn(goal).replace("受", "*") : Goal2GoalCn2(goal))); return str + '' + strGoal + '[' + goalObj.length + ']'; } else return ""; } var str = ''; if (t == 0 || t == 1) { var hashObj = (t == 0 ? filterHelper.letGoal : filterHelper.totalGoal); var arrKey = hashObj.keys().sort(); for (var i = 0; i < arrKey.length; i++) { str += ''; str += showGoal(arrKey[i], hashObj, t); str += ''; str += ''; str += ''; str += ''; } } else { var i = 0; var hasData = false; var hashLetGoal = filterHelper.letGoal, hashTotalGoal = filterHelper.totalGoal; var lKey = hashLetGoal.keys().sort(); var tKey = hashTotalGoal.keys().sort(); do { var html = showGoal(lKey[i], hashLetGoal, 0) + showGoal(tKey[i], hashTotalGoal, 1); if (hasData = (html.length > 0)) { str += ''; str += html; str += ''; } i++; } while (hasData); } str += '
' + (arrKey[i] != sC ? '' + (Config.language == 1 ? "同初指" : "同初指") + '' : '') + '' + (arrKey[i] != sC ? '' + (Config.language == 1 ? "同終指" : "同终指") + '' : '') + '' + (arrKey[i] != sC ? '' + (Config.language == 1 ? "初指終指相同" : "初指终指相同") + '' : '') + '
'; document.getElementById("goalTable").innerHTML = str; oldLetBig = t; } function showOrHiddenSche(arrValue, ifShow) { var schID = arrValue[0]; if ($("#tr1_" + schID).is(":visible") != ifShow) { var doms = $("#tr1_" + schID + (arrValue[27] + arrValue[32] != "" ? ",#tr2_" + schID : "") + (flashScheduleIDs != "" && parseInt(flashScheduleIDs) == arrValue[0] && flashData.scheduleList.items.length > 0 ? ",#tr3_" + schID : "")); (ifShow ? doms.show() : doms.hide()); return true; } else return false; } function checkGoalInput(t1) { $("#goalTable input:checkbox[name=goalType]").each(function (i) { var node = this; var value = filterHelper.getGoalValue(node.value); var t = $(node).attr("data-type"); var oldChecked = node.checked; if (t1 == 1) node.checked = true; //全选 else if (t1 == 2) node.checked = !oldChecked; //反选 if (oldChecked != node.checked) { if (t == 0) filterHelper.updateLetgoal(value, node.checked); else filterHelper.updateTotalgoal(value, node.checked); } }); } function hiddenGoalData(node) { var value = node.value; var isShow = node.checked; var t = $(node).attr("data-type"); if (t == 0) filterHelper.updateLetgoal(value, isShow); else filterHelper.updateTotalgoal(value, isShow); } function addConcern(matchIndex) { var schid = A[matchIndex][0]; if (concernIds.contains(schid)) return; concernIds.push(schid); writeCookie("concernIds", concernIds); var tr = document.getElementById("tr1_" + A[matchIndex][0]); tr.cells[13].innerHTML = tr.cells[13].innerHTML.replace("addConcern", "deleteConcern").replace("setTopOff", "setTopOn").replace("添加", "取消"); var TTime = new Date(); var isChange = false; var nt2 = getMatchTime(A[matchIndex]);; for (var i = 1; i < matchcount; i++) { if (concernIds.contains(A[i][0])) { if (A[i][13] > 0) { var ot2 = getMatchTime(A[i]); if (ot2 > nt2) { isChange = true; MovePlace(A[i][0], A[matchIndex][0]); break; } } } } if (!isChange) MovePlace(0, A[matchIndex][0]); } function deleteConcern(matchIndex) { var schid = A[matchIndex][0]; if (!concernIds.contains(schid)) return; var i = 0; for (; i < concernIds.length; i++) { if (concernIds[i] == schid) break; } doDeleteOneConcern(matchIndex); concernIds.splice(i, 1); writeCookie("concernIds", concernIds); } function doDeleteOneConcern(matchIndex) { var tr = document.getElementById("tr1_" + A[matchIndex][0]); var conTdObj = $(tr).find("td.Concern"); if (conTdObj.length>0) conTdObj[0].innerHTML = conTdObj[0].innerHTML.replace("deleteConcern", "addConcern").replace("setTopOn", "setTopOff").replace("取消", "添加"); var TTime = new Date(); var isChange = false; var nt2 = getMatchTime(A[matchIndex]); var matchState = A[matchIndex][12]; var schid = A[matchIndex][0] var sameStateID = -1; for (var i = 0; i < matchcount; i++) { var tempSchid = A[i][0]; var tempState = A[i][12]; if (tempSchid < 1 || concernIds.contains(tempSchid)) continue; if ((matchState == 0 && tempState == 0) || matchState * tempState > 0) { sameStateID = tempSchid; var tempTime = getMatchTime(A[i]); isChange = tempTime > nt2 || (tempTime - nt2 == 0 && i > matchIndex); } else if (sameStateID < 0 && matchState > tempState) isChange = true; if (isChange) { MovePlace(tempSchid, schid); break; } } if (!isChange) { if (sameStateID == -1) MovePlace(-1, schid, "BeforeEnd"); else MovePlace(sameStateID, schid, "afterEnd"); } } $("#DivLeague").on("click", ".sclassPlaceTop", function () { var thisObj = $(this); var sclassID = parseInt(thisObj.parents("li").find("[type=checkbox]").val()); var hasTop = thisObj.hasClass("top"); for (var i = 0; i < matchcount; i++) { var tempSclassID = A[i][1]; if (sclassID == tempSclassID) { if (hasTop) deleteConcern(i); else addConcern(i); } } if (hasTop) { thisObj.removeClass("top"); } else { thisObj.addClass("top"); } }); function removeSclassConcern() {//取消联赛置顶 var arr = concernIds; for (var i = 0; i < arr.length; i++) { var schID = arr[i]; var v = filterHelper.schs.get(schID); if (typeof (v) == "undefined") continue; doDeleteOneConcern(v.index); } $(".sclassPlaceTop.top").removeClass("top"); concernIds = []; writeCookie("concernIds", concernIds); } function getMatchTime(match) { var dt = match[10].split(":"); var nt = match[11].split(","); var reTime = new Date(nt[0], nt[1], nt[2], dt[0], dt[1], 0); if (match[12] != 0) { if (reTime > new Date()) reTime.setDate(reTime.getDate() - 1); if (reTime > new Date()) reTime.setFullYear(reTime.getFullYear() - 1); } return reTime; } function MovePlace(newPos, oldPos, sWhere) { try { if (typeof (sWhere) === "undefined") sWhere = "BeforeBegin"; var oEle = null; if (newPos == 0) { oEle = document.getElementById("tr_" + newPos); } else if (newPos > 0) { oEle = document.getElementById("tr1_" + newPos); } else if (newPos == -1) { oEle = document.getElementById("tr_0").parentElement; } if (oEle != null) { var arr = [document.getElementById("tr1_" + oldPos), document.getElementById("tr2_" + oldPos)]; if (!!document.getElementById("tr3_" + oldPos)) arr.push(document.getElementById("tr3_" + oldPos)); if (sWhere.toLowerCase().indexOf("after") == 0) arr.reverse(); for (var i = 0; i < arr.length; i++) oEle.insertAdjacentElement(sWhere, arr[i]); } changeTxtAdLocation(); } catch (e) { } } //竞猜推荐 function showRecommend() { var defer = $.Deferred(); $.ajax({ type: "GET", url: "/data/GetRecommend.js", dataType: "json", async: true, cache: true, success: function (data) { var arr = new Array(); for (var i = 0; i < data.length; i++) { var node = $("#recommend_" + data[i]); if (node.length > 0 && node.is(':hidden')) {  //如果node是隐藏的则显示node元素,否则隐藏 arr.push(node); } } defer.resolve(arr); } }); return defer.promise(); } $("#conditionBtn").click(function () { filterHelper.getConfition(function () { var titleCn = new Array("连胜场次", "连负场次", "连续让球胜", "连续让球负", "连续大球", "连续小球", "近20场让胜率", "近20场让负率", "近20场大球率", "近20场小球率"); var titleBig = new Array("連勝場次", "連負場次", "連續讓球勝", "連續讓球負", "連續大球", "連續小球", "近20場讓勝率", "近20場讓負率", "近20場大球率", "近20場小球率"); var numTtitle = new Array("3~4", "5~6", "7+"); var perTitle = new Array("60~65", "65~70", "75+"); var title = Config.language == 1 ? titleBig : titleCn; var choiseNum = 0; var conditionHtml = ""; for (var i = 0; i < title.length; i++) { var subTitle = i < 6 ? numTtitle : perTitle; conditionHtml += '
'; conditionHtml += '' + title[i] + ''; for (var j = 0; j < subTitle.length; j++) { var className = "condition"; var id = i + "_" + j; var arr = filterHelper.conditionHash.get(id); if (arr.length > 0) { var temNum = 0; $(arr).each(function (i, v) { if (v.ifShowNotCondition && v.sclass.ifShow && v.country.ifShow) temNum++; }); if (temNum > 0) { className += " btn"; if (filterHelper.selCondition != "" && filterHelper.selCondition == id) { className += " on"; choiseNum = temNum; } } } conditionHtml += '' + subTitle[j] + ''; } conditionHtml += '
'; } $("#filterList").html(conditionHtml); $("#conditionNum").html("[" + choiseNum + "]"); showPopupBox("filterBox"); }); }); $("#filterBox").on("click", ".btn", function () { var _this = $(this); if (!_this.hasClass("on")) { $("#filterList .btn.on").removeClass("on"); _this.addClass("on"); var arr = filterHelper.conditionHash.get(_this.attr("data-condition")); var temNum = 0; $(arr).each(function (i, v) { if (v.ifShowNotCondition && v.sclass.ifShow && v.country.ifShow) temNum++; }); $("#conditionNum").html("[" + temNum + "]"); } else { _this.removeClass("on"); $("#conditionNum").html("[0]"); } }); $("#filterBox .ok").click(function () { var selObj = $("#filterList .btn.on"); var selCondition = ""; if (selObj.length > 0) selCondition = selObj.attr("data-condition"); filterHelper.updateCondition(selCondition); showPopupBox("filterBox", true); }); function showPopupBox(popName,ifHide) { if (ifHide) { MM_showHideLayers(popName, '', 'hide'); } else { var pops = ["filterBox", "DivLeague", "DivCountry", "goalDiv", "DivFunction"]; if ($.inArray(popName, pops) > -1) { var arr = []; $(pops).each(function (i, v) { arr.push(v, "", popName == v ? "show" : "hide"); }); MM_showHideLayers.apply(null, arr); } else MM_showHideLayers(popName, '', 'show'); } } Config.getCookie("2in1"); if (Config.companyID != 1 && Config.companyID != 3 && Config.companyID != 4 && Config.companyID != 8 && Config.companyID != 12 && Config.companyID != 17 && Config.companyID != 23 && Config.companyID != 24 && Config.companyID != 31) Config.companyID = 3; getEleById("company" + Config.companyID).className = "selected"; showOrHideGoalSel(Config.companyID); orderby = getCookie("orderby"); if (orderby == null) orderby = "time"; audioHelper.init("flashsound", flash_sound[Config.sound]); audioHelper.init("oddsFlashSound", flash_sound[4]); LoadLiveFile(); if (Config.fontsize != 12 && Config.fontsize > 0) document.getElementById("ScoreDiv").style.fontSize = Config.fontsize + "px"; window.setTimeout("gettime()", 2000); window.setTimeout("check()", 30000); $("#cb_ifShowCorn").click(function () { Config.ifShowCorn = this.checked? 1:0; Config.writeCookie(); }); /************************************/ function changeTxtAdLocation() { if (filterHelper.needChangeSchNum > 0) return; var trs = $("#table_live tr:visible"); var lastIndex = 0; var arr = []; var arrAd = []; var lastObj = null; trs.each(function (i, v) { var thisObj = $(v); if (thisObj.hasClass("Leaguestitle")) return; if (lastObj == null) { if (thisObj.hasClass("ki1")) lastObj = thisObj; return; } if (thisObj.hasClass("showTxtAd")) arrAd.push(thisObj); else { if (typeof (thisObj.attr("index")) !== "undefined" && !lastObj.hasClass("ki1")) arr.push(lastObj); lastObj = thisObj; } }); if (lastObj != null && !lastObj.hasClass("ki1")) arr.push(lastObj); var advertTool = new Advert(arr.length, 0); var adIndex = 0; for (var i = 0; i < arr.length; i++) { var html = []; advertTool.Show(html, i); if (html.length > 0) arrAd[adIndex++].insertAfter(arr[i]); } if (lastObj != null) while (adIndex < arrAd.length) { arrAd[adIndex++].insertAfter(lastObj); } }