Index: branches/2.2/jabberit_messenger/jmessenger/js/trophyim.mini.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/trophyim.mini.js	(revision 4420)
+++ branches/2.2/jabberit_messenger/jmessenger/js/trophyim.mini.js	(revision 4479)
@@ -171,5 +171,5 @@
 {return i18n.PAUSED;}}}}
 return'';},makeChat:function(fulljid)
-{var barejid=Strophe.getBareJidFromJid(fulljid);var titleWindow="";var paramsChatBox={'enabledPopUp':((loadscript.getIsIE())?"none":"block"),'idChatBox':barejid+"__chatBox",'jidTo':barejid,'path_jabberit':path_jabberit};titleWindow=barejid.toLowerCase();titleWindow=titleWindow.substring(0,titleWindow.indexOf('@'));if(TrophyIM.rosterObj.roster[barejid])
+{var barejid=Strophe.getBareJidFromJid(fulljid);var titleWindow="";var paramsChatBox={'enabledPopUp':((loadscript.getBrowserCompatible())?"block":"none"),'idChatBox':barejid+"__chatBox",'jidTo':barejid,'path_jabberit':path_jabberit};titleWindow=barejid.toLowerCase();titleWindow=titleWindow.substring(0,titleWindow.indexOf('@'));if(TrophyIM.rosterObj.roster[barejid])
 {if(TrophyIM.rosterObj.roster[barejid.toLowerCase()]['contact']['name'])
 {titleWindow=TrophyIM.rosterObj.roster[barejid.toLowerCase()]['contact']['name'];}}
@@ -186,5 +186,7 @@
 {if(e.keyCode==13){_send_message();composingTimer_=0;clearInterval(timeCounter);}else{if(_chatStateOnOff.value=='on')
 setComposing();}});var winChatBox={id_window:"window_chat_area_"+barejid,barejid:barejid,width:387,height:375,top:TrophyIM.posWindow.top,left:TrophyIM.posWindow.left,draggable:true,visible:"display",resizable:true,zindex:loadscript.getZIndex(),title:titleWindow,closeAction:"hidden",content:_content}
-_win=_winBuild(winChatBox);loadscript.notification(barejid);loadscript.getPhotoUser(barejid);_textarea.focus();return(_messages=_win.content().firstChild);},makeChatRoom:function()
+_win=_winBuild(winChatBox);loadscript.notification(barejid);loadscript.getPhotoUser(barejid);_textarea.focus();_messages=_win.content().firstChild;while(_messages&&_messages.nodeType!==1)
+{_messages=_messages.nextSibling;}
+return(_messages);},makeChatRoom:function()
 {var jidChatRoom=arguments[0];var titleWindow="ChatRoom - "+unescape(arguments[1]);var paramsChatRoom={'idChatRoom':jidChatRoom+"__roomChat",'jidTo':jidChatRoom,'lang_Send':i18n.SEND,'lang_Leave_ChatRoom':i18n.LEAVE_CHATROOM,'path_jabberit':path_jabberit};TrophyIM.posWindow.top=TrophyIM.posWindow.top+10;if(TrophyIM.posWindow.top>200)
 TrophyIM.posWindow.top=100;TrophyIM.posWindow.left=TrophyIM.posWindow.left+5;if(TrophyIM.posWindow.left>455)
@@ -200,5 +202,7 @@
 {if(e.keyCode==13)
 {_send_message();}});var winChatRoom={id_window:"window_chat_room_"+arguments[0],barejid:jidChatRoom,width:500,height:450,top:TrophyIM.posWindow.top,left:TrophyIM.posWindow.left,draggable:true,visible:"display",resizable:true,zindex:loadscript.getZIndex(),title:titleWindow,closeAction:"hidden",content:_content}
-_win=_winBuild(winChatRoom);return(_messages=_win.content().firstChild);},addContact:function(jidTo,name,group)
+_win=_winBuild(winChatRoom);_messages=_win.content().firstChild;while(_messages&&_messages.nodeType!==1)
+{_messages=_messages.nextSibling;}
+return(_messages);},addContact:function(jidTo,name,group)
 {var _flag=true;if(TrophyIM.removeResult.idResult.length>0)
 {for(var i=0;i<TrophyIM.removeResult.idResult.length;i++)
Index: branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js	(revision 4475)
+++ branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js	(revision 4479)
@@ -987,7 +987,7 @@
                     {
                         contact : "[" + stamp + "] <font style='font-weight:bold; color:black;'>" + contact + "</font>",
-                        msg	: "</br>" + _message.innerHTML
+                        msg		: "</br>" + _message.innerHTML
                     };
-
+					
                     TrophyIM.addMessage( TrophyIM.makeChat( from ), jid_lower, message );
                 }
@@ -1002,5 +1002,5 @@
                         msg     : "</br>" + _message.innerHTML
                     };
