function ResetScrollPosition(){setTimeout("window.scrollTo(0,0)",0)}function ResolveUrlString(n){return n!=null&&n.indexOf("~/")==0?$("#hdnBaseURL").val()+n.substring(2):n}function OnAckHideActiveAdsBanner(n){$("#divPopUpCBAdd").hide();n&&$("#lnkPopUpCBAdd").attr("href")!=""&&(window.location.href=$("#lnkPopUpCBAdd").attr("href"))}function HideActiveAdsBanner(n){var t=$("#divPopUpCBAdd").attr("data-id"),i="{'adsbannerid':'"+t+"'}";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",datatype:"JSON",data:i,global:!1,url:$("#hdnBaseURL").val()+"Common/HideActiveAdsBanner",success:function(){OnAckHideActiveAdsBanner(n)},error:function(){OnAckHideActiveAdsBanner(n)}})}function HideJoinPPBanner(){$.ajax({type:"POST",contentType:"application/json; charset=utf-8",datatype:"JSON",data:"",global:!1,url:$("#hdnBaseURL").val()+"Common/HideJoinPPBanner",success:function(){},error:function(){}})}function OnAckAlertMessage(n,t,i,r){return SaveAlertMessageAck(n,t,i,r,""),!1}function OnClickAlertMessageLink(n,t,i,r,u){if(u!=""){var f=u.indexOf("~/")==0?baseUrl+u.substring(2):u;return SaveAlertMessageAck(n,t,i,r,f),!1}}function SaveAlertMessageAck(n,t,i,r,u){var f="{'tid':'"+n+"','mtype':'"+t+"','lid':'"+i+"','round':'"+r+"'}";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",datatype:"JSON",data:f,url:$("#hdnBaseURL").val()+"Common/SaveAlertMessageAck",success:function(){u!=""?window.location.replace(u):GetAlertMessages()},error:function(){}})}function GetAlertMessages(){$.ajax({type:"POST",contentType:"application/json; charset=utf-8",datatype:"JSON",data:"",url:$("#hdnBaseURL").val()+"Common/GetAlertMessages",success:function(n){$("#lblAlertCount").text(n?n.length:"0");$("#divAlertMessages").html("");n&&n.length>0?$("#AlertMessageTemplate").tmpl(n).appendTo("#divAlertMessages"):$(".icon-link-open").hide()},error:function(){}})}function OnSubmitTimeZone(){var n=$("#ddlMyTimeZone").val(),t;if(parseInt(n)<=0)return alert("Select your preferred time zone before submit"),$("#ddlMyTimeZone").focus(),!1;t="{'timezoneid':'"+n+"'}";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",datatype:"JSON",data:t,url:$("#hdnBaseURL").val()+"Common/UpdateUserTimeZone",success:function(n){n.ErrorCode!=0&&alert(n.Message);n.Result!=null&&($("#lblTimeZone").text(n.Result.TimeZone),$.fancybox.close())},error:function(){}})}function HideMessage(){$("#divSuccess").hide();$("#divError").hide()}function ShowMessage(n,t){n?($("#divSuccess").show(),$("#divError").hide(),$("#lblSuccess").text(t)):($("#divSuccess").hide(),$("#divError").show(),$("#lblError").text(t));ResetScrollPosition()}function myLeagueMenuFunction(){var n=document.getElementById("divLeagueMenuLinks");n.style.display=n.style.display==="block"?"none":"block"}function AddTHEAD(n){var t=document.getElementById(n),i;t!=null&&(i=document.createElement("THEAD"),i.appendChild(t.rows[0]),t.insertBefore(i,t.childNodes[0]))}function ShowMPopUpMsg(n,t,i,r){t!=""&&($("#lblMMsgPPTitle").html(n),$("#lblMMsgPPMsg").html(t),$("#lnkMMsgPP").attr("href",r),$("#lnkMMsgPP").html(i),i!=""&&r!=""?$("#lnkMMsgPP").show():$("#lnkMMsgPP").hide(),$("#divMMsgPP").show())}function savePreference(n,t){typeof Storage!="undefined"&&localStorage.setItem(n,t)}function getPreference(n){return typeof Storage!="undefined"?localStorage.getItem(n):null}function initLeaguePrizeHandler(){$("#divJoinLeaguePrizePP .btn-close").click(function(){$("#divPrizePP").modal("hide")})}function ShowLeaguePrizePopup(n){var t=$("#divJoinLeaguePrizePP"),r=t.find("#contestLoader"),u=t.find("#contestContent"),i=t.find("#contestError"),f;return i.hide().html(""),u.html(""),r.show(),f=new bootstrap.Modal(t[0]),f.show(),$.ajax({url:n,type:"GET",cache:!1}).done(function(n){u.html(n)}).fail(function(n){n.status===404?i.html("League info not found.").show():i.html("Something went wrong. Please try again.").show()}).always(function(){r.hide()}),!1}function CloseLeaguePrizePopup(){$("#divJoinLeaguePrizePP").modal("hide")}function setupFancyBoxPPOptions(){$(".fancyboxPP").fancybox({parent:$("form:first"),type:"iframe",maxWidth:1e3,maxHeight:"85%",fitToView:!1,width:"80%",height:"85%",minHeight:"525",autoSize:!1,closeClick:!1,openEffect:"none",closeEffect:"none"})}function ShowPlayerProfilePP(n){var t=$("#divPlayerProfilePP");return t.find("iframe").off("load").on("load",PlayerProfilePPLoaded).attr("src",n),t.find(".loading-spinner").show(),t.css("display","flex"),!1}function ClosePlayerProfilePP(){var n=$("#divPlayerProfilePP");return n.hide(),n.find(".loading-spinner").hide(),n.find("iframe").off("load").attr("src","about:blank"),!1}function PlayerProfilePPLoaded(){$("#divPlayerProfilePP .loading-spinner").hide()}function ShowTeamComparePP(n){var t=$("#divTeamComparePP");return t.find("iframe").off("load").on("load",TeamComparePPLoaded).attr("src",n),t.find(".loading-spinner").show(),t.css("display","flex"),!1}function CloseTeamComparePP(){var n=$("#divTeamComparePP");return n.hide(),n.find(".loading-spinner").hide(),n.find("iframe").off("load").attr("src","about:blank"),!1}function TeamComparePPLoaded(){$("#divTeamComparePP .loading-spinner").hide()}function ShowPlayerScoreBreackdownPP(n){var t=$("#divPlayerScoreBreackdownPP");return t.find("iframe").off("load").on("load",TeamComparePPLoaded).attr("src",n),t.find(".loading-spinner").show(),t.css("display","flex"),!1}function ClosePlayerScoreBreackdownPP(){var n=$("#divPlayerScoreBreackdownPP");return n.hide(),n.find(".loading-spinner").hide(),n.find("iframe").off("load").attr("src","about:blank"),!1}function PlayerScoreBreackdownPPLoaded(){$("#divPlayerScoreBreackdownPP .loading-spinner").hide()}$(document).ready(function(){$("#helplink").attr("href","");var n=location.pathname,t="";n.indexOf("LiveScoring")!=-1||n.indexOf("LiveScoring_Soccer.aspx")!=-1?t="live_scoring":n.indexOf("/FantasyScoring")!=-1?t="Fantasy_Scoring":n.indexOf("/TournamentRules.aspx")!=-1?t="League_Rules":n.indexOf("/WinPrizes/")!=-1?t="Win_Prizes":n.indexOf("/LeaderBoard")!=-1?t="Leadership_Board":n.indexOf("/LeaderBoard-SalaryCap")!=-1?t="Leaderboard_Salary":n.indexOf("/Tournament-PLayer-Profile")!=-1?t="Player_Research":n.indexOf("/Blogs")!=-1?t="Blogs":n.indexOf("/Forums")!=-1?t="Forums":n.indexOf("/Testimonials")!=-1?t="Testimonial":n.indexOf("/CB_Earning_Center.aspx")!=-1?t="Earning_Center":n.indexOf("MyFantasy/CreateLeague")!=-1||n.indexOf("MyFantasy/LeagueAction/CreateRoundLeague.aspx")!=-1?t="Create_League":n.indexOf("MyFantasy/Join-Create-League")!=-1||n.indexOf("MyFantasy/Join-Create-League-RL")!=-1||n.indexOf("MyFantasy/LeagueAction/JoinLeague.aspx")!=-1||n.indexOf("MyFantasy/LeagueAction/JoinRoundLeague.aspx")!=-1?t=n.indexOf("LeagueModel=SalaryCap")!=-1?"Public_leagues_salary":"Public_leagues_draft":n.indexOf("MyFantasy/Join-Create-League-RL")!=-1||n.indexOf("MyFantasy/LeagueAction/JoinRoundLeague.aspx")!=-1?t=n.indexOf("LeagueModel=SalaryCap")!=-1?"Public_leagues_rl_salary":"Public_leagues_rl_draft":n.indexOf("MyFantasy/MyFantasyHome")!=-1?t="My_fantasy":n.indexOf("MyFantasy/LeagueHome")!=-1?t="League_Home":n.indexOf("MyFantasy/CustomizeLeague")!=-1?t="My_Fantasy_League_Rules":n.indexOf("MyFantasy/LeagueAction/InviteFriendsToJoinLeague")!=-1||n.indexOf("Account/InviteFriends")!=-1?t="League_Invite_Friends":n.indexOf("MyFantasy/RoundSchedule")!=-1?t="League_Round_Schedule":n.indexOf("/MockDraft")!=-1?t="Draft_Central_Mock_Draft":n.indexOf("MyFantasy/DraftSchedule")!=-1?t="Draft_Central_Draft_Schedule":n.indexOf("MyFantasy/PreDraftSelection")!=-1?t="Draft_Central_Pre_Draft":n.indexOf("MyFantasy/OnlineDraft/PlayOnlineDraft")!=-1?t=location.href.indexOf("MyFantasy/OnlineDraft/PlayOnlineDraft?DR=1")!=-1?"Draft_Results":"Draft_Central_Start_Online_Draft":n.indexOf("MyFantasy/MyTeam")!=-1?t="Manage_Team_draft":n.indexOf("MyFantasy/MyTeam-SalaryCap")!=-1||n.indexOf("MyFantasy/MyTeam-SalaryCap")!=-1?t="Manage_Team_salary":n.indexOf("MyFantasy/PlayerScore")!=-1?t=n.indexOf("soccer.CricBattle.com")!=-1||n.indexOf("futBattle.CricBattle.com")!=-1||n.indexOf("football.CricBattle.com")!=-1?"Score_History_Football":"League_Score_History":n.indexOf("MyFantasy/League-MatchUp-H2H")!=-1?t="Matchup":n.indexOf("MyFantasy/League-MatchUp-RL")!=-1?t="Matchup_rl":n.indexOf("MyFantasy/TradePlayers")!=-1?t="Trade_Players":n.indexOf("MyFantasy/TradeClaimPlayer")!=-1?t="claim_players":n.indexOf("MyFantasy/TradeClaimHistory")!=-1?t="Claim_History":n.indexOf("MyFantasy/PlayerList")!=-1?t="List_Players":n.indexOf("MyFantasy/JoinPredictionLeague")!=-1?t="Prediction_Leagues":n.indexOf("/PredictionLeaderBoard.aspx")!=-1?t="Prediction_Leadership_Board":n.indexOf("MyFantasy/PredictionLeagueMyPicks")!=-1?t="My_picks":n.indexOf("MyFantasy/PredictionLeagueResults")!=-1&&(t="Pred_Results");t!=""?(n=$("#hdnBaseURL").val()+"help.html?id="+t,$("#helplink").attr("href",n),$("#helplink").show()):$("#helplink").hide()});var ResultStatus={UnAutorized:0,ValidationError:1,Exception:2,Success:3,Redirect:4,LogInExpired:5,VerficationPending:6};$(document).ready(function(){$("a.eng-ind-close-btn").on("click",function(){HideActiveAdsBanner(!1);$("#divPopUpCBAdd").hide()});$("#lnkPopUpCBAdd").on("click",function(){return HideActiveAdsBanner(!0),!1});$("#hide-error-pop").click(function(){$("#divMMsgPP").hide()});$("#lnkMHReferralBonus").on("click",function(){return $("#divRefPopUp").show(),!1});$(".refer-close").on("click",function(){return $("#divRefPopUp").hide(),$("#lnkCopyRefPPProfileLink img").attr("src",$("#hdnBaseURL").val()+"images/inv-copy-btn.png"),!1});$("#hdnAlertMsg").val()=="1";$("#divJoinPP .jl-close").on("click",function(){HideJoinPPBanner();$("#divJoinPP").hide()})});window.onbeforeunload=function(){$("input[type='submit']").attr("disabled","disabled");$("input[type='button']").attr("disabled","disabled")};$(document).ajaxStart(function(){$("#divLoadingPopup").show()}).ajaxStop(function(){$("#divLoadingPopup").hide()})