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 ShowLeaLetGoal(SclassID, selectSeason,SclassName) { bomHelper.ajaxGet("/jsData/letGoal/" + selectSeason + "/l" + SclassID + ".js", function(data) { try { eval(data); this.showHtml = function(name, panLu) { var ss = "" + name + "" + panLu[2] + "" + panLu[3] + "" + panLu[4] + "" + panLu[5] + "" + panLu[6] + "" + panLu[7] + "" + panLu[8] + "" + panLu[9] + "" + panLu[10] + "%" + panLu[11] + "%" + panLu[12] + "%" + panLu[0] + ""; return ss; } this.findTeam = function(TeamID, arrPanLu) { for (var i = 0; i < arrPanLu.length; i++) { var oneRe = arrPanLu[i]; if (TeamID == oneRe[1]) { return oneRe; } } return null; } var arrHtml = new Array(); var tableHtml = "
    "; //总积分的扣分 var ttPanlu = this.findTeam(teamDetail[0], TotalPanLu); var hPanlu = this.findTeam(teamDetail[0], HomePanLu); var gPanlu = this.findTeam(teamDetail[0], GuestPanLu); if (ttPanlu != null && hPanlu != null && gPanlu != null) { arrHtml.push("
    " + selectSeason + " " + SclassName + " " + _locModel.T.T_HandicapOddsOfSeason + "
    "); arrHtml.push(tableHtml); arrHtml.push(_$("tplLetgoal").innerHTML); arrHtml.push(this.showHtml(_locModel.T.T_Total, ttPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Home, hPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Away, gPanlu)); arrHtml.push("
    "); } //半场积分 var tthPanlu = this.findTeam(teamDetail[0], TotalHalfPanLu); var hhPanlu = this.findTeam(teamDetail[0], HomeHalfPanLu); var ghPanlu = this.findTeam(teamDetail[0], GuestHalfPanLu); if (tthPanlu != null && hhPanlu != null && ghPanlu != null) { arrHtml.push("
    " + selectSeason + " " + SclassName + " " + _locModel.T.T_HalfMatchHandicapOdds + "
    "); arrHtml.push(tableHtml); arrHtml.push(_$("tplLetgoal").innerHTML); arrHtml.push(this.showHtml(_locModel.T.T_Total, tthPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Home, hhPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Away, ghPanlu)); arrHtml.push(""); } ShowBigSmall(SclassID, selectSeason, SclassName, arrHtml.join('')); } catch (e) { document.getElementById("div_Table2").innerHTML = _locModel.T.T_NoData; console.log(e); } }); } //大小球---------------- function ShowBigSmall(SclassID, selectSeason, SclassName, letGoalHtml) { bomHelper.ajaxGet("/jsData/bigSmall/" + selectSeason + "/bs" + SclassID + ".js", function(data) { try { eval(data); this.showHtml = function(name, panLu) { var ss = "" + name + "" + panLu[2] + "" + panLu[3] + "" + panLu[4] + "" + panLu[5] + "" + panLu[6] + "" + panLu[7] + "" + panLu[8] + "" + panLu[0] + ""; return ss; } this.findTeam = function(TeamID, arrPanLu) { for (var i = 0; i < arrPanLu.length; i++) { var oneRe = arrPanLu[i]; if (TeamID == oneRe[1]) { return oneRe; } } return null; } var arrHtml = new Array(); var tableHtml = "
    "; //总积分的扣分 var ttPanlu = this.findTeam(teamDetail[0], TotalBs); var hPanlu = this.findTeam(teamDetail[0], HomeBs); var gPanlu = this.findTeam(teamDetail[0], GuestBs); if (ttPanlu != null && hPanlu != null && gPanlu != null) { arrHtml.push("
    " + selectSeason + " " + SclassName + " " + _locModel.T.T_OverUnderOddsOfSeason + "
    "); arrHtml.push(tableHtml); arrHtml.push(_$("tplOu").innerHTML); arrHtml.push(this.showHtml(_locModel.T.T_Total, ttPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Home, hPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Away, gPanlu)); arrHtml.push("
    "); } //半场积分 var tthPanlu = this.findTeam(teamDetail[0], TotalBsHalf); var hhPanlu = this.findTeam(teamDetail[0], HomeBsHalf); var ghPanlu = this.findTeam(teamDetail[0], GuestBsHalf); if (tthPanlu != null && hhPanlu != null && ghPanlu != null) { arrHtml.push("
    " + selectSeason + " " + SclassName + " " + _locModel.T.T_HalfMatchOverUnderOdds + "
    "); arrHtml.push(tableHtml); arrHtml.push(_$("tplOu").innerHTML); arrHtml.push(this.showHtml(_locModel.T.T_Total, tthPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Home, hhPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Away, ghPanlu)); arrHtml.push(""); } var divTable2 = document.getElementById("div_Table2"); divTable2.innerHTML = letGoalHtml+arrHtml.join(''); } catch (e) { console.log(e); } }); } function changeSeason(obj) { var sclassid = obj.options[obj.selectedIndex].value; var sclassName = obj.options[obj.selectedIndex].text; ShowLeaLetGoal(sclassid,selectSeason,sclassName); }; 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; };