var filter = { state: 0, middleague:new Array(), league: new Array(), country: new Array(), odds: new Array(), condition:"" }; //用于确定筛选 var tmpfilter = { state: 0, league: new Array(), country: new Array(), odds: new Array(), condition: "" }; //用于计算筛选数 var isLeftInit = 0; var leagueSIndex = _leagueNameIdx, leagueLIndex = 7; var countryIndex = 23; var isFromSch = false; var FbMatchTimeKey = "FootBallMatchTimeKey"; var FbFilterKey = "FootBallFilterKey"; var FbFilterTypeKey = "FootBallFilterTypeKey"; var minMatchTime = 0; function InitIndexNum() { if (typeof (isResult) != "undefined" && isResult) { FbMatchTimeKey = "FootBallMatchTimeKey_R"; FbFilterKey = "FootBallFilterKey_R"; FbFilterTypeKey = "FootBallFilterTypeKey_R"; } else if (typeof (isSchedule) != "undefined" && isSchedule) { leagueSIndex = 2; leagueLIndex = 8; countryIndex = 20; isFromSch = true; FbMatchTimeKey = "FootBallMatchTimeKey_2"; FbFilterKey = "FootBallFilterKey_2"; FbFilterTypeKey = "FootBallFilterTypeKey_2"; } } // 点取消后按原来的筛选恢复选择 function SelectReset(type) { SelectAll(1); SelectAll(2); //SelectAll(3); //ClearOddsSelect(); if (filter != null) { $("input:radio[name='selectType'][value='0']").prop("checked", true); $("input:radio[name='selectType2'][value='0']").prop("checked", true); if (type == 1) $('[id^=countryContent_]').show(); if (type == 2) $('[id^=leaguesContent_]').show(); if (filter.state != 0 && type == 1) { $("input:radio[name='selectType'][value='" + filter.state + "']").prop("checked", true); } else if (filter.state != 0 && type == 2) { $("input:radio[name='selectType2'][value='" + filter.state + "']").prop("checked", true); } if (type == 1 && filter.league != null && filter.league.length > 0) { for (var i = 0; i < filter.league.length; i++) { if (document.getElementById("myleague_" + filter.league[i])) document.getElementById("myleague_" + filter.league[i]).checked = false; } leagueFilterCount(); } if (type == 2 && filter.country != null && filter.country.length > 0) { for (var i = 0; i < filter.country.length; i++) { if (document.getElementById("mycountry_" + filter.country[i])) document.getElementById("mycountry_" + filter.country[i]).checked = false; } } if (type == 3) { //如果当前筛选是赔率,则恢复 if (filter.odds != null && filter.odds.length > 0) { ClearOddsSelect(); for (var i = 0; i < filter.odds.length; i++) { $("input:checkbox[name='filterOdds'][value='" + filter.odds[i] + "']").prop("checked", true); } } else { //如果不是,则全选 $("input:checkbox[name='filterOdds']").prop("checked", true); } } if (type == 4) { $("input:radio[name='filterCid']").prop("checked", false); if (filter.condition != null && filter.condition != "") { getCondition(); } else { if (document.getElementById("conditionNum"))document.getElementById("conditionNum").innerHTML = 0; } } if (type < 3) HideByState(); if (type > 2) { $('[id^=countryContent_]').show(); $('[id^=leaguesContent_]').show(); if (_leaSortting && !isFromSch) { SyncLeaSorting(0); /*SyncLeaSorting(1);*/ } } } } //选择赛事状态时隐藏没有的联赛或国家 function HideByState(type) { if ($('input[name="selectType"]')[0] && _$("myleague2").innerHTML != "") { fillMiddleLeague(); $('[id^=leaguesContent_]').hide(); var filterState = type == undefined ? $('input[name="selectType"]:checked').val() : type; FilterType = filterState; if (filterState == 0) { $("[id^=lcGu_]").show(); $('[id^=leaguesContent_]').show(); $("span[id^=numtip_]").show(); $("span[id^=numtip2_]").hide(); } else { var num = 0; var matchState = 0; var showed = false; for (var i = 1; i <= matchcount; i++) { //状态过滤 matchState = parseInt(A[i][8]); if (filterState == 1 && matchState > 0 || filterState == 2 && matchState == -1 || filterState == 3 && matchState == 0 || filterState == 4 && A[i][20] == "True") { var leaId = B[A[i][1]][0]; showed = $('#leaguesContent_' + leaId)[0].style.display != "none"; if (showed) { num = parseInt($("#numtip2_" + leaId)[0].getAttribute("num")) + 1; $("#numtip2_" + leaId).attr("num", num); $("#numtip2_" + leaId).html("[" + num + "]"); } else { $('#leaguesContent_' + leaId).show(); $("#numtip2_" + leaId).attr("num", 1); $("#numtip2_" + leaId).html("[" + 1 + "]"); $("#numtip2_" + leaId).show(); $("#numtip_" + leaId).hide(); } } } } leagueFilterCount(); displayCountryTitle(); } } function SyncLeaSorting(sortBy) { if (_leaSortting) { var id = sortBy == 1 ? "countryListDiv" : "myleague2"; var myLea = document.getElementById(id); var uls = myLea.getElementsByTagName("ul"); for (var i = 0; i < uls.length; i++) { var groupId = uls[i].getAttribute("name"); var ulId = uls[i].id; var lis = uls[i].getElementsByTagName("li"); var counter = 0; for (var j = 0; j < lis.length; j++) { if (lis[j].style.display != "none") counter++; } if (document.getElementById(groupId))document.getElementById(groupId).style.display = (counter == 0 ? "none" : ""); if (document.getElementById(ulId))document.getElementById(ulId).style.display = (counter == 0 ? "none" : ""); } leagueFilterCount(); firstCodeMenu(); } } //按照选择进行过滤 function DoFilter(type) { //清空旧选择 filter.league = new Array(); filter.country = new Array(); filter.odds = new Array(); filter.state = 0; filter.condition = ""; var countryFilter = new Array(); var oddsFilter = new Array(); var conditionIdList = ""; // 隐藏无赛事提示 if ($("#noMatchTip")[0]) { $("#noMatchTip").html(""); } if (type == 1) { //if ($('input:checkbox[name=filterLea]:checked').length == 0) { // alert('No Match Data.'); // return; //} filter.state = $('input[name="selectType"]:checked').val(); $('input:checkbox[name=filterLea]:not(:checked)').each(function () { filter.league.push($(this).val()); }); SelectReset(1); SelectAll(2); SelectAll(3); SelectAll(4); if (filter.league.length > 0) { $("input:radio[name='filterCid']").prop("checked", false); } filter.middleague = filter.league.concat(); } if (type == 2) { //if ($('input:checkbox[name=filterCoun]:checked').length == 0) { // alert('No Match Data.'); // return; //} filter.state = $('input[name="selectType2"]:checked').val(); $('input:checkbox[name=filterCoun]:not(:checked)').each(function () { filter.country.push($(this).val()); countryFilter.push(C[$(this).val()][0]); }); SelectReset(2); SelectAll(1); SelectAll(3); SelectAll(4); if (filter.country.length > 0) { $("input:radio[name='filterCid']").prop("checked", false); } } if (type == 3) { //if ($('input:checkbox[name=filterOdds]:checked').length == 0) { // alert('No Match Data.'); // return; //} $('input:checkbox[name=filterOdds]:checked').each(function () { filter.odds.push($(this).val()); }); var odds = filter.odds; if (odds != null && odds.length > 0) { for (var k = 0; k < odds.length; k++) { var otype = odds[k].split('_')[0]; var ovalue = odds[k].split('_')[1]; var arrLoc = otype == "h" ? hsLetGoal.items(ovalue).split(',') : hsBigSmallGoal.items(ovalue).split(','); if (arrLoc != null) { for (var j = 0; j < arrLoc.length; j++) { if (oddsFilter.indexOf(arrLoc[j]) == -1) { oddsFilter.push(arrLoc[j]); } } } } } SelectReset(4); } if (type == 4) { filter.condition = $('input[name="filterCid"]:checked').val(); SelectReset(3); if (!CheckEmpty(filter.condition) && !CheckEmpty(hsCondition)) conditionIdList = hsCondition.items(filter.condition); else return; } var i, j; var hh = 0; //先全部隐藏,按过滤器内容放出 var trs = document.getElementById("table_live").getElementsByTagName("tr"); for (var i = 1; i < trs.length; i++) { if (trs[i].getAttribute("index") != null) { trs[i].style.display = "none"; if (trs[i + 1]) trs[i + 1].style.display = "none"; if (!isFromSch && trs[i + 2]) trs[i + 2].style.display = "none"; } } if (orderby == "league") { if ($('.Leaguestitle')) $('.Leaguestitle').hide(); } for (var i = 1; i <= matchcount; i++) { var isShow = true; //热门过滤 //if (B[A[i][1]][4] == 0) { // if (type == 4 && B[A[i][1]][4] == 0) isShow = false; //} //状态过滤 if (filter.state == 1 && parseInt(A[i][8]) <= 0 || filter.state == 2 && A[i][8] != "-1" || filter.state == 3 && A[i][8] != "0" || filter.state == 4 && A[i][20] != "True") { isShow = false; } //联赛过滤 if (type == 1 && isShow) { if (filter.league != null && filter.league.length > 0) { if (filter.league.indexOf(B[A[i][1]][0].toString()) != -1) isShow = false; } } //国家过滤 if (type == 2 && isShow) { if (countryFilter != null && countryFilter.length > 0) { if (countryFilter.indexOf(A[i][countryIndex]) != -1) isShow = false; } } //赔率过滤 if (type == 3 && isShow) { if (oddsFilter != null && oddsFilter.length > 0) { if (oddsFilter.indexOf(i.toString()) == -1) isShow = false; } else { isShow = false; } } //条件过滤 if (type == 4 && isShow) { if (conditionIdList != null && conditionIdList != "") { if (conditionIdList.indexOf(A[i][0]) == -1) isShow = false; } } if (isShow) { var elem = null; elem = document.getElementById("tr1_" + A[i][0]); if (elem) elem.style.display = ""; elem = document.getElementById("tr2_" + A[i][0]); if (elem) { if ((typeof (_showRemark) != "undefined" && _showRemark) && (!isFromSch && hasExplain(i)) || (isFromSch && (A[i][19] != "" || A[i][21] != ""))) { elem.style.display = ""; } else { elem.style.display = "none"; } } if (orderby == "league" && document.getElementById("tr_" + A[i][1])) document.getElementById("tr_" + A[i][1]).style.display = ""; } else hh = hh + 1; } if (document.getElementById("hiddencount"))document.getElementById("hiddencount").innerHTML = hh; SyncMatchClass(); if (typeof HandleDateTitle != "undefined" && HandleDateTitle instanceof Function) HandleDateTitle(); if (typeof InitFlashShow != "undefined" && InitFlashShow instanceof Function) InitFlashShow(); if (document.getElementById("topLine")) { if (matchcount > 0 && matchcount == hh) { $("#topLine").show(); } else { $("#topLine").hide(); } if (typeof (HandleTitle) == "function") HandleTitle(); } if (typeof (reorderAd) == "function") reorderAd(); if (type > 0 && type < 5) { SetFilterCookie(type); if (typeof (FilterOptionType) != "undefined") FilterOptionType = 0; writeCookie(FilterCacheKey, 0); } if (typeof (InitTipsNum) != "undefined") InitTipsNum(); if (typeof (InitHeadShow) != "undefined") InitHeadShow(); if (typeof (isSchedule) == "undefined") hideResultTr(); if (typeof InitGroupTitleDisplay == "function") InitGroupTitleDisplay(); if (typeof reorderNotice == "function") reorderNotice(); } // 联赛\国家 反选 function SelectOthers(type) { if (type == 1) { var inputs = document.getElementById("myleague2").getElementsByTagName("input"); filter.middleague = new Array(); for (var i = 1; i <= sclasscount; i++) { //if (Bf_simply_disp && B[i][4] == 0) continue; var obj = document.getElementById("myleague_" + B[i][0]); if (typeof (obj) == "undefined" || obj == null || (i > 1 && B[i][0] == B[i - 1][0])) continue; obj.checked = !obj.checked; if (!obj.checked) filter.middleague.push(B[i][0].toString()); } leagueFilterCount(); //CountFilter(1); } else if (type == 2) { var inputs = document.getElementById("countryListDiv").getElementsByTagName("input"); if (C != undefined && C != null && C.length > 0) { for (var i = 0; i < C.length; i++) { var obj = document.getElementById("mycountry_" + i); if (typeof (obj) == "undefined" || obj == null) continue; obj.checked = !obj.checked; } } //CountFilter(2); } else if (type == 3) { var inputs = document.getElementById("goalTable").getElementsByTagName("input"); for (var i = 0; i < inputs.length; i++) { var obj = document.getElementById("myodds_" + i); if (typeof (obj) == "undefined" || obj == null) continue; obj.checked = !obj.checked; } OddsFilterCount(); //CountFilter(3); } } // 联赛\国家 全选 function SelectAll(type) { var i, j, inputs; if (type == 4) { //赛程页没有赔率筛选弹窗 if (document.getElementById("filterList") == null) return; //赔率连胜筛选初始状态是清空,不是全选,特殊处理 inputs = document.getElementById("filterList").getElementsByTagName("input"); for (var j = 0; j < inputs.length; j++) inputs[j].checked = false; _$("conditionNum").innerHTML = "0"; return; } else if (type == 1) { if (document.getElementById("myleague2") == null) return; inputs = document.getElementById("myleague2").getElementsByTagName("input"); filter.middleague = new Array(); } else if (type == 2) { if (document.getElementById("countryListDiv") == null) return; inputs = document.getElementById("countryListDiv").getElementsByTagName("input"); } else if (type == 3) { //赛程页没有赔率筛选弹窗 if (document.getElementById("goalTable") == null) return; inputs = document.getElementById("goalTable").getElementsByTagName("input"); } for (var i = 0; i < inputs.length; i++) inputs[i].checked = true; if (type == 1) { leagueFilterCount(); } else if (type == 3) { OddsFilterCount(); } //CountFilter(type); } //勾选热门联赛 function SelectHotLeague() { if (_$("myleague2")) { filter.league = new Array(); filter.middleague = new Array(); var checkboxs = _$("myleague2").getElementsByTagName("input"); for (var i = 0; i < checkboxs.length; i++) { if (checkboxs[i].hasAttribute("hot")) { checkboxs[i].checked = true; } else { checkboxs[i].checked = false; filter.league.push(checkboxs[i].value); filter.middleague.push(checkboxs[i].value); } } HideByState(); leagueFilterCount(); displayCountryTitle(); } } function InitAllOption() { SelectAll(1); SelectAll(2); SelectAll(3); SelectAll(4); HideByState(); if (_leaSortting && !isFromSch) { SyncLeaSorting(0); /*SyncLeaSorting(1);*/ } } function InitHotOption() { SelectHotLeague(); SelectAll(3); HideByState(); if (_leaSortting && !isFromSch) { SyncLeaSorting(0); } } //清除赔率选项 function ClearOddsSelect() { var inputs; if (document.getElementById("goalTable")) { inputs = document.getElementById("goalTable").getElementsByTagName("input"); for (var i = 0; i < inputs.length; i++) inputs[i].checked = false; } } // 联赛选项生成 function MakeSclass() { InitIndexNum(); var leaguehtml = new Array(); leaguehtml.push(""); $("#myleague2").html(leaguehtml.join("")); leagueFilterCount(); } //联赛选项排序 function MakeSclassWithSorting() { InitIndexNum(); var filterGroups = new Array(); for (var i = 65; i < 91; i++) { filterGroups.push({ name: String.fromCharCode(i), items: new Array() }); } filterGroups.push({ name: "*", items: new Array() }); var subLea = false; var subNum = 0; for (var i = 1; i <= sclasscount; i++) { var matchNum = 0; if (B[i] == undefined) continue; if (i < sclasscount && B[i][0] == B[i + 1][0]) { subNum += $("tr[id^=tr1_][leaindex='" + i + "']").length; subLea = true; continue; } var isChecked = true; if (hidden_LeagueId.indexOf("_" + B[i][0] + "_") != -1 || filter.middleague.indexOf(B[i][0].toString()) != -1) { isChecked = false; } var sclassName = CheckEmpty(B[i][leagueSIndex]) ? B[i][2] : B[i][leagueSIndex]; var fGroup = getFilterGroup(filterGroups, sclassName); if (subLea) { matchNum += subNum; subNum = 0; subLea = false; } matchNum += $("tr[id^=tr1_][leaindex='" + i + "']").length; fGroup.items.push({ idx: B[i][0], name: getSclassName(sclassName, B[i][leagueLIndex]), isOn: isChecked, isRed: (B[i][4] == 1), mNum: matchNum }); } var fg_idx = 0; var leaguehtml = new Array(); for (var i = 0; i < filterGroups.length; i++) { var fGroup = filterGroups[i]; if (fGroup.items.length == 0) continue; fg_idx++; leaguehtml.push("
" + fGroup.name + "
"); leaguehtml.push(""); } leaguehtml.push(""); $("#myleague2").html(leaguehtml.join("")); leagueFilterCount(); firstCodeMenu(); } //联赛选项按国家排序 function MakeSclassWithSortingByCountry() { InitIndexNum(); var filterGroups = new Array(); var indexList = new Array(); var orderByCode = $("#cbbSortLea")[0] && $("#cbbSortLea")[0].checked; if (C != undefined && C != null && C.length > 0) { var countryList = C.concat(); //按A-Z排序 if (orderByCode) { countryList.sort(function (a, b) { if (a == undefined || b == undefined) return -1; return a[1].charAt().charCodeAt() - b[1].charAt().charCodeAt(); }) } for (var i = 0; i < countryList.length; i++) { if (countryList[i] == undefined) continue; var cId = countryList[i][0]; filterGroups[cId] = { name: countryList[i][1], cid: countryList[i][0], items: new Array() }; indexList.push(cId); } } //打包国家包含的所有联赛 var subLea = false; var subNum = 0; for (var i = 1; i <= sclasscount; i++) { var matchNum = 0; if (B[i] == undefined) continue; if (i < sclasscount && B[i][0] == B[i + 1][0]) { subNum += $("tr[id^=tr1_][leaindex='" + i + "']").length; subLea = true; continue; } var isChecked = true; if (hidden_LeagueId.indexOf("_" + B[i][0] + "_") != -1 || filter.middleague.indexOf(B[i][0].toString()) != -1) { isChecked = false; } var fGroup = typeof (isSchedule) != "undefined" ? filterGroups[B[i][7]] : filterGroups[B[i][10]]; var sclassName = CheckEmpty(B[i][leagueSIndex]) ? B[i][2] : B[i][leagueSIndex]; if (subLea) { matchNum += subNum; subNum = 0; subLea = false; } matchNum += $("tr[id^=tr1_][leaindex='" + i + "']").length; fGroup.items.push({ idx: B[i][0], name: getSclassName(sclassName, B[i][leagueLIndex]), isOn: isChecked, isRed: (B[i][4] == 1), mNum: matchNum }); } //渲染列表 var leaguehtml = new Array(); for (var i = 0; i < indexList.length; i++) { var index = indexList[i]; var fGroup = filterGroups[index]; if (fGroup.items.length == 0) continue; leaguehtml.push("
" + fGroup.name + "
"); leaguehtml.push(""); } //字母选择栏 if (orderByCode) { leaguehtml.push(""); } $("#myleague2").html(leaguehtml.join("")); leagueFilterCount(); firstCodeMenu(); } //国家筛选相关 function MakeCountry() { InitIndexNum(); var countryhtml = new Array(); countryhtml.push(""); document.getElementById("countryListDiv").innerHTML = countryhtml.join(""); } //国家选项排序 function MakeCountryWithSorting() { InitIndexNum(); var filterGroups = new Array(); for (var i = 65; i < 91; i++) { filterGroups.push({ name: String.fromCharCode(i), items: new Array() }); } filterGroups.push({ name: "*", items: new Array() }); if (C == undefined || C.length == 0) return; for (var i = 0; i < C.length; i++) { if (C[i] == undefined) continue; var isChecked = true; if (hidden_Country.indexOf("_" + C[i][0] + "_") != -1) { isChecked = false; } var fGroup = getFilterGroup(filterGroups, C[i][1]); fGroup.items.push({ idx: i, name: C[i][1], isOn: isChecked, cid:C[i][0] }); } var fg_idx = 0; var countryhtml = new Array(); for (var i = 0; i < filterGroups.length; i++) { var fGroup = filterGroups[i]; if (fGroup.items.length == 0) continue; fg_idx++; countryhtml.push("
" + fGroup.name + "
"); countryhtml.push(""); } document.getElementById("countryListDiv").innerHTML = countryhtml.join(""); } //赔率筛选弹窗 function MakeGoalTable() { var oddshtml = new Array(); oddshtml.push("
" + _locModel.T.T_Handicap+"
"); oddshtml.push(CreateGoalTable(0)); oddshtml.push("
" + _locModel.T.T_OU +"
"); oddshtml.push(CreateGoalTable(1)); document.getElementById("goalTable").innerHTML = oddshtml.join(""); } function CreateGoalTable(t) { var sC = _locModel.T.T_NoOdds; var arrKey = (t == 0 ? hsLetGoal.keys() : hsBigSmallGoal.keys()); if (t == 0) { arrKey.sort(function (a, b) { if (a.indexOf(sC) != -1) return 1; if (parseFloat(a) < parseFloat(b)) { return 1; } else { return -1; } }); } else { arrKey.sort(); } var str = ''; var idx = t == 0 ? 0 : hsLetGoal.keys().length; for (var i = 0; i < arrKey.length; i++) { var strGoal = (t == 0 ? Goal2GoalCn(arrKey[i]) : Goal2CnOU(arrKey[i])); var count = (t == 0 ? hsLetGoal.items(arrKey[i]).split(',').length : hsBigSmallGoal.items(arrKey[i]).split(',').length); var flag = t == 0 ? "h_" : "o_"; if (i % 4 == 0) str += ''; //if (orderby == "time") { str += ''; //} str += ''; if (i % 4 == 3) str += ''; } str += '
' + (arrKey[i] == sC ? sC : strGoal) + '[' + count + ']
'; return str; } function getCondition() { conditionHttp.open("get", "/gf/data/condition.txt?" + Date.parse(new Date()), false); conditionHttp.send(null); if (conditionHttp.responseText != "") { var content = conditionHttp.responseText; var arrOne = content.split('!'); for (var i = 0; i < arrOne.length; i++) { var arrTwo = arrOne[i].split('^'); for (var j = 0; j < arrTwo.length; j++) { hsCondition.add(i + "_" + j, arrTwo[j]); } } makeCondition(); if (filter != null && !CheckEmpty(filter.condition)) { $('input:radio[name="filterCid"][value="' + filter.condition + '"]').prop('checked', true); selectConditon(filter.condition); } } //从其他页面切到OddFilter初始化OddsFilterQuery到初始选择 //SelectAll(3); } var oldConditionID = ""; function makeCondition() { var titleCn = new Array(_locModel.T.T_WinStreaks, _locModel.T.T_LossStreaks, _locModel.T.T_OddWinStreaks, _locModel.T.T_OddLossStreaks, _locModel.T.T_OverStreaks, _locModel.T.T_UnderStreaks, _locModel.T.T_Odds20WinRate, _locModel.T.T_Odds20LossRate, _locModel.T.T_Over20Rate, _locModel.T.T_Under20Rate); var numTtitle = new Array("3~4", "5~6", "7+"); var perTitle = new Array("60~65", "65~70", "75+"); var title = titleCn; //var arrFilter = getConditonList(4); var choiseNum = 0; var conditionHtml = "", actionStr = ''; 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 = "ef-radio off"; var showOrNot = "disabled='disabled'"; actionStr = ''; var id = i + "_" + j; var idList = hsCondition.items(id); if (idList.Trim().length > 3) { actionStr = 'onclick="selectConditon(\'' + id + '\')"'; className = "ef-radio"; showOrNot = ""; } conditionHtml += ""; } conditionHtml += '
'; } document.getElementById("filterList").innerHTML = conditionHtml; //document.getElementById("conditionNum").innerHTML = "[" + choiseNum + "]"; //MM_showHideLayers('filterBox', '', 'show', 'Layer2', '', 'hidden', 'DivCountry', '', 'hidden', 'goalDiv', '', 'hidden'); } function selectConditon(id) { document.getElementById("conditionNum").innerHTML = hsCondition.items(id).split(',').length; oldConditionID = id; } function SyncMatchClass() { var nList = $('.gameName'); var oldLeaIdx = 0, leaIdx = 0; for (var i = 0; i < nList.length; i++) { leaIdx = nList[i].getAttribute("index"); var trIdx = nList[i].getAttribute("data-idx"); if (oldLeaIdx != leaIdx && !($('#tr1_' + trIdx).is(":hidden"))) { oldLeaIdx = leaIdx; $('#tr0_' + trIdx).show(); $('#tr0_' + trIdx).addClass('show'); } else { $('#tr0_' + trIdx).removeClass('show'); $('#tr0_' + trIdx).removeAttr("style"); } } } function getSclassName(sName, subSymbol) { //if (!subSymbol) return sName; //if (subSymbol.indexOf("(") != -1) { // return sName + subSymbol; //} //return sName + "(" + subSymbol + ")"; //不显示子联赛名称 return sName; } function getFilterGroup(filterGroups, name) { var pixel = name.replace(" ", "").substr(0, 1).toUpperCase(); var code = pixel.charCodeAt(); if (code > 64 && code < 91) return filterGroups[code - 65]; else return filterGroups[26]; } //清除筛选缓存 function ClearAllFilter() { sessionStorage.removeItem(FbFilterTypeKey); sessionStorage.removeItem(FbFilterKey); filter.league = new Array(); filter.country = new Array(); filter.odds = new Array(); filter.state = 0; filter.condition = ""; if (_$("conditionNum")) _$("conditionNum").innerHTML = "0"; HideByState(); $("input:radio[name='selectType'][value='0']").prop("checked", true); $("input:radio[name='selectType2'][value='0']").prop("checked", true); //writeCookie(FbFilterTypeKey, 0); //writeCookie(FbFilterKey, ""); } //设置缓存 function SetFilterCookie(filterType) { if (filterType > 0 && filterType < 5) { sessionStorage.setItem(FbMatchTimeKey, minMatchTime); sessionStorage.setItem(FbFilterTypeKey, filterType); sessionStorage.setItem(FbFilterKey, JSON.stringify(filter)); //writeCookie(FbMatchTimeKey, minMatchTime); //writeCookie(FbFilterTypeKey, filterType); //writeCookie(FbFilterKey, JSON.stringify(filter)); } } function InitFilterByCookie() { if ((sessionStorage.getItem(FbFilterTypeKey) != "" && sessionStorage.getItem(FbFilterTypeKey) != 0) && sessionStorage.getItem(FbFilterKey) != null && sessionStorage.getItem(FbFilterKey) != "") { filter = JSON.parse(unescape(sessionStorage.getItem(FbFilterKey))); var filterType = parseInt(sessionStorage.getItem(FbFilterTypeKey)); if (filterType > 0 && filterType < 5) { FilterLogic(filterType); if (filterType == 1 && document.getElementById("li_FilterLea") && typeof (SelectMenu) == "function") SelectMenu("li_FilterLea"); else if (filterType == 2 && document.getElementById("li_FilterCon") && typeof (SelectMenu) == "function") SelectMenu("li_FilterCon"); else if (filterType == 3 && document.getElementById("li_FilterCdi") && typeof (SelectMenu) == "function") { SelectMenu("li_FilterCdi"); SwitchOddsFilter(0); $("#oddsFilter1").prop("checked", true); } else if (filterType == 4 && document.getElementById("li_FilterCdi") && typeof (SelectMenu) == "function") { SelectMenu("li_FilterCdi"); SwitchOddsFilter(1); $("#oddsFilter2").prop("checked", true); } } } } //切换公司时,如果在赔率删选状态,则清除缓存 function ClearOddsCookie() { if (sessionStorage.getItem(FbFilterTypeKey) != "" && sessionStorage.getItem(FbFilterTypeKey) != 0) { var filterType = parseInt(sessionStorage.getItem(FbFilterTypeKey)); if (filterType == 3) { ClearAllFilter(); _$("hiddencount").innerHTML = 0; _$("li_FilterCdi").classList.remove("on"); _$("li_ShowAll").classList.add("on"); } } } function SwitchOddsFilter(type) { switch (type) { case 0: $("#OddsFilter").show(); $("#StreaksFilter").hide(); SelectReset(4); OddsFilterCount(); break; case 1: $("#OddsFilter").hide(); $("#StreaksFilter").show(); SelectReset(3); break; } } function OddsFilterCount() { var oddsTmp = new Array(); var oddsFilter = new Array(); $('input:checkbox[name=filterOdds]:checked').each(function () { oddsTmp.push($(this).val()); }); if (oddsTmp != null && oddsTmp.length > 0) { for (var k = 0; k < oddsTmp.length; k++) { var otype = oddsTmp[k].split('_')[0]; var ovalue = oddsTmp[k].split('_')[1]; var arrLoc = otype == "h" ? hsLetGoal.items(ovalue).split(',') : hsBigSmallGoal.items(ovalue).split(','); if (arrLoc != null) { for (var j = 0; j < arrLoc.length; j++) { if (oddsFilter.indexOf(arrLoc[j]) == -1) { oddsFilter.push(arrLoc[j]); } } } } } var count = 0; if (oddsFilter != null && oddsFilter.length > 0) { for (var i = 1; i <= matchcount; i++) { //赔率过滤 if (oddsFilter.indexOf(i.toString()) > -1) count++; } } document.getElementById("oddsNum").innerHTML = count; } //#region 联赛筛选国家排序相关 //弹窗点击事件 function leagueFilterPopClick() { if (event.target.tagName == "INPUT") { leagueFilterCount(); /*fillMiddleLeague();*/ } } //计算已选赛事数量 function leagueFilterCount() { if ($("#showoptional2").is(":visible")) { var checkboxs = document.getElementsByName("filterLea"); var count = 0; var val = 0; var span1 = null, span2 = null; for (var i = 0; i < checkboxs.length; i++) { if ($(checkboxs[i]).is(":visible") && checkboxs[i].checked) { val = checkboxs[i].value; span1 = _$("numtip_" + val); span2 = _$("numtip2_" + val); count += $(span1).is(":visible") ? parseInt(span1.getAttribute("num")) : parseInt(span2.getAttribute("num")); } } $("#countryNum").html(count); } } //已选联赛临时存储 function fillMiddleLeague() { var checkboxs = $("#myleague2").find("input[name=filterLea]:not(:checked)"); filter.middleague = new Array(); for (var i = 0; i < checkboxs.length; i++) { filter.middleague.push(checkboxs[i].value); } } //切换赛事状态时隐藏无联赛的国家选项 function displayCountryTitle() { if ($("#cbbSortLeaByCountry")[0] && $("#cbbSortLeaByCountry")[0].checked) { var countryTitles = $("[id^=country_]"); var cId = 0; var leaList = new Array(); var display = false; for (var i = 0; i < countryTitles.length; i++) { cId = countryTitles[i].getAttribute("cid"); leaList = $("#lcGu_" + cId).find("li"); for (var j = 0; j < leaList.length; j++) { if (leaList[j].style.display != "none") { display = true; break; } } countryTitles[i].style.display = display ? "" : "none"; $("#lcGu_" + cId)[0].style.display = display ? "" : "none" display = false; } } } function closeLeaFilterPop() { MM_showHideLayers('showoptional2', '', 'hide'); setTimeout(function () { filter.middleague = filter.league.concat(); SelectReset(1); }); } function clickCbbSortLea() { var nodeName = event.target.nodeName; if (nodeName != "LABEL") { if (nodeName != "INPUT") { _$("cbbSortLea").checked = !_$("cbbSortLea").checked; } fillMiddleLeague(); SortList(); event.stopPropagation(); } } function clickCbbSortLeaByCountry() { var nodeName = event.target.nodeName; if (nodeName != "LABEL") { if (nodeName != "INPUT") { _$("cbbSortLeaByCountry").checked = !_$("cbbSortLeaByCountry").checked; } fillMiddleLeague(); SortList(); event.stopPropagation(); } } //#endregion //联赛筛选弹窗字母菜单栏 function firstCodeMenu() { if (_$("showoptional2").style.visibility == "visible" && _$("cbbSortLea") && _$("cbbSortLea").checked) { var html = new Array(); //国家A-Z排序 if (_$("cbbSortLeaByCountry") && _$("cbbSortLeaByCountry").checked) { var countryList = $("[id^=country_]:visible"); $("[id^=country_]").attr("data-quickpos", ""); var code = 0, newCode = 0; for (var i = 0; i < countryList.length; i++) { newCode = countryList[i].innerText[0].charCodeAt(); if (code != newCode) { if (65 <= newCode && newCode < 91) { countryList[i].setAttribute("data-quickpos", String.fromCharCode(newCode)); html.push("
  • " + String.fromCharCode(newCode) + "
  • "); } else { countryList[i].setAttribute("data-quickpos", "*"); html.push("
  • *
  • "); break; } code = newCode; } } } else { //联赛A-Z排序 var codeList = $("[id^=fG_]:visible"); $("[id^=fG_]").attr("data-quickpos", ""); for (var i = 0; i < codeList.length; i++) { codeList[i].setAttribute("data-quickpos", codeList[i].innerText); html.push("
  • " + codeList[i].innerText + "
  • "); } } $("#myleague2").find(".quickPos").html(html.join('')); //无滚动条缩小菜单栏右边距 if (_$("myleague2").scrollHeight == _$("myleague2").clientHeight) { $("#myleague2").find(".quickPos")[0].style.right = "6px"; } else { $("#myleague2").find(".quickPos")[0].style.right = "22px"; } } } function quickPos(opt) { var target = $("[data-quickPos='" + opt + "']")[0]; if (target) { $(".quickPos li").removeClass("on"); $(event.target).addClass("on"); if (_$("fG_1")) { target.parentNode.scrollTop = target.offsetTop - _$("fG_1").offsetTop; } else { target.parentNode.scrollTop = target.offsetTop; } } event.stopPropagation(); } function callLeagueFilterWin() { if (_$("myleague2").innerHTML == "") { if (_$("cbbSortLeaByCountry") && getCookie(FilterCountryKey) == "1") { MakeSclassWithSortingByCountry(); } else if (_$("cbbSortLea") && _$("cbbSortLea").checked) { MakeSclassWithSorting(); } else { MakeSclass(); } SelectReset(1); if (FilterOptionType == 1) { InitHotOption(); } } if ($("#showoptional2").css("visibility") == "visible") { closeLeaFilterPop(); } else { $("#showoptional2").css("visibility", "visible"); leagueFilterCount(); } } function callOddsFilterWin() { if ($("#showFilterBox").css("visibility") == "visible") { $("#showFilterBox").css("visibility", "hidden"); } else { getCondition(); $("#showFilterBox").css("visibility", "visible"); } } ; var showLiveTv = _appModule == "Vn"; var tvLinkList = new Array(); var tvLinkChangeTime = ""; var tvLinkHttp = zXmlHttp.createRequest(); var state_ch = Array(19); state_ch[0] = _locModel.T.T_ST_Postp; state_ch[1] = _locModel.T.T_ST_Pause; state_ch[2] = _locModel.T.T_ST_Abd; state_ch[3] = "" + _locModel.T.T_ST_Pend + ""; state_ch[4] = _locModel.T.T_ST_Cancel; state_ch[13] = "" + _locModel.T.T_ST_FT + ""; state_ch[14] = " "; state_ch[15] = _locModel.T.T_ST_Part1; state_ch[16] = _locModel.T.T_ST_HT; state_ch[17] = _locModel.T.T_ST_Part2; state_ch[18] = _locModel.T.T_ST_Ot; state_ch[19] = _locModel.T.T_ST_Pen; var state_Desc = Array(19); state_Desc[0] = _locModel.T.T_ST_Postponed; state_Desc[1] = _locModel.T.T_ST_Pause; state_Desc[2] = _locModel.T.T_ST_Abandoned; state_Desc[3] = ""; state_Desc[4] = _locModel.T.T_ST_Cancel; state_Desc[13] = ""; state_Desc[14] = ""; state_Desc[15] = _locModel.T.T_ST_Part1; state_Desc[16] = ""; state_Desc[17] = _locModel.T.T_ST_Part2; state_Desc[18] = _locModel.T.T_ST_Ot; state_Desc[19] = _locModel.T.T_ST_Pen; var scorePolling; var difftime; function getDiffTime() { if (_serverTime) { var sps = _serverTime.split(","); difftime = new Date() - new Date(sps[0], sps[1], sps[2], sps[3], sps[4], sps[5]); } } getDiffTime(); function ShowBf() { hiddenID = getCookie("Hidden_MatchID"); if (hiddenID == null) hiddenID = "_"; if (orderby == "league") { MakeTable(); document.getElementById("OrderSel").value = "league"; } else { MakeTableByTime(); document.getElementById("OrderSel").value = "time"; } MakeSclass(); hideSelMatch(); window.clearTimeout(runtimeTimer); runtimeTimer = window.setTimeout("setMatchTime()", 1000); document.getElementById("sloading").style.display = "none"; specialHide(); initSortLea(); reorderNotice(); if (isShowTips) { getTipsList() } if (showLiveTv) { InitTvLink() } } function formatTime(t) { var h = t.getHours(); var m = t.getMinutes(); var result = ""; if (h < 10) h = "0" + h; if (m < 10) m = "0" + m; return h + ":" + m; } function getBgClass() { if (_colorParam > 0 && _colorParam < 9) { return "cbg_" + _colorParam; } else return "cbg_0"; } function MakeTable() { var state, league = "", tmp_corner, tmp_half, match_half = " - ", match_corner = " - "; var H_redcard, G_redcard, H_yellow, G_yellow; var leagueIndex = 0, oldLeagueIndex = 0, ad = 0; var html = new Array(); html.push(""); html.push(""); var bgClass = getBgClass(); var dataLidx = 1; var sclassID = 0; var hh = 0; var showMt = false, showTime = false, showTvLink = false; if (!showLiveTv) { showMt = true, showTime = true; } for (var i = 1; i <= matchcount; i++) { try { leagueIndex = A[i][1]; if (Bf_simply_disp && B[leagueIndex][4] == 0) { hh++; continue; } var hTeam = escapeChar(skipHtmlTagBoth(A[i][4])); var gTeam = escapeChar(skipHtmlTagBoth(A[i][5])); var lfName = escapeChar(skipHtmlTagBoth(B[leagueIndex][2])); state = parseInt(A[i][8]); match_half = " - "; match_corner = " - "; switch (state) { case 0: if (A[i][19] == "1") match_score = "Lineup"; else match_score = " - "; break; case 1: match_score = A[i][9] + " - " + A[i][10]; match_corner = A[i][27] + " - " + A[i][28]; break; case -10: //取消 case -11: case -12: //腰斩 case -14: match_score = " - "; break; default: match_score = A[i][9] + " - " + A[i][10]; if (A[i][11] == null) A[i][11] = ""; if (A[i][12] == null) A[i][12] = ""; match_half = A[i][11] + " - " + A[i][12]; match_corner = A[i][27] + " - " + A[i][28]; break; } if (A[i][13] != "0") H_redcard = "" + A[i][13] + ""; else H_redcard = ""; if (A[i][14] != "0") G_redcard = "" + A[i][14] + ""; else G_redcard = ""; if (A[i][15] != "0") H_yellow = "" + A[i][15] + ""; else H_yellow = ""; if (A[i][16] != "0") G_yellow = "" + A[i][16] + ""; else G_yellow = ""; if (A[i][17] != "") A[i][17] = "[" + A[i][17] + "]"; if (A[i][18] != "") A[i][18] = "[" + A[i][18] + "]"; if (i % 2 == 0) bg = ""; else bg = bgClass; //日期兼容格式 var t2 = convertTime(A[i][6]); t2 = new Date(Date.UTC(t2.getFullYear(), t2.getMonth(), t2.getDate(), t2.getHours(), t2.getMinutes(), t2.getSeconds())); if (showLiveTv) { showMt = state <= 0; showTime = state != 0; showTvLink = state > -1; } if (state == -1) classx2 = "red"; else classx2 = "blue"; if (oldLeagueIndex != leagueIndex) { oldLeagueIndex = leagueIndex; sclassID = B[A[i][1]][0]; html.push(""); html.push(""); dataLidx++; } html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(`"); html.push(""); html.push(""); html.push(""); var explain = showExplain(A[i][24], A[i][4], A[i][5]); if (explain == "") classx = "none"; else classx = ""; html.push(""); } catch (e) { } } html.push("
     " + _locModel.T.T_Time + "" + _locModel.T.T_Home + "" + _locModel.T.T_Score + "" + _locModel.T.T_Away + "" + _locModel.T.T_TH_CHT + "" + _locModel.T.T_Data + "
    " + (B[leagueIndex][8] == undefined ? B[leagueIndex][2] : B[leagueIndex][8]) + " " + timeToText(t2, 12) + "
    "); html.push("") html.push("" + _locModel.T.T_DisplayMatch + "()"); html.push("
    " + formatTime(t2) + "" + state_ch[state + 14] + "" + H_yellow + "" + H_redcard + " " + A[i][4] + "" + match_score + "" + A[i][5] + " " + G_redcard + "" + G_yellow + ""); tmp_half = ""; tmp_corner = "onmouseover='showSBCorner(" + i + ",event)' onmouseout=\"hiddenSbCorner();\" style=\"cursor:pointer;display:block;\""; if (A[i][29] != "1") match_corner = " "; var cr_class = " class='conner_span blues'"; if (state == -1) cr_class = "class='conner_span'"; if (match_corner == " - ") html.push("" + match_corner + ""); else html.push("" + match_corner + ""); if (match_half == " - ") html.push("" + match_half + ""); else html.push("" + match_half + ""); html.push("" + ICONFONT.ANALYSIS + ""); if (_appModule != "Kor" && _appModule != "Pt") { html.push("" + ICONFONT.ODDS + "" + ICONFONT.DETAIL + ""); } html.push(""); /*if (A[i][20] == "True") html.push(" ");*/ html.push("
    "); if (A[i][24] && A[i][24] != "") html.push(explain); html.push("
    ") document.getElementById("live").innerHTML = html.join(""); if (hh > 0) document.getElementById("hiddencount").innerHTML = hh; } function MakeTableByTime() { var state, day = "", match_half = " - ", match_corner = " - "; var H_redcard, G_redcard, H_yellow, G_yellow; var showResultTr = false; var ad = 0; var bgClass = getBgClass(); var html = new Array(); html.push(""); html.push(""); var hh = 0; var showMt = false, showTime = false, showTvLink = false; if (!showLiveTv) { showMt = true, showTime = true; } for (var i = 1; i <= matchcount; i++) { try { if (Bf_simply_disp && B[A[i][1]][4] == 0) { hh++; continue; } var leagueIndex = A[i][1]; var hTeam = escapeChar(skipHtmlTagBoth(A[i][4])); var gTeam = escapeChar(skipHtmlTagBoth(A[i][5])); var lfName = escapeChar(skipHtmlTagBoth(B[leagueIndex][2])); state = parseInt(A[i][8]); match_half = " - "; match_corner = " - "; switch (state) { case 0: if (A[i][19] == "1") match_score = "Lineup"; else match_score = " - "; break; case 1: match_score = A[i][9] + " - " + A[i][10]; match_corner = A[i][27] + " - " + A[i][28]; break; case -10: //取消 case -11: case -12: //腰斩 case -14: match_score = " - "; break; default: match_score = A[i][9] + " - " + A[i][10]; if (A[i][11] == null) A[i][11] = ""; if (A[i][12] == null) A[i][12] = ""; match_half = A[i][11] + " - " + A[i][12]; match_corner = A[i][27] + " - " + A[i][28]; break; } if (A[i][13] != "0") H_redcard = "" + A[i][13] + ""; else H_redcard = ""; if (A[i][14] != "0") G_redcard = "" + A[i][14] + ""; else G_redcard = ""; if (A[i][15] != "0") H_yellow = "" + A[i][15] + ""; else H_yellow = ""; if (A[i][16] != "0") G_yellow = "" + A[i][16] + ""; else G_yellow = ""; if (A[i][17] != "") A[i][17] = "[" + A[i][17] + "]"; if (A[i][18] != "") A[i][18] = "[" + A[i][18] + "]"; if (i % 2 == 0) bg = ""; else bg = bgClass; //日期兼容格式 var t2 = convertTime(A[i][6]); t2 = new Date(Date.UTC(t2.getFullYear(), t2.getMonth(), t2.getDate(), t2.getHours(), t2.getMinutes(), t2.getSeconds())); if (state == -1) classx2 = "red"; else classx2 = "blue"; if (state < 0 && !showResultTr) { showResultTr = true; html.push(""); } if (state >= 0 && day != t2.getDate()) { day = t2.getDate(); html.push(""); } if (showLiveTv) { showMt = state <= 0; showTime = state != 0; showTvLink = state > -1; } html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(""); html.push(`"); html.push(""); //corner and Half tmp_half = ""; tmp_corner = "onmouseover='showSBCorner(" + i + ",event)' onmouseout=\"hiddenSbCorner();\" style=\"cursor:pointer;display:block;\""; html.push(""); html.push(""); var explain = showExplain(A[i][24], A[i][4], A[i][5]); if (hideMode || explain == "") classx = "none"; else classx = ""; html.push(""); } catch (e) { } } html.push("
     " + _locModel.T.T_League + "" + _locModel.T.T_Time + "" + _locModel.T.T_Home + "" + _locModel.T.T_Score + "" + _locModel.T.T_Away + "" + _locModel.T.T_TH_CHT + "" + _locModel.T.T_Data + "
    " + _locModel.T.T_Results + "
    " + timeToText(t2, 12) + "
    " + B[A[i][1]][1] + "" + formatTime(t2) + "" + state_ch[state + 14] + "" + H_yellow + "" + H_redcard + " " + A[i][4] + "" + match_score + "" + A[i][5] + " " + G_redcard + "" + G_yellow + ""); var cr_class = " class='blue2 conner_span'"; if (A[i][29] != "1") match_corner = ""; if (state == -1) cr_class = "class='conner_span'"; if (match_corner == " - ") html.push("" + match_corner + ""); else html.push("" + match_corner + ""); //html.push("
    "); if (match_half == " - ") html.push("" + match_half + ""); else html.push("" + match_half + ""); html.push("
    " + ICONFONT.ANALYSIS + ""); if (_appModule != "Kor" && _appModule != "Pt") { html.push("" + ICONFONT.ODDS + "" + ICONFONT.DETAIL + ""); } html.push(""); /*if (A[i][20] == "True") html.push("");*/ html.push("
    "); if (A[i][24] && A[i][24] != "") html.push(explain); html.push("
    ") document.getElementById("live").innerHTML = html.join(""); if (hh > 0) document.getElementById("hiddencount").innerHTML = hh; } function getAlignText(isCenter) { if (isCenter) return " style='text-align:center;' "; else return " style='text-align:left;' "; } var oXmlHttp = zXmlHttp.createRequest(); function getxml() { oXmlHttp.open("get", "/gf/data/change_en.xml?" + Date.parse(new Date()), true); oXmlHttp.onreadystatechange = xmlHandle; oXmlHttp.send(null); scorePolling = window.setTimeout("getxml()", 4000); } function xmlHandle() { try { if (oXmlHttp.readyState != 4 || (oXmlHttp.status != 200 && oXmlHttp.status != 0)) return; 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; } refresh(root, 0); } catch (e) { } } function refresh(data, type) { try { lastUpdateTime = new Date(); var D = new Array(); var matchindex, score1change, score2change, scorechange, stateChanged; var goTime, hometeam, guestteam, sclassname, score1, score2, tr; var homeIcon = ""; var guestIcon = ""; var homeRedCard = false; var guestRedCard = false; var matchNum = 0; var winStr = ""; var notify = document.getElementById("notify").innerHTML; var length = 0; if (type == 0) { length = data.childNodes.length; } else { length = data.length; } for (var i = 0; i < length; i++) { if (type == 0) { if (document.all && getIENumber() < 10) D = data.childNodes[i].text.split("^"); //0:ID,1:state,2:score1,3:score2,4:half1,5:half2,6:card1,7:card2,8:yellow1,9:yellow2,10:time1,11:time2,12:explain,13:lineup else D = data.childNodes[i].textContent.split("^"); } else { D = data[i].split("^"); } tr = document.getElementById("tr1_" + D[0]); if (tr == null) continue; D[1] = parseInt(D[1]); matchindex = tr.attributes["index"].value; score1change = false; if (A[matchindex][9] != D[2]) { A[matchindex][9] = D[2]; score1change = true; tr.cells[5].style.backgroundColor = "#bbbb22"; } score2change = false; if (A[matchindex][10] != D[3]) { A[matchindex][10] = D[3]; score2change = true; tr.cells[7].style.backgroundColor = "#bbbb22"; } scorechange = score1change || score2change; D[12] = checkExlink(D[12]); //red card if (D[6] != A[matchindex][13]) { A[matchindex][13] = D[6]; if (D[6] == "0") document.getElementById("redcard1_" + D[0]).innerHTML = ""; else document.getElementById("redcard1_" + D[0]).innerHTML = "" + D[6] + ""; if (document.getElementById("RedCheck").checked) tr.cells[5].style.backgroundColor = "#ff8888"; window.setTimeout("timecolors(" + D[0] + "," + matchindex + ")", 12000); homeRedCard = true; homeIcon = ""; if (_appModule == "Vn") homeIcon = ""; } if (D[7] != A[matchindex][14]) { A[matchindex][14] = D[7]; if (D[7] == "0") document.getElementById("redcard2_" + D[0]).innerHTML = ""; else document.getElementById("redcard2_" + D[0]).innerHTML = "" + D[7] + ""; if (document.getElementById("RedCheck").checked) tr.cells[7].style.backgroundColor = "#ff8888"; window.setTimeout("timecolors(" + D[0] + "," + matchindex + ")", 12000); guestRedCard = true; guestIcon = ""; if (_appModule == "Vn") guestIcon = ""; } //yellow card if (D[8] != A[matchindex][15]) { A[matchindex][15] = D[8]; if (D[8] == "0") document.getElementById("yellow1_" + D[0]).innerHTML = ""; else document.getElementById("yellow1_" + D[0]).innerHTML = "" + D[8] + ""; } if (D[9] != A[matchindex][16]) { A[matchindex][16] = D[9]; if (D[9] == "0") document.getElementById("yellow2_" + D[0]).innerHTML = ""; else document.getElementById("yellow2_" + D[0]).innerHTML = "" + D[9] + ""; } //time if (A[matchindex][6] != D[10]) { var t2 = convertTime(D[10]); t2 = new Date(Date.UTC(t2.getFullYear(), t2.getMonth(), t2.getDate(), t2.getHours(), t2.getMinutes(), t2.getSeconds())); tr.cells[2].innerHTML = formatTime(t2); } A[matchindex][6] = D[10]; A[matchindex][7] = D[11]; //h-t var htElem = document.getElementById("hht_" + A[matchindex][0]); if (A[matchindex][11] != D[4] || A[matchindex][12] != D[5]) { A[matchindex][11] = D[4]; A[matchindex][12] = D[5]; if (htElem) { htElem.innerHTML = A[matchindex][11] + " - " + A[matchindex][12]; if (A[matchindex][11] == "" || A[matchindex][12]) { htElem.setAttribute("class", ""); } else htElem.setAttribute("class", "red2"); } } //corner 16 17 18 var crElem = document.getElementById("cr_" + A[matchindex][0]); if (D[18] == "1") { if (A[matchindex][27] != D[16] || A[matchindex][28] != D[17]) { A[matchindex][27] = D[16]; A[matchindex][28] = D[17]; if (crElem) crElem.innerHTML = A[matchindex][27] + " - " + A[matchindex][28]; crElem.setAttribute("class", "conner_span blue2"); } } //status if (A[matchindex][8] != D[1]) { A[matchindex][8] = D[1]; stateChanged = true; switch (A[matchindex][8]) { case 0: tr.cells[3].innerHTML = ""; break; case 1: var t2 = convertTime(A[matchindex][7]); goTime = Math.floor((new Date() - t2 - difftime) / 60000); if (goTime > 45) goTime = "45+" if (goTime < 1) goTime = "1"; tr.cells[3].innerHTML = goTime + "in"; if (showLiveTv) { tr.cells[2].style.display = "none"; tr.cells[3].style.display = ""; } break; case 2: tr.cells[3].innerHTML = state_ch[D[1] + 14]; break; case 3: case 4: var t2 = convertTime(A[matchindex][7]); goTime = Math.floor((new Date() - t2 - difftime) / 60000) + 46; if (goTime > 90) goTime = "90+"; if (goTime < 46) goTime = "46"; tr.cells[3].innerHTML = goTime + "in"; break; case -1: tr.cells[3].innerHTML = state_ch[D[1] + 14]; tr.cells[6].style.color = "red"; if (showLiveTv) { tr.cells[2].style.display = ""; tr.cells[4].style.display = "none"; } if (crElem) crElem.setAttribute("class", ""); if (orderby == "time") window.setTimeout("MoveToBottom(" + D[0] + ")", 25000); break; case -10: tr.cells[3].innerHTML = state_ch[D[1] + 14]; if (showLiveTv) { tr.cells[2].style.display = ""; tr.cells[4].style.display = "none"; } break; default: tr.cells[3].innerHTML = state_ch[D[1] + 14]; if (showLiveTv) { tr.cells[2].style.display = ""; tr.cells[3].style.display = ""; tr.cells[4].style.display = "none"; } if (orderby == "time") MoveToBottom(D[0]); break; } } //score switch (A[matchindex][8]) { case 0: if (D[11] == "1") tr.cells[6].innerHTML = "Lineup"; else tr.cells[6].innerHTML = "-"; break; case 1: tr.cells[6].innerHTML = (score1change ? "" + A[matchindex][9] + "" : A[matchindex][9]) + " - " + (score2change ? "" + A[matchindex][10] + "" : A[matchindex][10]); break; case -11: case -14: tr.cells[6].innerHTML = "-"; break; default: //2 3 -1 -12 -13 tr.cells[6].innerHTML = (score1change ? "" + A[matchindex][9] + "" : A[matchindex][9]) + " - " + (score2change ? "" + A[matchindex][10] + "" : A[matchindex][10]); break; } if (scorechange) { ShowFlash(D[0], matchindex); if (tr.style.display != "none") { hometeam = A[matchindex][4].replace("(N)", "").substring(0, 20); guestteam = A[matchindex][5].substring(0, 20); sclassname = B[A[matchindex][1]][8] != undefined ? B[A[matchindex][1]][8] : B[A[matchindex][1]][2]; //优先取本地化翻译 if (score1change) { hometeam = "" + hometeam + ""; homeIcon = ""; if (_appModule == "Vn") homeIcon = ""; score1 = "" + D[2] + ""; score2 = "" + D[3] + ""; } if (score2change) { guestteam = "" + guestteam + ""; guestIcon = ""; if (_appModule == "Vn") guestIcon = ""; score1 = "" + D[2] + ""; score2 = "" + D[3] + ""; } window.clearTimeout(nofityTimer); if (notify == "") notify = "Goal notes:"; notify += sclassname + ": " + hometeam + " " + score1 + "-" + score2 + " " + guestteam + "   "; nofityTimer = window.setTimeout("clearNotify()", 20000); //红牌,读取原来比分,红牌方标红 var scoreTxt = "-"; if (!score1change && !score2change) { scoreTxt = tr.cells[7].innerHTML; if (homeRedCard) //主队红牌 hometeam = "" + hometeam + ""; if (guestRedCard) //客队红牌 guestteam = "" + guestteam + ""; } else { scoreTxt = "" + score1 + " - " + score2 + ""; } if (windowCheck && D[1] >= -1) { winStr += `
    ` + sclassname + `` + tr.cells[3].innerHTML.replace("in.gif", "in2.gif") + `
    `+ homeIcon + ` ` + hometeam + ` `+ scoreTxt + ` ` + guestteam + ` `+ guestIcon + `
    `; matchNum = matchNum + 1 } } //清空进球、红牌图标,复原红牌标识 homeIcon = guestIcon = ""; homeRedCard = guestRedCard = false; }//scorechange } if (matchNum > 0) { if (window.ActiveXObject) ShowCHWindow(winStr, matchNum); else ShowCHWindow123(winStr, matchNum); } } catch (e) { } //document.getElementById("notify").innerHTML=notify; } function ShowFlash(id, n) { try { if (soundCheck && parseInt(A[n][8]) >= -1) { if (document.getElementById("tr1_" + id).style.display != "none") { document.getElementById("audio_goal").play(); } } } catch (e) { }; window.setTimeout("timecolors(" + id + "," + n + ")", 120000); } function CheckSound(n) { soundid = n; sound_init(); document.getElementById("audio_goal").play(); } sound_init(); function sound_init() { //主队声音 var sound_arr = new Array(); sound_arr.push(''); _$("soundsGoal").innerHTML = sound_arr.join(""); //红牌声音 sound_arr = new Array(); sound_arr.push(''); _$("soundsRed").innerHTML = sound_arr.join(""); _$("audio_goal").load(); _$("audio_red").load(); window.removeEventListener("touchstart", soundHandle, true); window.addEventListener("touchstart", soundHandle, true); } function soundHandle() { _$("audio_goal").load(); _$("audio_red").load(); window.removeEventListener("touchstart", soundHandle); } function timecolors(matchid, matchindex) { try { var tr = document.getElementById("tr1_" + matchid); tr.cells[5].style.backgroundColor = ""; tr.cells[6].innerHTML = A[matchindex][9] + " - " + A[matchindex][10]; tr.cells[7].style.backgroundColor = ""; } catch (e) { } } function clearNotify() { document.getElementById("notify").innerHTML = ""; } function ShowAllMatch() { var i, j, inputs; inputs = document.getElementById("myleague2").getElementsByTagName("input"); for (var i = 0; i < inputs.length; i++) inputs[i].checked = true; inputs = document.getElementById("table_live").getElementsByTagName("tr"); for (var i = 0; i < inputs.length; i++) if (inputs[i].getAttribute("index") != null) { inputs[i].style.display = ""; } for (var i = 1; i <= matchcount; i++) if (A[i][24] != "" && (Bf_simply_disp == false || B[A[i][1]][4] == 1)) document.getElementById("tr2_" + A[i][0]).style.display = ""; if (orderby == "league") { for (var i = 1; i <= sclasscount; i++) { if (Bf_simply_disp && B[i][4] == 0) continue; if (document.getElementById("tr_" + i)) document.getElementById("tr_" + i).style.display = ""; if (document.getElementById("expand" + i)) document.getElementById("expand" + i).style.display = "none"; if (document.getElementById("collapse" + i)) document.getElementById("collapse" + i).style.display = ""; } } document.getElementById("hiddencount").innerHTML = "0"; hiddenID = "_"; writeCookie("Hidden_MatchID", hiddenID); } //dispaly by status function ShowMatchByMatchState(n) { var i, j; var hh = 0; var trs = document.getElementById("table_live").getElementsByTagName("tr"); for (var i = 1; i < trs.length; i++) { if (trs[i].getAttribute("index") != null) { trs[i].style.display = "none"; trs[i + 1].style.display = "none"; } } for (var i = 1; i <= matchcount; i++) { if (Bf_simply_disp && B[A[i][1]][4] == 0) continue; if (n == 1 && parseInt(A[i][8]) > 0 || n == 2 && A[i][8] == "-1" || n == 3 && A[i][8] == "0" || n == 4 && A[i][20] == "True") { document.getElementById("tr1_" + A[i][0]).style.display = ""; if (A[i][24] != "") document.getElementById("tr2_" + A[i][0]).style.display = ""; } else hh = hh + 1; } document.getElementById("hiddencount").innerHTML = hh; if (orderby == "league") { for (var i = 1; i <= sclasscount; i++) { var show = false; if (Bf_simply_disp && B[i][4] == 0) continue; for (var j = 1; j <= matchcount; j++) { if (A[j][1] != i) continue; if (n == 1 && parseInt(A[j][8]) > 0 || n == 2 && A[j][8] == "-1" || n == 3 && A[j][8] == "0" || n == 4 && A[j][20] == "True") show = true; } if (show) document.getElementById("tr_" + i).style.display = ""; else document.getElementById("tr_" + i).style.display = "none"; } } } function hidematch(i) { document.getElementById("tr1_" + A[i][0]).style.display = "none"; document.getElementById("tr2_" + A[i][0]).style.display = "none"; document.getElementById("hiddencount").innerHTML = parseInt(document.getElementById("hiddencount").innerHTML) + 1; if (hiddenID.indexOf("_" + A[i][0] + "_") == -1) hiddenID += A[i][0] + "_"; writeCookie("Hidden_MatchID", hiddenID); reorderNotice(); } function hideSelMatch() { if (hiddenID == "_") return; var hh = 0; var id = hiddenID.split("_"); for (var i = 1; i < id.length - 1; i++) { if (document.getElementById("tr1_" + id[i]) != null) { document.getElementById("tr1_" + id[i]).style.display = "none"; document.getElementById("tr2_" + id[i]).style.display = "none"; hh++; } } document.getElementById("hiddencount").innerHTML = hh; } function ClearAllMatch() { var i, j, inputs; inputs = document.getElementById("myleague2").getElementsByTagName("input"); for (var i = 0; i < inputs.length; i++) inputs[i].checked = false; inputs = document.getElementById("table_live").getElementsByTagName("tr"); for (var i = 0; i < inputs.length; i++) if (inputs[i].getAttribute("index") != null) inputs[i].style.display = "none"; for (var i = 1; i <= matchcount; i++) { if (A[i][30] != "" && (Bf_simply_disp == false || A[i][26] == 1)) document.getElementById("tr2_" + A[i][0]).style.display = "none"; if (hiddenID.indexOf("_" + A[i][0] + "_") == -1) hiddenID += A[i][0] + "_"; } if (orderby == "league") { for (var i = 1; i <= sclasscount; i++) { if (Bf_simply_disp && B[i][4] == 0) continue; document.getElementById("tr_" + i).style.display = "none"; document.getElementById("expand" + i).style.display = ""; document.getElementById("collapse" + i).style.display = "none"; } } document.getElementById("hiddencount").innerHTML = matchcount; writeCookie("Hidden_MatchID", hiddenID); } function CheckLeague(i,b) { var hh = parseInt(document.getElementById("hiddencount").innerHTML); if (b && filter.league.indexOf(B[i][0]) == -1) { if (orderby == "league") document.getElementById("tr_" + i).style.display = ""; for (var j = 1; j <= matchcount; j++) { if (A[j][1] == i) { document.getElementById("tr1_" + A[j][0]).style.display = ""; if (A[j][24] != "") document.getElementById("tr2_" + A[j][0]).style.display = ""; if (hiddenID.indexOf("_" + A[j][0] + "_") != -1) { hiddenID = hiddenID.replace("_" + A[j][0] + "_", "_") hh--; } } } } else if (!b) { if (orderby == "league") document.getElementById("tr_" + i).style.display = "none"; for (var j = 1; j <= matchcount; j++) { if (A[j][1] == i) { document.getElementById("tr1_" + A[j][0]).style.display = "none"; if (A[j][24] != "") document.getElementById("tr2_" + A[j][0]).style.display = "none"; if (hiddenID.indexOf("_" + A[j][0] + "_") == -1) { hiddenID += A[j][0] + "_"; hh++; } } } } document.getElementById("hiddencount").innerHTML = hh; /*writeCookie("Hidden_MatchID", hiddenID);*/ } function HiddenLeague(i, b) { if (_$("myleague_" + i)) _$("myleague_" + i).checked = b; if (b) { document.getElementById("expand" + i).style.display = "none"; document.getElementById("collapse" + i).style.display = ""; } else { document.getElementById("expand" + i).style.display = ""; document.getElementById("collapse" + i).style.display = "none"; } CheckLeague(i, b); document.getElementById("tr_" + i).style.display = ""; } function MoveToBottom(m) { try { document.getElementById("tr1_" + m).parentElement.insertAdjacentElement("beforeEnd", document.getElementById("tr1_" + m)); document.getElementById("tr2_" + m).parentElement.insertAdjacentElement("beforeEnd", document.getElementById("tr2_" + m)); reorderNotice(); } catch (e) { } } //update running time function setMatchTime() { for (var i = 1; i <= matchcount; i++) { try { //日期兼容格式() var t2 = convertTime(A[i][7]); if (A[i][8] == "1") { //part 1 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 + "in"; } if (A[i][8] == "3") { //part 2 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 + "in"; } } catch (e) { } } runtimeTimer = window.setTimeout("setMatchTime()", 30000); } function showdetail(n, event) { if (A[n][8] == "0") return; try { if (Math.floor((new Date() - loadDetailFileTime) / 600) > 6) LoadDetailFile(); var R = new Array(); var html = ""; html += ""; html += ""; for (var i = 0; i < rq.length; i++) { R = rq[i].split('^'); if (R[0] != A[n][0]) continue; if (R[1] == "1") html += ""; else html += ""; } html += "
    " + _locModel.T.T_TIL_GameEve + "
    " + A[n][4] + "" + _locModel.T.T_Minutes + "" + A[n][5] + "
    " + R[4] + " " + R[3] + "'
    " + R[3] + "'" + R[4] + "
    "; document.getElementById('winScore').style.left = (document.body.clientWidth / 2 - 175) + "px"; //document.getElementById('winScore').style.top = (document.documentElement.scrollTop + event.clientY+15)+"px"; var pos = getElementPos("sound"); var obj = document.getElementById('winScore'); var scrollTop = Math.max(document.body.scrollTop, document.documentElement.scrollTop); if (scrollTop == 0) { if (pos.y - event.clientY < 260) obj.style.top = (event.clientY - obj.clientHeight) + "px"; else if (event.clientY - 240 <= 0) { obj.style.top = event.clientY + "px"; } else obj.style.top = (event.clientY - obj.clientHeight) + "px"; } else { if (event.clientY < obj.clientHeight) obj.style.top = (scrollTop + event.clientY) + "px"; else obj.style.top = (scrollTop + event.clientY - obj.clientHeight) + "px"; } document.getElementById("winScore").innerHTML = html; document.getElementById("winScore").style.display = ""; } catch (e) { } } function hiddendetail() { document.getElementById("winScore").innerHTML = ""; document.getElementById("winScore").style.display = "none"; } function check() { if (oldUpdateTime == lastUpdateTime && oldUpdateTime != "") { if (confirm("Due to procedural busyness or other network problems, you have been disconnected with the server more than 5 minutes, whether re-link to continue your watching score or not?")) window.location.reload(); } oldUpdateTime = lastUpdateTime; window.setTimeout("check()", 300000); } function setOrderby(a) { orderby = a writeCookie("orderby", orderby); LoadLiveFile(); } function LoadLiveFile() { var allDate = document.getElementById("allDate"); var s = document.createElement("script"); s.type = "text/javascript"; if (isResult) { if (orderby == "league") s.src = _bfTxtByLeague + "?" + Date.parse(new Date()); else s.src = _bfTxtByTime + "?" + Date.parse(new Date()); } else { if (orderby == "league") s.src = _bfTxtByLeague + "?" + Date.parse(new Date()) + (_bfToken != '' ? "&from=free&token=" + _bfToken : ""); else s.src = _bfTxtByTime + "?" + Date.parse(new Date()) + (_bfToken != '' ? "&from=free&token=" + _bfToken : ""); } allDate.removeChild(allDate.firstChild); allDate.appendChild(s, "script"); window.setTimeout("LoadLiveFile()", 3600 * 1000); } function LoadDetailFile() { var detail = document.getElementById("span_detail"); var s = document.createElement("script"); s.type = "text/javascript"; s.src = "/gf/data/detail.js?" + Date.parse(new Date()); detail.removeChild(detail.firstChild); detail.appendChild(s, "script"); loadDetailFileTime = new Date(); } function LoadSbCornerFile() { var detail = document.getElementById("span_sbCorner"); var s = document.createElement("script"); s.type = "text/javascript"; s.charset = "utf-8"; s.src = "/gf/data/sbCorner.js?" + Date.parse(new Date()); detail.removeChild(detail.firstChild); detail.appendChild(s, "script"); loadSbCornerTime = new Date(); } function changeFontSize(obj, size) { for (var i = 1; i <= matchcount; i++) { if (Bf_simply_disp == false || A[i][26] == 1) { document.getElementById("team1_" + A[i][0]).style.fontSize = size + "px"; document.getElementById("team2_" + A[i][0]).style.fontSize = size + "px"; } } } orderby = getCookie("orderby"); if (orderby == null) orderby = "time"; LoadLiveFile(); window.setTimeout("LoadSbCornerFile()", 4000); //if (!_websocket) { scorePolling = window.setTimeout("getxml()", 2000); //} else { // openWebsocket(); //} //window.setTimeout("check()", 3000); function ToApp() { window.open(_touchWebDomain); } function hiddenSbCorner() { document.getElementById("ifShowCorner").value = 0; oldCorner = ""; showCornerCont = 0; MM_showHideLayers('sbOddsCorner', '', 'hidden'); } function showSbCornerDiv() { document.getElementById("ifShowCorner").value = 1; MM_showHideLayers('sbOddsCorner', '', 'show'); } function showSBCorner(n, event) { if (!_showCorner) return; if (showCornerCont > 0) return; var scheduleId = A[n][0]; var homeTeamID = A[n][2]; var guestTeamID = A[n][3]; var homeTeam = A[n][4]; var guestTeam = A[n][5]; var sclassName = B[A[n][1]][1]; var matchState = parseInt(A[n][8]); var html = new Array(); if (Math.floor((new Date() - loadSbDetailTime) / 600) > 50) LoadSbCornerFile(); if (typeof (sCornerData) == "undefined" || typeof (sCornerData[scheduleId]) == "undefined") return; var strGoals = ""; var arrOdds = sCornerData[scheduleId].split('^'); var arrCornerLetGoal = arrOdds[0].split(','); var arrCornerTotal = arrOdds[1].split(','); var arrCornerCount = arrOdds[2].split(','); var arrDetail = null; if (typeof (arrOdds[3]) != "undefined") arrDetail = arrOdds[3].split(';'); strGoals = scheduleId + "," + homeTeamID + "," + guestTeamID + "," + matchState + ","; for (var j = 3; j < 6; j++) { strGoals += (typeof (arrCornerLetGoal[j]) == "undefined" ? '' : arrCornerLetGoal[j]) + "," } for (var j = 3; j < 6; j++) { strGoals += (typeof (arrCornerTotal[j]) == "undefined" ? '' : arrCornerTotal[j]) + "," } for (var j = 0; j < 4; j++) { strGoals += (typeof (arrCornerCount[j]) == "undefined" ? '' : arrCornerCount[j]) + "," } if (arrDetail != null && arrDetail[0] != "") { var arr = arrDetail[arrDetail.length - 1].split(','); strGoals += arr[0] + ',' + arr[1]; } else strGoals += ','; var beginHeight = 60; var isShow = (typeof (arrCornerLetGoal[0]) != "undefined" && arrCornerLetGoal[0] != "") || (typeof (arrCornerTotal[0]) != "undefined" && arrCornerTotal[0] != ""); html.push(''); html.push(''); html.push(''); html.push('
    Bet365 ' + _locModel.T.T_TIL_CornerKicks + '
    ' + homeTeam + '' + guestTeam + '
    '); // html.push('
    角球数据
    '); // html.push('
    ' + homeTeam + '' + guestTeam + '
    '); if (A[n][27]) isShow = true; var goalIsShow = (isShow ? "" : "none"); beginHeight += (isShow ? 66 : 0); html.push('
    '); isShow = (A[n][29] == 1 && matchState != 0); if (A[n][27]) isShow = true; var cornerIsShow = (isShow ? "" : "none"); beginHeight += (isShow ? 44 : 0); html.push('
    '); html.push("
    " + _locModel.T.T_TIL_CornerDetail + "
    "); 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("
    ' + (typeof (arrCornerCount[0]) == "undefined" ? A[n][27] : arrCornerCount[0]) + '' + _locModel.T.T_FullTime + '' + (typeof (arrCornerCount[1]) == "undefined" ? A[n][28] : arrCornerCount[1]) + '
    ' + (typeof (arrCornerCount[2]) == "undefined" ? " " : arrCornerCount[2]) + '' + _locModel.T.T_HalfTime + '' + (typeof (arrCornerCount[3]) == "undefined" ? " " : arrCornerCount[3]) + '
    "); var obj = document.getElementById('sbOddsCorner'); var pos = getElementPos("sound"); //var contentHeight = (goalIsShow == "none" && cornerIsShow == "none" ? 0 : beginHeight + (arrDetail != null && arrDetail[0] != "" ? arrDetail.length * 18 : 0)); obj.style.left = (document.body.clientWidth / 2 - 220) + "px"; var scrollTop = Math.max(document.body.scrollTop, document.documentElement.scrollTop); if (scrollTop == 0) { if (pos.y - event.clientY < 260) obj.style.top = (event.clientY - obj.clientHeight) + "px"; else if (event.clientY - 240 <= 0) { obj.style.top = event.clientY + "px"; } else obj.style.top = (event.clientY - obj.clientHeight) + "px"; } else { if (event.clientY < obj.clientHeight) obj.style.top = (scrollTop + event.clientY) + "px"; else obj.style.top = (scrollTop + event.clientY - obj.clientHeight) + "px"; } obj.style.width = "400px"; if (goalIsShow == "none" && cornerIsShow == "none") { obj.style.width = "180px"; html = []; html.push("
    " + _locModel.T.T_PH_NoCornerData + "
    "); obj.style.left = (document.body.clientWidth / 2 + 20) + "px" } obj.innerHTML = html.join(""); document.getElementById("ifShowCorner").value = 1; MM_showHideLayers('sbOddsCorner', '', 'show'); showCornerCont++; } // odds window function changeData(odds) { if (typeof (odds) == "undefined" || odds == "") return ""; var tmp = odds; var arrd = odds.toString().split("."); if (arrd.length > 1) { if (arrd[1].length == 1) tmp = tmp + "0"; } else tmp = tmp + ".00"; return tmp; } function getStrDiv(odds1, odds2) { if (typeof (odds1) == "undefined" || odds1 + "" == "") return ""; var retVal; var tmp = changeData(odds1); if (parseFloat(odds1) > parseFloat(odds2)) retVal = '
    ' + tmp + '
    '; else if (parseFloat(odds1) < parseFloat(odds2)) retVal = '
    ' + tmp + '
    '; else retVal = tmp; return retVal; } function getStrDiv2(goal1, goal2, t) { if (typeof (goal1) == "undefined" || goal1 + "" == "") return ""; var tmp = "", retVal; if (t == 1) tmp = Goal2GoalCn(goal1); else tmp = Goal2GoalCn(goal1); if (parseFloat(goal1) != parseFloat(goal2)) retVal = '
    ' + tmp + '
    '; else retVal = tmp; return retVal; } function SelectMenu(menuId) { $('#li_ShowAll').removeClass('on'); $('#li_FilterHot').removeClass('on'); //$('#li_MyGame').removeClass('on'); $('.filterLi').removeClass('on'); $('#' + menuId).addClass('on'); var selOption = 0; if (menuId == 'li_FilterHot') selOption = 1; else if (menuId == 'li_MyGame') selOption = 8; selectMenu = selOption; sessionStorage.setItem("SelectMenu", selOption); } //统计当前隐藏数 function CountHidden() { var show = 0; var trs = document.getElementById("table_live").getElementsByTagName("tr"); for (var i = 1; i < trs.length; i++) { if (trs[i].getAttribute("index") != null) { if (trs[i].style.display != "none") show++; } } document.getElementById("hiddencount").innerHTML = matchcount - show; } if (Bf_simply_disp) { document.getElementById("ShowAllSel").getElementsByTagName("option")[1].selected = true; } function getTipsList() { $.get("/ajax/GetTipsCount", result => { var list = JSON.parse(result); if (list == null) return; for (let i = 0; i < list.length; i++) { let { id, topicCount } = list[i] let index = $(`#tr1_${id}`).attr("index") if (!index) continue; let state = A[index][8] if (state == 0 && topicCount > 0) { $(`#score_${id}`).html(` ${topicCount} ` + _locModel.T.T_Sub_Tips + ` `) //$(`#score_${id}`).html(`${topicCount + " " + _locModel.T.T_Sub_Tips}`) } } }) } function toMatch(index) { cancelBubble() let mid = A[index][0] var hTeam = escapeChar(skipHtmlTagBoth(A[index][4])); var gTeam = escapeChar(skipHtmlTagBoth(A[index][5])); let leagueIndex = A[index][1] var lfName = escapeChar(skipHtmlTagBoth(B[leagueIndex][2])); soccerInPage.tipsmatch(mid, hTeam, gTeam, lfName) } //webscoket function openWebsocket() { var channels = ["change_xml"]; wsUtil.connectWs(channels, function (data) { if (data["change_xml"] != undefined) { var list = data["change_xml"].split("!"); refresh(list, 1) } }, function () { //console.log("轮询启动"); if (scorePolling) window.clearTimeout(scorePolling); scorePolling = window.setTimeout("getxml()", 4000); }, function () { //console.log("轮询关闭"); if (scorePolling) window.clearTimeout(scorePolling); }) } function refreshBfToken() { if (_bfToken != '') { $.post("/ajax/RefreshBfToken", { token: _bfToken }, function (result) { if (result != '') { _bfToken = result; } }) window.setTimeout("refreshBfToken()", 60 * 1000); } } //-----------------------直播相关代码----------------------------// function OpenTvLink(id) { if (tvLinkList != null) { var linkObj = tvLinkList.filter(t => t.scheduleId == id); if (linkObj != null && linkObj.length > 0) { var linkUrl = linkObj[0].linkList[0]; if (_isForApp) { linkUrl = appOpenBrowserUrl(linkUrl) } window.open(linkUrl); } } } function TvLinkObj(data) { var arr = data.split('^'); this.scheduleId = arr[0]; this.linkList = new Array(); for (var i = 1; i <= arr.length; i++) { if (arr[i] != "" && arr[i] != undefined) { this.linkList.push(arr[i]); } } } function InitTvLink() { tvLinkList = new Array(); var txturl = getTvLinkTxtUrl(_appModule); tvLinkHttp.open("get", txturl + Date.parse(new Date()), false); tvLinkHttp.send(null); var data = tvLinkHttp.responseText; if (data == "") return; var dataArr = data.split("$"); tvLinkChangeTime = dataArr[0]; if (dataArr[1] == "") return; var linkArr = dataArr[1].split("!"); keyMatch = dataArr[2].split(","); for (var i = 0; i < linkArr.length; i++) { var link = new TvLinkObj(linkArr[i]); var tr = $("#tr1_" + link.scheduleId); if (tr[0]) { var index = parseInt(tr.attr("index")); var state = A[index][8]; if (state > -1) { if (state > 0) $("#mt_" + link.scheduleId).hide(); $("#tvLink_" + link.scheduleId).html("tv"); } } tvLinkList.push(link); } } $(document).ready(function () { refreshBfToken(); }); //function changeMainDomain() { // if (window.self !== window.top && _appModule == "World") { //open by iframe // //domain // var domain = ""; // var url = document.referrer; // var arrDoms = url.split("/")[2].split("."); // var isNum = /^\d+$/; // domain = isNum.test(arrDoms[1]) ? `${arrDoms[0]}.${arrDoms[1]}.${arrDoms[2]}.${arrDoms[3].split(":")[0]}` : arrDoms.join('.') //ip/domain // if (domain == 'www.livescore.red') { // _mainWebDomain = '//www.goaloo8.com/'; // _livescoreWebDomain = '//www.goaloo8.com/'; // _touchWebDomain = '//m1.goaloo8.com/'; // } else { // _mainWebDomain = '//www.goaloo18.com/'; // _livescoreWebDomain = '//www.goaloo18.com/'; // _touchWebDomain = '//m1.goaloo18.com/'; // } // } //} //changeMainDomain(); ; function SwithcDarkFree() { if (document.getElementById("DarkModeCheck").checked) { dark_mode = 1; WriteSession("dark_mode", 1); } else { dark_mode = 0; WriteSession("dark_mode", 0); } LoadDark(); } function SyncDarkCheckFree() { var dark = GetSession("dark_mode"); if (dark == null) dark = dark_mode; if (dark == 1) { if (document.getElementById("DarkModeCheck")) document.getElementById("DarkModeCheck").checked = true; } if (document.getElementById("DarkModeCheck")) document.getElementById("DarkModeCheck").style.display = ""; } SyncDarkCheckFree(); $(document).ready(function () { specialHide(); checkWhiteList(); }); function specialHide() { var mode = getQueryVariable("mode"); if (mode == null || mode == '') { mode = sessionStorage.getItem("HideMode"); } if (mode != null && mode == "hide") { $(".needHide").hide(); sessionStorage.setItem("HideMode", mode); } else if (mode == "deephide") { $(".needHide").hide(); $(".deepHide").hide(); sessionStorage.setItem("HideMode", mode); } else if (mode == "show") { $(".needHide").show(); $(".deepHide").show(); sessionStorage.setItem("HideMode", mode); } } var _leaSortting = false; function initSortLea() { if (document.getElementById("cbbSortLea") && document.getElementById("cbbSortLea").checked) { _leaSortting = true; MakeSclassWithSorting(); HideByState(1); SyncLeaSorting(0); } } //sort leagues list function SortList(elem, sortBy) { var byCountry = $("#cbbSortLeaByCountry")[0].checked; var byFirstCode = $("#cbbSortLea")[0] ? $("#cbbSortLea")[0].checked : false; if (byCountry) { _leaSortting = true; MakeSclassWithSortingByCountry(); } else if (byFirstCode) { _leaSortting = true; MakeSclassWithSorting(); } else { _leaSortting = false; MakeSclass(); } if (byCountry) { writeCookie(FilterCountryKey, 1); } else { writeCookie(FilterCountryKey, 0); } HideByState(); SyncLeaSorting(0); InitHeadShow(); } //无完场赛事隐藏Result分隔栏 function hideResultTr() { if (orderby == "league" || $("#resultSplit").length == 0) return; var ifShow = false; for (var i = 0; i < finishMatchList.length; i++) { if ($("#tr1_" + finishMatchList[i])[0].style.display != "none" && ((myGamesID.indexOf(finishMatchList[i]) == -1 && isFavTop) || !isFavTop)) { ifShow = true; break; } } $("#resultSplit")[0].style.display = !ifShow ? "none" : ""; } var soccerInPage = { isSummary: function (id) { if (typeof (checkInpageVersion) == "function" && checkInpageVersion(id) == 1) { return true; } return false; }, gethost: function () { return _mainWebDomain.substr(0, _mainWebDomain.length - 1); }, detail: function (id) { if (!this.isSummary(id)) { window.open(this.gethost() + "/match/live-" + id); } }, analysis: function (id) { if (!this.isSummary(id)) { window.open(this.gethost() + "/match/h2h-" + id); } }, oddscomp: function (id) { if (!this.isSummary(id)) { var url = "/oddscomp/" + id; window.open(this.gethost() + url); } }, euroodds: function (id) { window.open(this.gethost() + "/1x2-odds/" + id); }, ouodds: function (id) { window.open(this.gethost() + "/over-under-odds/" + id); }, ahodds: function (id) { window.open(this.gethost() + "/asian-handicap-odds/" + id); }, threemix: function (id, cid, ishalf) { var url = "/oddscomp/" + id; if (ishalf) { url += "?half=1" } window.open(this.gethost() + url); }, textlive: function (id) { window.open(this.gethost() + "/textlive/" + id); }, playertech: function (id) { window.open(this.gethost() + "/playertech/" + id); }, panluWin: function (id, cid) { var panluUrl = this.gethost() + "/soccer/oddsstats/" + id; if (typeof (cid) != "undefined" && cid != '') url += "?cid=" + cid; window.open(panluUrl, '', 'scrollbars=yes,resizable=yes,width=662, height=650,left=50,top=100'); }, tipsmatch: function (id, home, guest, sclass, isSelf) { if (!this.isSummary(id, home, guest, isSelf)) { window.open(_cmsWebDomain + "football/match/" + id, isSelf ? "_self" : ""); } } } var basketInPage = { gethost: function () { return _mainWebDomain.substr(0, _mainWebDomain.length - 1); }, analysis: function (id) { window.open(this.gethost() + "/basketball/analysis/" + id); }, oddscomp: function (id) { window.open(this.gethost() + "/oddscompbasket/" + id); }, euroodds: function (id) { window.open(this.gethost() + "/basketball/1x2-" + id); }, playertech: function (id) { window.open(this.gethost() + "/statistics/" + id); }, textlive: function (id) { window.open(this.gethost() + "/statistics/" + id + "?showtxt=1"); } } function callLeagueFilterWin() { if ($("#showoptional2").css("visibility") == "visible") { $("#showoptional2").css("visibility", "hidden"); } else { $("#showoptional2").css("visibility", "visible"); leagueFilterCount(); } } function teamClickEvent(i) { if (_appModule == "World") { var hTeam = escapeChar(skipHtmlTagBoth(A[i][4])); var gTeam = escapeChar(skipHtmlTagBoth(A[i][5])); var lfName = escapeChar(skipHtmlTagBoth(B[A[i][1]][2])); if (matchIsBegin(parseInt(A[i][8]))) { soccerInPage.detail(A[i][0], hTeam, gTeam, lfName); } else { soccerInPage.analysis(A[i][0], hTeam, gTeam, lfName); } } else { if (matchIsBegin(parseInt(A[i][8]))) { soccerInPage.detail(A[i][0]); } else { soccerInPage.analysis(A[i][0]); } } } function matchIsBegin(state) { let begin = false; state = parseInt(state); if (state > 0 || state == -1 || state == -13) { begin = true; } return begin; } function reorderNotice() { var jumpLink = _livescoreWebDomain; /*if (_appModule != "Pt" && _appModule != "Kor") { jumpLink = _cmsWebDomain + "rewards"; }*/ var template = "" + _locModel.T.T_Free_Drainage + ""; var notices = $(".notice"); for (var i = 0; i < notices.length; i++) { notices[i].parentNode.removeChild(notices[i]); } var rows = $("[id^=tr1_]:visible"); for (var i = 0; i < rows.length; i++) { if (i == 0) { var index = parseInt(rows[i].getAttribute("index")); var tr = _$("tr2_" + A[index][0]); insertAfter($(template)[0], tr); } if (i == 1) break; } } function showAllMatch() { writeCookie("Hidden_MatchID", "_"); location.href = '/free/freesoccer/?type=all'; } //初始化头部显示 function InitHeadShow() { if (orderby == "time") return; var titleList = $(".Leaguestitle"); if (titleList == null && titleList.length == 0) return; var arrtName = "leaIndex"; var arrtValue = ""; for (var i = 0; i < titleList.length; i++) { arrtValue = titleList[i].getAttribute(arrtName); var trList = $('tr[index][' + arrtName + '="' + arrtValue + '"]'); var isShow = false; if (trList != null && trList.length > 0) { for (var j = 0; j < trList.length; j++) { if (trList[j].style.display != "none" && (orderby != 'time' || trList[j].getAttribute("istop") != 1)) { isShow = true; break; } } } if (isShow) titleList[i].style.display = ""; else titleList[i].style.display = "none"; } reorderNotice(); } function openMainDomain() { window.open(_mainWebDomain + "/freemap"); } function checkWhiteList() { if (window.self !== window.top) { //open by iframe //domain var domain = ""; var url = document.referrer; var arrDoms = url.split("/")[2].split("."); var isNum = /^\d+$/; domain = isNum.test(arrDoms[1]) ? `${arrDoms[0]}.${arrDoms[1]}.${arrDoms[2]}.${arrDoms[3].split(":")[0]}` : arrDoms.join('.') //ip/domain if (domain == location.host) { return; } //check $.post(`/ajax/checkwhitelist`, { domain }, function (result) { console.log(url, domain, result) if (result != 1) { //not on white list $("#wlbox").show(); $("#wlshadow").show(); $("body").css("overflow", "hidden") } }) } else if (_freeWebDomain.indexOf(location.host) == -1) { $("#wlbox").show(); $("#wlshadow").show(); $("body").css("overflow", "hidden") } } function showExplain(exlist, hometeam, guestteam) { // 广东体育; 1 | 1; 2 | 5; 12 | 90, 1 - 1; 2 - 2; 1, 2 - 2; 5 - 4; 1 //;|1;2|;|90,3-3;2-5;2,2-2;; hometeam = hometeam.replace(/<[^>].*?>/g, ""); guestteam = guestteam.replace(/<[^>].*?>/g, ""); hometeam = hometeam.replace("(N)", ""); guestteam = guestteam.replace("(N)", ""); var explainList = ""; if (exlist != "") { if (exlist.indexOf('|') > -1) { var arrExplain = exlist.split('|'); var scoresList = arrExplain[3].split(';'); if (scoresList[0] != "") { // 90分钟 /*explainList += scoresList[0].split(',')[0] + _locModel.T.T_S_Minutes + "[" + scoresList[0].split(',')[1] + "], ";*/ // 两回合 if (scoresList[1] != "") explainList += _locModel.T.T_TwoRounds + "[" + scoresList[1] + "], "; // 120分钟 if (scoresList[2] != "") { if (scoresList[2].split(',')[0] == "1") explainList += "120" + _locModel.T.T_S_Minutes + "[" + scoresList[2].split(',')[1] + "], "; else explainList += _locModel.T.T_ST_Ot + "[" + scoresList[2].split(',')[1] + "], "; } // 点球 if (scoresList[3] != "") explainList += _locModel.T.T_Explain_Pen + "[" + scoresList[3] + "], "; // 赛果 if (scoresList[4] != "") { if (scoresList[4] == "1") explainList += _locModel.T.T_Home + " " + _locModel.T.T_Win; else if (scoresList[4] == "2") explainList += _locModel.T.T_Away + " " + _locModel.T.T_Win; } } } } return explainList; };