Index: branches/2.2/jabberit_messenger/jmessenger/js/trophyim.mini.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/trophyim.mini.js	(revision 3132)
+++ branches/2.2/jabberit_messenger/jmessenger/js/trophyim.mini.js	(revision 3177)
@@ -35,7 +35,8 @@
 {var xids=TrophyIM.cookies['trophyim_bosh_xid'].split("|");TrophyIM.delCookie('trophyim_bosh_xid');TrophyIM.constants.stale_roster=true;TrophyIM.connection=new Strophe.Connection(TROPHYIM_BOSH_SERVICE);TrophyIM.connection.rawInput=TrophyIM.rawInput;TrophyIM.connection.rawOutput=TrophyIM.rawOutput;Strophe.info('Attempting Strophe attach.');TrophyIM.connection.attach(xids[0],xids[1],xids[2],TrophyIM.onConnect);TrophyIM.onConnect(Strophe.Status.CONNECTED);}
 else
-{loadscript.rosterDiv();var _getUserCurrent=null;var _flag=0;do
-{_getUserCurrent=loadscript.getUserCurrent();_flag++;}while((_getUserCurrent==null||_flag>3))
-TrophyIM.login(Base64.decode(_getUserCurrent.jid),Base64.decode(_getUserCurrent.password));}}
+{loadscript.rosterDiv();var _getUserCurrent=null;_getUserCurrent=loadscript.getUserCurrent();if(_getUserCurrent==null)
+{setTimeout("TrophyIM.showLogin()",500);}
+else
+{TrophyIM.login(Base64.decode(_getUserCurrent.jid),Base64.decode(_getUserCurrent.password));}}}
 else
 {setTimeout("TrophyIM.showLogin()",500);}},log:function(level,msg)
@@ -104,5 +105,5 @@
 {for(var i=0;i<xquery.length;i++)
 {var xmlns=xquery[i].getAttribute("xmlns");if(xmlns.indexOf("http://jabber.org/protocol/muc#user")==0)
-{var _from=xquery[i].parentNode.getAttribute('from');var _to=xquery[i].parentNode.getAttribute('to');var nameChatRoom=Strophe.getBareJidFromJid(_from);var nickName=Strophe.getResourceFromJid(_from);var type=(xquery[i].parentNode.getAttribute('type')!=null)?xquery[i].parentNode.getAttribute('type'):'available';var show=(xquery[i].parentNode.firstChild.nodeName=="show")?xquery[i].parentNode.firstChild.firstChild.nodeValue:type;var _idElement=nameChatRoom+"_UserChatRoom__"+nickName;var _UserChatRoom=document.createElement("div");_UserChatRoom.id=_idElement;_UserChatRoom.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/"+show+".gif')no-repeat center left");_UserChatRoom.appendChild(document.createTextNode(nickName));var nodeUser=document.getElementById(_idElement);if(nodeUser==null)
+{var _from=xquery[i].parentNode.getAttribute('from');var _to=xquery[i].parentNode.getAttribute('to');var nameChatRoom=Strophe.getBareJidFromJid(_from);var nickName=Strophe.getResourceFromJid(_from);var type=(xquery[i].parentNode.getAttribute('type')!=null)?xquery[i].parentNode.getAttribute('type'):'available';var show=(xquery[i].parentNode.firstChild.nodeName=="show")?xquery[i].parentNode.firstChild.firstChild.nodeValue:type;var _idElement=nameChatRoom+"_UserChatRoom__"+nickName;var _UserChatRoom=document.createElement("div");_UserChatRoom.id=_idElement;_UserChatRoom.style.paddingLeft='18px';_UserChatRoom.style.margin='3px 0px 0px 2px';_UserChatRoom.style.background='url("'+path_jabberit+'templates/default/images/'+show+'.gif") no-repeat center left';_UserChatRoom.appendChild(document.createTextNode(nickName));var nodeUser=document.getElementById(_idElement);if(nodeUser==null)
 {if(document.getElementById(nameChatRoom+'__roomChat__participants')!=null)
 {nameChatRoom=document.getElementById(nameChatRoom+'__roomChat__participants');nameChatRoom.appendChild(_UserChatRoom);}
@@ -114,5 +115,5 @@
 {nodeUser.parentNode.removeChild(nodeUser);}
 else if(show)
-{nodeUser.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/"+show+".gif')no-repeat center left");}}}}}},onMessage:function(msg)
+{nodeUser.style.backgroundImage='url("'+path_jabberit+'templates/default/images/'+show+'.gif")';}}}}}},onMessage:function(msg)
 {var checkTime=function(i)
 {if(i<10)i="0"+i;return i;};var messageDate=function(_date)
Index: branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js	(revision 3132)
+++ branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js	(revision 3177)
@@ -305,15 +305,14 @@
 				// Get User Current;
 				var _getUserCurrent = null;
-				
-				var _flag	= 0;
-
-				do
+					_getUserCurrent = loadscript.getUserCurrent();
+				
+				if( _getUserCurrent == null )
+				{	
+					setTimeout( "TrophyIM.showLogin()", 500 );
+				}
+				else
 				{
-					_getUserCurrent = loadscript.getUserCurrent();
-					_flag++;
-					
-				}while( ( _getUserCurrent == null || _flag > 3 ) )
-					
-				TrophyIM.login( Base64.decode( _getUserCurrent.jid ), Base64.decode( _getUserCurrent.password ));
+					TrophyIM.login( Base64.decode( _getUserCurrent.jid ), Base64.decode( _getUserCurrent.password ));
+				}
             }
         }
