function SetNotifications(){var t=$("#hidden_isUserLoggedIn").val(),i=$("#hidden_notification_enabled").val(),n;if(t!="0"&&i!="0"&&t!=null&&i!=null){notification_box=$("#notification_box");notification_actionUrl=$("#hidden_notificationActionUrl").val();notification_cookieName=$("#hidden_notification_cookieName").val();notification_image_path=$("#hidden_notification_image_path").val();notification_icon_comment=notification_image_path+"notification_icon_comment.png?v1.2";notification_icon_user=notification_image_path+"notification_icon_user.png?v1.2";notification_icon_close=notification_image_path+"notification_icon_close.png?v1.2";notification_icon_approval=notification_image_path+"notification_icon_approval.png?v1.2";notification_icon_highlight=notification_image_path+"notification_icon_highlight.png?v1.2";notification_icon_goal=notification_image_path+"notification_icon_goal.png?v1.2";notification_icon_ad=notification_image_path+"notification_icon_ad.png?v1.2";notification_icon_general=notification_image_path+"notification_icon_ligtv.png?v1.2";n=ReadCookie(notification_cookieName);n!=null&&(notification_readList=n.split(","));notification_box.on("click","div.notification_default span.close",function(){var n=$(this).parent("div.notification_content");SetAsRead(n)});notification_box.on("click","div.notification_default a.link",function(n){n.preventDefault();var t=$(this).parent().parent("div.notification_content"),i=$(this).attr("href");SetAsRead(t,i)});notification_box.on("click","div.notification_general span.close",function(){var n=$(this).parent("div.notification_content");SetAsReadGeneralNotification(n)});notification_box.on("click","div.notification_general a",function(n){n.preventDefault();var t=$(this).parents("div.notification_general").first(),i=$(this).attr("href");SetAsReadGeneralNotification(t,i)});notification_box.on("mouseover","div.notification_content",function(){$(this).find("span.close").show()});notification_box.on("mouseout","div.notification_content",function(){$(this).find("span.close").hide()});setTimeout(function(){GetNotifications()},15e3);setInterval(function(){GetNotifications()},12e4);AreCookiesEnabled()==!0&&(setTimeout(function(){GetNotificationsGeneral()},15e3),setInterval(function(){GetNotificationsGeneral()},12e4))}}function SetAsRead(n,t){var i=n.attr("data-notificationId");$.ajax({type:"POST",url:notification_actionUrl+"/SetAsRead",data:JSON.stringify({notificationId:i}),dataType:"json",contentType:"application/json; charset=utf-8",success:function(){t&&(window.location=t);n.fadeOut()}})}function SetAsReadGeneralNotification(n,t){var i=n.attr("data-notificationGeneralId");$.ajax({type:"POST",url:notification_actionUrl+"/SetAsReadGeneralNotification",data:JSON.stringify({notificationId:i}),dataType:"json",contentType:"application/json; charset=utf-8",success:function(){var r=ReadCookie(notification_cookieName);r!=null&&(notification_readList=r.split(","));notification_readList.push(i);DeleteCookie(notification_cookieName);CreateCookie(notification_cookieName,notification_readList,1);t&&(window.location=t);n.fadeOut()}})}function GetNotifications(){$.ajax({type:"POST",url:notification_actionUrl+"/GetNotifications",data:"",dataType:"json",contentType:"application/json; charset=utf-8",success:function(n){var u=n.d,f,t;if(u!=null&&!(u.length<1))for(f=0;f<u.length;f++)if(t=u[f],!(notification_box.find("#notification_"+t.Id).length>0)){var e=$("<div id='notification_"+t.Id+"' class='notification_content notification_default dn' data-notificationId='"+t.Id+"'><\/div>"),i="<span class='close dn' title='Bildirimi Sil'><img src='"+notification_icon_close+"' alt='Bildirimi Sil'/><\/span>",r="haberine";switch(t.ItemType){case 1:r="haberine";break;case 2:r="videosuna";break;case 3:r="özetine";break;case 4:r="golüne"}switch(t.ContentType){case 1:i+="<div class='icon'><img src='"+notification_icon_comment+"' /><\/div>";i+="<div class='content'><a class='link' href='"+t.ContentUrl+"'>"+t.ContentTitle+"<\/a> "+r+" yaptığınız yoruma "+t.MessageCount+" cevap yazıldı.<\/div>";i+="<span class='c'><\/span>";break;case 2:i+="<div class='icon'><img src='"+notification_icon_user+"' /><\/div>";i+="<div class='content'>"+t.Message+"<\/div>";i+="<span class='c'><\/span>";break;case 7:i+="<div class='icon'><img src='"+notification_icon_approval+"' /><\/div>";i+="<div class='content'><a class='link' href='"+t.ContentUrl+"'>"+t.ContentTitle+"<\/a> "+r+" yaptığınız yorum yayınlandı.<\/div>";i+="<span class='c'><\/span>"}e.html(i);notification_box.append(e);e.slideDown().show()}}})}function GetNotificationsGeneral(){$.ajax({type:"POST",url:notification_actionUrl+"/GetNotificationsGeneral",data:"",dataType:"json",contentType:"application/json; charset=utf-8",success:function(n){var r=n.d,o,u,i,s,f,e,t;if(r!=null&&!(r.length<1))for(o=ReadCookie(notification_cookieName),o!=null&&(notification_readList=o.split(",")),u=0;u<r.length;u++)if(i=r[u],!(notification_box.find("#notificationGeneral_"+i.Id).length>0)){if(s=!1,notification_readList!=null)for(f=0;f<notification_readList.length;f++)if(i.Id==parseInt(notification_readList[f])){s=!0;break}if(s!=!0){e=$("<div id='notificationGeneral_"+i.Id+"' class='notification_content notification_general dn' data-notificationGeneralId='"+i.Id+"'><\/div>");t="<span class='close dn' title='Bildirimi Sil'><img src='"+notification_icon_close+"' alt='Bildirimi Sil'/><\/span>";switch(i.ContentType){case 3:t+="<div class='icon'><img src='"+notification_icon_highlight+"' /><\/div>";t+="<div class='content'>"+i.Body+"<\/div>";t+="<span class='c'><\/span>";break;case 4:t+="<div class='icon'><img src='"+notification_icon_goal+"' /><\/div>";t+="<div class='content'>"+i.Body+"<\/div>";t+="<span class='c'><\/span>";break;case 5:t+=i.Body;t+="<span class='c'><\/span>";break;case 6:t+="<div class='icon'><img src='"+notification_icon_general+"' /><\/div>";t+="<div class='content'>"+i.Body+"<\/div>";t+="<span class='c'><\/span>";break;case 1e3:t+="<div class='icon'><img src='"+notification_icon_general+"' /><\/div>";t+="<div class='content'>"+i.Body+"<\/div>";t+="<span class='c'><\/span>"}e.html(t);notification_box.append(e);e.slideDown().show()}}}})}function LayerDownReklamport(){$("body").find("#divSticky1").css("z-index","25");$("body").find("#divSticky2").css("z-index","25")}function CustomContentBgImage(){var n=$("#ad_bg_image_customContent"),t=$("#hidden_customContent_backgroundImage").val();n.length<1||t&&n.css({"background-image":"url('"+t+"')"})}function TvGuideLinks(){var t=$("#schedule_tabs"),n;t.length<1||(n=t.find("div.tab").find("ul.schedule").find("li"),n.length<1)||$.each(n,function(n,t){var i=$(t),r=i.attr("data-url");r&&i.css("cursor","pointer").click(function(n){n.preventDefault();window.open(r)}).find("span.programme").css("text-decoration","underline")})}function AdSettings(){}function RssBoxClick(){$("#rss_box_container").click(function(n){n.preventDefault();$(this).next("div.rsscontent").slideToggle("fast")})}function CreateCookie(n,t,i){var u="",f=n+"="+unescape(t),r;i&&(r=new Date,r.setDate(r.getDate()+i),u=";expires="+r.toUTCString());document.cookie=f+u}function ReadCookie(n){var i,r,t;if(!n)return null;for(i=null,r=document.cookie.split(";"),t=0;t<r.length;t++){var u=r[t].split("="),f=u[0].replace(" ",""),e=u[1];if(f==n){i=e;break}}return i}function DeleteCookie(n){CreateCookie(n,"",-1)}function AreCookiesEnabled(){var n=navigator.cookieEnabled?!0:!1;return typeof navigator.cookieEnabled!="undefined"||n||(document.cookie="testcookie",n=document.cookie.indexOf("testcookie")!=-1?!0:!1),n}function AlertBox(n,t,i){if(StrCode="<div class='lightBox_container'><div onclick='RemoveAlertBox();' class='alertBox_overlay'><\/div><div class='alertBox'><div class='alertBoxHeader'><div class='text'>"+(t==undefined||t==""?"tr.beinsports.com":t)+"<\/div><div class='closeC'><div onclick='RemoveAlertBox();' title='Kapat' class='closeButton CloseAlert'><\/div><\/div><\/div><div class='alertBoxContent'>"+n+"<\/div><\/div><\/div>",$(".lightBox_container").remove(),$("body").append(StrCode),i!=undefined&&i>0)var r=setTimeout(function(){$(".lightBox_container").fadeOut(600,function(){$(".lightBox_container").remove()})},i)}function RemoveAlertBox(){$(".lightBox_container").remove()}function SetAnnounce(){var n=$(".announce"),t=$("body"),r=$("#hdn_siteGeneralServiceRoot").val(),u=$("#goto_site"),i;$(u).click(function(n){n.preventDefault();$.ajax({type:"POST",url:r+"/SetIsMobile",data:JSON.stringify({isMobile:!0}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){var t=n.d}})});n.length>0&&(i=t.css("margin-top"),t.css("margin-top",parseInt(i)+parseInt(n.height())+"px"),n.show(),$(".announce .closeButton").click(function(){i=t.css("margin-top");t.css("margin-top",parseInt(i)-parseInt(n.height())+"px");n.fadeOut(400,function(){n.remove()})}))}function ShowGuide(){var n,t,i;for($(".guideC").remove(),n=$("<div>"),n.addClass("guideC"),t=0;t<1600;t++)i=$("<div>"),i.addClass("guide"),n.append(i);$(".wrapper .inner_wrapper").append(n)}function HideGuide(){$(".guideC").remove()}function dfpAdContainerToggle(n){var t=$(n).parents(".gpt-ad-container");t.toggleClass("closed")}function dfpPopupOpen(n,t){$(window).load(function(){setTimeout(function(){$.fancybox.open({src:"#"+n,beforeLoad:function(){isDfpPopupDisplay=!0;googletag.pubads().refresh([t])},afterLoad:function(){setTimeout(function(){$(".fancybox-slide").animate({top:0})},300)}})},500)})}function customPopupOpen(n){var t=$(".custom-popup-stage."+n);t.length!=0&&($("body").append('<div class="custom-popup-overlay"><\/div>'),t.addClass("active"),$(".custom-popup-stage, .close-btn").click(function(){$(".custom-popup-overlay, .custom-popup-stage").remove();$("body").removeClass("custom-popup-visible")}),$(window).load(function(){setTimeout(function(){$("body").addClass("custom-popup-visible")},500)}))}var notification_box,notification_actionUrl,notification_image_path,notification_cookieName,notification_icon_close,notification_icon_comment,notification_icon_user,notification_icon_approval,notification_icon_goal,notification_icon_highlight,notification_icon_general,notification_icon_ad,notification_readList=[],playerEventHandler;$(function(){SetAnnounce();CustomContentBgImage();AdSettings();TvGuideLinks();$(".tabbed_match_slider .tabs li.selected").dblclick(function(){ShowGuide()});$(".guide").dblclick(function(){HideGuide()})});playerEventHandler=function(){};$(document).ready(function(){ligtv.LoadPartialContents();ligtv.Boot()});var ligtv={MobileOverlay:function(){},Boot:function(){$(".stylish").size()>0&&$(".stylish").sSelect();this.SubMenus();this.CreateTabs();this.CreateModals();this.CreateProgramsExpanders();this.MobileOverlay()},SubMenus:function(){$("li.search .textinput, .search-box .corner .textinput").unbind("focus").focus(function(){var n=$(this).attr("data-cleared");n||$(this).attr("data-cleared","1").val("");$(this).parent("li.search").css("background-position","-100px -100px")})},CreateTabs:function(){$("ul.tabs.active li").unbind("click").click(function(n){if(!$(this).is(".notab")){n.preventDefault();var i=$(this).index(),t=$(this).parents("ul").parents("div.tabs_holder").attr("id");$("#"+t+" .tab").css("display","none");$("#"+t+" .tab").eq(i).css("display","block");$("#"+t+" ul.tabs li").removeClass("selected").css("cursor","pointer").find("a").css("cursor","pointer");$(this).addClass("selected").css("cursor","default").find("a").css("cursor","default")}});$(".tabs_holder").each(function(){var n=$(this),t;n.find("ul:first").find("li.selected").length<1?(n.find(".tab").hide(),n.find(".tab").eq(0).show()):(t=n.find("ul:first").find("li.selected").index(),n.find(".tab").hide(),n.find(".tab").eq(t).show())})},CreateModals:function(){$("a[data-popup=true]").unbind("click").click(function(n){var t,i,r,u,f;n.preventDefault();t=$(this).attr("href");$(t).attr("data-width")&&$(t).css("width",$(t).attr("data-width")+"px");i=$(document).height();r=$(window).width();$("#mask").css({width:r,height:i});$("#mask").fadeIn(100).fadeTo("fast",.8);u=$(window).height();f=$(window).width();$(t).css("top",u/2-$(t).height()/2);$(t).css("left",f/2-$(t).width()/2);$(t).fadeIn(500)});$(".window .close").unbind("click").click(function(n){n.preventDefault();$("#mask, .window").hide()});$("#mask").unbind("click").click(function(){$(this).hide();$(".window").hide()})},PushState:function(){var n="pushState"in history;if(n)$("body").on("click","a.jVideo",function(n){var t=$("#hidden_videolig_url_seasonName").val()+" "+$(this).attr("data-title"),i=$(this).attr("data-videolink");document.title=t;history.pushState(null,t,i);n.preventDefault()})},CreateProgramsExpanders:function(){$(".programs_wrapper ul.list li a.program").unbind("click").click(function(n){var t=$(this).parent("li");t.hasClass("selected")?t.removeClass("selected"):t.addClass("selected");n.preventDefault()});$(".content .programs .expander a").unbind("click").click(function(){$(".programs_wrapper ul.list li").addClass("selected");$(".content .programs .expander").css("display","none");$(".content .programs .collapser").css("display","block")});$(".content .programs .collapser a").unbind("click").click(function(){$(".programs_wrapper ul.list li").removeClass("selected");$(".content .programs .collapser").css("display","none");$(".content .programs .expander").css("display","block")})},FixTimeline:function(){$(".timeline_item").each(function(){var n=$(this).attr("data-minute");$(this).css("margin-left",n*8+"px")})},LoadPartialContents:function(){$(".partialContent").each(function(n,t){var i=$(t),r=i.data("url");r+="?type=ajaxCall";r&&r.length>0&&$.get(r,function(n){var t=$(n);i.hide();t.hide();t.appendTo(i);t.show();window.setTimeout(function(){i.fadeIn()},10);ligtv.Boot()},"html")})},ExecuteGaFunctionWhenScriptIsReady:function(n){$(function(){var t=function(){typeof _ligTvGa=="function"?n():setTimeout(t,200)};t()})},ExecuteFunctionWhenScriptIsReady:function(n){$(function(){var t=function(){typeof n=="function"?n():setTimeout(t,100)};t()})}},dfp={clearTargetings:function(){googletag.pubads().clearTargeting()},setTargetings:function(){if(typeof dfpParameters!="undefined"&&dfpParameters!=null&&dfpParameters.Data.length>0)for(i=0;i<dfpParameters.Data.length;i++)dfpParameters.Data[i].Value!=""&&googletag.pubads().setTargeting(dfpParameters.Data[i].Key,dfpParameters.Data[i].Value)},refreshAds:function(){googletag.pubads().refresh()}},supports_pushState="pushState"in history;$("body").on("click","a.jVideo",function(n){var t=$("#hidden_videolig_url_seasonName").val()+" "+$(this).attr("data-title"),i=$(this).attr("data-videolink");document.title=t;history.pushState(null,t,i);n.preventDefault()});$(".tabs_league_news li>a").click(function(n){var t=$(this).attr("data-title"),i=$(this).attr("data-url");document.title=t;history.pushState(null,t,i);n.preventDefault()});$("#team_tabs .tabs li>a").click(function(n){var t=$(this).attr("data-title"),i=$(this).attr("data-url");document.title=t;history.pushState(null,t,i);n.preventDefault()});$(".playerVideoline .playerTabline .title > li").click(function(n){if(!$(this).hasClass("selected"))for(var t=1;t<=$(this).parent().find("li").length;t++)$(this).attr("data-tabId")==t?($(this).addClass("selected"),$(".playerVideoline #playertab_content_"+t+"").css("display","inline-block")):($(this).parent().find("li:eq("+(t-1)+")").removeClass("selected"),$(".playerVideoline #playertab_content_"+t+"").css("display","none"));document.title=title;history.pushState(null,title,url);n.preventDefault()})