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(""); // } // arrHtml1.push("
" + oneRecord[1] + "" + ShowCaptain(oneRecord) + "" + oneRecord[2 + lang] + "
"); // 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("") // } // arrHtml1.push("
" + oneRecord[1] + "" + ShowCaptain(oneRecord) + "" + oneRecord[2 + lang] + "
"); // 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("") // } // arrHtml1.push("
" + oneRecord[1] + "" + ShowCaptain(oneRecord) + "" + oneRecord[2 + lang] + "
"); // 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("") // } // arrHtml1.push("
" + oneRecord[1] + "" + ShowCaptain(oneRecord) + "" + oneRecord[2 + lang] + "
"); // return arrHtml1.join(''); // } // //转会:转出 // this.ShowTurnOut = function() { // var arrHtml1 = new Array(); // arrHtml1.push("
Departure
"); // arrHtml1.push(""); // arrHtml1.push(""); // arrHtml1.push("
 No Information
"); // return arrHtml1.join(''); // } // //转会:转入 // this.ShowTurnIn = function() { // var arrHtml1 = new Array(); // arrHtml1.push("
Join in
"); // arrHtml1.push(""); // arrHtml1.push(""); // arrHtml1.push("
 No Information
"); // 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 'captain'; break; // case 5: return 'vicecaptain'; 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 Team_SelectLogic(selectDom) { this.dom = selectDom; this.Show = function (SelectTeamID) { var htmlArray = new Array(); for (var i = 0; i < arrTeam.length; i++) { var oneRecord = arrTeam[i]; htmlArray.push(' '); } this.dom.innerHTML = htmlArray.join(''); } this.Change = function () { var value = this.dom.value; window.location.href = value; } } function GetPlayers(TeamID) { function DefaultStr(firstStr, secondStr, middleStr) { var reStr = "-"; if (!!firstStr && firstStr != 0) { reStr = firstStr; if (secondStr != null && typeof (secondStr) != 'undefined' && secondStr != '') { reStr += (middleStr != null && typeof (middleStr) != 'undefined' && middleStr != '' ? middleStr : "") + secondStr; } } return reStr; } function ShowCaptain(captainID) { var reStr = ""; switch (captainID) { case '1': reStr = 'captain'; break; case '5': reStr = 'captain'; break; } return reStr; } var arrHtml = new Array(); arrHtml.push(""); arrHtml.push(_$("tplHeader").innerHTML); if (lineupDetail[0][1] && !lineupDetail[0][8]) lineupDetail[0][8] = "Coach"; for (var i = 0; i < lineupDetail.length; i++) { var oneRecord = lineupDetail[i]; arrHtml.push(" "); } document.getElementById("main_dt").innerHTML = arrHtml.join(''); } function toExp(val) { if (/(\d)/.test(val)) { return (parseFloat(val) / 100).toFixed(4); } return val; }; function MathHelp() { this.Sum = function(list) { return eval(list.join("+")); } this.Avg = function(list, fixed) { return Divide(this.Sum(list), list.length, fixed); } this.Divide = function(dividend, divisor, fixed) { if (isNaN(divisor) || divisor == 0 || dividend == 0) return 0; var reValue = dividend / divisor; if (isNaN(fixed)) return reValue; else return reValue.toFixed(fixed); } } Number.prototype.toFixed = function (s) { changenum = (parseInt(this * Math.pow(10, s) + 0.5) / Math.pow(10, s)).toString(); return changenum; } function VerifyHelp() { this.IsArray=function(o) { return Object.prototype.toString.call(o) === '[object Array]'; } this.IsNum=function (s) { if (s != null && s != "") { return !isNaN(s); } return false; } } function $_(q, o) { if (typeof (q) !== 'string' || q == '') return []; var ss = q.split(' '); var attr = ''; var s = ss[0].split(':')[0]; if (s != ss[0]) attr = ss[0].split(':')[1]; var val = s.split('[')[0]; if (val != s) val = s.split('[')[1].replace(/[",\]]/g, ''); else val = ''; s = s.split('[')[0]; var obj = []; var sObj = null; o = o || document; switch (s.charAt(0)) { case '#': sObj = document.getElementById(s.substr(1)); if (sObj) obj.push(sObj); break; case '.': var l = o.getElementsByTagName('*'); var c = s.substr(1); for (var i = 0; i < l.length; i++) if (l[i].className.search('\\b' + c + '\\b') != -1) obj.push(l[i]); break; default: obj = o.getElementsByTagName(s); break; } if (val) { var l = []; var a = val.split('='); for (var i = 0; i < obj.length; i++) { switch (a.length) { case 1: if (obj[i].getAttribute(a[0]) != null) l.push(obj[i]); break; case 2: if (obj[i].getAttribute(a[0]) == a[1]) l.push(obj[i]); break; } } obj = l; } if (attr) { var l = []; for (var i = 0; i < obj.length; i++) if (obj[i][attr]) l.push(obj[i]); obj = l; } if (ss.length > 1) { var l = []; for (var i = 0; i < obj.length; i++) { var ll = arguments.callee(q.substr(ss[0].length + 1), obj[i]); if (ll.tagName) l.push(ll); else for (var j = 0; j < ll.length; j++) l.push(ll[j]); } obj = l; } if (sObj && ss.length == 1) { obj = sObj; if (obj) obj.length = 1; } else { var l = []; for (var i = 0; i < obj.length; i++) obj[i].$isAdd = false; for (var i = 0; i < obj.length; i++) { if (!obj[i].$isAdd) { obj[i].$isAdd = true; l.push(obj[i]); } } obj = l; } return obj; };