File: /home/barbeatleanalyti/www/manage.beatleanalytics.com/theme/black/page/notification/notification.js
function generate(type,text,id){var n=noty({text:text,type:type,dismissQueue:true,layout:'topRight',closeWith:['click'],theme:'relax',id:id,maxVisible:10,animation:{open:'animated bounceInRight',close:'animated bounceOutRight',easing:'swing',speed:500},callback:{onClose:function(){},onCloseClick:function(){UPDATENewsInfo(n.options.id);},}});}
function OpenNotification(id){if(window.XMLHttpRequest){xmlhttpNews=new XMLHttpRequest();}else{xmlhttpNews=new ActiveXObject("Microsoft.XMLHTTP");}
xmlhttpNews.onreadystatechange=function(){if(xmlhttpNews.readyState==4&&xmlhttpNews.status==200)
{var NewsArr=eval(xmlhttpNews.responseText);notification_html='<div class="activity-item"><div class="activity"><h4> '+NewsArr[0]+'</h4><br>'+NewsArr[1]+' </div> </div>',GenerateMain('alert',notification_html,"news_"+NewsArr[2]);}}
xmlhttpNews.open("GET","ajax/news.php?data="+base64_encode("acn=FetchOldNews&pg=dashbordma&val1="+id),true);xmlhttpNews.send();}
function GenerateMain(type,text,id){var n=noty({text:text,type:type,dismissQueue:true,layout:'center',closeWith:['click'],theme:'relax',id:id,maxVisible:10,animation:{open:'animated pulse',close:'animated bounceOutRight',easing:'swing',speed:500},callback:{onClose:function(){$('.noty_modal').remove();},onCloseClick:function(){},}});}
function UPDATENewsInfo(id){if(window.XMLHttpRequest){xmlhttpUpdateNews=new XMLHttpRequest();}else{xmlhttpUpdateNews=new ActiveXObject("Microsoft.XMLHTTP");}
xmlhttpUpdateNews.onreadystatechange=function(){if(xmlhttpUpdateNews.readyState==4&&xmlhttpUpdateNews.status==200)
{}}
xmlhttpUpdateNews.open("GET","ajax/news.php?data="+base64_encode("acn=UPDATENewsInfo&pg=dashbordma&val1="+id),true);xmlhttpUpdateNews.send();}
$(window).load(function(e){if(window.XMLHttpRequest){xmlhttpNotification=new XMLHttpRequest();}else{xmlhttpNotification=new ActiveXObject("Microsoft.XMLHTTP");}
xmlhttpNotification.onreadystatechange=function(){if(xmlhttpNotification.readyState==4&&xmlhttpNotification.status==200)
{var NotificationArr=eval(xmlhttpNotification.responseText);var Subject=NotificationArr[1];var Messages=NotificationArr[2];var NewsID=NotificationArr[3];notification_html=[];for(n=0;n<Subject.length;n++){notification_html[n]='<div class="activity-item"><div class="activity"><h4> '+Subject[n]+'</h4> <br> '+Messages[n]+' </div> </div>',generate('success',notification_html[n],"notification_"+NewsID[n]);}}}
xmlhttpNotification.open("GET","ajax/news.php?data="+base64_encode("acn=FetchNotification&pg=dashbordma"),true);xmlhttpNotification.send();});