function buildTags(e,t){return e.replace(/\{\$(\w+)\}/g,(function(e,a){return a in t?t[a]:""}))}function loadData(){if("undefined"!=typeof _pageType)switch(_pageType){case PageType.THREEMIX:loadThreeMixCompOdds(),_oddsCompFilterWin&&_oddsCompFilterWin.displayCompany();break;case PageType.AH:_$("CompanyOddsDiv").innerHTML=_$("ahTableTpl").innerHTML,loadAHOUCompOdds(),_oddsCompFilterWin&&_oddsCompFilterWin.displayCompany();break;case PageType.OU:_$("CompanyOddsDiv").innerHTML=_$("ouTableTpl").innerHTML,loadAHOUCompOdds(),_oddsCompFilterWin&&_oddsCompFilterWin.displayCompany();break;case PageType.CORNEROU:_$("CompanyOddsDiv").innerHTML=_$("cornerOUTableTpl").innerHTML,loadCornerOUCompOdds();break;case PageType.BODAN:_$("CompanyOddsDiv").innerHTML=_$("correctScoreTableTpl").innerHTML,loadCorrectScoreCompOdds();break;case PageType.EUROAH:_$("CompanyOddsDiv").innerHTML=_$("euroAHTableTpl").innerHTML,loadEuroAHCompOdds();break;case PageType.DOUBLECHANCE:_$("CompanyOddsDiv").innerHTML=_$("doubleChanceTableTpl").innerHTML,loadDoubleChanceCompOdds()}}function loadThreeMixCompOdds(){let e=_ENDPOINT_ODDS+"/ajax/soccerajax?type=14&t=1&id="+_scheduleID+"&h="+_halfTime+"&s="+_matchInfo.state;bomHelper.ajaxGet(e,updateMixOddsComp),window.clearTimeout(_timerObj.threeMixTimer),0==_matchInfo.state?_timerObj.threeMixTimer=setTimeout("loadThreeMixCompOdds()",_updateRate.live):_matchInfo.state>0&&(loadThreeMixRunOdds(),_updateRate.run=5e3)}function updateMixOddsComp(e){if(!CheckEmpty(e)){let t=[];0==(e=JSON.parse(e)).ErrCode&&(t=e.Data.mixodds);for(let e=0;e<t.length;e++){let a=t[e],d=a.cid,o=$("[name=oddsTr][cid="+d+"]")[0],s={up:null,goal:null,down:null};for(let e=0;e<_oddsOrder.length;e++){s.up=o.cells[2+3*e].getElementsByTagName("span"),s.goal=o.cells[3+3*e].getElementsByTagName("span"),s.down=o.cells[4+3*e].getElementsByTagName("span");let t=_oddsOrder[e]==ODDSTYPE.AH?a.ah:_oddsOrder[e]==ODDSTYPE.OP?a.euro:a.ou;if(s.up[1].classList.value=getUpDownClass(t.f.u,t.l.u),s.goal[1].classList.value=getUpDownClass(t.f.g,t.l.g),s.down[1].classList.value=getUpDownClass(t.f.d,t.l.d),oddsParseFloat(t.f),oddsParseFloat(t.l),oddsParseFloat(t.r),_oddsOrder[e]==ODDSTYPE.AH||_oddsOrder[e]==ODDSTYPE.OU){t.f.g=_oddsOrder[e]==ODDSTYPE.AH?Goal2GoalCn(t.f.g):OddsCompGoal2CnOU(t.f.g),t.l.g=_oddsOrder[e]==ODDSTYPE.AH?Goal2GoalCn(t.l.g):OddsCompGoal2CnOU(t.l.g);let a=oTool.getPL(_oddsType,t.f.u,t.f.g,t.f.d),d=oTool.getPL(_oddsType,t.l.u,t.l.g,t.l.d);if(s.up[0].innerText=a[0]||_noOddsTxt,s.up[1].innerText=d[0]||_noOddsTxt,s.goal[0].innerText=a[1]||_noOddsTxt,s.goal[1].innerText=d[1]||_noOddsTxt,s.down[0].innerText=a[2]||_noOddsTxt,s.down[1].innerText=d[2]||_noOddsTxt,_matchInfo.state<0&&t.hr){t.r.g=_oddsOrder[e]==ODDSTYPE.AH?Goal2GoalCn(t.r.g):OddsCompGoal2CnOU(t.r.g);let a=oTool.getPL(_oddsType,t.r.u,t.r.g,t.r.d);s.up[2].innerText=a[0]||_noOddsTxt,s.goal[2].innerText=a[1]||_noOddsTxt,s.down[2].innerText=a[2]||_noOddsTxt}}if(_oddsOrder[e]==ODDSTYPE.OP){let e=oTool.getPL(_oddsType,t.f.u,t.f.g,t.f.d,!0),a=oTool.getPL(_oddsType,t.l.u,t.l.g,t.l.d,!0);if(s.up[0].innerText=e[0]||_noOddsTxt,s.up[1].innerText=a[0]||_noOddsTxt,s.goal[0].innerText=e[1]||_noOddsTxt,s.goal[1].innerText=a[1]||_noOddsTxt,s.down[0].innerText=e[2]||_noOddsTxt,s.down[1].innerText=a[2]||_noOddsTxt,_matchInfo.state<0&&t.hr){let e=oTool.getPL(_oddsType,t.r.u,t.r.g,t.r.d,!0);s.up[2].innerText=e[0]||_noOddsTxt,s.goal[2].innerText=e[1]||_noOddsTxt,s.down[2].innerText=e[2]||_noOddsTxt}}s.up[0].setAttribute("data-o",t.f.u),s.up[1].setAttribute("data-o",t.l.u),s.goal[0].setAttribute("data-o",t.f.g),s.goal[1].setAttribute("data-o",t.l.g),s.down[0].setAttribute("data-o",t.f.d),s.down[1].setAttribute("data-o",t.l.d),_matchInfo.state<0&&t.hr&&(s.up[2].setAttribute("data-o",t.r.u),s.goal[2].setAttribute("data-o",t.r.g),s.down[2].setAttribute("data-o",t.r.d))}}}}function loadThreeMixRunOdds(){let e=_ENDPOINT_ODDS+"/ajax/soccerajax?type=14&t=11&id="+_scheduleID+"&h="+_halfTime;bomHelper.ajaxGet(e,updateThreeMixRunOdds),window.clearTimeout(_timerObj.threeMixRunTimer),_matchInfo.state>0&&(_timerObj.threeMixRunTimer=setTimeout("loadThreeMixRunOdds()",_updateRate.run))}function updateThreeMixRunOdds(e){if(!CheckEmpty(e)&&_matchInfo.state>0){let t=[];0==(e=JSON.parse(e)).ErrCode&&(t=e.Data.roddsList);for(let e=0;e<t.length;e++){let a=t[e],d=a.cid,o=$("[name=oddsTr][cid="+d+"]")[0],s={up:null,goal:null,down:null};for(let e=0;e<_oddsOrder.length;e++){s.up=o.cells[2+3*e].getElementsByTagName("span"),s.goal=o.cells[3+3*e].getElementsByTagName("span"),s.down=o.cells[4+3*e].getElementsByTagName("span");let t=_oddsOrder[e]==ODDSTYPE.AH?a.ah:_oddsOrder[e]==ODDSTYPE.OP?a.euro:a.ou;if(oddsParseFloat(t),$(s.up[2]).attr("data-o")&&t.u!=$(s.up[2]).attr("data-o")){let e=$(s.up[2]),a=getUpDownClass3(e.attr("data-o"),t.u);e.attr("class",a),setTimeout((()=>e.removeClass(a)),5e3)}if($(s.goal[2]).attr("data-o")&&t.g!=$(s.goal[2]).attr("data-o")){let e=$(s.goal[2]),a=getUpDownClass3(e.attr("data-o"),t.g);e.attr("class",a),setTimeout((()=>e.removeClass(a)),5e3)}if($(s.down[2]).attr("data-o")&&t.d!=$(s.down[2]).attr("data-o")){let e=$(s.down[2]),a=getUpDownClass3(e.attr("data-o"),t.d);e.attr("class",a),setTimeout((()=>e.removeClass(a)),5e3)}if(s.up[2].setAttribute("data-o",t.u),s.goal[2].setAttribute("data-o",t.g),s.down[2].setAttribute("data-o",t.d),_oddsOrder[e]==ODDSTYPE.AH||_oddsOrder[e]==ODDSTYPE.OU){t.g=_oddsOrder[e]==ODDSTYPE.AH?Goal2GoalCn(t.g):OddsCompGoal2CnOU(t.g);let a=oTool.getPL(_oddsType,t.u,t.g,t.d);s.up[2].innerText=a[0]||_noOddsTxt,s.goal[2].innerText=a[1]||_noOddsTxt,s.down[2].innerText=a[2]||_noOddsTxt}if(_oddsOrder[e]==ODDSTYPE.OP){let e=oTool.getPL(_oddsType,t.u,t.g,t.d,!0);s.up[2].innerText=e[0]||_noOddsTxt,s.goal[2].innerText=e[1]||_noOddsTxt,s.down[2].innerText=e[2]||_noOddsTxt}}}}}function loadAHOUCompOdds(){let e=_oddsKind==ODDSTYPE.AH?2:3,t=_ENDPOINT_ODDS+"/ajax/soccerajax?type=14&t="+e+"&id="+_scheduleID+"&h="+_halfTime+"&s="+_matchInfo.state;bomHelper.ajaxGet(t,updateAHOUOddsComp),window.clearTimeout(_timerObj.threeMixTimer),0==_matchInfo.state?_timerObj.threeMixTimer=setTimeout("loadAHOUCompOdds()",_updateRate.live):_matchInfo.state>0&&loadAHOURunOdds()}function updateAHOUOddsComp(e){if(!CheckEmpty(e)){let t=[];0==(e=JSON.parse(e)).ErrCode&&(t=e.Data.oddsList);for(let e=0;e<t.length;e++){let a=t[e],d=a.odds,o=a.cid,s=$("[name=oddsTr][cid="+o+"]")[0];oddsParseFloat(d.f),oddsParseFloat(d.l),oddsParseFloat(d.r);let n={up:"",goal:"",down:""},l=[],r=null,i=[d.f,d.l,d.r],u=!1;if(i.forEach(((e,t)=>{(2!=t||_matchInfo.state<0&&d.hr)&&(u=e.u||e.g||e.d,e.g=_pageType==PageType.AH?Goal2GoalCn(e.g):OddsCompGoal2CnOU(e.g),l=oTool.getPL(_oddsType,e.u,e.g,e.d),n.up=l[0],n.goal=l[1],n.down=l[2],r=s.cells[3*t+1].getElementsByTagName("span")[0],r.setAttribute("data-o",e.u),r.innerText=n.up||_noOddsTxt,1==t&&(r.classList.value=getUpDownClass(d.f.u,e.u)),r=s.cells[3*t+2].getElementsByTagName("span")[0],r.setAttribute("data-o",e.g),r.innerText=n.goal||_noOddsTxt,1==t&&(r.classList.value=getUpDownClass(d.f.g,e.g)),r=s.cells[3*t+3].getElementsByTagName("span")[0],r.setAttribute("data-o",e.d),r.innerText=n.down||_noOddsTxt,1==t&&(r.classList.value=getUpDownClass(d.f.d,e.d)))})),!u){let e=$(s).find("[name=oddsStats]");e.addClass("nolink"),e[0].setAttribute("onclick","")}}}}function loadAHOURunOdds(){let e=_oddsKind==ODDSTYPE.AH?12:13,t=_ENDPOINT_ODDS+"/ajax/soccerajax?type=14&t="+e+"&id="+_scheduleID+"&h="+_halfTime;bomHelper.ajaxGet(t,updateAHOURunOdds),window.clearTimeout(_timerObj.ahOURunTimer),_matchInfo.state>0&&(_timerObj.ahOURunTimer=window.setTimeout("loadAHOURunOdds()",_updateRate.run),_updateRate.run=5e3)}function updateAHOURunOdds(e){if(!CheckEmpty(e)&&_matchInfo.state>0){let t=[];0==(e=JSON.parse(e)).ErrCode&&(t=e.Data.roddsList);for(let e=0;e<t.length;e++){let a=t[e],d=a.odds,o=$("[name=oddsTr][cid="+a.cid+"]")[0],s={up:"",goal:"",down:""},n=[],l=null;if(oddsParseFloat(d),d.g=_pageType==PageType.AH?Goal2GoalCn(d.g):OddsCompGoal2CnOU(d.g),n=oTool.getPL(_oddsType,d.u,d.g,d.d),s.up=n[0],s.goal=n[1],s.down=n[2],l=o.cells[7].getElementsByTagName("span")[0],$(l).attr("data-o")&&d.u!=$(l).attr("data-o")){let e=$(l),t=getUpDownClass3(e.attr("data-o"),d.u);e.attr("class",t),setTimeout((()=>e.removeClass(t)),5e3)}if(l.setAttribute("data-o",d.u),l.innerText=s.up||_noOddsTxt,l=o.cells[8].getElementsByTagName("span")[0],$(l).attr("data-o")&&d.g!=$(l).attr("data-o")){let e=$(l),t=getUpDownClass3(e.attr("data-o"),d.g);e.attr("class",t),setTimeout((()=>e.removeClass(t)),5e3)}if(l.setAttribute("data-o",d.g),l.innerText=s.goal||_noOddsTxt,l=o.cells[9].getElementsByTagName("span")[0],$(l).attr("data-o")&&d.d!=$(l).attr("data-o")){let e=$(l),t=getUpDownClass3(e.attr("data-o"),d.d);e.attr("class",t),setTimeout((()=>e.removeClass(t)),5e3)}l.setAttribute("data-o",d.d),l.innerText=s.down||_noOddsTxt}}}function loadCornerOUCompOdds(){let e=_ENDPOINT_ODDS+"/ajax/soccerajax?type=14&t=4&id="+_scheduleID+"&h="+_halfTime+"&s="+_matchInfo.state;bomHelper.ajaxGet(e,updateCornerOUOddsComp),window.clearTimeout(_timerObj.cornerOUTimer),_matchInfo.state>-1&&(_timerObj.cornerOUTimer=window.setTimeout("loadCornerOUCompOdds()",_updateRate.run)),_matchInfo.state>0&&(_updateRate.run=5e3)}function updateCornerOUOddsComp(e){if(!CheckEmpty(e)){let t=[];0==(e=JSON.parse(e)).ErrCode&&(t=e.Data.oddsList);for(let e=0;e<t.length;e++){let a=t[e],d=a.odds,o=$("[name=oddsTr][cid="+a.cid+"]")[0];oddsParseFloat(d.f,2),oddsParseFloat(d.l,2),oddsParseFloat(d.r,2);let s={up:"",goal:"",down:""},n=[],l=null;[d.f,d.l,d.r].forEach(((e,t)=>{if(2!=t||d.hr){if(e.g=OddsCompGoal2CnOU(e.g),n=oTool.getPL(_oddsType,e.u,e.g,e.d),s.up=n[0],s.goal=n[1],s.down=n[2],l=o.cells[3*t+1].getElementsByTagName("span")[0],$(l).attr("data-o")&&e.u!=$(l).attr("data-o")){let t=$(l),a=getUpDownClass3(t.attr("data-o"),e.u);t.attr("class",a),setTimeout((()=>t.removeClass(a)),5e3)}if(l.setAttribute("data-o",e.u),l.innerText=s.up||_noOddsTxt,1==t&&(l.classList.value=getUpDownClass(d.f.u,e.u)),l=o.cells[3*t+2].getElementsByTagName("span")[0],$(l).attr("data-o")&&e.g!=$(l).attr("data-o")){let t=$(l),a=getUpDownClass3(t.attr("data-o"),e.g);t.attr("class",a),setTimeout((()=>t.removeClass(a)),5e3)}if(l.setAttribute("data-o",e.g),l.innerText=s.goal||_noOddsTxt,1==t&&(l.classList.value=getUpDownClass(d.f.g,e.g)),l=o.cells[3*t+3].getElementsByTagName("span")[0],$(l).attr("data-o")&&e.d!=$(l).attr("data-o")){let t=$(l),a=getUpDownClass3(t.attr("data-o"),e.d);t.attr("class",a),setTimeout((()=>t.removeClass(a)),5e3)}l.setAttribute("data-o",e.d),l.innerText=s.down||_noOddsTxt,1==t&&(l.classList.value=getUpDownClass(d.f.d,e.d))}}))}}}function loadCorrectScoreCompOdds(){let e=_ENDPOINT_ODDS+"/ajax/soccerajax?type=14&t=5&id="+_scheduleID;bomHelper.ajaxGet(e,updateCorrectScoreOddsComp),window.clearTimeout(_timerObj.correctScoreTimer),0==_matchInfo.state&&(_timerObj.correctScoreTimer=window.setTimeout("loadCorrectScoreCompOdds()",_updateRate.live))}function updateCorrectScoreOddsComp(e){if(!CheckEmpty(e)){let t=[];0==(e=JSON.parse(e)).ErrCode&&(t=e.Data.oddsList);for(let e=0;e<t.length;e++){let a=t[e],d=a.odds,o=a.prevOdds,s=$("[name=oddsTr][cid="+a.cid+"]")[0],n=[];n=s.cells[2].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.h1)||_noOddsTxt,n[0].setAttribute("data-o",d.h1),n[0].classList.value=getUpDownClass2(o.h1,d.h1),n[1].innerHTML=bodanUSOddsFormat(d.g1)||_noOddsTxt,n[1].setAttribute("data-o",d.g1),n[1].classList.value=getUpDownClass2(o.g1,d.g1),n=s.cells[3].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.h2)||_noOddsTxt,n[0].setAttribute("data-o",d.h2),n[0].classList.value=getUpDownClass2(o.h2,d.h2),n[1].innerHTML=bodanUSOddsFormat(d.g2)||_noOddsTxt,n[1].setAttribute("data-o",d.g2),n[1].classList.value=getUpDownClass2(o.g2,d.g2),n=s.cells[4].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.h3)||_noOddsTxt,n[0].setAttribute("data-o",d.h3),n[0].classList.value=getUpDownClass2(o.h3,d.h3),n[1].innerHTML=bodanUSOddsFormat(d.g3)||_noOddsTxt,n[1].setAttribute("data-o",d.g3),n[1].classList.value=getUpDownClass2(o.g3,d.g3),n=s.cells[5].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.h4)||_noOddsTxt,n[0].setAttribute("data-o",d.h4),n[0].classList.value=getUpDownClass2(o.h4,d.h4),n[1].innerHTML=bodanUSOddsFormat(d.g4)||_noOddsTxt,n[1].setAttribute("data-o",d.g4),n[1].classList.value=getUpDownClass2(o.g4,d.g4),n=s.cells[6].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.h5)||_noOddsTxt,n[0].setAttribute("data-o",d.h5),n[0].classList.value=getUpDownClass2(o.h5,d.h5),n[1].innerHTML=bodanUSOddsFormat(d.g5)||_noOddsTxt,n[1].setAttribute("data-o",d.g5),n[1].classList.value=getUpDownClass2(o.g5,d.g5),n=s.cells[7].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.h6)||_noOddsTxt,n[0].setAttribute("data-o",d.h6),n[0].classList.value=getUpDownClass2(o.h6,d.h6),n[1].innerHTML=bodanUSOddsFormat(d.g6)||_noOddsTxt,n[1].setAttribute("data-o",d.g6),n[1].classList.value=getUpDownClass2(o.g6,d.g6),n=s.cells[8].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.h7)||_noOddsTxt,n[0].setAttribute("data-o",d.h7),n[0].classList.value=getUpDownClass2(o.h7,d.h7),n[1].innerHTML=bodanUSOddsFormat(d.g7)||_noOddsTxt,n[1].setAttribute("data-o",d.g7),n[1].classList.value=getUpDownClass2(o.g7,d.g7),n=s.cells[9].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.h8)||_noOddsTxt,n[0].setAttribute("data-o",d.h8),n[0].classList.value=getUpDownClass2(o.h8,d.h8),n[1].innerHTML=bodanUSOddsFormat(d.g8)||_noOddsTxt,n[1].setAttribute("data-o",d.g8),n[1].classList.value=getUpDownClass2(o.g8,d.g8),n=s.cells[10].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.h9)||_noOddsTxt,n[0].setAttribute("data-o",d.h9),n[0].classList.value=getUpDownClass2(o.h9,d.h9),n[1].innerHTML=bodanUSOddsFormat(d.g9)||_noOddsTxt,n[1].setAttribute("data-o",d.g9),n[1].classList.value=getUpDownClass2(o.g9,d.g9),n=s.cells[11].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.h10)||_noOddsTxt,n[0].setAttribute("data-o",d.h10),n[0].classList.value=getUpDownClass2(o.h10,d.h10),n[1].innerHTML=bodanUSOddsFormat(d.g10)||_noOddsTxt,n[1].setAttribute("data-o",d.g10),n[1].classList.value=getUpDownClass2(o.g10,d.g10),n=s.cells[12].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.d1)||_noOddsTxt,n[0].setAttribute("data-o",d.d1),n[0].classList.value=getUpDownClass2(o.d1,d.d1),n=s.cells[13].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.d2)||_noOddsTxt,n[0].setAttribute("data-o",d.d2),n[0].classList.value=getUpDownClass2(o.d2,d.d2),n=s.cells[14].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.d3)||_noOddsTxt,n[0].setAttribute("data-o",d.d3),n[0].classList.value=getUpDownClass2(o.d3,d.d3),n=s.cells[15].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.d4)||_noOddsTxt,n[0].setAttribute("data-o",d.d4),n[0].classList.value=getUpDownClass2(o.d4,d.d4),n=s.cells[16].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.d5)||_noOddsTxt,n[0].setAttribute("data-o",d.d5),n[0].classList.value=getUpDownClass2(o.d5,d.d5),n=s.cells[17].getElementsByTagName("span"),n[0].innerHTML=bodanUSOddsFormat(d.o)||_noOddsTxt,n[0].setAttribute("data-o",d.o),n[0].classList.value=getUpDownClass2(o.o,d.o)}}}function loadEuroAHCompOdds(){let e=_ENDPOINT_ODDS+"/ajax/soccerajax?type=14&t=6&id="+_scheduleID;bomHelper.ajaxGet(e,updateEuroAHOddsComp),window.clearTimeout(_timerObj.euroAHTimer),0==_matchInfo.state&&(_timerObj.euroAHTimer=setTimeout("loadEuroAHCompOdds()",_updateRate.live))}function updateEuroAHOddsComp(e){if(!CheckEmpty(e)){let t=[];0==(e=JSON.parse(e)).ErrCode&&(t=e.Data.oddsList);for(let e=0;e<t.length;e++){let a=t[e],d=$("[name=oddsTr][cid="+a.cid+"]")[0];oddsParseFloat(a.fodds),oddsParseFloat(a.lodds);let o={up:"",goal:"",down:""},s=[],n=null;[a.fodds,a.lodds].forEach(((e,t)=>{s=oTool.getPL(_oddsType,e.u,e.g,e.d,!0),o.up=s[0],o.goal=s[1],o.down=s[2],e.h=euroHandicapFormat(e.h),n=d.cells[4*t+1].getElementsByTagName("span")[0],n.setAttribute("data-o",e.h),n.innerText=e.h||_noOddsTxt,n=d.cells[4*t+2].getElementsByTagName("span")[0],n.setAttribute("data-o",e.u),n.innerText=o.up||_noOddsTxt,1==t&&(n.classList.value=getUpDownClass(a.fodds.u,e.u)),n=d.cells[4*t+3].getElementsByTagName("span")[0],n.setAttribute("data-o",e.g),n.innerText=o.goal||_noOddsTxt,1==t&&(n.classList.value=getUpDownClass(a.fodds.g,e.g)),n=d.cells[4*t+4].getElementsByTagName("span")[0],n.setAttribute("data-o",e.d),n.innerText=o.down||_noOddsTxt,1==t&&(n.classList.value=getUpDownClass(a.fodds.d,e.d))}))}}}function euroHandicapFormat(e){return"Pt"==_appModule&&e&&"0"!=e&&(e=parseFloat(e)>0?e="-"+e:e.toString().replace("-","+")),e}function loadDoubleChanceCompOdds(){let e=_ENDPOINT_ODDS+"/ajax/soccerajax?type=14&t=7&id="+_scheduleID;bomHelper.ajaxGet(e,updateDoubleChanceOddsComp),window.clearTimeout(_timerObj.doubleChanceTimer),0==_matchInfo.state&&(_timerObj.doubleChanceTimer=setTimeout("loadDoubleChanceCompOdds()",_updateRate.live))}function updateDoubleChanceOddsComp(e){if(!CheckEmpty(e)){let t=[];0==(e=JSON.parse(e)).ErrCode&&(t=e.Data.oddsList);for(let e=0;e<t.length;e++){let a=t[e],d=$("[name=oddsTr][cid="+a.cid+"]")[0];oddsParseFloat(a.fodds),oddsParseFloat(a.lodds);let o={up:"",goal:"",down:""},s=null;[a.fodds,a.lodds].forEach(((e,t)=>{o.up=oTool.changePL(_oddsType,e.u),o.goal=oTool.changePL(_oddsType,e.g),o.down=oTool.changePL(_oddsType,e.d),s=d.cells[3*t+1].getElementsByTagName("span")[0],s.setAttribute("data-o",e.u),s.innerText=o.up||_noOddsTxt,1==t&&(s.classList.value=getUpDownClass(a.fodds.u,e.u)),s=d.cells[3*t+2].getElementsByTagName("span")[0],s.setAttribute("data-o",e.g),s.innerText=o.goal||_noOddsTxt,1==t&&(s.classList.value=getUpDownClass(a.fodds.g,e.g)),s=d.cells[3*t+3].getElementsByTagName("span")[0],s.setAttribute("data-o",e.d),s.innerText=o.down||_noOddsTxt,1==t&&(s.classList.value=getUpDownClass(a.fodds.d,e.d))}))}}}function oddsParseFloat(e,t){if(t)e.u=e.u?round(e.u,t).toFixed(t):"",e.g=e.g?round(e.g,t).toFixed(t):"",e.d=e.d?round(e.d,t).toFixed(t):"";else{let t=2;t=countDecimal(e.u)>2?3:2,e.u=e.u?round(e.u,t).toFixed(t):"",t=countDecimal(e.g)>2?3:2,e.g=e.g?round(e.g,t).toFixed(t):"",t=countDecimal(e.d)>2?3:2,e.d=e.d?round(e.d,t).toFixed(t):""}let a=new RegExp(/^0\.[0]+$/);e.u=a.test(e.u)?"0":e.u,e.g=a.test(e.g)?"0":e.g,e.d=a.test(e.d)?"0":e.d}function round(e,t){let a=Math.pow(10,t),d=e*a;return Math.round(d)/a}function countDecimal(e){var t=(""+e).match(/\.(\d+)$/);return null===t?0:t[1].length}function OddsCompGoal2CnOU(e){return!e&&"0"!=e||isNaN(e)?"":e>20||e<-20?_ouTrimEndZero?parseFloat(e).toString():e:_OddsCompGoalCnOU[Math.abs(parseInt(4*e))]}function getUpDownClass(e,t){return parseFloat(e)<parseFloat(t)?"up2":parseFloat(e)>parseFloat(t)?"down2":""}function getUpDownClass2(e,t){return parseFloat(e)<parseFloat(t)?"up3":parseFloat(e)>parseFloat(t)?"down3":""}function getUpDownClass3(e,t){return parseFloat(e)<parseFloat(t)?"up":parseFloat(e)>parseFloat(t)?"down":""}function changeOddsType(){if(_pageType==PageType.THREEMIX){let e=$("[name=oddsTr]");for(let t=0;t<e.length;t++)for(let a=0;a<_oddsOrder.length;a++){let d={up:null,goal:null,down:null};d.up=e[t].cells[2+3*a].getElementsByTagName("span"),d.goal=e[t].cells[3+3*a].getElementsByTagName("span"),d.down=e[t].cells[4+3*a].getElementsByTagName("span");let o={u:"",g:"",d:""},s=null;for(let e=0;e<3;e++)o.u=d.up[e].getAttribute("data-o"),o.g=d.goal[e].getAttribute("data-o"),o.d=d.down[e].getAttribute("data-o"),s="2"==_oddsOrder[a]?oTool.getPL(_oddsType,o.u,o.g,o.d,!0):oTool.getPL(_oddsType,o.u,o.g,o.d),d.up[e].innerText=s[0]||_noOddsTxt,d.goal[e].innerText=s[1]||_noOddsTxt,d.down[e].innerText=s[2]||_noOddsTxt}}else if(_pageType==PageType.AH||_pageType==PageType.OU||_pageType==PageType.CORNEROU){let e=$("[name=oddsTr]");for(let t=0;t<e.length;t++){let a=e[t].getElementsByTagName("td"),d={up:null,goal:null,down:null},o={u:"",g:"",d:""},s=null;for(let e=0;e<3;e++)d.up=a[3*e+1].getElementsByTagName("span")[0],d.goal=a[3*e+2].getElementsByTagName("span")[0],d.down=a[3*e+3].getElementsByTagName("span")[0],o.u=d.up.getAttribute("data-o"),o.g=d.goal.getAttribute("data-o"),o.d=d.down.getAttribute("data-o"),s=oTool.getPL(_oddsType,o.u,o.g,o.d),d.up.innerText=s[0]||_noOddsTxt,d.goal.innerText=s[1]||_noOddsTxt,d.down.innerText=s[2]||_noOddsTxt}}else if(_pageType==PageType.BODAN){let e=$("[name=oddsTr]");for(let t=0;t<e.length;t++){let a=$(e[t]).find("span[data-o]");for(let e=0;e<a.length;e++)a[e].innerText=(3==_oddsType?bodanUSOddsFormat(a[e].getAttribute("data-o")):a[e].getAttribute("data-o"))||_noOddsTxt}}else if(_pageType==PageType.EUROAH){let e=$("[name=oddsTr]");for(let t=0;t<e.length;t++){let a=e[t].getElementsByTagName("td"),d={up:null,goal:null,down:null},o={u:"",g:"",d:""},s=null;for(let e=0;e<2;e++)d.up=a[4*e+2].getElementsByTagName("span")[0],d.goal=a[4*e+3].getElementsByTagName("span")[0],d.down=a[4*e+4].getElementsByTagName("span")[0],o.u=d.up.getAttribute("data-o"),o.g=d.goal.getAttribute("data-o"),o.d=d.down.getAttribute("data-o"),s=oTool.getPL(_oddsType,o.u,o.g,o.d,!0),d.up.innerText=s[0]||_noOddsTxt,d.goal.innerText=s[1]||_noOddsTxt,d.down.innerText=s[2]||_noOddsTxt}}else if(_pageType==PageType.DOUBLECHANCE){let e=$("[name=oddsTr]");for(let t=0;t<e.length;t++){let a=e[t].getElementsByTagName("td"),d={up:null,goal:null,down:null},o={u:"",g:"",d:""};for(let e=0;e<2;e++)d.up=a[3*e+1].getElementsByTagName("span")[0],d.goal=a[3*e+2].getElementsByTagName("span")[0],d.down=a[3*e+3].getElementsByTagName("span")[0],o.u=d.up.getAttribute("data-o"),o.g=d.goal.getAttribute("data-o"),o.d=d.down.getAttribute("data-o"),d.up.innerText=oTool.changePL(_oddsType,o.u)||_noOddsTxt,d.goal.innerText=oTool.changePL(_oddsType,o.g)||_noOddsTxt,d.down.innerText=oTool.changePL(_oddsType,o.d)||_noOddsTxt}}_$("detailtable")&&_oddsDetailWin&&_oddsDetailWin.changeOddsFormat()}function bodanUSOddsFormat(e){if(3!=_oddsType)return e;if(!e)return"";var t=parseFloat(e),a={.22:-450,.28:-350,.33:-300,.36:-275,.38:-267,.44:-225,.47:-212.5,.53:-187.5,.57:-175,.62:-162.5,.63:-160,.66:-150,.72:-137.5,.83:-120,.88:-114,.91:-110,.95:-105};if(t in a)return a[t];let d=0;return d=t<=0?0:t<1?Math.round(0-100*(1/t).toFixed(2)):Math.round(100*t),d>0?"+"+d:d}function addChangeClass(e){$(e).addClass("odds-change"),setTimeout((()=>$(e).removeClass("odds-change")),5e3)}let _OddsCompGoalCnOU=["0","0/0.5","0.5","0.5/1","1","1/1.5","1.5","1.5/2","2","2/2.5","2.5","2.5/3","3","3/3.5","3.5","3.5/4","4","4/4.5","4.5","4.5/5","5","5/5.5","5.5","5.5/6","6","6/6.5","6.5","6.5/7","7","7/7.5","7.5","7.5/8","8","8/8.5","8.5","8.5/9","9","9/9.5","9.5","9.5/10","10","10/10.5","10.5","10.5/11","11","11/11.5","11.5","11.5/12","12","12/12.5","12.5","12.5/13","13","13/13.5","13.5","13.5/14","14","14/14.5","14.5","14.5/15","15","15/15.5","15.5","15.5/16","16","16/16.5","16.5","16.5/17","17","17/17.5","17.5","17.5/18","18","18/18.5","18.5","18.5/19","19","19/19.5","19.5","19.5/20","20","20/20.5","20.5","20.5/21"],_noOddsTxt="-",_timerObj={threeMixTimer:null,threeMixRunTimer:null,ahOUTimer:null,ahOURunTimer:null,cornerOUTimer:null,correctScoreTimer:null,euroAHTimer:null,doubleChanceTimer:null},_updateRate={live:1e4,run:1e4};const PageType={THREEMIX:3,AH:35,OU:36,CORNEROU:37,BODAN:38,EUROAH:39,DOUBLECHANCE:40};Object.freeze(PageType),loadData();
