var isFavTop=!0;null!=getCookie("isFavTop")&&0==parseInt(getCookie("isFavTop"))&&(document.getElementById("FavTopCheck").checked=!1,isFavTop=!1),null!=getCookie("TeamOrderCheck")&&1==parseInt(getCookie("TeamOrderCheck"))&&document.getElementById("TeamOrderCheck")&&(document.getElementById("TeamOrderCheck").checked=!0),null!=getCookie("YellowCheck")&&1==parseInt(getCookie("YellowCheck"))&&document.getElementById("YellowCheck")&&(document.getElementById("YellowCheck").checked=!1);var optionType=getCookie(FilterCacheKey);null!=optionType&&""!=optionType&&(FilterOptionType=parseInt(optionType));var state_ch=Array(19);state_ch[0]=_locModel.T.T_ST_Postp,state_ch[1]=_locModel.T.T_ST_Pause,state_ch[2]=_locModel.T.T_ST_Abd,state_ch[3]="<font color=green>"+_locModel.T.T_ST_Pend+"</font>",state_ch[4]=_locModel.T.T_ST_Cancel,state_ch[13]="<b>"+_locModel.T.T_ST_FT+"</b>",state_ch[14]=" ",state_ch[15]=_locModel.T.T_ST_Part1,state_ch[16]=_locModel.T.T_ST_HT,state_ch[17]=_locModel.T.T_ST_Part2,state_ch[18]=_locModel.T.T_ST_Ot,state_ch[19]=_locModel.T.T_ST_Pen;var state_Desc=Array(19);function ShowBf(){myLeagueID=getCookie(FavLeagueKey),null==myLeagueID&&(myLeagueID="_"),"league"==orderby?(MakeTable(),document.getElementById("li_league").style.display="none",document.getElementById("li_time").style.display=""):(MakeTableByTime(),document.getElementById("li_league").style.display="",document.getElementById("li_time").style.display="none"),document.getElementById("TeamOrderCheck").checked&&ShowTeamOrder(),1==FilterOptionType&&1==selectMenu&&(FilterByOption(FilterOptionType),SelectMenu("li_FilterHot")),MakeSclass(),MakeCountry(),showMyGameCookie(),"8"==selectMenu&&"0"!=$("#myGamesCount").html()&&(ShowMyGames(),SelectMenu("li_MyGame")),InitToTop(),InitHeadShow(),InitFilter()}function formatTime(e){var t=e.getHours(),n=e.getMinutes();return t<10&&(t="0"+t),n<10&&(n="0"+n),t+":"+n}function ShowTeamOrder(){if(document.getElementById("TeamOrderCheck").checked){writeCookie("TeamOrderCheck",1);for(var e=1;e<=matchcount;e++)if(!Bf_simply_disp||0!=B[A[e][1]][4]){var t=/[\u4E00-\u9FA5]/g;""!=A[e][16]&&0!=A[e][16]&&(document.getElementById("horder_"+A[e][0]).innerHTML="<span class=team-hg>["+A[e][16].toString().replace(t,"")+"]</span>"),""!=A[e][17]&&0!=A[e][17]&&(document.getElementById("gorder_"+A[e][0]).innerHTML="<span class=team-hg>["+A[e][17].toString().replace(t,"")+"]</span>")}}else{writeCookie("TeamOrderCheck",0);for(e=1;e<=matchcount;e++)Bf_simply_disp&&0==B[A[e][1]][4]||(""!=A[e][16]&&(document.getElementById("horder_"+A[e][0]).innerHTML=""),""!=A[e][17]&&(document.getElementById("gorder_"+A[e][0]).innerHTML=""))}}state_Desc[0]=_locModel.T.T_ST_Postponed,state_Desc[1]=_locModel.T.T_ST_Pause,state_Desc[2]=_locModel.T.T_ST_Abandoned,state_Desc[3]="",state_Desc[4]=_locModel.T.T_ST_Cancel,state_Desc[13]="",state_Desc[14]="",state_Desc[15]=_locModel.T.T_ST_Part1,state_Desc[16]="",state_Desc[17]=_locModel.T.T_ST_Part2,state_Desc[18]=_locModel.T.T_ST_Ot,state_Desc[19]=_locModel.T.T_ST_Pen;var searchArray=new Array,_explainColIdx=21;function MakeTable(){var e,t,n,a,l,o=0,d=0,s=0,i="",c="",r=new Array;r.push("<table id='table_live' width='100%' align=center cellspacing=0 border=0 cellpadding=0><tr id='tr_0' class='scoretitle'>"),r.push("<td width='2.4%'><span class='allno' onclick='ClearMyGames()'></span></td><td width=10% colspan=2>"+_locModel.T.T_Time+"</td><td width=22% align=right>"+_locModel.T.T_Home+"</td><td id='ScoreTh' width='7.5%'>"+_locModel.T.T_Score+"</td><td width=22% align=left>"+_locModel.T.T_Away+"</td><td class='data_td' style='width:12.5%'>"+_locModel.T.T_Data+"</td>"),0==matchcount&&r.push("<tr><td colspan=8 height=40>No match.</td></tr>"),r.push("<tr id='topLine' class='emptyFilter' style='display:none;'><td colspan=13>"+_locModel.T.T_Tip_NoMatchFilter+"<a href='javascript:FilterByOption(0);SelectMenu(\"li_ShowAll\");' class='blue;'>["+_locModel.T.T_Btn_ShowAll+"]</a></td></tr>");for(var m=!1,p=1,y=0,u=1,g=1;g<=matchcount;g++)try{if(s=A[g][1],Bf_simply_disp&&0==B[s][4])continue;switch(e=A[g][7],m=parseInt(e)>0||-1==parseInt(e),"&nbsp;",i="",c=""," - ",e){case 0:match_score=" VS ";break;case 1:match_score=A[g][8]+" - "+A[g][9],A[g][23]&&A[g][24]&&A[g][23]+" - "+A[g][24];break;case-10:case-11:case-14:match_score=" VS ";break;default:match_score=A[g][8]+" - "+A[g][9],null==A[g][10]&&(A[g][10]=""),null==A[g][11]&&(A[g][11]=""),A[g][10]+" - "+A[g][11],parseInt(A[g][8])>parseInt(A[g][9])&&(i="font-weight:bold;"),parseInt(A[g][9])>parseInt(A[g][8])&&(c="font-weight:bold;"),A[g][23]&&A[g][24]&&A[g][23]+" - "+A[g][24]}var _=convertTime(A[g][6]);_=new Date(Date.UTC(_.getFullYear(),_.getMonth(),_.getDate(),_.getHours(),_.getMinutes(),_.getSeconds())),t=m&&"0"!=A[g][12]?"<span class='redcard'>"+A[g][12]+"</span>":"",n=m&&"0"!=A[g][13]?"<span class='redcard'>"+A[g][13]+"</span>":"",a=m&&"0"!=A[g][14]?"<span class='yellowcard' "+(document.getElementById("YellowCheck").checked?"":'style="display:none;" ')+">"+A[g][14]+"</span>":"",l=m&&"0"!=A[g][15]?"<span class='yellowcard' "+(document.getElementById("YellowCheck").checked?"":'style="display:none;" ')+">"+A[g][15]+"</span>":"",bg=g%2==0?"":"b2";_=convertTime(A[g][6]);_=ToLocalTime(_),classx2=-1==e?"red":"blue",o!=s&&(o=s,y=B[A[g][1]][0],r.push("<tr class='Leaguestitle fbHead'  id='tr_"+s+"'  leaIndex='"+s+"'  data-lidx='"+p+"' sclassID='"+y+"' isLeaTop='0'>"),r.push("<td><div class='add-div'><span class='add-info-l l0'><i id='favLeague_"+s+"' src='/images/star_off.png' onclick='MoveTopLeague("+s+");' style='cursor:pointer;'></i></span><span class='add-info-l2 l0'><i id='delLeague_"+s+"' onclick='ResetTopLeague("+s+");' style='cursor:pointer;display:none;'></i></span></div></td>"),r.push("<td colspan='8'><span class='l1'><a class='fbsclass' href='javascript:void(0)'><img src='"+B[A[g][1]][9]+"' />"+B[s][2]+"</a></span><div class='l2'>"),r.push("<span class='l5'><span class='hidden-info r0'><a href=\"javascript:HiddenLeague("+s+",false)\" id='collapse"+s+"' class='collapse'></a></span><span class='display-info r0'><a href=\"javascript:HiddenLeague("+s+",true)\" id='expand"+s+"' style='display:none;' class='expand'></a></span></span>"),r.push("<span id='tips_"+s+"' class='l5 tipsNum'>"+_locModel.T.T_DisplayMatch+"(<span id='tips_num_"+s+"'></span>)</span>"),r.push("</div></td></tr>"),p++);r.push("<tr id='tr1_"+A[g][0]+"' class='"+bg+"' leaIndex='"+s+"' index='"+g+"' >"),r.push("<td height=30><div class='add-div'><span class='add-info l0'><i id='mygame_"+A[g][0]+"' class='mygame_"+A[g][0]+"' onclick='MyMatch("+g+");' style='cursor:pointer;'></i></span><span class='add-info2 l0'><i id='delgame_"+A[g][0]+"' class='delgame_"+A[g][0]+"' onclick='MyremoveMatch("+g+");' style='cursor:pointer;display:none;'></i></span></div></td>"),r.push("<td width=0 style='display:none;'></td>"),r.push("<td name='timeData' data-t='"+A[g][6]+"' data-tf='4' class='time' "+(-1==e?"onclick='openFbDetail("+A[g][0]+")'":"onclick='openFbAnalysis("+A[g][0]+")'")+" >"+formatTime(_)+"</td>"),r.push("<td class='status td_status' "+(-1==e?"onclick='openFbDetail("+A[g][0]+")'":"onclick='openFbAnalysis("+A[g][0]+")'")+" title='"+state_Desc[e+14]+"'>"+state_ch[e+14]+"</td>"),r.push("<td style='text-align:right;"+i+"'  "+(-1==e?"onclick='openFbDetail("+A[g][0]+")'":"onclick='openFbAnalysis("+A[g][0]+")'")+">"+t+a+"<span id=horder_"+A[g][0]+"></span><a href='javascript:void(0)'>"+A[g][4]+"<span class='teamLogoBox teamLogoHomeBox'><img src='"+A[g][25]+"'></span></a></td>"),r.push("<td "+(-1==e?"onclick='openFbDetail("+A[g][0]+")'":"onclick='openFbAnalysis("+A[g][0]+")'")+" class='handpoint "+classx2+"'><b>"+match_score+"</b></td>"),r.push("<td style='text-align:left;"+c+"'  "+(-1==e?"onclick='openFbDetail("+A[g][0]+")'":"onclick='openFbAnalysis("+A[g][0]+")'")+"><a  href='javascript:void(0)'><span class='teamLogoBox teamLogoAwayBox'><img src='"+A[g][26]+"'></span>"+A[g][5]+"</a><span id=gorder_"+A[g][0]+"></span> "+n+l+"</td>"),r.push("<td class='toolimg' style='text-align:left;'><span onclick='openFbAnalysis("+A[g][0]+")' class='analyze-icon r0'></span><span onclick='opentFbOddsComp("+A[g][0]+")'  class='odds-icon r0'></span><span onclick='openFbDetail("+A[g][0]+")' class='Detail-icon r0'></span>"),"True"==A[g][22]&&r.push("<span onclick='openFb3in1('"+A[g][0]+")'><img src='/images/"+(parseInt(e)>0?"t32":"t3")+".png' class='threeinone-icon l0'></span>"),r.push("</td></tr>");var h=A[g][_explainColIdx];if(""==A[g][_explainColIdx-2]&&""==A[g][_explainColIdx]||""==A[g][_explainColIdx-2]&&""==h||null!=requestF&&"sel"==requestF?classx="none":classx="",r.push("<tr id='tr2_"+A[g][0]+"' leaindex='"+s+"' style='display:"+classx+"'><td colspan=10 align=center height=18 class='text-info' id='other_"+A[g][0]+"'>"),A[g][_explainColIdx]&&""!=A[g][_explainColIdx]){var T=" "+_locModel.T.T_Win;h=(h=h.replace(/Win/i,T).replace("Thắng",T).replace("勝",T).replace("승",T)).replace(/min/i,_locModel.T.T_S_Minutes),r.push(h)}""!=h?r.push("<br />"+A[g][_explainColIdx-2]):r.push(A[g][_explainColIdx-2]),r.push("</td></tr>"),r.push("<tr id='tr3_"+A[g][0]+"' style='display:none' leaIndex='"+s+"'></tr>"),"undefined"!=typeof adinfo1&&d<adinfo1.length?r.push("<tr id=tr_ad"+d+" class='adtext-bg'><td colspan=10 align=center height=20><a rel='nofollow' class='adtext"+(d%2==0?1:2)+"' href='"+adinfo1[d]+"' target=_blank ><b>"+unescape(adinfo2[d])+"</b></a></td></tr>"):u<=admiddleCount&&""!=getAdHtml("en","middle_M"+u)&&(r.push("<tr id=tr_ad"+d+" class='ad_m'><td colspan=10>"+getAdHtml("en","middle_M"+u)+"</td></tr>"),u++),d++}catch(e){console.log(e)}null!=requestF&&""!=requestF&&-1!=requestF.indexOf("ft")&&r.push("<tr class='adtext-bg'><td colspan=10 height=20 style='color:red;text-align:center;'>"+_locModel.T.T_FX_Notes+"</td></tr>"),r.push("</table>"),document.getElementById("live").innerHTML=r.join("")}function MakeTableByTime(){var e,t,n,a,l,o=0,d=0,s=new Array,i="",c="";s.push("<table id='table_live' width='100%' align=center cellspacing=0 border=0 cellpadding=0><tr id='tr_0' class='scoretitle'>"),s.push("<td width='2.4%' height=20><span class='allno' onclick='ClearMyGames()'></span></td><td width=7.1%>"+_locModel.T.T_League+"</td><td  width=9% colspan=2>"+_locModel.T.T_Time+"</td><td width=20% align=right>"+_locModel.T.T_Home+"</td><td id='ScoreTh' width='7.5%'>"+_locModel.T.T_Score+"</td><td width=20% align=left>"+_locModel.T.T_Away+"</td><td class='data_td'  style='width:12.5%'>"+_locModel.T.T_Data+"</td>"),0==matchcount&&s.push("<tr><td colspan=9 height=40>No match.</td></tr>"),s.push("<tr id='topLine' class='emptyFilter' style='display:none;'><td colspan=13>"+_locModel.T.T_Tip_NoMatchFilter+"<a href='javascript:FilterByOption(0);SelectMenu(\"li_ShowAll\");' class='blue;'>["+_locModel.T.T_Btn_ShowAll+"]</a></td></tr>");for(var r=!1,m=1,p=1;p<=matchcount;p++)try{if(Bf_simply_disp&&0==B[A[p][1]][4])continue;switch(e=A[p][7],r=parseInt(e)>0||-1==parseInt(e),"&nbsp;",i="",c=""," - ",e){case 0:match_score="VS";break;case 1:match_score=A[p][8]+" - "+A[p][9],A[p][23]&&A[p][24]&&A[p][23]+" - "+A[p][24];break;case-10:case-11:case-14:match_score=" VS ";break;default:match_score=A[p][8]+" - "+A[p][9],null==A[p][10]&&(A[p][10]=""),null==A[p][11]&&(A[p][11]=""),A[p][10]+" - "+A[p][11],parseInt(A[p][8])>parseInt(A[p][9])&&(i="font-weight:bold;"),parseInt(A[p][9])>parseInt(A[p][8])&&(c="font-weight:bold;"),A[p][23]&&A[p][24]&&A[p][23]+" - "+A[p][24]}var y=convertTime(A[p][6]);if(y=new Date(Date.UTC(y.getFullYear(),y.getMonth(),y.getDate(),y.getHours(),y.getMinutes(),y.getSeconds())),d=A[p][1],searchArray[p-1]=A[p][0]+"^"+p+"^"+B[d][1]+"^"+formatTime(y)+"^"+state_ch[e+14]+"^"+A[p][4]+"^"+A[p][5]+"^"+match_score,A[p][21]&&""!=A[p][21]){var u=" "+_locModel.T.T_Win;searchArray[p-1]+="^"+A[p][21].replace(/Win/i,u).replace("Thắng",u).replace("勝",u).replace("승",u)}t=r&&"0"!=A[p][12]?"<span class='redcard'>"+A[p][12]+"</span>":"",n=r&&"0"!=A[p][13]?"<span class='redcard'>"+A[p][13]+"</span>":"",a=r&&"0"!=A[p][14]?"<span class='yellowcard'"+(document.getElementById("YellowCheck").checked?"":'style ="display:none;" ')+">"+A[p][14]+"</span>":"",l=r&&"0"!=A[p][15]?"<span class='yellowcard'"+(document.getElementById("YellowCheck").checked?"":'style ="display:none;" ')+">"+A[p][15]+"</span>":"",bg=p%2==0?"":"b2";y=convertTime(A[p][6]);y=ToLocalTime(y),classx2=-1==e?"red":"blue";s.push("<tr id='tr1_"+A[p][0]+"' class='"+bg+"' index='"+p+"' date='' >"),s.push("<td height=30><div class='add-div'><span class='add-info'><i id='mygame_"+A[p][0]+"' class='mygame_"+A[p][0]+"' onclick='MyMatch("+p+");' style='cursor:pointer;'></i></span><span class='add-info2'><i id='delgame_"+A[p][0]+"' class='star delgame_"+A[p][0]+"' onclick='MyremoveMatch("+p+");' style='cursor:pointer;display:none;'></i></span></div></td>"),s.push("<td class='black-down' style='color:#FFF;' title=\""+B[A[p][1]][_leagueNameIdx]+'">'),""!=B[A[p][1]][5]?s.push("<a href='#' target=_blank style='color:white;'><span style='background-color: "+B[A[p][1]][3]+"'>"+B[A[p][1]][1]+"</span></a></td>"):s.push("<span style='background-color: "+B[A[p][1]][3]+"'>"+B[A[p][1]][1]+"</span></td>"),s.push("<td name='timeData' data-t='"+A[p][6]+"' data-tf='4' class='time'  "+(-1==e?"onclick='openFbDetail("+A[p][0]+")'":"onclick='openFbAnalysis("+A[p][0]+")'")+">"+formatTime(y)+"</td>"),s.push("<td class='status' class='td_status'  "+(-1==e?"onclick='openFbDetail("+A[p][0]+")'":"onclick='openFbAnalysis("+A[p][0]+")'")+" title='"+state_Desc[e+14]+"'>"+state_ch[e+14]+"</td>"),s.push("<td style='text-align:right;"+i+"' onclick='openFbPanlu("+A[p][0]+")'><span id=horder_"+A[p][0]+"></span><a id='yellow1_"+A[p][0]+"'>"+a+"</a><a id='redcard1_"+A[p][0]+"'>"+t+"</a> <a id='team1_"+A[p][0]+"' href='javascript:' >"+A[p][4].replace("#880000","#FF2929")+"<span class='teamLogoBox teamLogoHomeBox'><img src='"+A[p][25]+"'></span></a></td>"),s.push("<td "+(-1==e?"onclick='openFbDetail("+A[p][0]+")'":"onclick='openFbAnalysis("+A[p][0]+")'")+" class='handpoint "+classx2+"'><b>"+match_score+"</b></td>"),s.push("<td style='text-align:left;"+c+"' onclick='openFbPanlu("+A[p][0]+")'><a id='team2_"+A[p][0]+"' href='javascript:' ><span class='teamLogoBox teamLogoAwayBox'><img src='"+A[p][26]+"'></span>"+A[p][5]+"</a> <a id='redcard2_"+A[p][0]+"'>"+n+"</a><a id='yellow2_"+A[p][0]+"'>"+l+"</a><span id=gorder_"+A[p][0]+"></span></td>"),s.push("<td class='toolimg' style='text-align:left;'><span onclick='openFbAnalysis("+A[p][0]+")' class='analyze-icon l0''></span><span onclick='opentFbOddsComp("+A[p][0]+")' class='odds-icon l0'></span><span onclick='openFbDetail("+A[p][0]+")' class='Detail-icon l0'></span>"),"True"==A[p][22]&&s.push("<span onclick='openFb3in1('"+A[p][0]+")'><img src='/images/"+(parseInt(e)>0?"t32":"t3")+".png' title='3in1'></span>"),s.push("</td></tr>");var g=A[p][21];if(classx=g?"":"none",s.push("<tr id='tr2_"+A[p][0]+"' style='display:"+classx+"'><td colspan=10 align=center height=18 class='text-info'  id='other_"+A[p][0]+"'>"),g){u=" "+_locModel.T.T_Win;g=(g=g.replace(/Win/i,u).replace("Thắng",u).replace("勝",u).replace("승",u)).replace(/min/gi,_locModel.T.T_S_Minutes),s.push(g)}s.push("</td></tr>"),s.push("<tr id='tr3_"+A[p][0]+"' style='display:none'></tr>"),"undefined"!=typeof adinfo1&&o<adinfo1.length?s.push("<tr id=tr_ad"+o+" class='adtext-bg'><td colspan=10 align=center height=20><a class='adtext"+(o%2==0?1:2)+"' href='"+adinfo1[o]+"' target=_blank ><b>"+unescape(adinfo2[o])+"</b></a></td></tr>"):m<=admiddleCount&&""!=getAdHtml("en","middle_M"+m)&&(s.push("<tr id=tr_ad"+o+" class='ad_m'><td colspan=10>"+getAdHtml("en","middle_M"+m)+"</td></tr>"),m++),o++}catch(e){console.log(e)}null!=requestF&&""!=requestF&&-1!=requestF.indexOf("ft")&&s.push("<tr class='adtext-bg'><td colspan=10 height=20 style='color:red;text-align:center;'>"+_locModel.T.T_FX_Notes+"</td></tr>"),s.push("</table>"),document.getElementById("live").innerHTML=s.join("")}function ShowAllMatch(){var e;e=document.getElementById("myleague2").getElementsByTagName("input");for(var t=0;t<e.length;t++)e[t].checked=!0;e=document.getElementById("countryListDiv").getElementsByTagName("input");for(t=0;t<e.length;t++)e[t].checked=!0;e=document.getElementById("table_live").getElementsByTagName("tr");for(t=0;t<e.length;t++)null!=e[t].getAttribute("index")&&(e[t].style.display="");for(t=1;t<=matchcount;t++)""==A[t][_explainColIdx-2]&&(""==A[t][_explainColIdx]||0!=Bf_simply_disp&&1!=B[A[t][1]][4])||(document.getElementById("tr2_"+A[t][0]).style.display="");if("league"==orderby)for(t=1;t<=sclasscount;t++)Bf_simply_disp&&0==B[t][4]||(document.getElementById("tr_"+t).style.display="");document.getElementById("hiddencount").innerHTML="0"}function HiddenLeague(e,t){t?(document.getElementById("expand"+e).style.display="none",document.getElementById("collapse"+e).style.display=""):(document.getElementById("expand"+e).style.display="",document.getElementById("collapse"+e).style.display="none"),HiddenSub(e,t),reorderAd()}function HiddenSub(e,t){var n=0;if(t){for(var a=1;a<=matchcount;a++)A[a][1]==e&&(document.getElementById("tr1_"+A[a][0]).style.display="",""==A[a][_explainColIdx-2]&&""==A[a][_explainColIdx]||document.getElementById("tr2_"+A[a][0])&&(document.getElementById("tr2_"+A[a][0]).style.display=""));document.getElementById("tips_"+e).style.display="none"}else{for(a=1;a<=matchcount;a++)A[a][1]==e&&(document.getElementById("tr1_"+A[a][0]).style.display="none",""==A[a][_explainColIdx-2]&&""==A[a][_explainColIdx]||document.getElementById("tr2_"+A[a][0])&&(document.getElementById("tr2_"+A[a][0]).style.display="none"),n++);document.getElementById("tips_num_"+e).innerHTML=n,document.getElementById("tips_"+e).style.display="block"}}function CloseLeague(e){document.getElementById("myleague_"+e).checked=!1,CheckLeague(e)}function setOrderby(e){orderby=e,writeCookie("orderby",orderby),LoadLiveFile()}var _dynamicData=!1;function LoadLiveFile(){var e="",t="",n=!1;if(null!=requestF&&""!=requestF&&(e=requestF),null!=requestDate&&""!=requestDate&&(t=requestDate),""==e&&""!=t&&(n=!0),""==t){var a=new Date;e="ft0",t=a.getFullYear()+"-"+(a.getMonth()+1)+"-"+a.getDate()}if(!n){var l=_$(e);l&&($("#daFixture").removeClass("on"),l.parentNode.addClass="on")}var o=document.getElementById("allDate"),d=document.createElement("script");d.type="text/javascript",d.src="/AjaxCenter/GetScheduleWithTimeZone?date="+t+"&order="+orderby+"&timezone="+_timeZone,o.removeChild(o.firstChild),o.appendChild(d,"script"),window.setTimeout("LoadLiveFile()",36e5)}function createMatchData(result){var jsdata="";CheckEmpty(result)||(result=eval("("+result+")"),0==result.ErrCode&&(jsdata=result.Data,""!=jsdata&&X2.Eval(jsdata)))}function FilterByOption(e){FilterOptionType!=e&&(FilterOptionType=e,writeCookie(FilterCacheKey,FilterOptionType)),ClearAllFilter(),0!=e?(hiddenID="_",writeCookie("Hidden_MatchID",hiddenID),hidden_LeagueId="_",writeCookie("Hidden_SclassID","_"),InitMatchByMatchState(FilterType)):ShowAllMatch(FilterBy)}function ShowAllMatch(e){ClearMatchCookie(),FilterBy=1==e?1:0,InitMatchByMatchState(0)}function ClearMatchCookie(){hiddenID="_",writeCookie("Hidden_MatchID",hiddenID),hidden_LeagueId="_",writeCookie("Hidden_SclassID","_"),hidden_Country="_",writeCookie("Hidden_Country","_")}function InitMatchByMatchState(e){var t=0;_$("topLine")&&(_$("topLine").style.display="none");for(var n=document.getElementById("table_live").getElementsByTagName("tr"),a=1;a<n.length;a++)null!=n[a].getAttribute("index")&&(n[a].style.display="none",n[a+1].style.display="none");for(a=1;a<=matchcount;a++)if(CheckFilterOpt(A[a]))if(0==e||1==e&&parseInt(A[a][8])>0||2==e&&"-1"==A[a][8]||3==e&&"0"==A[a][8]||4==e&&"True"==A[a][20]){var l=null;(l=document.getElementById("tr1_"+A[a][0]))&&(l.style.display=""),(l=document.getElementById("mygame_"+A[a][0]))&&(l.style.display=""),(l=document.getElementById("delgame_"+A[a][0]))&&(l.style.display="none"),hasExplain(a)&&(l=document.getElementById("tr2_"+A[a][0]))&&(l.style.display="")}else t+=1;else t++;document.getElementById("hiddencount").innerHTML=t,FilterType=e,writeCookie("Filter_Type",FilterType);var o=document.getElementById("rb"+(FilterType+5*FilterBy));o&&!o.checked&&(o.checked=!0),reorderAd(),InitToTop()}function hasExplain(e){return A[e][_explainColIdx-2]+A[e][_explainColIdx]!=""}function SyncLeaSorting(){if(_leaSortting)for(var e=document.getElementById("myleague2").getElementsByTagName("ul"),t=0;t<e.length;t++){for(var n=e[t].getAttribute("name"),a=e[t].getElementsByTagName("li"),l=0,o=0;o<a.length;o++)"none"!=a[o].style.display&&l++;_$(n)&&(_$(n).style.display=0==l?"none":"")}}function CheckFilterOpt(e){return rsIdx=A.indexOf(e),!(1==FilterOptionType&&0==B[e[1]][4]||2==FilterOptionType&&1!=RS[rsIdx][0]||3==FilterOptionType&&1!=RS[rsIdx][1])}function reorderAd(){for(var e=_$("table_live"),t=new Array,n=0;n<20;n++){var a=_$("tr_ad"+n);a&&(t.push(a),a.parentNode.removeChild(a))}var l=e.rows;if(0!=l.length){var o=0,d=0;for(n=0;n<l.length;n++)if(l[n].getAttribute("index")&&"none"!=l[n].style.display&&(++d-1)%2==0){if(t.length-1<o)return;if("ad_m"==t[o].classList[0]&&d<12)continue;insertAfter(t[o++],l[n+1])}for(n=o;n<t.length;n++)e.appendChild(t[n])}}function MyMatch(e){$(".mygame_"+A[e][0]).hide(),$(".delgame_"+A[e][0]).show(),-1==myGamesID.indexOf("_"+A[e][0]+"_")&&(myGamesID+=A[e][0]+"_",document.getElementById("myGamesCount").innerHTML=parseInt(document.getElementById("myGamesCount").innerHTML)+1),writeCookie(FavMatchKey,myGamesID,new Date((new Date).getTime()+6048e5)),isFavTop&&MoveToTop(A[e][0]),InitHeadShow()}function MoveToTop(e){try{if(null!=document.getElementById("tr1_"+e)){if("league"==orderby){var t=document.getElementById("tr1_"+e).getAttribute("leaIndex");document.getElementById("tr_"+t).insertAdjacentElement("afterEnd",document.getElementById("tr2_"+e)),document.getElementById("tr_"+t).insertAdjacentElement("afterEnd",document.getElementById("tr1_"+e))}else{var n=$("[isTop=1]");if(0==$("[isTop=1]").length)document.getElementById("topLine").insertAdjacentElement("afterEnd",document.getElementById("tr2_"+e)),document.getElementById("topLine").insertAdjacentElement("afterEnd",document.getElementById("tr1_"+e));else{var a=GetDataIndex(e);if(a>0){for(var l=GetWeight(a),o=0,d=0,s=0,i=0;i<n.length;i++){var c=GetWeight(s=$("#"+n[i].id).attr("index"));if(!(c<l&&(c>o||0==o)))break;d=A[s][0],o=c}0==d?(document.getElementById("topLine").insertAdjacentElement("afterEnd",document.getElementById("tr2_"+e)),document.getElementById("topLine").insertAdjacentElement("afterEnd",document.getElementById("tr1_"+e))):(document.getElementById("tr2_"+d).insertAdjacentElement("afterEnd",document.getElementById("tr2_"+e)),document.getElementById("tr2_"+d).insertAdjacentElement("afterEnd",document.getElementById("tr1_"+e)))}}}document.getElementById("tr1_"+e).setAttribute("isTop","1")}}catch(e){}}function GetDataIndex(e){return $("#tr1_"+e)?$("#tr1_"+e).attr("index"):0}function GetWeight(e){var t=A[e];-1!=t[6].indexOf(":")&&(t[6]=t[6].replace(/-/g,",").replace(/\ /g,",").replace(/:/g,","));var n=t[6].split(",");1==n[1].length&&(n[1]="0"+n[1]);var a=(new Date).getFullYear()-parseInt(n[0])+n[1]+n[2]+n[3]+n[4];return parseFloat(parseInt(a)+"."+e)}function MyremoveMatch(e){$(".mygame_"+A[e][0]).show(),$(".delgame_"+A[e][0]).hide(),-1!=myGamesID.indexOf("_"+A[e][0]+"_")&&(myGamesID=myGamesID.replace(A[e][0]+"_",""),document.getElementById("myGamesCount").innerHTML=parseInt(document.getElementById("myGamesCount").innerHTML)-1),writeCookie(FavMatchKey,myGamesID,new Date((new Date).getTime()+6048e5)),isFavTop&&MoveToReset(A[e][0]),$("#li_MyGame").hasClass("on")&&(document.getElementById("tr1_"+A[e][0]).style.display="none",document.getElementById("tr2_"+A[e][0])&&(document.getElementById("tr2_"+A[e][0]).style.display="none")),InitHeadShow()}function MoveToReset(e){try{null!=document.getElementById("tr3_"+e)&&(document.getElementById("tr1_"+e).setAttribute("isTop","0"),document.getElementById("tr3_"+e).insertAdjacentElement("beforeBegin",document.getElementById("tr1_"+e)),document.getElementById("tr3_"+e).insertAdjacentElement("beforeBegin",document.getElementById("tr2_"+e)))}catch(e){}}function showMyGameCookie(){if(null!=getCookie(FavMatchKey))try{myGamesID=getCookie(FavMatchKey);for(var e=0,t=1;t<=matchcount;t++)-1!=myGamesID.indexOf(A[t][0])&&e++;document.getElementById("myGamesCount").innerHTML=e}catch(e){}}function FavTopCheck(){document.getElementById("FavTopCheck").checked?(writeCookie("isFavTop",1),isFavTop=!0):(writeCookie("isFavTop",0),isFavTop=!1),InitToTop()}function InitToTop(){if(null!=getCookie(FavMatchKey))try{myGamesID=getCookie(FavMatchKey);for(var e=1;e<matchcount;e++)if(-1!=myGamesID.indexOf(A[e][0])){var t=A[e][0];if(document.getElementById("mygame_"+t)){if(!document.getElementById("mygame_"+t))return!1;document.getElementById("mygame_"+t).style.display="none",document.getElementById("delgame_"+t).style.display=""}document.getElementById("tr1_"+t)&&(isFavTop?MoveToTop(t):MoveToReset(t))}}catch(e){}if("league"==orderby&&null!=getCookie(FavLeagueKey))try{myLeagueID=getCookie(FavLeagueKey),null==myLeagueID&&(myLeagueID="_");var n=$(".Leaguestitle");if(null!=n&&n.length>0)for(e=0;e<n.length;e++){var a=n[e].id.replace("tr_",""),l=n[e].getAttribute("sclassid");-1!=myLeagueID.indexOf("_"+l+"_")&&MoveTopLeague(a)}}catch(e){}InitHeadShow()}function OpenMyGame(){"0"==$("#myGamesCount").html()?alert(_locModel.T.T_Tip_AddGame):(ShowMyGames(),SelectMenu("li_MyGame"),ClearAllFilter(),InitAllOption(),"undefined"!=typeof InitTipsNum&&InitTipsNum())}function ShowMyGames(){try{var e;e=document.getElementById("myleague2").getElementsByTagName("input");for(var t=0;t<e.length;t++)e[t].checked=!0;e=document.getElementById("table_live").getElementsByTagName("tr");for(t=0;t<e.length;t++)null!=e[t].getAttribute("index")&&(e[t].style.display="none");for(t=1;t<=matchcount;t++)hasExplain(t)&&document.getElementById("tr2_"+A[t][0])&&(document.getElementById("tr2_"+A[t][0]).style.display="none");if("league"==orderby)for(t=1;t<=sclasscount;t++)try{if(null==B[t])continue;document.getElementById("tr_"+t).style.display="none",document.getElementById("expand"+t).style.display="none",document.getElementById("collapse"+t).style.display="none"}catch(e){}if(myGamesID=getCookie(FavMatchKey),"_"==myGamesID)return;var n=0,a=myGamesID.split("_");for(t=1;t<a.length-1;t++)null!=document.getElementById("tr1_"+a[t])&&(document.getElementById("tr1_"+a[t]).style.display="",document.getElementById("mygame_"+a[t]).style.display="none",document.getElementById("delgame_"+a[t]).style.display="",document.getElementById("other_"+a[t])&&""!=document.getElementById("other_"+a[t]).innerHTML&&(document.getElementById("tr2_"+a[t]).style.display=""),n++);document.getElementById("myGamesCount").innerHTML=n,document.getElementById("hiddencount").innerHTML=matchcount-n,InitHeadShow(),ClearAllFilter()}catch(e){alert(_locModel.T.T_Tip_AddGame)}}function SetDate(e){if(document.getElementById("da_"+e)){var t=document.getElementById("da_"+e).firstChild.href;null!=t&&""!=t&&(window.location.href=t)}}function SelectMenu(e){$("#li_ShowAll").removeClass("on"),$("#li_FilterHot").removeClass("on"),$("#li_MyGame").removeClass("on"),$(".filterLi").removeClass("on"),$("#"+e).addClass("on");var t=0;"li_FilterHot"==e?t=1:"li_MyGame"==e&&"0"!=$("#myGamesCount").html()&&(t=8),selectMenu=t,sessionStorage.setItem(SelMenuCacheKey,t)}function InitHeadShow(){var e=$(".Leaguestitle");if(null!=e||0!=e.length){var t="leaIndex";"time"==orderby?t="date":"league"==orderby&&(t="leaIndex");for(var n="",a=0;a<e.length;a++){n=e[a].getAttribute(t);var l=$("tr[index]["+t+'="'+n+'"]'),o=!1;if(null!=l&&l.length>0)for(var d=0;d<l.length;d++)if("none"!=l[d].style.display&&("time"!=orderby||1!=l[d].getAttribute("istop"))){o=!0;break}e[a].style.display=o?"":"none"}reorderAd()}}function MoveTopLeague(e){try{var t=document.getElementById("tr_"+e);if(null!=t){document.getElementById("favLeague_"+e).style.display="none",document.getElementById("delLeague_"+e).style.display="";var n=B[e][0];null==myLeagueID&&(myLeagueID="_"),-1==myLeagueID.indexOf("_"+n+"_")&&(myLeagueID+=n+"_"),writeCookie(FavLeagueKey,myLeagueID,new Date((new Date).getTime()+6048e5));var a=$("[isLeaTop=1]");if(0==a.length)document.getElementById("topLine").insertAdjacentElement("beforeBegin",t),$(t).after($("[leaindex="+e+"]"));else{var l=GetLeagueIndex(e);if(l>0){for(var o=0,d=0,s=0,i=0;i<a.length;i++)if(s=$("#"+a[i].id).attr("data-lidx"),d=a[i].id,s>l){o=s;break}0==o?(document.getElementById("topLine").insertAdjacentElement("beforeBegin",t),$(t).after($("[leaindex="+e+"]"))):(document.getElementById(d).insertAdjacentElement("beforeBegin",t),$(t).after($("[leaindex="+e+"]")))}}t.setAttribute("isLeaTop","1"),$(t).addClass("isLeaTop"),reorderAd()}}catch(e){}}function ResetTopLeague(e){try{var t=document.getElementById("tr_"+e);if(null!=t){document.getElementById("delLeague_"+e).style.display="none",document.getElementById("favLeague_"+e).style.display="";var n=B[e][0];null==myLeagueID&&(myLeagueID="_"),-1!=myLeagueID.indexOf("_"+n+"_")&&(myLeagueID=myLeagueID.replace(n+"_","")),writeCookie(FavLeagueKey,myLeagueID,new Date((new Date).getTime()+6048e5));var a=$("[isLeaTop=0]");if(0==a.length)document.getElementById("topLine").insertAdjacentElement("afterEnd",t),$(t).after($("[leaindex="+e+"]"));else{var l=GetLeagueIndex(e);if(l>0){for(var o=0,d=0,s=0,i=0;i<a.length;i++)if(s=parseInt($("#"+a[i].id).attr("data-lidx")),d=a[i].id,s>l){o=s;break}0==o?(document.getElementById("table_live").insertAdjacentElement("beforeEnd",t),$(t).after($("[leaindex="+e+"]"))):(document.getElementById(d).insertAdjacentElement("beforeBegin",t),$(t).after($("[leaindex="+e+"]")))}}t.setAttribute("isLeaTop","0"),$(t).removeClass("isLeaTop"),reorderAd()}}catch(e){}}function GetLeagueIndex(e){return $("#tr_"+e)?parseInt($("#tr_"+e).attr("data-lidx")):0}function InitFilter(){InitFilterByCookie()}function changeTimeZone(){LoadLiveFile()}function showYellowCheck(){document.getElementById("YellowCheck").checked?(writeCookie("YellowCheck",0),$(".yellowcard").show()):(writeCookie("YellowCheck",1),$(".yellowcard").hide())}function initEvent(){$(".date-picker").on("click",(function(){ClearAllFilter()}))}function SortList(e,t){e.checked?(_leaSortting=!0,1==t?MakeCountryWithSorting():MakeSclassWithSorting()):(_leaSortting=!1,1==t?MakeCountry():MakeSclass()),SyncLeaSorting(t)}orderby=getCookie("orderby"),null==orderby&&(orderby="time"),LoadLiveFile(),initEvent();
