var _oddsType=GetOddType(),needInitOddsType=!0,CompanyId=0;function LoadLiveFile(){var e=_ENDPOINT_ODDS+"/Ajax/SoccerAjax?type=4&id="+_scheduleID;bomHelper.ajaxGet(e,LoadLiveData),window.setTimeout("LoadLiveFile()",6e4)}function LoadLiveData(e){try{var t="";if(!CheckEmpty(e)){if(0!=(e=JSON.parse(e)).ErrCode)return;if(t=e.Data,!CheckEmpty(t)){var s=t.split("!");if(s.length>0){var a=new Array;a.push("<div>"),a.push('<h2 class="team-table-title">'+_locModel.T.T_TIL_LiveOdds);for(var l=new Array,d="",i=0;i<s.length;i++){var o=s[i].split("#");if(!(o.length<2)){var r=o[0].split(",")[1],n=o[1];l.push("<div id='oddsDiv_"+r+"' class='oddsDiv' style='display:none;'>"),l.push(Maketable(r,n.split("^"))),l.push("</div>"),d+=r+","}}""!=d&&(a.push('<ul id="detail-oddsSel" class="d-flex oddsCompany">'),-1!=d.indexOf("8,")&&a.push('<li id="oddsSel_8" class="active" value="8"><a href="javascript:SwitchOddsComp(8)">Bet365</a></li>'),-1!=d.indexOf("3,")&&a.push('<li id="oddsSel_3" value="3"><a href="javascript:SwitchOddsComp(3)">Crown</a></li>'),-1!=d.indexOf("31,")&&a.push('<li id="oddsSel_31" value="31"><a href="javascript:SwitchOddsComp(31)">Sbobet</a></li>'),a.push("</ul>")),a.push("</h2>"),a.push(l.join("")),a.push('<div class="discription">'),a.push('<span class="hbg-td2"></span>'+_locModel.T.T_HistoryData+"   "),a.push('<span class="hbg-td1"></span>'+_locModel.T.T_LastestData+" </div>"),a.push("</div>"),a.push("</div>"),document.getElementById("oddsDiv").innerHTML=a.join(""),document.getElementById("detail-oddsSel")&&(0==CompanyId&&(CompanyId=document.getElementById("detail-oddsSel").firstChild.getAttribute("value")),SwitchOddsComp(CompanyId)),needInitOddsType=!1}}}}catch(e){console.log(e)}}function SwitchOddsComp(e){$(".oddsDiv").hide(),$("#oddsDiv_"+e).show(),$("#detail-oddsSel li").removeClass("active"),$("#oddsSel_"+e).addClass("active"),CompanyId=e,$("#detail-oddsSel").val(CompanyId)}function Maketable(e,t){var s=new Array;if(void 0!==t&&void 0!==t[0][0]){s.push('<table class="team-table-other oddsTable" width="100%" align="center" cellpadding="0" cellspacing="0" id="oddsTable'+e+'">'),s.push('<tbody id="oddsTbody">'),s.push("<tr>"),s.push('<th rowspan="2" align="center" class="">'+_locModel.T.T_Time+"</th>"),s.push('<th rowspan="2" align="center" class="rl">'+_locModel.T.T_Score+"</th>"),s.push('<th rowspan="2" align="center" class="rl">F/H</th>');var a=_oddsOrder.split("-"),l=0,d="";a.forEach((function(e){d=3==++l?"":"rl",1==e?s.push('<th height="20" colspan="6" align="center" class="'+d+'"><b>'+_locModel.T.T_Handicap+"</b></th>"):2==e?s.push('<th colspan="6" align="center" class="'+d+'"><b>'+_locModel.T.T_1x2+"</b></th>"):3==e&&s.push('<th colspan="6" align="center"class="'+d+'"><b>'+_locModel.T.T_OU+"</b></th>")})),s.push("</tr>"),s.push("<tr>"),s.push('<th height="20" colspan="3" align="center">'+_locModel.T.T_FirstOdds+"</th>"),s.push('<th colspan="3" align="center" class="ll th-bg2 rl">'+_locModel.T.T_LiveOdds+"</th>"),s.push('<th colspan="3" align="center" >'+_locModel.T.T_FirstOdds+"</th>"),s.push('<th colspan="3" align="center" class="ll th-bg2 rl">'+_locModel.T.T_LiveOdds+"</th>"),s.push('<th colspan="3" align="center" >'+_locModel.T.T_FirstOdds+"</th>"),s.push('<th colspan="3" align="center" class="ll th-bg2">'+_locModel.T.T_LiveOdds+"</th>"),s.push("</tr>");for(var i=3,o=0;o<t.length;o++){var r=t[o].split(",");s.push(oneRow(r,o==t.length-1,0));var n=("早餐"==r[0]||"Ear"==r[0]?1:"未开场"==r[0]||"Live"==r[0]?2:3)+"_"+r[1]+"_"+r[2]+"_"+r[39];scoreStateHt.add(n,i+","+(r[39]>1||-1==r[39]?1:2)+","+o),i+=r[39]>1||-1==r[39]?1:2}return s.push("</tbody></table>"),s.join("")}}function ReOrderAd(){var e=2,t=$("#matchData .content .content");if(t.length>0)for(var s=1;s<=t.length&&e<=3;s++){var a=t[s];CheckEmpty(a.innerHTML)||"none"==a.style.display||(a.insertAdjacentElement("afterEnd",document.getElementById("ad"+e)),e++)}}function LoadCornerLiveFile(){var e=document.getElementById("allCornerDate"),t=document.createElement("script");t.type="text/javascript",t.charset="utf-8",t.src="https://data1.api-football.xyz/jsData/corner/"+_scheduleID.substring(0,2)+"/"+_scheduleID.substring(2,4)+"/"+_scheduleID+".js?v="+Date.parse(new Date),e.removeChild(e.firstChild),e.appendChild(t,"script"),window.setTimeout("getcornerxml()",6e3)}function getcornerxml(){if("undefined"!=typeof cOdds&&getSpanHour(_matchTime)<=3){var e="/Ajax/SoccerAjax?type=5&ID="+_scheduleID;bomHelper.ajaxGet(e,refreshCorner),window.setTimeout("getcornerxml()",6e3)}}var zXml={useActiveX:"undefined"!=typeof ActiveXObject,useXmlHttp:"undefined"!=typeof XMLHttpRequest};function Hashtable(){this._hash=new Object,this.add=function(e,t){return void 0!==e&&(this._hash[e]=void 0===t?null:t,!0)},this.remove=function(e){delete this._hash[e]},this.keys=function(){var e=new Array;for(var t in this._hash)e.push(t);return e},this.count=function(){var e=0;for(var t in this._hash)e++;return e},this.items=function(e){return this._hash[e]},this.contains=function(e){return void 0!==this._hash[e]},this.clear=function(){for(var e in this._hash)delete this._hash[e]}}zXml.ARR_XMLHTTP_VERS=["MSXML2.XmlHttp.6.0","MSXML2.XmlHttp.3.0"];var scoreStateHt=new Hashtable;function getCookie(e){var t=e+"=",s=document.cookie;return s.length>0&&(begin=s.indexOf(t),-1!=begin)?(begin+=t.length,end=s.indexOf(";",begin),-1==end&&(end=s.length),s.substring(begin,end)):null}function writeCookie(e,t){delCookie(e);var s="";s=";path=/;expires="+(s=new Date((new Date).getTime()+1314e6)).toGMTString()+";domain="+getDoMain(),document.cookie=e+"="+t+s}function delCookie(e){var t=new Date;t.setTime(t.getTime()-36e5);var s=getCookie(e);null!=s&&"null"!=s&&(document.cookie=e+"="+s+";expires="+t.toGMTString())}var oXmlHttp=zXmlHttp.createRequest(),oXmlCornerHttp=zXmlHttp.createRequest(),oldXml="",oldCornerXml="",ieNum=0;try{document.all&&void 0!==document.documentMode&&(ieNum=document.documentMode)}catch(e){ieNum=0}function getSpanHour(e){var t=((new Date).getTime()-e.getTime())%864e5;return Math.floor(t/36e5)}function restoreOddsColor(e){var t=document.getElementById("oddsTable");if(null!=t){var s=t.rows[t.rows.length-2],a=t.rows[t.rows.length-1];if(e>1)var l=t.rows[t.rows.length-4],d=t.rows[t.rows.length-3];for(var i=4;i<s.cells.length;i++)s.cells[i].innerHTML=s.cells[i].innerHTML.toLowerCase().replace(/<span class=[/"]?up[/"]?>/g,"").replace(/<span class=[/"]?down[/"]?>/g,"").replace(/<\/span>/g,"");for(i=4;i<a.cells.length;i++)a.cells[i].innerHTML=a.cells[i].innerHTML.toLowerCase().replace(/<span class=[/"]?up[/"]?>/g,"").replace(/<span class=[/"]?down[/"]?>/g,"").replace(/<\/span>/g,"");if(e>1){for(i=4;i<l.cells.length;i++)l.cells[i].innerHTML=l.cells[i].innerHTML.toLowerCase().replace(/<span class=[/"]?up[/"]?>/g,"").replace(/<span class=[/"]?down[/"]?>/g,"").replace(/<\/span>/g,"");for(i=4;i<d.cells.length;i++)d.cells[i].innerHTML=d.cells[i].innerHTML.toLowerCase().replace(/<span class=[/"]?up[/"]?>/g,"").replace(/<span class=[/"]?down[/"]?>/g,"").replace(/<\/span>/g,"")}}}function changeOddsType(){LoadLiveFile(),makecornertable()}function isInsert(e){var t=("早餐"==e[0]?1:"未开场"==e[0]?2:3)+"_"+e[1]+"_"+e[2]+"_"+e[39];return!scoreStateHt.contains(t)}function translate(e){return"早餐"==e?_locModel.T.T_Early:"未开场"==e?_locModel.T.T_Live:"中场"==e?_locModel.T.T_HalfTime:e}function oneRow(e,t,s){var a=e;s>0&&(a=e.split(","));var l=new Array,d="早餐"==a[0]||"Ear"==a[0]||"未开场"==a[0]||"Live"==a[0]?" ":a[1]+":"+a[2],i="早餐"==a[0]||"Ear"==a[0]?"fx-green":"未开场"==a[0]||"Live"==a[0]||"Trực tuyến"==a[0]?"fx-red":"fx-blue",o="",r=a[39]>1||-1==a[39];if(0==s&&l.push("<tr "+(t?" odds='"+e+"'":"")+">"),0==s||1==s){o=1==a[39]&&""!=a[0]&&parseInt(a[0].toString())>45?"45":a[0],l.push('<td width="80"'+(r?"":' rowspan="2"')+' align="center" class="'+i+'" >'+translate(o)+"</td>"),l.push('<td width="50"'+(r?"":' rowspan="2"')+' align="center"  class="red_number rl">'+d+"</td>"),l.push('<td width="50" height="24" align="center" class="rl">'+(r?_locModel.T.T_FT:_locModel.T.T_HT)+"</td>");var n=_oddsOrder.split("-"),c=0;n.forEach((function(e){if(c++,1==e)for(var s=0;s<6;s++){var d=3+s;r&&(d=9+s);var i=s<3?"#FFFFFF":t?"hbg-td1":"hbg-td2",o="";3==s&&(o="ll"),5==s&&c!=n.length&&(o="rl");var h="",p=a[d];1==s||4==s?p=Goal2GoalCn(a[d]):(h=p,p=oTool.changePL(_oddsType,p)),l.push('<td data-o="'+h+'" width="'+(1==s||4==s?"70":"40")+'" align="center" class=" '+o+" "+i+'">'+(void 0!==a[d]&&""!=String(a[d])?p:" ")+"</td>")}else if(2==e)for(s=0;s<6;s++){d=27+s;r&&(d=33+s);i=s<3?"#FFFFFF":t?"hbg-td1":"hbg-td2",o="";3==s&&(o="ll"),5==s&&c!=n.length&&(o="rl");h=a[d],p=oTool.changePL(_oddsType,h,!0);l.push('<td data-o="'+h+'" width="'+(1==s||4==s?"70":5==s?42:"40")+'" align="center"'+(""!=i?' class=" '+o+" "+i+'"':"")+">"+(t&&s>=3?'<span class="isnew">':"")+(void 0!==a[d]&&""!=String(a[d])?p:"&nbsp;")+(t&&s>3?"</span>":"")+"</td>")}else if(3==e)for(s=0;s<6;s++){d=15+s;r&&(d=21+s);i=s<3?"#FFFFFF":t?"hbg-td1":"hbg-td2",o="";3==s&&(o="ll"),5==s&&c!=n.length&&(o="rl");h="",p=a[d];1==s||4==s?p=Goal2CnOU(a[d]):(h=p,p=oTool.changePL(_oddsType,p)),l.push('<td data-o="'+h+'" width="'+(1==s||4==s?"70":5==s?42:"40")+'" align="center"'+(0==s?' class=" "':"")+(""!=i?' class=" '+o+" "+i+'"':"")+">"+(t&&s>=3?'<span class="isnew">':"")+(void 0!==a[d]&&""!=String(a[d])?p:" ")+(t&&s>3?"</span>":"")+"</td>")}}))}return 0==s&&(l.push("</tr>"),r||l.push('<tr bgcolor="#FFFFFF">')),r||0!=s&&2!=s||(l.push('<td height="24" align="center" class="rightline rl">'+_locModel.T.T_FT+"</td>"),c=0,n.forEach((function(e){if(c++,1==e)for(var s=0;s<6;s++){var d=9+s,i=s<3?"#FFFFFF":t?"hbg-td1":"hbg-td2",o="";3==s&&(o="ll"),5==s&&c!=n.length&&(o="rl");var r="",h=a[d];1==s||4==s?h=Goal2GoalCn(a[d]):(r=h,h=oTool.changePL(_oddsType,h)),l.push('<td data-o="'+r+'" align="center"'+(""!=i?' class=" '+o+" "+i+'"':"")+">"+(void 0!==a[d]&&""!=String(a[d])?h:" ")+"</td>")}else if(2==e)for(s=0;s<6;s++){d=33+s,i=s<3?"#FFFFFF":t?"hbg-td1":"hbg-td2",o="";3==s&&(o="ll"),5==s&&c!=n.length&&(o="rl");r=a[d],h=oTool.changePL(_oddsType,r,!0);l.push('<td data-o="'+r+'" align="center"'+(""!=i?' class=" '+o+" "+i+'"':"")+">"+(t&&s>=3?'<span class="isnew">':"")+(void 0!==a[d]&&""!=String(a[d])?h:"&nbsp;")+(t&&s>3?"</span>":"")+"</td>")}else if(3==e)for(s=0;s<6;s++){d=21+s,i=s<3?"#FFFFFF":t?"hbg-td1":"hbg-td2",o="";3==s&&(o="ll"),5==s&&c!=n.length&&(o="rl");r="",h=a[d];1==s||4==s?h=Goal2CnOU(a[d]):(r=h,h=oTool.changePL(_oddsType,h)),l.push('<td data-o="'+r+'" align="center"'+(0==s?' class="leftline"':"")+(""!=i?' class="'+o+" "+i+'"':"")+">"+(t&&s>=3?'<span class=" '+o+' isnew">':"")+(void 0!==a[d]&&""!=String(a[d])?h:" ")+(t&&s>3?"</span>":"")+"</td>")}}))),0!=s||r||l.push("</tr>"),l.join("")}function createTd(e,t,s){var a=e.split(","),l=t.split(","),d="";try{for(var i=0;i<a.length;i++)d+=" "+a[i]+"='"+l[i]+"'";return(o=document.createElement("<td"+d+"></td>")).innerHTML=s,o}catch(e){var o=document.createElement("td");for(i=0;i<a.length;i++)o.setAttribute(a[i],l[i]);return o.innerHTML=s,o}}function makecornertable(){try{var e=new Array;if("undefined"==typeof cOdds)return;if(void 0===cOdds[0]&&void 0===cOdds[6])return;var t=new Array;e.push("<div>"),e.push('<h2 class="team-table-title">'+_locModel.T.T_TIL_365Corn+"</h2>"),e.push('<table class="team-table-other" width="100%" cellpadding="0" cellspacing="0">'),e.push("<tbody>"),void 0!==cOdds[0]&&(t=oTool.getPL(_oddsType,cOdds[1],cOdds[0],cOdds[2]),cOdds[1]=t[0],cOdds[0]=t[1],cOdds[2]=t[2],t=oTool.getPL(_oddsType,cOdds[4],cOdds[3],cOdds[5]),cOdds[4]=t[0],cOdds[3]=t[1],cOdds[5]=t[2],e.push("<tr >"),e.push('<th colspan="10" align="center"><b>'+_locModel.T.T_Handicap+"</b></th>"),e.push("</tr>"),e.push('<tr align="center" class="bg1" id="trCornerLetgoal" odds='+cOdds[3]+","+cOdds[4]+","+cOdds[5]+">"),e.push('<td width="14%" class="th-bg3 rl">'+_locModel.T.T_Early+"</td>"),e.push('<td width="10%" class="bg2">'+cOdds[1]+" </td>"),e.push('<td width="10%" class="bg2">'+Goal2GoalCn2(cOdds[0])+"</td>"),e.push('<td width="10%" class="bg2">'+cOdds[2]+"</td>"),e.push('<td width="14%" class="th-bg3 ll rl">'+_locModel.T.T_Live+"</td>"),e.push('<td width="10%" class="bg2">'+cOdds[4]+"</td>"),e.push('<td width="10%" class="bg2">'+Goal2GoalCn2(cOdds[3])+"</td>"),e.push('<td width="10%" class="bg2">'+cOdds[5]+"</td>"),e.push("</tr>")),void 0!==cOdds[6]&&(t=oTool.getPL(_oddsType,cOdds[7],cOdds[6],cOdds[8]),cOdds[7]=t[0],cOdds[6]=t[1],cOdds[8]=t[2],t=oTool.getPL(_oddsType,cOdds[10],cOdds[9],cOdds[11]),cOdds[10]=t[0],cOdds[9]=t[1],cOdds[11]=t[2],e.push("<tr>"),e.push('<th colspan="10" align="center"><b>'+_locModel.T.T_OU+"</b></th>"),e.push("</tr>"),e.push('<tr align="center" class="bg1"  id="trCornerTotal" odds='+cOdds[9]+","+cOdds[10]+","+cOdds[11]+">"),e.push('<td width="14%" class="th-bg3 rl">'+_locModel.T.T_Early+"</td>"),e.push('<td width="10%" class="bg2">'+cOdds[7]+" </td>"),e.push('<td width="10%" class="bg2">'+Goal2GoalCn2(cOdds[6])+"</td>"),e.push('<td width="10%" class="bg2">'+cOdds[8]+"</td>"),e.push('<td width="14%" class="th-bg3 ll rl">'+_locModel.T.T_Live+"</td>"),e.push('<td width="10%" class="bg2">'+cOdds[10]+"</td>"),e.push('<td width="10%" class="bg2">'+Goal2GoalCn2(cOdds[9])+"</td>"),e.push('<td width="10%" class="bg2">'+cOdds[11]+"</td>"),e.push("</tr>")),e.push("</tbody></table>"),e.push("</div>"),document.getElementById("cornerOddsDiv").innerHTML=e.join("")}catch(e){console.log(e)}}function refreshCorner(e){try{var t="";if(!CheckEmpty(e)&&0==(e=JSON.parse(e)).ErrCode&&!CheckEmpty(e.Data)){if(t=e.Data,oldCornerXml==t)return;oldCornerXml=t;var s=createXml(t).documentElement,a=new Array,l=document.getElementById("trCornerLetgoal"),d=document.getElementById("trCornerTotal"),i=new Array;if(s.childNodes.length>0){a=document.all&&parseInt(ieNum)<10?s.childNodes[0].text.split(";"):s.childNodes[0].textContent.split(";");for(var o=0;o<a.length;o++){t=a[o].split(",");var r=a[o].split(",");if(null!=l&&void 0!==t[0]&&""!=t[0]){i=oTool.getPL(_oddsType,t[1],t[0],t[2]),t[1]=i[0],t[0]=i[1],t[2]=i[2];for(var n=l.attributes.odds.value.split(","),c=1;c<3;c++)void 0!==n[c]&&void 0!==t[c]&&(parseFloat(n[c])>parseFloat(t[c])?t[c]="<span class=down>"+t[c]+"</span>":parseFloat(n[c])<parseFloat(t[c])&&(t[c]="<span class=up>"+t[c]+"</span>"));l.cells[5].innerHTML=t[1],l.cells[6].innerHTML=Goal2GoalCn2(t[0]),l.cells[7].innerHTML=t[2],l.attributes.odds.value=r[0]+","+r[1]+","+r[2]}if(null!=d&&void 0!==t[3]&&""!=t[3]){n=d.attributes.odds.value.split(",");i=oTool.getPL(_oddsType,t[4],t[3],t[5]),t[4]=i[0],t[3]=i[1],t[5]=i[2];for(c=1;c<3;c++)void 0!==n[c]&&void 0!==t[c+3]&&(parseFloat(n[c])>parseFloat(t[c+3])?t[c+3]="<span class=down>"+t[c+3]+"</span>":parseFloat(n[c])<parseFloat(t[c+3])&&(t[c+3]="<span class=up>"+t[c+3]+"</span>"));d.cells[5].innerHTML=t[4],d.cells[6].innerHTML=Goal2GoalCn2(t[3]),d.cells[7].innerHTML=t[5],d.attributes.odds.value=r[3]+","+r[4]+","+r[5]}}window.setTimeout("restoreCornerOddsColor()",3e4)}}}catch(e){console.log(e)}}function restoreCornerOddsColor(e){var t=document.getElementById("trCornerLetgoal"),s=document.getElementById("trCornerTotal");if(null!=t)for(var a=0;a<t.cells.length;a++)t.cells[a].innerHTML=t.cells[a].innerHTML.toLowerCase().replace(/<span class=up>/g,"").replace(/<span class=down>/g,"").replace(/<\/span>/g,"");if(null!=s)for(a=0;a<s.cells.length;a++)s.cells[a].innerHTML=s.cells[a].innerHTML.toLowerCase().replace(/<span class=up>/g,"").replace(/<span class=down>/g,"").replace(/<\/span>/g,"")}function changeJsq(e){_$("jsq"+(1==e?"50":"30")).style.display="none",_$("jsq"+(1==e?"30":"50")).style.display=""}window.onload=function(){updateDetailAndTech(),LoadLiveFile(),LoadOtherFile(),LoadOddsFile(),LoadCornerLiveFile(),LoadDark(),lazyload()},String.prototype.format=function(){for(var e=this.toString(),t=0,s=0;t<arguments.length;t++)if(arguments[t]instanceof Array)for(var a=0;a<arguments[t].length;a++)e=e.replace(new RegExp("\\{"+s+++"\\}","g"),arguments[t][a]);else e=e.replace(new RegExp("\\{"+s+++"\\}","g"),arguments[t]);return e},Array.prototype.forEach||(Array.prototype.forEach=function(e,t){var s,a;if(null==this)throw new TypeError("this is null or not defined");var l=Object(this),d=l.length>>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(s=t),a=0;a<d;){var i;a in l&&(i=l[a],e.call(s,i,a,l)),a++}});var _detail=new Object;function evals(e){"string"==typeof e&&(window.execScript?window.execScript(e):window.eval(e))}function updateDetailAndTech(){var e=_detailData+"?"+Date.parse(new Date);$.ajax({type:"get",url:e,dataType:"text",success:function(e){evals(e),updateDetail(_scheduleID)}}),setTimeout("updateDetailAndTech()",3e4)}function updateDetail(e){void 0!==d_f[e]&&(new _detail.SetEventList(d_f[e]),updateDetailHtml(e)),void 0!==tT_f[e]&&(new _detail.SetTeamTechList(tT_f[e]),updateTeamTechHtml()),void 0!==pT_f[e]&&updatePlayerTech(e)}function updateDetailHtml(e){if(void 0!==s_f[e]&&_detail.eventList.length>0){var t=document.getElementById("detailRowTemplate").innerHTML,s=$("#headVs .team-home").html(),a=$("#headVs .team-away").html(),l=new Array;l.push('<h2 class="team-table-title">'+_locModel.T.T_TIL_KeyEvent+"</h2>"),l.push('<div class="team-h1"><span class="home-bg"></span><span class="away-bg"></span></div>'),l.push('<div class="matchEvent__head d-flex"><div class="flex-1 justify-content-between align-items-center d-flex"><div class="matchEvent__team--home">'+s+"</div>"+s_f[e][0]+'</div><div style="width:125px;font-weight:700;" class="matchEvent__minute d-flex align-items-center justify-content-center">'+_locModel.T.T_Minutes+'</div><div class="flex-1 justify-content-between align-items-center d-flex">'+s_f[e][1]+'<div class="matchEvent__team--away">'+a+"</div></div></div>"),_detail.eventList.forEach((function(e){l.push(buildTags(t,e))})),l.push("</table>"),$("#teamEventDiv_detail").html(l.join("")),$("#teamEventDiv_detail").show()}}function updateTeamTechHtml(){if(0!=_detail.teamTechList.length){var e=document.getElementById("teamTechRowTemplate").innerHTML,t=document.getElementById("trackerStatsTemplate")?document.getElementById("trackerStatsTemplate").innerHTML:"",s=new Array,a=new Array,l=$("#headVs .team-home").html(),d=$("#headVs .team-away").html();s.push('<h2 class="team-table-title">'+_locModel.T.T_TIL_TechStat+"</h2>"),s.push('<div class="matchTech__head"><div class="matchTech__team"><div class="matchTech__team--home">'+l+'</div><div class="matchTech__team--away">'+d+"</div></div></div>"),s.push('<div class="fx20 pt-5 pb-3"><ul class="stat">');a={homePossession:"0%",guestPossession:"0%",homeCorner:0,guestCorner:0,homeRed:0,guestRed:0,homeYellow:0,guestYellow:0,guestYellow:0};_detail.teamTechList.forEach((function(t){s.push(buildTags(e,t).replace("*","<img src='/images/bf_img/55.png' class='sjImg' />")),"Tỉ lệ kiểm soát bóng"==t.kindName.trim()?(a.homePossession=t.homeValue,a.homePossessionValue=Math.round(100*parseInt(t.homeValue)/(parseInt(t.homeValue)+parseInt(t.guestValue)))+"%",a.guestPossession=t.guestValue,a.guestPossessionValue=Math.round(100*parseInt(t.guestValue)/(parseInt(t.homeValue)+parseInt(t.guestValue)))+"%"):"Phạt góc"==t.kindName.trim()?(a.homeCorner=t.homeValue,a.guestCorner=t.guestValue):"Thẻ đỏ"==t.kindName.trim()?(a.homeRed=t.homeValue,a.guestRed=t.guestValue):"Thẻ vàng"==t.kindName.trim()?(a.homeYellow=t.homeValue,a.guestYellow=t.guestValue):"Tấn công"==t.kindName.trim()?(a.homeAttacks=t.homeValue,a.homeAttacksValue=Math.round(100*parseInt(t.homeValue)/(parseInt(t.homeValue)+parseInt(t.guestValue)))+"%",a.guestAttacks=t.guestValue,a.guestAttacksValue=Math.round(100*parseInt(t.guestValue)/(parseInt(t.homeValue)+parseInt(t.guestValue)))+"%"):"Tấn công nguy hiểm"==t.kindName.trim()?(a.homeDangerousAttacks=t.homeValue,a.homeDangerousAttacksValue=Math.round(100*parseInt(t.homeValue)/(parseInt(t.homeValue)+parseInt(t.guestValue)))+"%",a.guestDangerousAttacks=t.guestValue,a.guestDangerousAttacksValue=Math.round(100*parseInt(t.guestValue)/(parseInt(t.homeValue)+parseInt(t.guestValue)))+"%"):"Sút cầu môn"==t.kindName.trim()?(a.homeShotsOnTarget=t.homeValue,a.homeShotsOnTargetValue=Math.round(100*parseInt(t.homeValue)/(parseInt(t.homeValue)+parseInt(t.guestValue)))+"%",a.guestShotsOnTarget=t.guestValue,a.guestShotsOnTargetValue=Math.round(100*parseInt(t.guestValue)/(parseInt(t.homeValue)+parseInt(t.guestValue)))+"%"):"Sút ngoài cầu môn"==t.kindName.trim()&&(a.homeShotsOffTarget=t.homeValue,a.homeShotsOffTargetValue=Math.round(100*parseInt(t.homeValue)/(parseInt(t.homeValue)+parseInt(t.guestValue)))+"%",a.guestShotsOffTarget=t.guestValue,a.guestShotsOffTargetValue=Math.round(100*parseInt(t.guestValue)/(parseInt(t.homeValue)+parseInt(t.guestValue)))+"%")})),s.push("</ul></div>"),$("#teamTechDiv_detail").html(s.join("")),$("#teamTechDiv_detail").show(),$("#matchTechDiv_detail").html(s.join("")),$("#matchTechDiv_detail").show(),t&&$(".live__tracker--stats").html(buildTags(t,a)).removeClass("d-none")}}function updatePlayerTech(e){$("#matchBox").find("div").each((function(){null!=$(this)[0].id.match("playerTech")&&($(this)[0].innerHTML="")}));var t=pT_f[e];if(void 0!==t)for(var s=0;s<t.length;s++){for(var a=t[s][0],l=t[s][1].split(";"),d="",i=0;i<l.length;i++){var o=l[i].split(",");d+=_detail.playerTechImg.format(""!=o[1]?o[1]+"'":"",15==parseInt(o[0])?"m"+o[0]:o[0])}$("#playerTech_"+a).html(d)}var r=pD_f[e];if(void 0!==r)for(s=0;s<r.length;s++){a=r[s][0];var n=r[s][1],c="#5cb400";$("#playerRating_"+a).html(n),n<=6?c="#ff203c":n>6&&n<=6.5?c="#ff6600":n>6.5&&n<=7?c="#ffae0f":n>7&&n<=8&&(c="#c1cc01"),$("#playerRating_"+a).css("background",c).css("opacity",1)}}function buildTags(e,t){return e.replace(/\{\$(\w+)\}/g,(function(e,s){return s in t?t[s]:""}))}function switchHScored(e){$(".hScoredLi").hide(),$(".hScoredLi"+e).show(),$(".hScoredBtn").removeClass("fx-tab-on"),$("#hScoredBtn"+e).addClass("fx-tab-on")}function switchGScored(e){$(".gScoredLi").hide(),$(".gScoredLi"+e).show(),$(".gScoredBtn").removeClass("fx-tab-on2"),$("#gScoredBtn"+e).addClass("fx-tab-on2")}function switchScoredPlan(e){$(".lastMatchBtn").removeClass("fx-tab2-on"),$("#lastMatchBtn"+e).addClass("fx-tab2-on"),$(".rateOfScored").hide(),$("#rateOfScored"+e).show()}function showHideBack(){var e=!1;$("#backupPlay").hasClass("shutup2")&&(e=!0),e?($("#shutup-btn").text(_locModel.T.T_Btn_Substitutes),$("#backupPlay").removeClass("shutup2").addClass("shutup")):($("#shutup-btn").text(_locModel.T.T_Btn_Close),$("#backupPlay").removeClass("shutup").addClass("shutup2"))}function LoadOtherFile(){var e="/Ajax/SoccerAjax?type=12&id="+_scheduleID+"&cid=3";bomHelper.ajaxGet(e,LoadOtherData),window.setTimeout("LoadOtherFile()",2e4)}function LoadOtherData(e){try{var t="";if(!CheckEmpty(e)){if(0!=(e=JSON.parse(e)).ErrCode)return;t=e.Data;var s=new Array;if(!CheckEmpty(t)){if(!CheckEmpty(t.Even)){var a=document.getElementById("odds-even"),l=t.Even;if(null!=a){var d=JSON.parse(a.attributes.odds.value);$.map(l,(function(e,t){void 0!==d[t]&&void 0!==l[t]&&(parseFloat(d[t])>parseFloat(l[t])?l[t]="<span class=down>"+l[t]+"</span>":parseFloat(d[t])<parseFloat(l[t])&&(l[t]="<span class=up>"+l[t]+"</span>"))})),a.setAttribute("odds",JSON.stringify(l))}s.push('<h2 class="team-table-title">BÀN THẮNG: LẺ / CHẴN</h2>'),s.push("<div id='odds-even' class='market-wrapper mt-3 mb-3' odds='"+JSON.stringify(l)+"'><div class='row'>"),s.push('<div class="col-6"><div class="other__item"><div class="other__item--title">Lẻ</div><span class="other__item--odd">'+l.Odd+"</span></div></div>"),s.push('<div class="col-6"><div class="other__item"><div class="other__item--title">Chẵn</div><span class="other__item--odd">'+l.Even+"</span></div></div>"),s.push("</div></div>")}if(!CheckEmpty(t.HalfFull)){var i=document.getElementById("odds-halffull");l=t.HalfFull;if(null!=i){d=JSON.parse(i.attributes.odds.value);$.map(l,(function(e,t){void 0!==d[t]&&void 0!==l[t]&&(parseFloat(d[t])>parseFloat(l[t])?l[t]="<span class=down>"+l[t]+"</span>":parseFloat(d[t])<parseFloat(l[t])&&(l[t]="<span class=up>"+l[t]+"</span>"))})),i.setAttribute("odds",JSON.stringify(l))}s.push('<h2 class="team-table-title">Hiệp 1 / Hết Trận</h2>'),s.push("<div id='odds-halffull' class='market-wrapper mt-3 mb-3' odds='"+JSON.stringify(l)+"'><div class='row'>"),""!=l.halfWinFullWin&&s.push('<div class="col-4"><div class="other__item mb-3"><div class="other__item--title">'+_homeTeam+" / "+_homeTeam+'</div><span class="other__item--odd">'+l.halfWinFullWin+"</span></div></div>"),""!=l.halfWinFullDraw&&s.push('<div class="col-4"><div class="other__item mb-3"><div class="other__item--title">Hòa / '+_homeTeam+'</div><span class="other__item--odd">'+l.halfWinFullDraw+"</span></div></div>"),""!=l.halfWinFullLose&&s.push('<div class="col-4"><div class="other__item mb-3"><div class="other__item--title">'+_guestTeam+" / "+_homeTeam+'</div><span class="other__item--odd">'+l.halfWinFullLose+"</span></div></div>"),""!=l.halfDrawFullWin&&s.push('<div class="col-4"><div class="other__item mb-3"><div class="other__item--title">'+_homeTeam+' / Hòa</div><span class="other__item--odd">'+l.halfDrawFullWin+"</span></div></div>"),""!=l.halfDrawFullDraw&&s.push('<div class="col-4"><div class="other__item mb-3"><div class="other__item--title">Hòa / Hòa</div><span class="other__item--odd">'+l.halfDrawFullDraw+"</span></div></div>"),""!=l.halfDrawFullLose&&s.push('<div class="col-4"><div class="other__item mb-3"><div class="other__item--title">'+_guestTeam+' / Draw</div><span class="other__item--odd">'+l.halfDrawFullLose+"</span></div></div>"),""!=l.halfLoseFullWin&&s.push('<div class="col-4"><div class="other__item"><div class="other__item--title">'+_homeTeam+" / "+_guestTeam+'</div><span class="other__item--odd">'+l.halfLoseFullWin+"</span></div></div>"),""!=l.halfLoseFullDraw&&s.push('<div class="col-4"><div class="other__item"><div class="other__item--title">Draw / '+_guestTeam+'</div><span class="other__item--odd">'+l.halfLoseFullDraw+"</span></div></div>"),""!=l.halfLoseFullLose&&s.push('<div class="col-4"><div class="other__item"><div class="other__item--title">'+_guestTeam+" / "+_guestTeam+'</div><span class="other__item--odd">'+l.halfLoseFullLose+"</span></div></div>"),s.push("</div></div>")}if(!CheckEmpty(t.TeamToScore)){var o=document.getElementById("odds-teamtoscore");l=t.TeamToScore;if(null!=i){d=JSON.parse(i.attributes.odds.value);$.map(l,(function(e,t){void 0!==d[t]&&void 0!==l[t]&&(parseFloat(d[t])>parseFloat(l[t])?l[t]="<span class=down>"+l[t]+"</span>":parseFloat(d[t])<parseFloat(l[t])&&(l[t]="<span class=up>"+l[t]+"</span>"))})),o.setAttribute("odds",JSON.stringify(l))}s.push('<h2 class="team-table-title">BÀN THẮNG ĐẦU TIÊN / BÀN THẮNG CUỐI CÙNG</h2>'),s.push("<div id='odds-teamtoscore' class='market-wrapper mt-3 mb-3' odds='"+JSON.stringify(l)+"'><div class='row'>"),s.push('<div class="col-6 text-center mb-3"><strong>BÀN THẮNG ĐẦU TIÊN</strong></div><div class="col-6 text-center mb-3"><strong>BÀN THẮNG CUỐI CÙNG</strong></div>'),""!=l.firstIsHome&&s.push('<div class="col-6"><div class="other__item mb-3"><div class="other__item--title">'+_homeTeam+'</div><span class="other__item--odd">'+l.firstIsHome+"</span></div></div>"),""!=l.lastIsHome&&s.push('<div class="col-6"><div class="other__item mb-3"><div class="other__item--title">'+_homeTeam+'</div><span class="other__item--odd">'+l.lastIsHome+"</span></div></div>"),""!=l.firstIsAway&&s.push('<div class="col-6"><div class="other__item mb-3"><div class="other__item--title">'+_guestTeam+'</div><span class="other__item--odd">'+l.firstIsAway+"</span></div></div>"),""!=l.lastIsAway&&s.push('<div class="col-6"><div class="other__item mb-3"><div class="other__item--title">'+_guestTeam+'</div><span class="other__item--odd">'+l.lastIsAway+"</span></div></div>"),""!=l.noGoal&&s.push('<div class="col-12"><div class="other__item"><div class="other__item--title">Không Có Bàn Thắng</div><span class="other__item--odd">'+l.noGoal+"</span></div></div>"),s.push("</div></div>")}if(!CheckEmpty(t.CorrectScore)){var r=document.getElementById("odds-correctscore");l=t.CorrectScore;if(null!=r){d=JSON.parse(r.attributes.odds.value);$.map(l,(function(e,t){void 0!==d[t]&&void 0!==l[t]&&(parseFloat(d[t])>parseFloat(l[t])?l[t]="<span class=down>"+l[t]+"</span>":parseFloat(d[t])<parseFloat(l[t])&&(l[t]="<span class=up>"+l[t]+"</span>"))})),r.setAttribute("odds",JSON.stringify(l))}s.push('<h2 class="team-table-title">KẾT QUẢ ĐÚNG</h2>'),s.push("<div id='odds-correctscore' class='market-wrapper mt-3 mb-3' odds='"+JSON.stringify(l)+"'><div class='row'>"),$.map(t.CorrectScore.BettingOddsItems,(function(e,t){0!=e.odds&&s.push('<div class="col-2"><div class="other__item mb-3"><div class="other__item--title">'+e.homeScore+"-"+e.awayScore+'</div><span class="other__item--odd">'+e.odds+"</span></div></div>")})),0!=l.OtherScoresOdds&&s.push('<div class="col-12"><div class="other__item"><div class="other__item--title">Tỉ số khác</div><span class="other__item--odd">'+l.OtherScoresOdds+"</span></div></div>"),s.push("</div></div>")}if(!CheckEmpty(t.CorrectScoreHalf)){var n=document.getElementById("odds-correctscorehalf");l=t.CorrectScoreHalf;if(null!=n){d=JSON.parse(n.attributes.odds.value);$.map(l,(function(e,t){void 0!==d[t]&&void 0!==l[t]&&(parseFloat(d[t])>parseFloat(l[t])?l[t]="<span class=down>"+l[t]+"</span>":parseFloat(d[t])<parseFloat(l[t])&&(l[t]="<span class=up>"+l[t]+"</span>"))})),n.setAttribute("odds",JSON.stringify(l))}s.push('<h2 class="team-table-title">KẾT QUẢ ĐÚNG (Hiệp 1)</h2>'),s.push("<div id='odds-correctscorehalf' class='market-wrapper mt-3 mb-3' odds='"+JSON.stringify(l)+"'><div class='row'>"),$.map(t.CorrectScoreHalf.BettingOddsItems,(function(e,t){0!=e.odds&&s.push('<div class="col-2"><div class="other__item mb-3"><div class="other__item--title">'+e.homeScore+"-"+e.awayScore+'</div><span class="other__item--odd">'+e.odds+"</span></div></div>")})),0!=l.OtherScoresOdds&&s.push('<div class="col-12"><div class="other__item"><div class="other__item--title">Tỉ số khác</div><span class="other__item--odd">'+l.OtherScoresOdds+"</span></div></div>"),s.push("</div></div>")}if(!CheckEmpty(t.TotalScore)){var c=document.getElementById("odds-totalscore");l=t.TotalScore;if(null!=c){d=JSON.parse(c.attributes.odds.value);$.map(l,(function(e,t){void 0!==d[t]&&void 0!==l[t]&&(parseFloat(d[t])>parseFloat(l[t])?l[t]="<span class=down>"+l[t]+"</span>":parseFloat(d[t])<parseFloat(l[t])&&(l[t]="<span class=up>"+l[t]+"</span>"))})),c.setAttribute("odds",JSON.stringify(l))}s.push('<h2 class="team-table-title">TỔNG SỐ BÀN THẮNG</h2>'),s.push("<div id='odds-totalscore' class='market-wrapper mt-3 mb-3' odds='"+JSON.stringify(l)+"'><div class='row'>"),""!=l.zeroToOne&&s.push('<div class="col-3"><div class="other__item"><div class="other__item--title">0 - 1</div><span class="other__item--odd">'+l.zeroToOne+"</span></div></div>"),""!=l.twoToThree&&s.push('<div class="col-3"><div class="other__item"><div class="other__item--title">2 - 3</div><span class="other__item--odd">'+l.twoToThree+"</span></div></div>"),""!=l.fourToSix&&s.push('<div class="col-3"><div class="other__item"><div class="other__item--title">4 - 6</div><span class="other__item--odd">'+l.fourToSix+"</span></div></div>"),""!=l.moreThanSix&&s.push('<div class="col-3"><div class="other__item"><div class="other__item--title">7 hoặc Nhiều hơn</div><span class="other__item--odd">'+l.moreThanSix+"</span></div></div>"),s.push("</div></div>")}document.getElementById("otherOddsDiv").innerHTML=s.join("")}}}catch(e){console.log(e)}}function LoadOddsFile(e=!0){bomHelper.ajaxGet(_detailOdds,LoadOddsData),e&&window.setTimeout("LoadOddsFile()",15e3)}_detail.playerUrl="{1}",_detail.eventKindImgUrl='<img src="/images/bf_img/{0}.png" width="12px" class="me-1" style="cursor:pointer;">',_detail.techPreImg='<div class="{0}"><div class="info" style="width:{1}%;"></div></div>',_detail.playerTechImg='<img alt="{0}" title="{0}" src="/images/bf_img/{1}.png" align="absmiddle" style="cursor:pointer;">',_detail.techImg='<img src="/images/bf_img/55.png" class="sjImg">',_detail.eventList=new Array,_detail.teamTechList=new Array,_detail.techKindNameList=_locModel.T.T_Mul_TechKind.split(","),_detail.OneEvent=function(e,t){1==parseInt(e[5])?1!=parseInt(e[0])&&8!=parseInt(e[0])&&7!=parseInt(e[0])||_detail.homeScore++:1!=parseInt(e[5])&&(1!=parseInt(e[0])&&8!=parseInt(e[0])&&7!=parseInt(e[0])||_detail.awayScore++),this.homeScore=_detail.homeScore,this.awayScore=_detail.awayScore,this.kind=parseInt(e[0]),this.time=""!=e[1]?e[1]+(e[8]?"+"+e[8]:"")+"'":"",this.teamID=e[2],this.playerID=e[3],this.playerID2=e[4],this.isHome=1==parseInt(e[5]),this.playerName=e[6],this.player2Name=e[7];var s="";s=11==this.kind?'<img src="/images/bf_img/444.png" height="10px" class="me-1" align="absmiddle"/>'+_detail.playerUrl.format(this.playerID,this.playerName)+'<img src="/images/bf_img/555.png" class="ms-2 me-1" height="10px" align="absmiddle"/>'+_detail.playerUrl.format(this.playerID2,this.player2Name):1==this.kind&&this.playerID>0&&this.playerID2>0?"<strong>"+this.homeScore+"-"+this.awayScore+"</strong>"+_detail.playerUrl.format(this.playerID,this.playerName)+_detail.playerUrl.format(this.playerID2," ("+_locModel.T.T_Assist+":"+this.player2Name+")"):1==this.kind&&this.playerID>=0&&this.playerID2<=0||7==this.kind&&this.playerID>=0&&this.playerID2<=0?"<strong>"+this.homeScore+"-"+this.awayScore+"</strong>"+_detail.playerUrl.format(this.playerID,this.playerName):this.playerName;var a=11!=this.kind?_detail.eventKindImgUrl.format(this.kind):"";this.showPlayerData_H=this.isHome?s:"",this.showPlayerData_G=this.isHome?"":s,this.kindImg_H=this.isHome?a:"",this.kindImg_G=this.isHome?"":a,this.trClass=t%2==1?"bg1":"bg2",this.titleClass=t%2==1?"bg3":"bg4"},_detail.SetEventList=function(e){_detail.eventList=new Array,_detail.homeScore=0,_detail.awayScore=0;for(var t=0;t<e.length;t++)_detail.eventList.push(new _detail.OneEvent(e[t],t))},_detail.OneTeamTech=function(e,t){var s=parseInt(e[0]);this.homeValue="*"==e[1]?_detail.techImg:e[1],this.guestValue="*"==e[2]?_detail.techImg:e[2];var a=parseInt(e[3]),l=parseInt(e[4]);this.trClass=t%2==1?"bg1":"bg2",this.titleClass=t%2==1?"bg3":"bg4",this.showHomePre=a+"%",this.showGuestPre=l+"%",this.kindName=_detail.techKindNameList[s]},_detail.SetTeamTechList=function(e){_detail.teamTechList=new Array;for(var t=0;t<e.length;t++)_detail.teamTechList.push(new _detail.OneTeamTech(e[t],t))};var oldData,newDatas=[];function LoadOddsData(result){var data="";const template=document.querySelector("#oddsChangesTemplate")?document.querySelector("#oddsChangesTemplate").innerHTML:"";if(!template)return;let company=localStorage.hasOwnProperty("soccer_company_id_"+_scheduleID)?parseInt(localStorage.getItem("soccer_company_id_"+_scheduleID)):8;const renderTemplate=data=>eval(`\`${template}\``);if(!CheckEmpty(result)){result=JSON.parse(result);try{oldData=newDatas;var filteredData={company:company,cornersTotal:result.cornersTotal.filter((e=>parseInt(e[1])===company)).flat(),handicap:result.handicap.filter((e=>parseInt(e[1])===company)).flat(),europe:result.europeOdds.filter((e=>parseInt(e[1])===company)).flat(),europeHalf:result.europeOddsHalf.filter((e=>parseInt(e[1])===company)).flat(),overUnder:result.overUnder.filter((e=>parseInt(e[1])===company)).flat(),handicapHalf:result.handicapHalf.filter((e=>parseInt(e[1])===company)).flat(),overUnderHalf:result.overUnderHalf.filter((e=>parseInt(e[1])===company)).flat()};filteredData.handicapIsClose=filteredData.handicap[12]??0,filteredData.overUnderIsClose=filteredData.overUnder[12]??0,filteredData.euroIsClose=filteredData.europe[12]??0,filteredData.cornersIsClose=filteredData.cornersTotal[9]??0,newDatas=filteredData,jQuery(".teambox__odds").html(renderTemplate(filteredData))}catch(e){console.log(e)}}jQuery(".company .pointer").click((function(e){let t=jQuery(this).attr("data-id");jQuery(".pointer").removeClass("active"),localStorage.setItem("soccer_company_id_"+_scheduleID,parseInt(t)),LoadOddsFile(!1)}))}function getClass(e="",t=""){try{if(void 0===oldData[e]||void 0===newDatas[e])return"";if("-"!==oldData[e][t]&&"-"!==newDatas[e][t]&&newDatas[e][t]!==oldData[e][t])return newDatas[e][t]>oldData[e][t]?"up":"down"}catch(e){console.log(e)}return""}
