Index: /sandbox/jabberit_messenger/trophy/xsl/chatBox.xsl
===================================================================
--- /sandbox/jabberit_messenger/trophy/xsl/chatBox.xsl	(revision 2290)
+++ /sandbox/jabberit_messenger/trophy/xsl/chatBox.xsl	(revision 2293)
@@ -3,8 +3,10 @@
 	<xsl:output method="html" omit-xml-declaration="yes"/>
 	
+	<xsl:param name="idChatBox" />
+
 	<xsl:template match="chat_box">
 		
-			<div id="trophyimchat">
-				<div style="height:190px; width:370px; overflow-y:scroll"></div>
+			<div>
+				<div id="{$idChatBox}" style="height:190px; width:370px; overflow-y:scroll"></div>
 				<div style="margin:2px;">
 					<form name="chat" onsubmit="TrophyIM.sendMessage(this); return(false);">
Index: /sandbox/jabberit_messenger/trophy/js/loadIM.js
===================================================================
--- /sandbox/jabberit_messenger/trophy/js/loadIM.js	(revision 2290)
+++ /sandbox/jabberit_messenger/trophy/js/loadIM.js	(revision 2293)
@@ -165,7 +165,11 @@
 	}
 	
-	function parse(pXml, pXsl)
-	{
-		return _xtools.parse(_xtools.xml(pXml), pXsl);	
+	function parse()
+	{
+		if( arguments.length == 2 )
+			return _xtools.parse(_xtools.xml(arguments[0]), arguments[1] );
+		
+		if( arguments.length === 3 )
+			return _xtools.parse(_xtools.xml(arguments[0]), arguments[1], arguments[2] );
 	}
 	
Index: /sandbox/jabberit_messenger/trophy/js/trophyim.js
===================================================================
--- /sandbox/jabberit_messenger/trophy/js/trophyim.js	(revision 2290)
+++ /sandbox/jabberit_messenger/trophy/js/trophyim.js	(revision 2293)
@@ -592,33 +592,64 @@
      *  Message handler
      */
-    onMessage : function(msg) {
+    onMessage : function(msg)
+    {
         Strophe.debug("Message handler");
+    
         var from = msg.getAttribute('from');
         var type = msg.getAttribute('type');
         var elems = msg.getElementsByTagName('body');
 
-        if ((type == 'chat' || type == 'normal') && elems.length > 0) {
-            var barejid = Strophe.getBareJidFromJid(from);
-            var jid_lower = barejid.toLowerCase();
-            var contact = TrophyIM.rosterObj.roster[barejid.toLowerCase()]['contact'];
-            if (contact) { //Do we know you?
-                if (contact['name'] != null) {
+        if ( (type == 'chat' || type == 'normal') && elems.length > 0 )
+        {
+            var barejid		= Strophe.getBareJidFromJid(from);
+            var jid_lower	= barejid.toLowerCase();
+            var contact	= "";
+        	
+            if( TrophyIM.rosterObj.roster[barejid.toLowerCase()] )
+            {
+            	contact = TrophyIM.rosterObj.roster[barejid.toLowerCase()]['contact']['name'];
+            }
+            else
+            {
+            	contact = barejid.toLowerCase();
+            	contact = contact.substring(0, contact.indexOf('@'));
+            }	
+            
+            var message = 
+            { 
+            	contact : contact,
+            	msg		: Strophe.getText(elems[0])	
+            };
+
+            TrophyIM.makeChat(from); //Make sure we have a chat window
+            TrophyIM.addMessage(message, jid_lower);
+
+            /*	
+            if ( contact )
+            { 
+
+            	//Do we know you?
+                if ( contact['name'] != null )
+                {
                     message  = contact['name'] + " (" + barejid + "): ";
-                } else {
+                }
+                else
+                {
                     message = contact['jid'] + ": ";
                 }
-                message += Strophe.getText(elems[0]);
-                TrophyIM.makeChat(from); //Make sure we have a chat window
+                
+            	message += Strophe.getText(elems[0]);
+                
+            	TrophyIM.makeChat(from); //Make sure we have a chat window
                 TrophyIM.addMessage(message, jid_lower);
                 
-                /*
-                if (TrophyIM.activeChats['current'] != jid_lower) {
-                    TrophyIM.activeChats['divs'][jid_lower][
-                    'tab'].className = "trophyimchattab trophyimchattab_a";
-                    TrophyIM.setTabPresence(from,
-                    TrophyIM.activeChats['divs'][jid_lower]['tab']);
-                }
-                */
-            }
+               
+                //if (TrophyIM.activeChats['current'] != jid_lower) {
+                //    TrophyIM.activeChats['divs'][jid_lower][
+                //    'tab'].className = "trophyimchattab trophyimchattab_a";
+                //    TrophyIM.setTabPresence(from,
+                //    TrophyIM.activeChats['divs'][jid_lower]['tab']);
+                //}
+            }*/
         }
         return true;
@@ -633,4 +664,10 @@
     	
     	var barjid = Strophe.getBareJidFromJid(fulljid);
+    	
+    	var paramsChatBox =
+    	{
+    			'idChatBox' : barjid + "__chatBox",
+    	};
+    	
     	
     	var winChatBox = 
@@ -647,5 +684,5 @@
 			 title			: barjid.substring(0, barjid.indexOf('@')),
 			 closeAction	: "hidden",
-			 content		: loadIM.parse("chat_box","chatBox.xsl")	
+			 content		: loadIM.parse("chat_box","chatBox.xsl", paramsChatBox)	
     	}
     	
@@ -747,6 +784,12 @@
     addMessage : function(msg, jid)
     {
-        alert(jid + " : " + msg);
-    	 
+    	var chatBox		= document.getElementById(jid + "__chatBox");
+    	var messageDiv	= document.createElement("div");
+    		messageDiv.style.margin = "3px 0px 3px 3px";
+    		messageDiv.innerHTML	= "<font style='font-weight:bold;'>" + msg.contact + "</font> : " + msg.msg ;
+    		
+    	chatBox.appendChild(messageDiv);
+    	chatBox.scrollTop = chatBox.scrollHeight;
+        
         /*
          * Codigo Original Comentado 
