var GoalCn = "平手,平/半,半球,半/一,一球,一/球半,球半,球半/两,两球,两/两球半,两球半,两球半/三,三球,三/三球半,三球半,三球半/四球,四球,四球/四球半,四球半,四球半/五球,五球,五球/五球半,五球半,五球半/六球,六球,六球/六球半,六球半,六球半/七球,七球,七球/七球半,七球半,七球半/八球,八球,八球/八球半,八球半,八球半/九球,九球,九球/九球半,九球半,九球半/十球,十球".split(",");
function Goal2GoalCn(goal) { //数字让球转汉汉字
if (goal >= 0) return GoalCn[parseInt(goal * 4)];
else return "受让" + GoalCn[Math.abs(parseInt(goal * 4))];
}
function ShowHtml(teamid) {
var html = [], bgcolor = "", searchTeam = "";
var bigNum = 0, victoryNum = 0, singleNum = 0, j = 0, win1;
var drawNum = 0, lossNum = 0;
var win = 0, standoff = 0;
var countInfo = "";
html.push("
");
html.push("");
html.push("| 赛事 | ");
html.push("时间 | ");
html.push("主场球队 | ");
html.push("比分 | ");
html.push("客场球队 | ");
html.push("半场 | ");
html.push("胜负 | ");
html.push("让球 | ");
html.push("盘路 | ");
html.push("大小 | ");
html.push("单双 | ");
html.push("
");
for (var i = 0; i < a.length; i++) {
var b = a[i];
if (j >= num) continue;
if (kind == 1 && b[6] != teamid && b[7] != teamid) continue;
if (kind == 2 && (b[6] != hometeamid && teamid == hometeamid || b[7] != guestteamid && teamid == guestteamid)) continue;
if (kind == 3 && (b[6] != teamid && b[7] != teamid || b[1] != sclass)) continue;
bgcolor = (bgcolor == "#FFFFFF") ? "#F4F8FF" : "#FFFFFF";
html.push("");
html.push("| " + b[1] + " | ");
html.push("" + b[3] + " | ");
if (teamid == b[6]) //主场
{
html.push("" + (parseInt(b[13]) > 0 ? "" + b[13] + " " : "") + "" + b[4] + " | ");
html.push("" + b[8] + "-" + b[9] + " | ");
html.push("" + (parseInt(b[14]) > 0 ? "" + b[14] + " " : "") + "" + b[5] + " | ");
html.push("" + b[10] + "-" + b[11] + " | ");
if (b[8] > b[9]) html.push("胜 | ");
if (b[8] == b[9]) html.push("平 | ");
if (b[8] < b[9]) html.push("负 | ");
if (b[8] > b[9]) victoryNum++;
if (b[8] == b[9]) drawNum++;
if (b[8] < b[9]) lossNum++;
html.push("" + Goal2GoalCn(b[12]) + " | ");
if (b[8] - b[12] > b[9]) { html.push("赢 | "); win++; }
if (b[8] - b[12] == b[9]) { html.push("走 | "); standoff++ }
if (b[8] - b[12] < b[9]) html.push("输 | ");
}
else //客场
{
html.push("" + (parseInt(b[13]) > 0 ? "" + b[13] + " " : "") + "" + b[4] + " | ");
html.push("" + b[8] + "-" + b[9] + " | ");
html.push("" + (parseInt(b[14]) > 0 ? "" + b[14] + " " : "") + "" + b[5] + " | ");
html.push("" + b[10] + "-" + b[11] + " | ");
if (b[8] < b[9]) html.push("胜 | ");
if (b[8] == b[9]) html.push("平 | ");
if (b[8] > b[9]) html.push("负 | ");
if (b[8] < b[9]) victoryNum++;
if (b[8] == b[9]) drawNum++;
if (b[8] > b[9]) lossNum++;
html.push("" + Goal2GoalCn(b[12]) + " | ");
if (b[8] - b[12] < b[9]) { html.push("赢 | "); win++; }
if (b[8] - b[12] == b[9]) { html.push("走 | "); standoff++ }
if (b[8] - b[12] > b[9]) html.push("输 | ");
}
if (b[8] + b[9] > 2.5) {
html.push("大 | ");
bigNum++;
}
else
html.push("小 | ");
if ((b[8] + b[9]) % 2 == 1) {
html.push("单 | ");
singleNum++;
}
else
html.push("双 | ");
html.push("
");
j++;
if (b[6] == teamid)
searchTeam = b[4];
else
searchTeam = b[5];
}
if (j == 0)
html.push("| 无相关记录 |
");
html.push("
");
if (j > 0) {
if (j - standoff > 0)
win1 = Math.round(win / (j - standoff) * 1000) / 10;
else
win1 = "0";
countInfo = "| " + searchTeam + " | 最近 " + j + " 场 | 胜率:" + Math.round(victoryNum / j * 1000) / 10 + "% | 和局:" + Math.round(drawNum / j * 1000) / 10 + "% | 输率:" + Math.round(lossNum / j * 1000) / 10 + "% | 让胜率:" + win1 + "% | 大球:" + Math.round(bigNum / j * 1000) / 10 + "% | 单:" + Math.round(singleNum / j * 1000) / 10 + "% |
";
}
if (teamid == hometeamid)
return html.join("") + countInfo;
else
return countInfo + html.join("");
}
function select(k) {
kind = k;
if (kind == 1) {
document.getElementById("tabid1").className = "gl_on";
document.getElementById("tabid2").className = "";
document.getElementById("tabid3").className = "";
}
if (kind == 2) {
document.getElementById("tabid1").className = "";
document.getElementById("tabid2").className = "gl_on";
document.getElementById("tabid3").className = "";
}
if (kind == 3) {
document.getElementById("tabid1").className = "";
document.getElementById("tabid2").className = "";
document.getElementById("tabid3").className = "gl_on";
}
document.getElementById("league1").innerHTML = ShowHtml(hometeamid);
document.getElementById("league2").innerHTML = ShowHtml(guestteamid);
}
function set_num(n) {
document.getElementById("td" + num).className = "";
document.getElementById("td" + n).className = "kl_on";
num = n;
select(kind);
}
function showgoallist(id) {
//window.open("/detail/score_cn.html?id=" + id + "cn", "", "scrollbars=yes,resizable=yes,width=668, height=370");
window.open("/detail/score_cn.html?id=" + id + "cn");
}