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 2290)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	<xsl:output method="html" omit-xml-declaration="yes"/>
+	
+	<xsl:template match="chat_box">
+		
+			<div id="trophyimchat">
+				<div style="height:190px; width:370px; overflow-y:scroll"></div>
+				<div style="margin:2px;">
+					<form name="chat" onsubmit="TrophyIM.sendMessage(this); return(false);">
+						<div style="margin-top:0px; width:70px; height:93px; position:relative; float:right; background-image:url('images/photo.png');"></div>
+						<textarea class="trophyimchatinput" rows="5" cols="38"/>
+					</form>
+				</div>
+				<div style="margin-left:2px;">
+					<input type="button" value="Send" onclick="TrophyIM.sendMessage(this)"/>
+				</div>
+			</div>			
+		 
+	</xsl:template>
+	
+</xsl:stylesheet>
Index: /sandbox/jabberit_messenger/trophy/css/trophyim.css
===================================================================
--- /sandbox/jabberit_messenger/trophy/css/trophyim.css	(revision 2271)
+++ /sandbox/jabberit_messenger/trophy/css/trophyim.css	(revision 2290)
@@ -22,5 +22,5 @@
 }
 div#trophyimchat {
-	border: 1px black solid;
+	/*border: 1px black solid;*/
     clear: right;
     float: left;
@@ -103,9 +103,10 @@
     margin: 1px;
 }
-div.trophyimchatbox { /*Collection of chat messages*/
-	height: 200px;
+/*div.trophyimchatbox { /*Collection of chat messages*/
+/*	height: 200px;
 	width: 380px;
-	overflow: scroll;
-}
+	overflow-y: scroll;
+}*/
+
 textarea.trophyimchatinput {
 }
Index: /sandbox/jabberit_messenger/trophy/js/makeW.js
===================================================================
--- /sandbox/jabberit_messenger/trophy/js/makeW.js	(revision 2271)
+++ /sandbox/jabberit_messenger/trophy/js/makeW.js	(revision 2290)
@@ -59,5 +59,6 @@
 			if ( pVisible == "display" )
 			{
-				_window.style.left = _window.getAttribute("leftOld");
+				if( _window.style.left == "-1500px" )
+					_window.style.left = _window.getAttribute("leftOld");
 			}
 			
Index: /sandbox/jabberit_messenger/trophy/js/loadIM.js
===================================================================
--- /sandbox/jabberit_messenger/trophy/js/loadIM.js	(revision 2271)
+++ /sandbox/jabberit_messenger/trophy/js/loadIM.js	(revision 2290)
@@ -11,5 +11,5 @@
 			 id_window		: "window_chat_area",
 			 width			: 490,
-			 height			: 380,
+			 height			: 395,
 			 top			: 100,
 			 left			: 400,
@@ -23,5 +23,5 @@
 		};
 		
-		_winBuild( winImChatArea );
+		//_winBuild( winImChatArea );
 		
 		//return '<div id="trophyimchat"><div id="trophyimchattabs"/></div>';
@@ -159,4 +159,15 @@
 	}
 	
+	
+	function getZindex()
+	{
+		return zIndex++;
+	}
+	
+	function parse(pXml, pXsl)
+	{
+		return _xtools.parse(_xtools.xml(pXml), pXsl);	
+	}
+	
 	function loadScripts(pFiles)
 	{
@@ -222,7 +233,9 @@
 	
 	
-	
-	loadIM.prototype.HTMLSnippets	= new HTMLSnippets;
-	window.loadIM					= new loadIM;
+	loadIM.prototype.getZIndex			= getZindex;
+	loadIM.prototype.parse				= parse;
+	
+	loadIM.prototype.HTMLSnippets		= new HTMLSnippets;
+	window.loadIM						= new loadIM;
 	
 })();
