Index: /trunk/jabberit_messenger/jmessenger/js/trophyim.js
===================================================================
--- /trunk/jabberit_messenger/jmessenger/js/trophyim.js	(revision 3059)
+++ /trunk/jabberit_messenger/jmessenger/js/trophyim.js	(revision 3065)
@@ -1052,106 +1052,21 @@
     	},500);
     },
-    
-    testeSala : function()
+
+    
+    /** Function : getlistRooms
+     * 
+     * 
+     */
+    
+    getListRooms : function()
     {
-    	var deu_certo = function(element)
+    	var _error_return = function(element)
     	{
-    		element = element.getElementsByTagName( 'item' );
-    		var _rooms = 0;
-    		var _list = document.createElement( 'ul' );
-    		
-    		function show( )
-    		{
-    			if ( _rooms != element.length )
-    				return false;
-
-    			var winTeste =
-        		{	
-        			 id_window		: "window_Teste",
-        			 width			: 400,
-        			 height			: 300,
-        			 top			: 100,
-        			 left			: 400,
-        			 draggable		: true,
-        			 visible		: "display",
-        			 resizable		: true,
-        			 zindex			: loadscript.getZIndex(),
-        			 title			: "Expresso Messenger - Salas de Bate Papo",
-        			 closeAction	: "remove",
-        			 content		: '<ul>' + _list.innerHTML + '</ul>'
-        		};
-    			
-    			_winBuild( winTeste );
-    		}
-
-    		function _add_room( _room )
-        	{
-    			_rooms++;
-    			
-    			var _desc = _room.getAttribute( 'from' );
-    			
-    			var _fields = _room.getElementsByTagName( 'field' );
-    			for ( var f = 0; f < _fields.length; f++ )
-    				if ( ! ( _fields[ f ].hasAttribute( 'type' ) && _fields[ f ].getAttribute( 'type' ) == 'hidden' ) )
-    					if ( _fields[ f ].hasAttribute( 'label' ) && _fields[ f ].firstChild.hasChildNodes( ) )
-    						_desc += ' :: ' + _fields[ f ].getAttribute( 'label' ) + '( ' + _fields[ f ].firstChild.firstChild.nodeValue + ')'; 
-    		
-    			_list.appendChild(
-    				document.createElement( 'li' )
-    			).appendChild(
-    				document.createTextNode( _desc )
-    			);
-    			
-    			show( );
-        	}
-    		
-    		function _get_room_info( _room )
-    		{
-	    		TrophyIM.connection.sendIQ(
-	    				$iq( { "to" : _room, "type" : "get" } ).c( "query",{xmlns: Strophe.NS.DISCO_INFO } ),
-	    				_add_room,
-			        	function( a )
-			        	{
-			        		_rooms++;
-			        	
-			        		show( );
-			        	},
-			        	500
-			        );
-    		}
-
-    		for ( var i = 0; i < element.length; i++ )
-    			_get_room_info( element[ i ].getAttribute( 'jid' ) );
-    		
-    		/*
-    		var winTeste =
-    		{	
-    			 id_window		: "window_Teste",
-    			 width			: 400,
-    			 height			: 300,
-    			 top			: 100,
-    			 left			: 400,
-    			 draggable		: true,
-    			 visible		: "display",
-    			 resizable		: true,
-    			 zindex			: loadscript.getZIndex(),
-    			 title			: "Expresso Messenger - Salas de Bate Papo",
-    			 closeAction	: "remove",
-    			 content		: ( new xtools( path_jabberit ) ).parse( element, "listRooms.xsl")
-    		};*/
-
-			 //loadscript.parse("group","groups.xsl", paramsGroup);
+    		alert( " ERROR : " + element );
     	};
-    	
-    	var deu_errado = function(element)
-    	{
-    		alert( "DEU ERRADO  " + element );
-    	};
-    	
-    	var jid = "alexandrecorreia@im.pr.gov.br/OI";
     	
    		var iq = $iq({to: "conference.im.pr.gov.br", type: "get"}).c("query",{xmlns: Strophe.NS.DISCO_ITEMS});    		
     		
-    	TrophyIM.connection.sendIQ( iq, deu_certo, deu_errado, 500 );   		
+    	TrophyIM.connection.sendIQ( iq, loadscript.listRooms, _error_return, 500 );   		
     },
     
Index: /trunk/jabberit_messenger/jmessenger/js/jscode/loadIM.js
===================================================================
--- /trunk/jabberit_messenger/jmessenger/js/jscode/loadIM.js	(revision 3059)
+++ /trunk/jabberit_messenger/jmessenger/js/jscode/loadIM.js	(revision 3065)
@@ -345,5 +345,5 @@
 			                	['Adicionar Contato', 'loadscript.addContact();' ],
 			                	['Preferências', 'loadscript.preferences();'],
-			                	['Sala(s) de Bate-Papo', 'loadscript.teste();'],
+			                	['Sala(s) de Bate-Papo', 'loadscript.getListRooms();'],
 						   ];
 
@@ -1250,11 +1250,171 @@
 	}
 
