Index: trunk/jabberit_messenger/jmessenger/xsl/listRooms.xsl
===================================================================
--- trunk/jabberit_messenger/jmessenger/xsl/listRooms.xsl	(revision 3059)
+++ trunk/jabberit_messenger/jmessenger/xsl/listRooms.xsl	(revision 3070)
@@ -3,10 +3,38 @@
 	<xsl:output method="html" omit-xml-declaration="yes"/>
 
-	<xsl:template match="child::*">
-		<xsl:for-each select="descendant::*">
-			<xsl:if test="name( ) = 'item'">
-				:: <xsl:value-of select="name( )" /> - <xsl:value-of select="@jid" /> ::<br/>
-			</xsl:if>
-		</xsl:for-each>
+	<xsl:param name="path_jabberit" />
+
+	<xsl:template match="listRooms">
+		
+		<div style="margin:5px; height:200px; overflow-y: auto">
+			
+			<xsl:for-each select="room">
+				<xsl:sort select="@nameRoom"/>
+				<div onclick="alert('aqui dentro');" style="cursor:pointer;padding :5px 0px 5px 45px; background:url({$path_jabberit}templates/default/images/conference.png) no-repeat center left; border-bottom:1px dashed #cecece; margin:6px 1px;">
+					Nome da Sala : <xsl:value-of select="@nameRoom"/> <br/>
+					<xsl:choose>
+						<xsl:when test="description != ''">
+							DescriÃ§Ã£o : <xsl:value-of select="description"/> <br/>
+						</xsl:when>
+						<xsl:otherwise>
+							DescriÃ§Ã£o : &lt; Sem DescriÃ§Ã£o &gt; <br/>
+						</xsl:otherwise>
+					</xsl:choose>					
+					Ocupantes : <xsl:value-of select="occupants"/> <br/>
+					<xsl:choose>
+						<xsl:when test="password = 'true'">
+							Password : <span style="color:red; font-weight: bold;"><blink>Com Senha</blink></span><br/>
+						</xsl:when>
+						<xsl:otherwise>
+							Password : Sem Senha <br/>
+						</xsl:otherwise>
+					</xsl:choose>					
+				</div>
+			</xsl:for-each>
+			
+		</div>
+		
+		<div id="buttons_addChatRoom" style="float:left; margin:10px 0px 0px 10px;" />
+		
 	</xsl:template>
 
Index: trunk/jabberit_messenger/jmessenger/xsl/listTeste.xsl
===================================================================
--- trunk/jabberit_messenger/jmessenger/xsl/listTeste.xsl	(revision 3070)
+++ trunk/jabberit_messenger/jmessenger/xsl/listTeste.xsl	(revision 3070)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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="listRooms">
+		
+		<xsl:for-each select="room">
+
+			:: <xsl:value-of select="." /> :: <br/>
+
+		</xsl:for-each>
+		
+	</xsl:template>
+	
+	
+	
+	<xsl:template match="child::*">
+		<xsl:for-each select="descendant::*">
+			<xsl:if test="name( ) = 'item'">
+				:: <xsl:value-of select="name( )" /> - <xsl:value-of select="@jid" /> ::<br/>
+			</xsl:if>
+		</xsl:for-each>
+	</xsl:template>
+	
+	
+
+</xsl:stylesheet>
Index: trunk/jabberit_messenger/jmessenger/js/jscode/loadIM.js
===================================================================
--- trunk/jabberit_messenger/jmessenger/js/jscode/loadIM.js	(revision 3065)
+++ trunk/jabberit_messenger/jmessenger/js/jscode/loadIM.js	(revision 3070)
@@ -1255,15 +1255,22 @@
 	{
 		element = element.getElementsByTagName( 'item' );
-		var _rooms = 0;
-		var _list = document.createElement( 'div' );
+
+		var _roomsCount	= 0;
+		var _xml		= Xtools.xml('listRooms');
+		var _listRooms	= _xml.documentElement; 
 		
 		var show = function( )
 		{
-			if ( _rooms != element.length )
+			if ( _roomsCount != element.length )
 				return false;
-
-			var winTeste =
+			
+			var paramsListRooms = 
+			{
+				"path_jabberit" : path_jabberit	
+			};
+			
+			var winListRooms =
     		{	
-    			 id_window		: "window_Teste",
+    			 id_window		: "window_List_Rooms",
     			 width			: 450,
     			 height			: 300,
@@ -1276,23 +1283,34 @@
     			 title			: "Expresso Messenger - Salas de Bate Papo",
     			 closeAction	: "remove",
-    			 content		: _list.innerHTML
+    			 content		: Xtools.parse( _xml, "listRooms.xsl", paramsListRooms )
     		};
 			
-			_winBuild( winTeste );
+			_winBuild( winListRooms );
+			
+			var _pButtons =
+			{
+				'lang1' 		: 'Criar Nova Sala',
+				'lang2'			: 'Fechar',
+				'onclickClose'	: '_winBuild("window_List_Rooms","remove");',
+				'onclickSubmit'	: 'alert(\'Vou criar mais uma sala\')'
+			}; 
+
+			// Add Buttons
+			document.getElementById('buttons_addChatRoom').innerHTML = Xtools.parse(Xtools.xml('buttons_main'), 'buttons.xsl', _pButtons);
 		};
 
 		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() ));