Index: /sandbox/jabberit_messenger/trophy/js/trophyim.js
===================================================================
--- /sandbox/jabberit_messenger/trophy/js/trophyim.js	(revision 2271)
+++ /sandbox/jabberit_messenger/trophy/js/trophyim.js	(revision 2290)
@@ -611,4 +611,6 @@
                 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][
@@ -617,4 +619,5 @@
                     TrophyIM.activeChats['divs'][jid_lower]['tab']);
                 }
+                */
             }
         }
@@ -626,6 +629,31 @@
      *  given resource
      */
-    makeChat : function(fulljid) {
-        var barejid = Strophe.getBareJidFromJid(fulljid);
+    makeChat : function(fulljid)
+    {
+    	
+    	var barjid = Strophe.getBareJidFromJid(fulljid);
+    	
+    	var winChatBox = 
+    	{
+   			 id_window		: "window_chat_area_" + barjid,
+			 width			: 387,
+			 height			: 355,
+			 top			: 100,
+			 left			: 400,
+			 draggable		: true,
+			 visible		: "display",
+			 resizable		: true,
+			 zindex			: loadIM.getZIndex(),
+			 title			: barjid.substring(0, barjid.indexOf('@')),
+			 closeAction	: "hidden",
+			 content		: loadIM.parse("chat_box","chatBox.xsl")	
+    	}
+    	
+    	_winBuild(winChatBox)
+		
+    	/*
+    	 * Codigo Original 
+    	 * 
+    	var barejid = Strophe.getBareJidFromJid(fulljid);
         if (!TrophyIM.activeChats['divs'][barejid]) {
             var chat_tabs = document.getElementById('trophyimchattabs');
@@ -635,11 +663,9 @@
             var tab_name = (contact['name'] != null) ? contact['name'] : barejid;
             chat_tab.className = "trophyimchattab trophyimchattab_a";
-            getElementsByClassName('trophyimchattabjid', 'div',
-            chat_tab)[0].appendChild(document.createTextNode(barejid));
-            getElementsByClassName('trophyimchattabname', 'div',
-            chat_tab)[0].appendChild(document.createTextNode(tab_name));
+            getElementsByClassName('trophyimchattabjid', 'div', chat_tab)[0].appendChild(document.createTextNode(barejid));
+            getElementsByClassName('trophyimchattabname', 'div', chat_tab)[0].appendChild(document.createTextNode(tab_name));
             chat_tab = chat_tabs.appendChild(chat_tab);
-            TrophyIM.activeChats['divs'][barejid] = {jid:fulljid, tab:chat_tab,
-            box:chat_box};
+            TrophyIM.activeChats['divs'][barejid] = {jid:fulljid, tab:chat_tab, box:chat_box};
+            
             if (!TrophyIM.activeChats['current']) { //We're the first
                 TrophyIM.activeChats['current'] = barejid;
@@ -658,5 +684,6 @@
         Strophe.getResourceFromJid(fulljid);
         TrophyIM.chatHistory[barejid.toLowerCase()]['resource'] =
-        Strophe.getResourceFromJid(fulljid);
+        Strophe.getResourceFromJid(fulljid);*/
+        
     },
     /** Function showChat
@@ -718,6 +745,13 @@
      *    (string) jid - the jid of chat box to add the message to.
      */
-    addMessage : function(msg, jid) {
-        var chat_box = getElementsByClassName('trophyimchatbox', 'div',
+    addMessage : function(msg, jid)
+    {
+        alert(jid + " : " + msg);
+    	 
+        /*
+         * Codigo Original Comentado 
+         *
+        
+    	var chat_box = getElementsByClassName('trophyimchatbox', 'div',
         TrophyIM.activeChats['divs'][jid]['box'])[0];
         var msg_div = document.createElement('div');
@@ -731,4 +765,5 @@
         TrophyIM.chatHistory[jid]['history'][
         TrophyIM.chatHistory[jid]['history'].length] = msg;
+        */
     },
     /** Function: renderRoster
