That's just a copy of the actual chat portlet JS code..! I didn't touch this since chat-portlet might use it.