         EventManager.addEvent "receiveTextMessage", (message) =>
             @update message
 
+    # Update the text chat with a new message.
     update          : (message) =>
         @addMessage message
 
+    # Send the new message to the guests.
     sendMessage     : (message) =>
         if message? and message isnt ""
             message =

                event ['message', null, message]
                @addMessage message

    addMessage      : (message) =>
        jqLastElem = do (@jqMessageBox.find 'div.msgBox').last
        prevTime   = jqLastElem.attr 'rel'


###

class   TextChat
    # Init the text chat window and the callbacks in the event manager.
    constructor     : (NetworkManager) ->
        @jqForm       = ($ 'form#chatForm')
        @jqMessageBox = ($ '#tcMessagesContainer')