-                    
+
                     TrophyIM.addMessage( TrophyIM.makeChatRoom( barejid ), jid_lower, message );
                 }
@@ -1089,5 +1089,5 @@
     {
         var barejid		= Strophe.getBareJidFromJid(fulljid);
-        var titleWindow	= "";
+        var titleWindow         = "";
 
         var paramsChatBox =
@@ -1096,5 +1096,5 @@
             'idChatBox' 	: barejid + "__chatBox",
             'jidTo'		: barejid,
-            'path_jabberit' : path_jabberit
+            'path_jabberit'     : path_jabberit
         };
 
@@ -1121,12 +1121,10 @@
         
         var _content = document.createElement( 'div' );
-            _content.innerHTML = loadscript.parse( "chat_box", "chatBox.xsl", paramsChatBox);
-            _content = _content.firstChild;
+        _content.innerHTML = loadscript.parse( "chat_box", "chatBox.xsl", paramsChatBox);
+        _content = _content.firstChild;
         
         var _messages		= _content.firstChild.firstChild;
-        
-        
         var _textarea		= _content.getElementsByTagName( 'textarea' ).item( 0 );
-        var _send		= _content.getElementsByTagName( 'input' ).item( 0 );
+        var _send			= _content.getElementsByTagName( 'input' ).item( 0 );
         var _chatStateOnOff	= _content.getElementsByTagName( 'input' ).item( 1 );
 
@@ -1213,13 +1211,13 @@
    		
         _textarea.focus( );
-        
-        _messages = _win.content( ).firstChild;
-        
-        while ( _messages && _messages.nodeType !== 1 )
-        {
-            _messages = _messages.nextSibling;
-        }
-
-        return ( _messages );
+
+        _messages = _win.content( ).firstChild; 
+ 	 
+ 	while ( _messages && _messages.nodeType !== 1 ) 
+ 	{ 
+            _messages = _messages.nextSibling; 
+ 	} 
+ 	
+ 	return ( _messages ); 
     },
 
@@ -1238,5 +1236,5 @@
         {
             'idChatRoom' 	: jidChatRoom + "__roomChat",
-            'jidTo'			: jidChatRoom,
+            'jidTo'		: jidChatRoom,
             'lang_Send'		: i18n.SEND,
             'lang_Leave_ChatRoom' : i18n.LEAVE_CHATROOM,
@@ -1260,5 +1258,5 @@
         var _messages		= _content.firstChild.firstChild;
         var _textarea		= _content.getElementsByTagName( 'textarea' ).item( 0 );
-        var _send		= _content.getElementsByTagName( 'input' ).item( 0 );
+        var _send			= _content.getElementsByTagName( 'input' ).item( 0 );
         var _leaveChatRoom	= _content.getElementsByTagName( 'input' ).item( 1 );
         
@@ -1318,19 +1316,19 @@
             zindex		: loadscript.getZIndex(),
             title		: titleWindow,
-            closeAction 	: "hidden",
+            closeAction         : "hidden",
             content		: _content 	
         }
     	
         _win = _winBuild(winChatRoom);
-
-
-        _messages = _win.content( ).firstChild;
-        
-        while ( _messages && _messages.nodeType !== 1 )
-        {
-            _messages = _messages.nextSibling;
-        }
-
-        return ( _messages );
+    	
+        _messages = _win.content( ).firstChild; 
+ 	 
+ 	while ( _messages && _messages.nodeType !== 1 ) 
+ 	{ 
+            _messages = _messages.nextSibling; 
+ 	} 
+ 	
+ 	return ( _messages ); 
+
     },
     
Index: branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js	(revision 4475)
+++ branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js	(revision 4479)
@@ -393,5 +393,5 @@
             return SnifferBrowser.isCompatible('firefox3','firefox4');
         }
-        
+	
         function getPhotoUser( jid )
         {
@@ -1623,6 +1623,6 @@
         loadIM.prototype.disabledNotificationNewUsers	= disabledNotificationNewUsers;
         loadIM.prototype.enabledNotificationNewUsers	= enabledNotificationNewUsers;	
+        loadIM.prototype.getListRooms		= getListRooms;	
         loadIM.prototype.getBrowserCompatible	= getBrowserCompatible;
-        loadIM.prototype.getListRooms		= getListRooms;	
         loadIM.prototype.getPhotoUser		= getPhotoUser;
         loadIM.prototype.getSmiles		= getSmiles;
Index: branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.mini.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.mini.js	(revision 4475)
+++ branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.mini.js	(revision 4479)
@@ -324,5 +324,5 @@
 {if(SnifferBrowser.isCompatible('chrome11','ie8','firefox3','firefox4','epiphany2','iceweasel3','safari'))
 TrophyIM.load();}},1500);autoStatus();configEvents(document,'onmousemove',autoStatus);configEvents(document,'onkeypress',autoStatus);},2000);}}
