what it does is basically asynchronously calls a particular page, and then the particular page could be your custom page which returns no. of new emails , their subject etc...
and then using javascirpt you can create an alert on a new window.
This will help you a lot
http://developer.apple.com/internet/web ... tpreq.html