-				
+			_roomsCount++;
+
+			var _ROOM 		= _xml.createElement('room')
+			var nameRoom	= _room.getAttribute( 'from' );
+				nameRoom	= nameRoom.substring(0, nameRoom.indexOf("@"));
+			
+			_ROOM.setAttribute('nameRoom', nameRoom.toUpperCase() );
+			
+			// Get fields elements;
 			var _fields = _room.getElementsByTagName( 'field' );
+			
 			for ( var f = 0; f < _fields.length; f++ )
 			{
@@ -1300,12 +1318,42 @@
 				{
 					if ( _fields[ f ].firstChild.hasChildNodes( ) && _fields[ f ].getAttribute( 'var' ) == 'muc#roominfo_description' )
-						_desc.innerHTML += "<br/> Descrição : " + _fields[ f ].firstChild.firstChild.nodeValue;						
-						
+					{
+						var _description	= _xml.createElement("description");
+							_description.appendChild( _xml.createTextNode( _fields[ f ].firstChild.firstChild.nodeValue ) );
+							_ROOM.appendChild( _description );
+					}
+
 					if ( _fields[ f ].firstChild.hasChildNodes( ) && _fields[ f ].getAttribute( 'var' ) == 'muc#roominfo_occupants' )
-						_desc.innerHTML += "<br/> Ocupantes : " + _fields[ f ].firstChild.firstChild.nodeValue;
+					{
+						var _occupants = _xml.createElement("occupants")
+							_occupants.appendChild( _xml.createTextNode( _fields[ f ].firstChild.firstChild.nodeValue) );
+							_ROOM.appendChild( _occupants );
+					}
 				}
 			}
 
-			_list.appendChild( _desc );
+			// Get feature elements;
+			var _feature = _room.getElementsByTagName( 'feature' );
+			
+			for( var f = 0 ; f < _feature.length; f++ )
+			{
+				if ( _feature[ f ].hasAttribute( 'var' ) )
+				{
+					if( _feature[ f ].getAttribute( 'var' ) == 'muc_unsecured' )
+					{
+						var _password = _xml.createElement("password");
+							_password.appendChild( _xml.createTextNode("false") );
+							_ROOM.appendChild( _password );
+					}
+					else if( _feature[ f ].getAttribute( 'var' ) == 'muc_passwordprotected' )
+					{
+						var _password = _xml.createElement("password");
+							_password.appendChild( _xml.createTextNode("true") );
+							_ROOM.appendChild( _password );
+					}	
+				}
+			}
+			
+			_listRooms.appendChild( _ROOM );
 			
 			show( );
@@ -1319,5 +1367,5 @@
 		        	function( a )
 		        	{
-		        		_rooms++;
+		        		_roomsCount++;
 		        	
 		        		show( );
@@ -1332,76 +1380,5 @@
 		}
 		 		
-		
-		
-		/*
-		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' ) );
-		}
-		 */
+	
 		
 	}
@@ -1409,11 +1386,12 @@
 	function getListRooms()
 	{
-		TrophyIM.getListRooms();
-	}
+     		TrophyIM.getListRooms();	
+		
+	}
+	
 	
 	loadIM.prototype.getListRooms	= getListRooms;
 	loadIM.prototype.listRooms		= listRooms;
-	
-	
+
 	
 	