@@ -671,7 +670,9 @@
                 	var _idElement = nameChatRoom + "_UserChatRoom__" + nickName;
                 	  
-                	var _UserChatRoom		= document.createElement("div");
-	            		_UserChatRoom.id	= _idElement;
-	            		_UserChatRoom.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/" + show + ".gif')no-repeat center left");
+                	var _UserChatRoom					= document.createElement("div");
+	            		_UserChatRoom.id				= _idElement;
+	            		_UserChatRoom.style.paddingLeft = '18px';
+	            		_UserChatRoom.style.margin 		= '3px 0px 0px 2px';
+	            		_UserChatRoom.style.background	= 'url("'+path_jabberit+'templates/default/images/' + show + '.gif") no-repeat center left';
 	            		_UserChatRoom.appendChild( document.createTextNode( nickName ) );
 
@@ -703,6 +704,6 @@
                 		else if( show )
                 		{
-                			nodeUser.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/" + show + ".gif')no-repeat center left");	
-                		}
+                			nodeUser.style.backgroundImage =  'url("'+path_jabberit+'templates/default/images/' + show + '.gif")';
+	            		}
                 	}
                 }
Index: branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js	(revision 3129)
+++ branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js	(revision 3177)
@@ -1351,15 +1351,15 @@
 			var _JIDROOM	= _xml.createElement('jidRoom')
 			var nameRoom	= _room.getAttribute( 'from' );
-			
+
 			_ROOM.setAttribute( 'nameRoom', (nameRoom.substring(0, nameRoom.indexOf("@"))).toUpperCase() );
 			_JIDROOM.appendChild( _xml.createTextNode(nameRoom) );
 			_ROOM.appendChild( _JIDROOM );
-			
+
 			// Get fields elements;
 			var _fields = _room.getElementsByTagName( 'field' );
