function SubSelect(arrCupKind, lang, groupID) {
var div = document.getElementById("SubSelectDiv");
var divContent = "
";
var afterCurr = false;
for (var i = 0; i < arrCupKind.length; i++) {
var subLeague = arrCupKind[i];
//0子杯賽ID,1是否分組,2子杯賽簡體名,3子杯賽繁體名,4子杯賽英文名,5分組數,6是否當前子杯賽,7出線球隊數
if (i != 0 && i % 4 == 0) {
divContent += "
";
}
if (afterCurr)
divContent += "" + subLeague[2 + lang] + " | ";
else
divContent += "" + subLeague[2 + lang] + " | ";
if (groupID == -1 && subLeague[6] == 1 || subLeague[0] == groupID)
currCupMatch = subLeague;
//if (subLeague[6] == 1)
// afterCurr = true;
}
var j = arrCupKind.length % 4;
for (var i = 0; j > 0 && i < 4 - j; i++) {
divContent += " | ";
}
divContent += "
";
div.innerHTML = divContent;
}
function InitTeam() {
for (var i = 0; i < arrTeam.length; i++) {
teamHelper["T_" + arrTeam[i][0]] = arrTeam[i];
}
}
//报错的弹出界面js
function miniopen(a) {
var w = window.screen.width;
var h = window.screen.height;
var winWidth = 400;
var winHeight = 600;
var winTop = (h - winHeight) / 2;
var winLeft = (w - winWidth) / 2;
window.open(a, "_blank", "top=" + winTop + ",left=" + winLeft + ",height=" + winHeight + ",width=" + winWidth + ",status=yes,toolbar=auto,menubar=no,location=no");
return false;
}
// 左边标题
function LoadTitleLeft() {
var titleLeftHtml = ""; //图片
titleLeftHtml += selectSeason + " " + arrCup[lang + 1] + " 赛程积分 "; //标题
titleLeftHtml += "报错"; //报错
document.getElementById("TitleLeft").innerHTML = titleLeftHtml;
}
//右边标题赛季选择
function titleRightSeason() {
var seasonSel = document.getElementById("seasonList");
for (var i = 0; i < arrSeason.length; i++) {
seasonSel.options.add(new Option(arrSeason[i], arrSeason[i]));
if (arrSeason[i] == selectSeason) {
seasonSel.selectedIndex = i;
}
}
}
function ShowMain() {
//有分组,且分组数大于1的
if (currCupMatch[1] == 1 && currCupMatch[5] > 1) {
document.getElementById("showRound").style.display = "block";
document.getElementById("ScoreGroupDiv").style.display = "block";
showRound(-1);
showScoreDet(-1);
document.getElementById("mainTableDiv").style.display = "none";
} else if (currCupMatch[1] == 1 && currCupMatch[5] == 1) {//有一个组的
document.getElementById("showRound").style.display = "none";
document.getElementById("ScoreGroupDiv").style.display = "block";
showScoreDet(0);
showSche(currCupMatch[0], "A");
document.getElementById("mainTableDiv").style.display = "block";
} else {//无分组的
document.getElementById("showRound").style.display = "none";
document.getElementById("ScoreGroupDiv").style.display = "none";
showSche(currCupMatch[0], "");
document.getElementById("mainTableDiv").style.display = "block";
}
}
function changeSub(groupID) {
SubSelect(arrCupKind, lang, groupID);
ShowMain();
LoadTitleLeft(); //重新改写报错按钮
}
var fenZuShu = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
//轮次显示,selectGroup表示A,B,C,D之一
function showRound(selectGroup) {
var showRoundTd = document.getElementById("showRound");
var html = " ";
html += "" + currCupMatch[2 + lang] + " | ";
var totalRound = currCupMatch[5];
//上面一行
for (var i = 0; i < totalRound; i++) {
html += "" + fenZuShu[i] + " | ";
}
html += "总 | ";
html += "
";
showRoundTd.innerHTML = html;
}
function selectRound(obj) {
var selectGroup = obj.groupType || obj.getAttribute("groupType");
showRound(selectGroup);
if (selectGroup == -1) {
document.getElementById("mainTableDiv").style.display = "none";
} else {
showSche(currCupMatch[0], fenZuShu[selectGroup]);
document.getElementById("mainTableDiv").style.display = "block";
}
showScoreDet(selectGroup);
}
//显示积分
function showScoreDet(selectGroup) {
var scoreDet = document.getElementById("ScoreGroupTab").tBodies[0];
//删除节点
for (var i = scoreDet.childNodes.length - 1; i > 0; i--) {
scoreDet.removeChild(scoreDet.childNodes[i]);
}
var fra = document.createDocumentFragment();
for (var i = 0; i < currCupMatch[5]; i++) {
if (selectGroup != i && selectGroup != -1) continue; //selectGroup为-1时,表示总积分榜
if (currCupMatch[5] != 1) {//若只有一组分组,则不显示头部
var tr1 = document.createElement("tr");
tr1.setAttribute("align", "center");
tr1.appendChild(creatTd2("style", "background-color:#456da8;color:#fff;font-weight:bold;", "colspan", "10", fenZuShu[i] + "组积分"));
fra.appendChild(tr1);
}
for (var j = 0; j < jh["S" + currCupMatch[0] + fenZuShu[i]].length; j++) {
var tr2 = document.createElement("tr");
tr2.setAttribute("align", "center");
var oneRecord = jh["S" + currCupMatch[0] + fenZuShu[i]][j];
tr2.appendChild(creatTd("bgcolor", "#FFFFFF", "" + oneRecord[0]));
if (j < oneRecord[10]) {
tr2.appendChild(creatTd("style", "background-color:#fff;text-align:left;", "" + teamHelper["T_" + oneRecord[1]][1 + lang] + ""));
} else {
tr2.appendChild(creatTd("style", "background-color:#fff;text-align:left;", "" + teamHelper["T_" + oneRecord[1]][1 + lang] + ""));
}
for (var k = 2; k < 9; k++) {
tr2.appendChild(creatTd("bgcolor", "#FFFFFF", "" + oneRecord[k]))
}
tr2.appendChild(creatTd("bgcolor", "#fdfccc", "" + oneRecord[9]))
fra.appendChild(tr2);
}
}
var tr3 = document.createElement("tr");
tr3.appendChild(creatTd("colspan", "10", "备注:有颜色球队表示已出线球队"));
fra.appendChild(tr3);
scoreDet.appendChild(fra);
}
//对阵显示
function showSche(groupID, group2) {
var tBoday = document.getElementById("Table3").tBodies[0];
for (var i = tBoday.childNodes.length - 1; i > 1; i--) {
tBoday.removeChild(tBoday.childNodes[i]);
}
var fra = document.createDocumentFragment();
for (var i = 0; i < jh["G" + groupID + group2].length; i++) {
if (currCupMatch.length <= 7 || (currCupMatch.length > 7 && currCupMatch[7] == 0)) {
var arrOneRecord = jh["G" + groupID + group2][i];
var tr1 = document.createElement("tr");
tr1.setAttribute("align", "center");
tr1.appendChild(creatTd("bgcolor", arrCup[9], "" + arrCup[4 + lang] + "")); //轮次
tr1.appendChild(creatTd(null, null, ShowMatchTime(arrOneRecord[3]))); //时间
tr1.appendChild(creatTd(null, null, "" + teamHelper["T_" + arrOneRecord[4]][1 + lang] + (arrOneRecord.length >= 24 && arrOneRecord[23] != "0" ? "(中)" : "") + "")); //主队
tr1.appendChild(creatTd(null, null, "")); //比分
tr1.appendChild(creatTd(null, null, "" + teamHelper["T_" + arrOneRecord[5]][1 + lang] + "")); //客队
if (i % 2 == 0) {
tr1.appendChild(creatTd(null, null, showLetGoal(arrOneRecord[10]))); //让球
tr1.appendChild(creatTd(null, null, showLetGoal(arrOneRecord[11]))); //让球
tr1.appendChild(creatTd(null, null, arrOneRecord[12])); //大小
tr1.appendChild(creatTd(null, null, arrOneRecord[13])); //大小
} else {
tr1.appendChild(creatTd("style", "background-color:#E3EEF9", showLetGoal(arrOneRecord[10]))); //让球
tr1.appendChild(creatTd("style", "background-color:#E3EEF9", showLetGoal(arrOneRecord[11]))); //让球
tr1.appendChild(creatTd("style", "background-color:#F4E8FC", arrOneRecord[12])); //大小
tr1.appendChild(creatTd("style", "background-color:#F4E8FC", arrOneRecord[13])); //大小
}
tr1.appendChild(creatTd(null, null, showFour(arrOneRecord[0], arrOneRecord[14], arrOneRecord[15], arrOneRecord[16], arrOneRecord[17])));
tr1.appendChild(creatTd(null, null, "" + arrOneRecord[7] + ""));
fra.appendChild(tr1);
//注释
if (arrOneRecord[20] != "" || (arrOneRecord[22] != undefined && arrOneRecord[22] != "")) {
try {
var tr2 = document.createElement("tr");
tr2.align = "center";
tr2.style.backgroundColor = "#FAFAE3";
var explain = PoJie(arrOneRecord[22], arrOneRecord[4], arrOneRecord[5], arrOneRecord[20]);
if (explain != "") {
tr2.appendChild(creatTd("colspan", "11", explain));
fra.appendChild(tr2);
}
} catch (e) { }
}
} else {
var oneScheKind = jh["G" + groupID + group2][i];
var tr21 = document.createElement("tr");
tr21.setAttribute("align", "center");
tr21.appendChild(creatTd2("colspan", "11", "style", "font-weight:bold; line-height:25px; font-size:12px;background-color:#FBEDC8;", "" + teamHelper["T_" + oneScheKind[0]][1 + lang] + " " + (oneScheKind[2] > oneScheKind[3] ? "" + oneScheKind[2] + "" : oneScheKind[2]) + " : " + (oneScheKind[2] < oneScheKind[3] ? "" + oneScheKind[3] + "" : oneScheKind[3]) + " " + teamHelper["T_" + oneScheKind[1]][1 + lang] + "")); //比分
fra.appendChild(tr21);
for (var j = 4; j < oneScheKind.length; j++) {
var arrOneRecord = oneScheKind[j];
var tr1 = document.createElement("tr");
tr1.setAttribute("align", "center");
tr1.appendChild(creatTd("bgcolor", arrCup[9], "" + arrCup[4 + lang] + "")); //轮次
tr1.appendChild(creatTd(null, null, ShowMatchTime(arrOneRecord[3]))); //时间
var h_redCard = "";
if (arrOneRecord[18] != 0)
h_redCard = "" + arrOneRecord[18] + ""; //主队红牌
tr1.appendChild(creatTd(null, null, h_redCard + "" + teamHelper["T_" + arrOneRecord[4]][1 + lang] + (arrOneRecord.length >= 24 && arrOneRecord[23] != "0" ? "(中)" : "") + "")); //主队
tr1.appendChild(creatTd(null, null, "")); //比分
var g_redCard = "";
if (arrOneRecord[19] != 0)
g_redCard = "" + arrOneRecord[19] + ""; //客队红牌
tr1.appendChild(creatTd(null, null, "" + teamHelper["T_" + arrOneRecord[5]][1 + lang] + "" + g_redCard)); //客队
if (j % 2 == 0) {
tr1.appendChild(creatTd(null, null, showLetGoal(arrOneRecord[10]))); //让球
tr1.appendChild(creatTd(null, null, showLetGoal(arrOneRecord[11]))); //让球
tr1.appendChild(creatTd(null, null, arrOneRecord[12])); //大小
tr1.appendChild(creatTd(null, null, arrOneRecord[13])); //大小
} else {
tr1.appendChild(creatTd("style", "background-color:#E3EEF9", showLetGoal(arrOneRecord[10]))); //让球
tr1.appendChild(creatTd("style", "background-color:#E3EEF9", showLetGoal(arrOneRecord[11]))); //让球
tr1.appendChild(creatTd("style", "background-color:#F4E8FC", arrOneRecord[12])); //大小
tr1.appendChild(creatTd("style", "background-color:#F4E8FC", arrOneRecord[13])); //大小
}
tr1.appendChild(creatTd(null, null, showFour(arrOneRecord[0], arrOneRecord[14], arrOneRecord[15], arrOneRecord[16], arrOneRecord[17])));
tr1.appendChild(creatTd(null, null, "" + arrOneRecord[7] + ""));
fra.appendChild(tr1);
//注释
if (arrOneRecord[20] != "" || (arrOneRecord[22] != undefined && arrOneRecord[22] != "")) {
try {
var tr2 = document.createElement("tr");
tr2.align = "center";
tr2.style.backgroundColor = "#FAFAE3";
var explain = PoJie(arrOneRecord[22], arrOneRecord[4], arrOneRecord[5], arrOneRecord[20]);
if (explain != "") {
tr2.appendChild(creatTd("colspan", "11", explain));
fra.appendChild(tr2);
}
} catch (e) { }
}
}
}
}
tBoday.appendChild(fra);
}
//翻译出角球数之类的
function PoJie(explainList, homeTeamID, guestTeamID, tv) {
if (typeof (tv) === "undefined")
tv = "";
if (typeof (removeTV) !== "undefined")
tv = removeTV(tv);
if (explainList == undefined||explainList == "")
return tv;
var exShuZu = explainList.split("|");
var gex2 = exShuZu[1].split(";");
var explainTemp = "";
//得分
if (explainTemp != "" && exShuZu[3] != ";;;;")
explainTemp += "
";
var gex4 = exShuZu[3].split(";");
if (gex4[0] != "")
explainTemp += gex4[0].replace(",", "分钟[") + "],";
if (gex4[1] != "")
explainTemp += "二回合[" + gex4[1] + "],";
if (gex4[2] != "")
explainTemp += gex4[2].replace("1,", "120分钟[").replace("2,", "加时[") + "],";
if (gex4[3] != "")
explainTemp += "点球[" + gex4[3] + "],";
if (gex4[4] == "1")
explainTemp += teamHelper["T_" + homeTeamID][1 + lang] + "赢";
else if (gex4[4] == "2")
explainTemp += teamHelper["T_" + guestTeamID][1 + lang] + "赢";
return explainTemp + (tv !== "" ? "
" + tv : "");
}
function creatTd(attrName, attrVal, txt) {
try {
var td = document.createElement(" | ");
td.innerHTML = txt;
return td;
} catch (e) {
var td = document.createElement("td");
if (attrName != null) {
td.setAttribute(attrName, attrVal);
}
td.innerHTML = txt;
return td;
}
}
function creatTd2(attrName, attrVal, attrName2, attrVal2, txt) {
try {
var td = document.createElement(" | ");
td.innerHTML = txt;
return td;
} catch (e) {
var td = document.createElement("td");
td.setAttribute(attrName, attrVal);
td.setAttribute(attrName2, attrVal2);
td.innerHTML = txt;
return td;
}
}
//赛程显示比分
function showScheScore(sscore) {
if (sscore.indexOf("|") != -1) {
return sscore.split("|")[lang];
}
return sscore;
}
//让球显示,中英文
var GoalCn = ["平手", "平/半", "半球", "半/一", "一球", "一/球半", "球半", "半/二", "二球", "二/半", "二球半", "半/三", "三球", "三/半", "三球半", "半/四", "四球", "四/半", "四球半", "半/五", "五球", "五/半", "五球半", "五球半/六球", "六球", "六球/六球半", "六球半", "六球半/七球", "七球", "七球/七球半", "七球半", "七球半/八球", "八球", "八球/八球半", "八球半", "八球半/九球", "九球", "九球/九球半", "九球半", "九球半/十球", "十球"];
var GoalEn = ["0", "0/0.5", "0.5", "0.5/1", "1", "1/1.5", "1.5", "1.5/2", "2", "2/2.5", "2.5", "2.5/3", "3", "3/3.5", "3.5", "3.5/4", "4", "4/4.5", "4.5", "4.5/5", "5", "5/5.5", "5.5", "5.5/6", "6", "6/6.5", "6.5", "6.5/7", "7", "7/7.5", "7.5", "7.5/8", "8", "8/8.5", "8.5", "8.5/9", "9", "9/9.5", "9.5", "9.5/10", "10"];
function showLetGoal(goal) {
try {
var Goal2GoalCn = "";
var goalKind = parseInt((goal * 4.0).toString());
if (goal >= 0) {
Goal2GoalCn = GoalCn[goalKind] + "|" + GoalEn[goalKind];
}
else {
goalKind = Math.abs(goalKind);
var enGoals = GoalEn[goalKind].split("/");
var s = "";
if (enGoals[0] !== "0") {//第一个数字为0则不显示负号
if (enGoals.length == 2)
s = "-" + enGoals[0] + "/-" + enGoals[1];
else
s = "-" + enGoals[0];
} else {
if (enGoals.length == 2)
s = enGoals[0] + "/-" + enGoals[1];
else
s = enGoals[0];
}
Goal2GoalCn = "*" + GoalCn[goalKind] + "|" + s;
}
if (lang == 2)//英文
return Goal2GoalCn.split("|")[1];
return Goal2GoalCn.split("|")[0];
} catch (e) {
return "";
}
}
//析,欧,亚,大
function showFour(scheid, x, o, y, d) {
var str = "";
if (x != 0)
str += "[析]";
if (o != 0)
str += "[欧]";
if (x + o + y + d > 2)
str += "
";
if (y != 0)
str += "[亚]";
if (d != 0)
str += "[大]";
return str;
}
function changeSeason() {
var seasonList = document.getElementById("seasonList");
var season = seasonList.options[seasonList.selectedIndex].value;
var ul = "/cn/CupMatch/?matchSeason=" + season + "&sclassID=" + arrCup[0] ;
window.location.href = ul;
// window.location.href = "CupMatch.aspx?matchSeason=" + season + "&sclassID=" + arrCup[0] + "&lang=" + lang;
}