$(document).ready(function(){var b=$("#Notification #Notification_Events"),a=$("#Notification #Notification_Reflections");$(function(){c(b,"Alert_Events_Hover");c(a,"Alert_News_Hover");function c(c,f){var a=$(".MenuButton",c),d=$(".MenuContent",c),e=a.attr("class"),g=200,b=[];c.hover(function(){var c=jQuery.data(this);b[c]=setTimeout(function(){a.removeClass();a.addClass(f);d.show(0);b[c]=""},g)},function(){var c=jQuery.data(this);if(b[c]!="")clearTimeout(b[c]);else d.slideUp(0,function(){a.removeClass();a.addClass(e)})})}});$(function(){c(b,"Events");c(a,"News");function c(a,b){var e="../../Libs/App_Services/NotificationService.asmx/Notification_GetUnreadMessages",d="SubscriptionName="+b;$.ajax({type:"POST",url:e,data:d,dataType:"xml",processData:false,success:function(e){var d=$(e).find("Item").length;if(d!=0){$(".Notification_UnreadCount",a).show();$(".UnreadCount_Value",a).text(d);$(e).find("Item").each(function(){var b=$(this).find("FromDescription").text(),e=$(this).find("WebMessage").text(),d=$(this).find("MessageUrl").text(),f=$(this).find("PostDate").text(),c=$("<div>").attr("class","RowMessage").attr("style","margin-top:5px;").prependTo($(".Messages_List",a)),g=$("<a>").attr("href",d).attr("class","Link_Black_12px_OverOrange").html("<strong>"+b+"</strong> "+e+'<br /><strong style="font-size:10px;">'+f+"</strong>").prependTo(c)});$(".Messages_List",a).show();$(".Messages_ReadAll",a).show();$(".Messages_ReadAll_Button",a).click(function(f){f.preventDefault();var e="../../Libs/App_Services/NotificationService.asmx/Notification_SetIsReadAll",d="{'SubscriptionName':'"+b+"'}";$.ajax({type:"POST",url:e,data:d,contentType:"application/json; charset=utf-8",dataType:"json",success:function(){c(a,b)},error:function(a){alert(a.responseText)}})})}else{$(".Notification_UnreadCount",a).hide();$(".Messages_List",a).hide();$(".Messages_ReadAll",a).hide();$(".Messages_NotFound",a).show()}},error:function(a){alert(a.responseText)}})}})})
