I personally really like XMPP (which is what Google Talk uses and is also known as Jabber). To do something really cool with javascript, check out the Comet project for an HTTP push framework. For javascript, dojo has an implementation of it that works quite well (just don't use the Google JS API version of dojo, it doesn't have a valid implementation of comet in there ;-) ). Additionally, there is an XMPP library for PHP that you can find here. Between dojo's cometd and the XMPP php library this shouldn't be too difficult to do. Also, if you don't need something as robust as XMPP, there actually is an example chatroom in the comet source (although the server is written in java, you can get the idea) found here.
Good luck!
Edit As per your comment below, a tutorial for Comet can be found here. Although it uses Java on the server, you can use the principals discussed at the PHP link above and just tweak this tutorial a bit.