function updateNotificationCount(){var n=0,t;$(".notification-content").first().find(".notification.unread").each(function(){n++});n>0?($(".notification-header-total").each(function(){$(this).text("("+n+")")}),$(".toggle-bell-icon").removeClass("fa-bell").addClass("fa-bell-on")):($(".notification-header-total").each(function(){$(this).text("(0)")}),$(".toggle-bell-icon").removeClass("fa-bell-on").addClass("fa-bell"),t=0,$(".notification-content").first().find(".notification").each(function(){t++}),t==0&&$(".notification-content").each(function(){$(this).html('<li class="notification no-new-notifications"><a class= "no-notifications-default" role = "button" tabindex = "0" > No New Notifications<\/a ><\/li>')}))}$(function(){var n,t;updateNotificationCount();$("body").on("hide.bs.dropdown",".notification-keep-open",function(n){if(!n.clickEvent)return!0;var t=$(n.clickEvent.target);return!(t.hasClass("notification-keep-open")||t.parents(".notification-keep-open").length)});$("body").on("click",".notification.unread",function(){$(this).removeClass("unread");updateNotificationCount();$.ajax({type:"POST",data:{id:$(this).data("id")},dataType:"json",url:"/Notification/SetStatusToRead",cache:!1})});$("body").on("click",".notification-mark-all-read",function(){$(".notification.unread").each(function(){$(this).removeClass("unread")});$(".notification-total").text("");$(".notification-total").hide();$(".notification-header-total").text("(0)");$.ajax({type:"POST",data:{id:$(this).data("userId")},dataType:"json",url:"/Notification/SetAllStatusToRead",cache:!1})});$("body").on("click",".archthis",function(){var n=$(this).data("id");$(".notification-content").each(function(){$(this).find("li").filter(function(){return $(this).data("id")==n}).remove()});updateNotificationCount();$.ajax({type:"POST",data:{id:n},dataType:"html",url:"/Notification/ArchiveNotification",cache:!1,error:function(n){alert(n)},success:function(n){$(".notifications-wrapper").html(n);updateNotificationCount()}})});n=$.connection.matchHub;n.client.messageNotification=function(){$.ajax({type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",dataType:"html",url:"/Notification/GetNotificationDropdown",cache:!1,error:function(n){alert(n)},success:function(n){$(".notifications-wrapper").html(n);updateNotificationCount()}})};t=$.connection.emailVerifyHub;t.client.emailVerifiedNotification=function(){location.reload()};$.connection.hub.start();window.addEventListener("focus",function(){$.connection.hub.start()});window.addEventListener("blur",function(){$.connection.hub.stop()})})