-loadIM.prototype.adIcon=addIcon;loadIM.prototype.actionButton=actionButton;loadIM.prototype.addContact=addContact;loadIM.prototype.addNewUser=addNewUser;loadIM.prototype.clrAllContacts=clrAllContacts;loadIM.prototype.configEvents=configEvents;loadIM.prototype.createChatRooms=createChatRooms;loadIM.prototype.disabledNotificationNewUsers=disabledNotificationNewUsers;loadIM.prototype.enabledNotificationNewUsers=enabledNotificationNewUsers;loadIM.prototype.getBrowserCompatible=getBrowserCompatible;loadIM.prototype.getListRooms=getListRooms;loadIM.prototype.getPhotoUser=getPhotoUser;loadIM.prototype.getSmiles=getSmiles;loadIM.prototype.getStatusUserIM=getStatusUserIM;loadIM.prototype.getStatusMessage=getStatusMessage;loadIM.prototype.getShowContactsOffline=getShowContactsOffline;loadIM.prototype.getUserCurrent=getUserCurrent;loadIM.prototype.getZIndex=getZindex;loadIM.prototype.groupsHidden=groupsHidden;loadIM.prototype.groupsVisible=groupsVisible;loadIM.prototype.joinRoom=joinRoom;loadIM.prototype.keyPressSearch=keyPressSearch;loadIM.prototype.listRooms=listRooms;loadIM.prototype.loginPage=loginPage;loadIM.prototype.notification=notificationNewMessage;loadIM.prototype.parse=parse;loadIM.prototype.preferences=preferences;loadIM.prototype.searchUser=searchUser
+loadIM.prototype.adIcon=addIcon;loadIM.prototype.actionButton=actionButton;loadIM.prototype.addContact=addContact;loadIM.prototype.addNewUser=addNewUser;loadIM.prototype.clrAllContacts=clrAllContacts;loadIM.prototype.configEvents=configEvents;loadIM.prototype.createChatRooms=createChatRooms;loadIM.prototype.disabledNotificationNewUsers=disabledNotificationNewUsers;loadIM.prototype.enabledNotificationNewUsers=enabledNotificationNewUsers;loadIM.prototype.getListRooms=getListRooms;loadIM.prototype.getBrowserCompatible=getBrowserCompatible;loadIM.prototype.getPhotoUser=getPhotoUser;loadIM.prototype.getSmiles=getSmiles;loadIM.prototype.getStatusUserIM=getStatusUserIM;loadIM.prototype.getStatusMessage=getStatusMessage;loadIM.prototype.getShowContactsOffline=getShowContactsOffline;loadIM.prototype.getUserCurrent=getUserCurrent;loadIM.prototype.getZIndex=getZindex;loadIM.prototype.groupsHidden=groupsHidden;loadIM.prototype.groupsVisible=groupsVisible;loadIM.prototype.joinRoom=joinRoom;loadIM.prototype.keyPressSearch=keyPressSearch;loadIM.prototype.listRooms=listRooms;loadIM.prototype.loginPage=loginPage;loadIM.prototype.notification=notificationNewMessage;loadIM.prototype.parse=parse;loadIM.prototype.preferences=preferences;loadIM.prototype.searchUser=searchUser
 loadIM.prototype.setAutorization=setAutorization;loadIM.prototype.setMessageStatus=setMessageStatus;loadIM.prototype.setPreferences=setPreferences;loadIM.prototype.setPresence=setPresence;loadIM.prototype.setStatusJabber=setStatusJabber;loadIM.prototype.setSelectEditable=setSelectEditable;loadIM.prototype.setUserCurrent=setUserCurrent;loadIM.prototype.removeContact=removeContact;loadIM.prototype.removeElement=removeElement;loadIM.prototype.removeGroup=removeGroup;loadIM.prototype.renameContact=renameContact;loadIM.prototype.renameGroup=renameGroup;loadIM.prototype.rosterDiv=rosterDiv;loadIM.prototype.windowNotificationNewUsers=windowNotificationNewUsers;loadIM.prototype.windowPOPUP=windowPOPUP;window.LoadIM=loadIM;if(SnifferBrowser.isCompatible('is_ie'))
 {configEvents(window,'onload',function()
