function rightSide() {
this.Decrypt2 = function(data) {
var b = (7 * (data - 6) % 10 + 10) % 10;
return b.toString();
}
this.Decrypt = function(playerID) {
playerID = playerID.toString();
var arrID = new Array();
for (var i = 0; i < playerID.length; i = i + 1) {
var a = playerID.substr(i, 1);
switch (a) {
case "0": arrID.push(this.Decrypt2(0)); break;
case "4": arrID.push(this.Decrypt2(1)); break;
case "5": arrID.push(this.Decrypt2(2)); break;
case "3": arrID.push(this.Decrypt2(3)); break;
case "6": arrID.push(this.Decrypt2(4)); break;
case "9": arrID.push(this.Decrypt2(5)); break;
case "7": arrID.push(this.Decrypt2(6)); break;
case "1": arrID.push(this.Decrypt2(7)); break;
case "2": arrID.push(this.Decrypt2(8)); break;
case "8": arrID.push(this.Decrypt2(9)); break;
}
}
return arrID.join('');
}
// //守门员
// this.ShowGoalkeeper = function() {
// var arrHtml1 = new Array();
// arrHtml1.push("
Goalkeeper
");
// arrHtml1.push("");
// for (var i = 0; i < goalkeeper.length; i++) {
// var oneRecord = goalkeeper[i];
// arrHtml1.push("" + oneRecord[1] + " | " + ShowCaptain(oneRecord) + "" + oneRecord[2 + lang] + " |
");
// }
// arrHtml1.push("
");
// return arrHtml1.join('');
// }
// //后卫
// this.ShowRearguard = function() {
// var arrHtml1 = new Array();
// arrHtml1.push("Defender
");
// arrHtml1.push("");
// for (var i = 0; i < rearguard.length; i++) {
// var oneRecord = rearguard[i];
// arrHtml1.push("" + oneRecord[1] + " | " + ShowCaptain(oneRecord) + "" + oneRecord[2 + lang] + " |
")
// }
// arrHtml1.push("
");
// return arrHtml1.join('');
// }
// //中场
// this.ShowMidfielder = function() {
// var arrHtml1 = new Array();
// arrHtml1.push("Midfielder
");
// arrHtml1.push("");
// for (var i = 0; i < midfielder.length; i++) {
// var oneRecord = midfielder[i];
// arrHtml1.push("" + oneRecord[1] + " | " + ShowCaptain(oneRecord) + "" + oneRecord[2 + lang] + " |
")
// }
// arrHtml1.push("
");
// return arrHtml1.join('');
// }
// //前锋
// this.ShowVanguard = function() {
// var arrHtml1 = new Array();
// arrHtml1.push("Striker
");
// arrHtml1.push("");
// for (var i = 0; i < vanguard.length; i++) {
// var oneRecord = vanguard[i];
// arrHtml1.push("" + oneRecord[1] + " | " + ShowCaptain(oneRecord) + "" + oneRecord[2 + lang] + " |
")
// }
// arrHtml1.push("
");
// return arrHtml1.join('');
// }
// //转会:转出
// this.ShowTurnOut = function() {
// var arrHtml1 = new Array();
// arrHtml1.push("Departure
");
// arrHtml1.push("");
// arrHtml1.push(" | No Information |
");
// arrHtml1.push("
");
// return arrHtml1.join('');
// }
// //转会:转入
// this.ShowTurnIn = function() {
// var arrHtml1 = new Array();
// arrHtml1.push("Join in
");
// arrHtml1.push("");
// arrHtml1.push(" | No Information |
");
// arrHtml1.push("
");
// return arrHtml1.join('');
// }
// function ShowCaptain(oneRecord) {
// if (Object.prototype.toString.call(oneRecord) !== '[object Array]' || oneRecord.length < 6) {
// return '';
// }
// var imageUlr = "/images/"
// switch (oneRecord[5]) {
// case 1: return ''; break;
// case 5: return ''; break;
// }
// return '';
// }
// //document.getElementById("i_right").innerHTML = "" + this.ShowGoalkeeper() + this.ShowRearguard() + this.ShowMidfielder() + this.ShowVanguard() + this.ShowTurnOut() + this.ShowTurnIn() + "
";
}
//头部信息
function mainTitle(teamDetail) {
var ri = new rightSide();
var coachID = 0, coachName = "";
if (window.coach && window.coach.length) {
coachID = ri.Decrypt(coach[0][0]);
coachName = coach[0][2] || coach[0][4];
}
var mainDiv = document.getElementById("mainTitle");
var address = teamDetail[15] && !/[\u4E00-\u9FA5]/.test(teamDetail[15]) ? teamDetail[15] : "";//忽略中文
var coachUrl = teamDetail[13];
//修正部分不是http开头的网址
if (coachUrl !== null && coachUrl.indexOf("www") == 0) {
coachUrl = "//" + coachUrl;
}
mainDiv.innerHTML = _$("tplMainTitle").innerHTML.format(
/*0*/(teamDetail[4] == "" ? _teamIcon : changeGif("/Image/team/" + teamDetail[4]) + "?" + Math.floor(Math.random() * 10)),
/*1*/teamDetail[3] == "" ? teamDetail[2] : teamDetail[3],
/*2*/_moduleKey == 'thai' || _moduleKey == 'vn' ? teamDetail[2] : "",
/*3*/handleEmpty(teamDetail[7]),
/*4*/handleEmpty(teamDetail[10]),
/*5*/handleEmpty(teamDetail[11]),
/*6*/handleEmpty(dateToTime(teamDetail[12])),
/*7*/"",
/*8*/(coachID == 0 ? handleEmpty(coachName) : "" + handleEmpty(coachName) + ""),
/*9*/coachUrl,
/*10*/!teamDetail[13] ? "hide" : "",
/*11*/handleEmpty(address));
try {
if (typeof (forLoc) != "undefined" && forLoc) {
var indItem = document.getElementById("introduce1");
if (indItem && teamDetail[14] != "") indItem.innerHTML = teamDetail[14]; //把不需要显示球队简介的id给去掉则抛出异常
else {
if (document.getElementById("introduce_div")) document.getElementById("introduce_div").style.display = "none";
}
}
else {
var indItem = document.getElementById("introduce");
if(indItem) indItem.style.display = "none";
}
guiderBar();
} catch (e) { }
//初始化关注图标
if (Config.getFavTeamIds().indexOf(teamDetail[0].toString()) != -1) {
$("#favTeamIcon").addClass("on");
$("#favTeamIcon").html(_locModel.T.T_Btn_Following + "");
};
}
function guiderBar() {
if (!_$("guiderBarList")) return;
var html = new Array();
html.push(getGuiderLi("/", _locModel.T.T_Database));
if (typeof (arrLeague) != "undefined" && arrLeague[0]) {
if (arrLeague[0] == 91) html.push(getGuiderLi("/fifa.html", arrLeague[3], 1)); //国家队转到世界排名页面
else html.push(getGuiderLi("/leagueinfo/" + arrLeague[0] + ".html", arrLeague[3], 1));
}
document.getElementById('guiderBarList').innerHTML = html.join('');
}
function getGuiderLi(link, title, lastf) {
return [
'',
'',
title == '' ? '' : '' + title + '',
''
].join('');
}
function handleEmpty(str) {
if (CheckEmpty(str)) {
return "-";
} else {
return str;
}
};
//左边的信息
function leftSide() {
if (_moduleKey == 'thai' || _moduleKey == 'sagor' || _moduleKey == 'vn' || _moduleKey == 'tyso' || _moduleKey == 'kr' || _moduleKey == 'pt' || _moduleKey == 'ind') {
lang = 0;
}
var mainDiv = document.getElementById("i_left2");
var arrHtml = new Array();
// var url = document.URL;
// var rg = /\w{1,15}\.aspx/;
// var murl = url.match(rg);
this.Decrypt2 = function (data) {
var b = (7 * (data - 6) % 10 + 10) % 10;
return b.toString();
}
this.Decrypt = function (playerID) {
playerID = playerID.toString();
var arrID = new Array();
for (var i = 0; i < playerID.length; i = i + 1) {
var a = playerID.substr(i, 1);
switch (a) {
case "0": arrID.push(this.Decrypt2(0)); break;
case "4": arrID.push(this.Decrypt2(1)); break;
case "5": arrID.push(this.Decrypt2(2)); break;
case "3": arrID.push(this.Decrypt2(3)); break;
case "6": arrID.push(this.Decrypt2(4)); break;
case "9": arrID.push(this.Decrypt2(5)); break;
case "7": arrID.push(this.Decrypt2(6)); break;
case "1": arrID.push(this.Decrypt2(7)); break;
case "2": arrID.push(this.Decrypt2(8)); break;
case "8": arrID.push(this.Decrypt2(9)); break;
}
}
return arrID.join('');
}
playerColor = "#00328F";
//教练
this.ShowCoach = function () {
if (typeof (coach) == "undefined" || coach == null) return;
var arrHtml1 = new Array();
arrHtml1.push("" + _locModel.T.T_LP_Coach + "
");
arrHtml1.push("");
for (var i = 0; i < coach.length; i++) {
var oneRecord = coach[i];
arrHtml1.push("" + oneRecord[1] + " | " + oneRecord[2 + lang] + " |
");
}
arrHtml1.push("
");
return arrHtml1.join('');
}
//守门员
this.ShowGoalkeeper = function () {
var arrHtml1 = new Array();
arrHtml1.push("" + _locModel.T.T_LP_GoalKeeper+"
");
arrHtml1.push("");
for (var i = 0; i < goalkeeper.length; i++) {
var oneRecord = goalkeeper[i];
arrHtml1.push("" + oneRecord[1] + " | " + oneRecord[2 + lang] + " |
");
}
arrHtml1.push("
");
return arrHtml1.join('');
}
//后卫
this.ShowRearguard = function () {
var arrHtml1 = new Array();
arrHtml1.push("" + _locModel.T.T_LP_Defender +"
");
arrHtml1.push("");
for (var i = 0; i < rearguard.length; i++) {
var oneRecord = rearguard[i];
arrHtml1.push("" + oneRecord[1] + " | " + oneRecord[2 +lang] + " |
")
}
arrHtml1.push("
");
return arrHtml1.join('');
}
//中场
this.ShowMidfielder = function () {
var arrHtml1 = new Array();
arrHtml1.push("" + _locModel.T.T_LP_Midfielder +"
");
arrHtml1.push("");
for (var i = 0; i < midfielder.length; i++) {
var oneRecord = midfielder[i];
arrHtml1.push("" + oneRecord[1] + " | " + oneRecord[2 +lang] + " |
")
}
arrHtml1.push("
");
return arrHtml1.join('');
}
//前锋
this.ShowVanguard = function () {
var arrHtml1 = new Array();
arrHtml1.push("" + _locModel.T.T_LP_Striker + "
");
arrHtml1.push("");
for (var i = 0; i < vanguard.length; i++) {
var oneRecord = vanguard[i];
arrHtml1.push("" + oneRecord[1] + " | " + oneRecord[2 +lang] + " |
")
}
arrHtml1.push("
");
return arrHtml1.join('');
}
mainDiv.innerHTML = arrHtml.join('') + "" + this.ShowCoach() + this.ShowGoalkeeper() + this.ShowRearguard() + this.ShowMidfielder() + this.ShowVanguard() + "
";
}
function translateWord(str) {
if (_moduleKey.toLowerCase()=="br") {
if (str === 'Striker') return 'Atacante';
}
else if (_moduleKey.toLowerCase() == "rus") {
if (str === 'Striker') return 'Нападающие';
}
else if (_moduleKey.toLowerCase() == "spa") {
if (str === 'Striker') return 'Delantero';
}
return str;
}
function showNowTeam() {
var arrHtml = new Array();
arrHtml.push("");
arrHtml.push(_$("tplCurrent").innerHTML);
var count = 0;
for (var i = 0; i < nowTeamInfo.length; i++) {
var oneRecord = nowTeamInfo[i];
if (oneRecord[5] && oneRecord[6]) {
if (_moduleKey === 'ptg') {
var patt = /\(.*\)/;
if (oneRecord[5].search(patt)>-1) {
var pattResult = patt.exec(oneRecord[5])[0];
oneRecord[5]=oneRecord[5].replace(pattResult,'');
}
}
count++;
var dataHtml = `${oneRecord[6]} | `;
dataHtml += `${oneRecord[1]} | `;
dataHtml += `${oneRecord[5]} | `;
arrHtml.push(`${dataHtml}
`)
}
}
arrHtml.push("
");
if (count != 0) {
document.getElementById("nowTeamDiv").innerHTML = arrHtml.join('');
document.getElementById("nowTeamTitle").style.display = "";
}
}
function showTwoYear() {
if (!twoYear || !twoYear.length)
return;
var nameIdxs = [12, 15], sclassIdx = 3;
switch (_moduleKey) {
case "thai":
nameIdxs = [21, 22];
break;
case "vn":
nameIdxs = [23, 24];
break;
case "kr":
nameIdxs = [25, 26];
break;
case "ind":
nameIdxs = [35, 36];
break;
}
var arrHtml = new Array()
arrHtml.push(" ");
arrHtml.push(_$("tplTwoYear").innerHTML);
for (var i = 0; i < twoYear.length; i++) {
var oneRecord = twoYear[i];
var homeTeam = oneRecord[nameIdxs[0]] == "" ? oneRecord[12] : oneRecord[nameIdxs[0]];
var guestTeam = oneRecord[nameIdxs[1]] == "" ? oneRecord[15] : oneRecord[nameIdxs[1]];
arrHtml.push(" " + oneRecord[sclassIdx] + " | " + timeToText(timeFromE8(oneRecord[4])) + " | " + homeTeam + " | " + oneRecord[7] + "-" + oneRecord[8] + " | " + guestTeam + " | " + oneRecord[18] + " | " + oneRecord[19] + " | " + oneRecord[20] + " | " + (oneRecord[17] < 0 ? 0 : oneRecord[17]) + " | " + (oneRecord[16] < 0 ? 0 : oneRecord[16]) + " |
");
}
arrHtml.push(" " + _locModel.T.T_Total+" | " + playerTotal[0] + " | " + playerTotal[1] + " | " + playerTotal[2] + " | " + playerTotal[3] + " | " + playerTotal[4] + " |
");
document.getElementById("TwoYearDiv").innerHTML = arrHtml.join('');
document.getElementById("TwoYearDiv").style.display = "";
document.getElementById("playerStatic").style.display = "";
}
//转会记录
function showTransferList() {
var v2Show = _moduleKey == 'tyso' || _moduleKey == 'sagor';
if (typeof (transferInfo) == "undefined" || transferInfo == null || !transferInfo.length)
return;
var arrHtml = new Array()
arrHtml.push("");
arrHtml.push(_$("tplTransfer").innerHTML);
for (var i = 0; i < transferInfo.length; i++) {
var oneRecord = transferInfo[i];
if (v2Show) {
arrHtml.push("" + getFormated(dateToTime(oneRecord[3])) + " | " + getFormated(oneRecord[11]) + " | " + getFormated(oneRecord[12]) + " | " + getTranType(oneRecord[10]) + " | " + formatEstValue(getFormated(oneRecord[9])) + " |
");
}
else {
arrHtml.push("" + getFormated(oneRecord[0]) + " | " + getFormated(dateToTime(oneRecord[3])) + " | " + getFormated(dateToTime(oneRecord[4])) + " | " + getFormated(oneRecord[11]) + " | " + getFormated(oneRecord[12]) + " | " + formatEstValue(getFormated(oneRecord[9])) + " | " + getTranType(oneRecord[10]) + " |
");
}
}
arrHtml.push("
");
document.getElementById("TransferDiv").innerHTML = arrHtml.join('');
document.getElementById("TransferDiv").style.display = "";
document.getElementById("TransferTitle").style.display = "";
}
function getHref(value) {
if (value == undefined || value == "") return "";
return " href='" + utTeam(value)+"'";
}
function getTranType(typeNo) {
var msg = "";
switch (parseInt(typeNo)) {
case 1: msg = _locModel.T.T_Zh_OwnedWholly; break;
case 2: msg = _locModel.T.T_Zh_Loan; break;
case 3: msg = _locModel.T.T_Zh_FreeTransfer; break;
case 4: msg = _locModel.T.T_Zh_EndLoan; break;
case 5: msg = _locModel.T.T_Zh_Common; break;
}
return msg;
}
function getFormated(value) {
var reg = /^(\s*)$/g;
if (value == undefined || value == "" || reg.test(value)) return "-";
return value;
}
function formatEstValue(val) {
if (/[\d\.]+/.test(val)) {
return "£" + parseInt(val) / 100.0 + "M";
}
else return '-';
}
function ShowHonor(tableID) {
if (!playerHonor || playerHonor.length < 1)
return;
var htmlArray = new Array();
htmlArray.push('');
htmlArray.push(_$("tplHonor").innerHTML);
for (var i = 0; i < playerHonor.length; i++) {
var oneData = playerHonor[i];
var honorArr = oneData[1].split(',');
htmlArray.push('' + oneData[0].split('^')[dataLang] + ' | ' + honorArr.length + ' | ');
for (var j = 0; j < honorArr.length; j++) {
htmlArray.push('' + honorArr[j] + '');
}
htmlArray.push(' |
');
}
htmlArray.push('
');
document.getElementById(tableID).innerHTML = htmlArray.join('');
document.getElementById(tableID).style.display = "";
document.getElementById("playerHonor").style.display = "";
}
function guiderBar() {
var html = new Array();
html.push(getGuiderLi("/", _locModel.T.T_Database));
if (typeof (arrLeague) != "undefined" && arrLeague[0]) {
html.push(getGuiderLi("/leagueinfo/" + arrLeague[0] , arrLeague[3]));
}
if (typeof (teamDetail) != "undefined" && teamDetail[0]) {
html.push(getGuiderLi(utTeam(teamDetail[0]), teamDetail[3], 1));
}
var glist = document.getElementById('guiderBarList');
if (glist) glist.innerHTML = html.join('');
}
;
function changeTimeZone(value) {
showTwoYear();
if (document.getElementById("lastUpdateTime") && lastUpdateTime && typeof (lastUpdateTime) == "string") {
document.getElementById("lastUpdateTime").innerHTML = _locModel.T.T_LastUpdate + timeToText(timeFromE8(lastUpdateTime));
}
}
;