You no longer have to implement your own notification system. The Web Notifications API is here.

var notification = new Notification('Notification Title', {
   body: 'A few sentences giving more information about the notification.',
   icon: 'http://example.com/icon.png'
});

notification.onshow = function () {
   // Notification presented to user
}

notification.onclick = function () {
   // The user clicked on the notification
}

notification.onclose = function () {
   // The user closed the notification
}

Demo: http://aurelio.audero.it/demo/web-notifications-api-demo.html

A notification in Chrome 35: