Notification system in javascript