-	function teste()
-	{
-		TrophyIM.testeSala();
-		
-	}
-	
-	loadIM.prototype.teste = teste;
+	// TESTE 
+	
+	function listRooms( element )
+	{
+		element = element.getElementsByTagName( 'item' );
+		var _rooms = 0;
+		var _list = document.createElement( 'div' );
+		
+		var show = function( )
+		{
+			if ( _rooms != element.length )
+				return false;
+
+			var winTeste =
+    		{	
+    			 id_window		: "window_Teste",
+    			 width			: 450,
+    			 height			: 300,
+    			 top			: 100,
+    			 left			: 400,
+    			 draggable		: true,
+    			 visible		: "display",
+    			 resizable		: true,
+    			 zindex			: loadscript.getZIndex(),
+    			 title			: "Expresso Messenger - Salas de Bate Papo",
+    			 closeAction	: "remove",
+    			 content		: _list.innerHTML
+    		};
+			
+			_winBuild( winTeste );
+		};
+
+		var _add_room = function( _room )
+    	{
+			_rooms++;
+
+			// Name Room
+			var nameRoom = _room.getAttribute( 'from' );
+				nameRoom = nameRoom.substring(0, nameRoom.indexOf("@"));
+			
+			var _desc = document.createElement("div");
+				_desc.setAttribute("style","margin:5px 3px 10px 3px; border-bottom:1px dashed #cecece");
+				_desc.appendChild(document.createTextNode( "Nome da Sala : " + nameRoom.toUpperCase() ));
+				
+			var _fields = _room.getElementsByTagName( 'field' );
+			for ( var f = 0; f < _fields.length; f++ )
+			{
+				if ( _fields[ f ].hasAttribute( 'var' ) )
+				{
+					if ( _fields[ f ].firstChild.hasChildNodes( ) && _fields[ f ].getAttribute( 'var' ) == 'muc#roominfo_description' )
+						_desc.innerHTML += "<br/> Descrição : " + _fields[ f ].firstChild.firstChild.nodeValue;						
+						
+					if ( _fields[ f ].firstChild.hasChildNodes( ) && _fields[ f ].getAttribute( 'var' ) == 'muc#roominfo_occupants' )
+						_desc.innerHTML += "<br/> Ocupantes : " + _fields[ f ].firstChild.firstChild.nodeValue;
+				}
+			}
+
+			_list.appendChild( _desc );
+			
+			show( );
+    	};
+		
+		var _get_room_info = function( _room )
+		{
+    		TrophyIM.connection.sendIQ(
+    				$iq( { "to" : _room, "type" : "get" } ).c( "query",{xmlns: Strophe.NS.DISCO_INFO } ),
+    				_add_room,
+		        	function( a )
+		        	{
+		        		_rooms++;
+		        	
+		        		show( );
+		        	},
+		        	500
+		        );
+		};
+
+		for ( var i = 0; i < element.length; i++ )
+		{
+			_get_room_info( element[ i ].getAttribute( 'jid' ) );
+		}
+		 		
+		
+		
+		/*
+		element = element.getElementsByTagName( 'item' );
+		var _rooms = 0;
+		var _list = document.createElement( 'ul' );
+		
+		var show = function( )
+		{
+			if ( _rooms != element.length )
+				return false;
+
+			var winTeste =
+    		{	
+    			 id_window		: "window_Teste",
+    			 width			: 400,
+    			 height			: 300,
+    			 top			: 100,
+    			 left			: 400,
+    			 draggable		: true,
+    			 visible		: "display",
+    			 resizable		: true,
+    			 zindex			: loadscript.getZIndex(),
+    			 title			: "Expresso Messenger - Salas de Bate Papo",
+    			 closeAction	: "remove",
+    			 content		: '<ul>' + _list.innerHTML + '</ul>'
+    		};
+			
+			_winBuild( winTeste );
+		};
+
+		var _add_room = function( _room )
+    	{
+			_rooms++;
+			
+			var _desc = _room.getAttribute( 'from' );
+			
+			var _fields = _room.getElementsByTagName( 'field' );
+			for ( var f = 0; f < _fields.length; f++ )
+				if ( ! ( _fields[ f ].hasAttribute( 'type' ) && _fields[ f ].getAttribute( 'type' ) == 'hidden' ) )
+					if ( _fields[ f ].hasAttribute( 'label' ) && _fields[ f ].firstChild.hasChildNodes( ) )
+						_desc += ' :: ' + _fields[ f ].getAttribute( 'label' ) + ' ( ' + _fields[ f ].firstChild.firstChild.nodeValue + ' ) '; 
+		
+			_list.appendChild(
+				document.createElement( 'li' )
+			).appendChild(
+				document.createTextNode( _desc )
+			);
+			
+			show( );
+    	};
+		
+		var _get_room_info = function( _room )
+		{
+    		TrophyIM.connection.sendIQ(
+    				$iq( { "to" : _room, "type" : "get" } ).c( "query",{xmlns: Strophe.NS.DISCO_INFO } ),
+    				_add_room,
+		        	function( a )
+		        	{
+		        		_rooms++;
+		        	
+		        		show( );
+		        	},
+		        	500
+		        );
+		};
+
+		for ( var i = 0; i < element.length; i++ )
+		{
+			_get_room_info( element[ i ].getAttribute( 'jid' ) );
+		}
+		 */
+		
+	}
+	
+	function getListRooms()
+	{
+		TrophyIM.getListRooms();
+	}
+	
+	loadIM.prototype.getListRooms	= getListRooms;
+	loadIM.prototype.listRooms		= listRooms;
+	
+	
+	
 	
 	