-			
+
 			for ( var f = 0; f < _fields.length; f++ )
 			{
-				if ( _fields[ f ].hasAttribute( 'var' ) )
+				if ( _fields[ f ].getAttribute( 'var' ) )
 				{
 					if ( _fields[ f ].firstChild.hasChildNodes( ) && _fields[ f ].getAttribute( 'var' ) == 'muc#roominfo_description' )
@@ -1384,5 +1384,5 @@
 			for( var f = 0 ; f < _feature.length; f++ )
 			{
-				if ( _feature[ f ].hasAttribute( 'var' ) )
+				if ( _feature[ f ].getAttribute( 'var' ) )
 				{
 					if( _feature[ f ].getAttribute( 'var' ) == 'muc_unsecured' )
Index: branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.mini.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.mini.js	(revision 3129)
+++ branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.mini.js	(revision 3177)
@@ -277,5 +277,5 @@
 var _JIDROOM=_xml.createElement('jidRoom')
 var nameRoom=_room.getAttribute('from');_ROOM.setAttribute('nameRoom',(nameRoom.substring(0,nameRoom.indexOf("@"))).toUpperCase());_JIDROOM.appendChild(_xml.createTextNode(nameRoom));_ROOM.appendChild(_JIDROOM);var _fields=_room.getElementsByTagName('field');for(var f=0;f<_fields.length;f++)
-{if(_fields[f].hasAttribute('var'))
+{if(_fields[f].getAttribute('var'))
 {if(_fields[f].firstChild.hasChildNodes()&&_fields[f].getAttribute('var')=='muc#roominfo_description')
 {var _description=_xml.createElement("description");_description.appendChild(_xml.createTextNode(_fields[f].firstChild.firstChild.nodeValue));_ROOM.appendChild(_description);}
@@ -284,5 +284,5 @@
 _occupants.appendChild(_xml.createTextNode(_fields[f].firstChild.firstChild.nodeValue));_ROOM.appendChild(_occupants);}}}
 var _feature=_room.getElementsByTagName('feature');for(var f=0;f<_feature.length;f++)
-{if(_feature[f].hasAttribute('var'))
+{if(_feature[f].getAttribute('var'))
 {if(_feature[f].getAttribute('var')=='muc_unsecured')
 {var _password=_xml.createElement("password");_password.appendChild(_xml.createTextNode("false"));_ROOM.appendChild(_password);}
Index: branches/2.2/jabberit_messenger/jmessenger/js/dragdrop.mini.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/dragdrop.mini.js	(revision 3102)
+++ branches/2.2/jabberit_messenger/jmessenger/js/dragdrop.mini.js	(revision 3177)
@@ -2,5 +2,5 @@
 (function()
 {var _element=null;var _elementA=null;var _elementB=null;var _parent=null;function _configEvent(pObj,pEvent,pHandler)
-{if(typeof pObj=='object')
+{if(pObj&&typeof pObj=='object')
 {if(pEvent.substring(0,2)=='on')
 pEvent=pEvent.substring(2,pEvent.length);if(arguments.length==3)
@@ -9,7 +9,8 @@
 pObj.attachEvent('on'+pEvent,pHandler);}
 else if(arguments.length==4)
-{if(pObj.removeEventListener&&pObj.removeEventListener!='undefined')
-pObj.removeEventListener(pEvent,pHandler,false);else if(pObj.detachEvent)
-pObj.detachEvent('on'+pEvent,pHandler);}}}
+{if(pObj.removeEventListener)
+{pObj.removeEventListener(pEvent,pHandler,false);}
+else if(pObj.detachEvent)
+{pObj.detachEvent('on'+pEvent,pHandler);}}}}
 function _drag(e)
 {if(typeof e.preventDefault!='undefined')
@@ -38,5 +39,5 @@
 function _mouseUp()
 {if(_element)
-{_mouseUpShadow();_configEvent(_element,'onmousemove',_mouseMove,'remove');_configEvent(top.document,'onmousemove',_mouseMove,'remove');_configEvent(_element,'onmouseup',_mouseUp,'remove');_configEvent(top.document,'onmouseup',_mouseUp,'remove');_element.mouseOffset=null;_element=null;}}
+{_configEvent(_element,'onmousemove',_mouseMove,'remove');_configEvent(top.document,'onmousemove',_mouseMove,'remove');_configEvent(_element,'onmouseup',_mouseUp,'remove');_configEvent(top.document,'onmouseup',_mouseUp,'remove');_element.mouseOffset=null;_mouseUpShadow();}}
 function _mouseDownShadow(e)
 {try
Index: branches/2.2/jabberit_messenger/jmessenger/js/dragdrop.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/dragdrop.js	(revision 3102)
+++ branches/2.2/jabberit_messenger/jmessenger/js/dragdrop.js	(revision 3177)
@@ -6,7 +6,7 @@
 	var _parent		= null;
 
-	function _configEvent(pObj, pEvent, pHandler)
-	{
-		if ( typeof pObj == 'object' )
+	function _configEvent( pObj, pEvent, pHandler )
+	{
+		if ( pObj && typeof pObj == 'object' )
 		{
 			if ( pEvent.substring(0, 2) == 'on' )
@@ -22,8 +22,12 @@
 			else if ( arguments.length == 4 )
 			{
-				if ( pObj.removeEventListener && pObj.removeEventListener != 'undefined')
-					pObj.removeEventListener(pEvent, pHandler, false);
+				if ( pObj.removeEventListener )
+				{
+					pObj.removeEventListener( pEvent, pHandler, false );
+				}
 				else if ( pObj.detachEvent )
-					pObj.detachEvent('on' + pEvent, pHandler);
+				{
+					pObj.detachEvent( 'on' + pEvent, pHandler );
+				}
 			}
 		}
@@ -148,6 +152,4 @@
 		if ( _element )
 		{
-			_mouseUpShadow();
-			
 			_configEvent(_element, 'onmousemove', _mouseMove, 'remove');
 			_configEvent(top.document, 'onmousemove', _mouseMove, 'remove');
@@ -157,5 +159,5 @@
 
 			_element.mouseOffset = null;
-			_element = null;
+			_mouseUpShadow();
 		}
 	}
