Index: /sandbox/jabberit_messenger/trophy_expresso/xsl/contactsList.xsl
===================================================================
--- /sandbox/jabberit_messenger/trophy_expresso/xsl/contactsList.xsl	(revision 2670)
+++ /sandbox/jabberit_messenger/trophy_expresso/xsl/contactsList.xsl	(revision 2706)
@@ -19,4 +19,8 @@
 					<img src="{$path_jabberit}/templates/default/images/users.png"/>
 				</button>
+				
+				<img style="height:15px; margin-left:10px;cursor:pointer;" alt="Minhas Preferências" title="Minhas Preferências" src="{$path_jabberit}/templates/default/images/preferences.png" onclick="loadscript.preferences();"/>
+				
+				<img style="height:16px; margin-left:10px;cursor:pointer;" alt="Help" title="Help" src="{$path_jabberit}/templates/default/images/help.png" onclick="alert('2');" />
 			</div>
 
@@ -27,5 +31,5 @@
 			</div>
 			
-			<div id="JabberIMRosterLoadingGif" style="position:absolute; left:80px; top:72px; display:block;">
+			<div id="JabberIMRosterLoadingGif" style="position:absolute; left:85px; top:72px; display:block;">
 					<img src='{$path_jabberit}/templates/default/images/loading.gif' style="width:20px; height:20px;"/>
 					<span style="color:red;">Carregando...</span>
Index: /sandbox/jabberit_messenger/trophy_expresso/xsl/itensGroup.xsl
===================================================================
--- /sandbox/jabberit_messenger/trophy_expresso/xsl/itensGroup.xsl	(revision 2670)
+++ /sandbox/jabberit_messenger/trophy_expresso/xsl/itensGroup.xsl	(revision 2706)
@@ -3,21 +3,22 @@
 	<xsl:output method="html" omit-xml-declaration="yes"/>
 	
-	<xsl:param name="nameContact" />
-	<xsl:param name="jid"/>
+	<xsl:param name="divDisplay" />
 	<xsl:param name="id" />
 	<xsl:param name="index" />
+	<xsl:param name="jid"/>
+	<xsl:param name="nameContact" />
 	<xsl:param name="path_jabberit" />
 	<xsl:param name="presence" />
+	<xsl:param name="spanDisplay"/>
 	<xsl:param name="status"/>
 	<xsl:param name="statusColor" />
-	<xsl:param name="statusDisplay"/>
 	<xsl:param name="subscription" />
 	
 	<xsl:template match="itens_group">
 
-			<div id="{$id}" subscription="{$subscription}" onmousedown="loadscript.actionButton(event,'{$jid}','{$index}');" style="background: url('{$path_jabberit}templates/default/images/{$presence}.gif') no-repeat center left; padding-left: 20px; margin:2px 0px 0px 10px; cursor:pointer; font-weight:normal;">
+			<div id="{$id}" subscription="{$subscription}" onmousedown="loadscript.actionButton(event,'{$jid}','{$index}');" style="background: url('{$path_jabberit}templates/default/images/{$presence}.gif') no-repeat center left; padding-left: 20px; margin:2px 0px 0px 10px; cursor:pointer; font-weight:normal; display:{$divDisplay};">
 				<xsl:value-of select="$nameContact"/>
 			</div>
-			<span id="span_show_{$id}" style="margin:2px 0px 0px 10px; font-size: 10px; font-style:italic; display:{$statusDisplay}; color:{$statusColor};"><xsl:value-of select="$status"/></span>
+			<span id="span_show_{$id}" style="margin:2px 0px 0px 10px; font-size: 10px; font-style:italic; display:{$spanDisplay}; color:{$statusColor};"><xsl:value-of select="$status"/></span>
 			
 	</xsl:template>
Index: /sandbox/jabberit_messenger/trophy_expresso/xsl/preferences.xsl
===================================================================
--- /sandbox/jabberit_messenger/trophy_expresso/xsl/preferences.xsl	(revision 2696)
+++ /sandbox/jabberit_messenger/trophy_expresso/xsl/preferences.xsl	(revision 2706)
@@ -14,4 +14,6 @@
 	<xsl:param name="lang11" />
 	<xsl:param name="lang12" />
+	<xsl:param name="lang13" />
+	<xsl:param name="lang14" />
 	<xsl:param name="langYes" />
 	<xsl:param name="langNo" />		
@@ -29,5 +31,5 @@
 				</select>
 			</fieldset>
-			<fieldset style="height:60px;margin-bottom:6px;padding:5px; border:1px solid #cecece;">
+			<fieldset style="height:60px;margin-top:6px;padding:5px; border:1px solid #cecece;">
 				<legend><xsl:value-of select="$lang8"/></legend>
 				<br/>
@@ -43,4 +45,15 @@
 				<label><xsl:value-of select="$lang11"/><input id="flagAwayIM" type="text" size="2" maxlength="2" style="margin-left:4px; margin-right:4px;" onclick="this.select();" /><xsl:value-of select="$lang12"/></label>
 			</fieldset>
+			
+			<fieldset style="height:60px;margin-top:6px;padding:5px; border:1px solid #cecece;">
+				<legend><xsl:value-of select="$lang13"/></legend>			
+				<br/>
+				<label><xsl:value-of select="$lang14"/> .: </label>
+				<select id="showContactsOfflineJabberit">
+					<option value="true"><xsl:value-of select="$langYes"/></option>
+					<option value="false"><xsl:value-of select="$langNo"/></option>					
+				</select>
+			</fieldset>
+			
 		</fieldset>
 
Index: /sandbox/jabberit_messenger/trophy_expresso/inc/preferencesJMessenger.php
===================================================================
--- /sandbox/jabberit_messenger/trophy_expresso/inc/preferencesJMessenger.php	(revision 2696)
+++ /sandbox/jabberit_messenger/trophy_expresso/inc/preferencesJMessenger.php	(revision 2706)
@@ -25,4 +25,7 @@
 			$preferences .= ";". $pArgs['preferences3'];
 
+		if(isset($pArgs['preferences4']))
+			$preferences .= ";". $pArgs['preferences4'];
+
 		return setPreferences($preferences);
 	}
Index: /sandbox/jabberit_messenger/trophy_expresso/js/trophyim.js
===================================================================
--- /sandbox/jabberit_messenger/trophy_expresso/js/trophyim.js	(revision 2678)
+++ /sandbox/jabberit_messenger/trophy_expresso/js/trophyim.js	(revision 2706)
@@ -1013,5 +1013,6 @@
 				var element		= arguments[2];
 				var index		= arguments[3];
-
+				var showOffline	= loadscript.getShowContactsOffline();
+				
 				var itensJid	= document.getElementById( 'itenContact_' + objContact.contact.jid + '_' + index );
 
@@ -1057,13 +1058,14 @@
 					var paramsContact =
 					{
-						nameContact 	: nameContact,
-						jid		  		: objContact.contact.jid,	
+						divDisplay		: "block", 
 						id		  		: 'itenContact_' + objContact.contact.jid + '_' + index ,
 						index			: ((index == 0 ) ? "0" : index),
+						jid		  		: objContact.contact.jid,
+						nameContact 	: nameContact,
 						path_jabberit	: path_jabberit,
 						presence	  	: presence,
+						spanDisplay		: statusDisplay,
 						status	  		: status,
 						statusColor		: "black",
-						statusDisplay	: statusDisplay,
 						subscription	: objContact.contact.subscription
 					}
@@ -1205,13 +1207,51 @@
 					with ( document.getElementById('span_show_' + 'itenContact_' + objContact.contact.jid + '_' + index ) )
 					{
-						if( is_open > 0 )
+						/*if( is_open > 0 )
 						{
 							style.display	= statusDisplay;
 							style.color		= statusColor;
 							innerHTML		= status;
+						}*/
+
+						if( presence == "unavailable" && !showOffline )
+						{
+							style.display = "none";
+						}
+						else
+						{
+							if( is_open > 0 )
+							{
+								style.display	= statusDisplay;
+								style.color		= statusColor;
+								innerHTML		= status;
+							}
+						}
+					}
+					
+					if( presence == "unavailable" && !showOffline )
+						itensJid.style.display = "none";
+					else
+					{
+						if( is_open > 0 )
+						{
+							itensJid.style.display = "block";
 						}
 					}
 					
 					itensJid.style.background	= "url('"+path_jabberit+"templates/default/images/" + presence + ".gif') no-repeat center left";
+				}
+
+				// Contact OffLine
+				if( !objContact.presence && !showOffline )
+				{
+					with ( document.getElementById('span_show_' + 'itenContact_' + objContact.contact.jid + '_' + index ))
+					{
+						style.display 	= "none";
+					}
+
+					with ( document.getElementById('itenContact_' + objContact.contact.jid + '_' + index ) )
+					{
+						style.display	= "none";
+					}
 				}
 			}
Index: /sandbox/jabberit_messenger/trophy_expresso/js/jscode/loadIM.js
===================================================================
--- /sandbox/jabberit_messenger/trophy_expresso/js/jscode/loadIM.js	(revision 2696)
+++ /sandbox/jabberit_messenger/trophy_expresso/js/jscode/loadIM.js	(revision 2706)
@@ -281,4 +281,19 @@
 	}
 	
+	function getShowContactsOffline()
+	{
+		if( _preferencesIM[3] )
+		{
+			var showOffline = _preferencesIM[3].split(":");
+			
+			if( showOffline[1] === "true")
+				return true;
+			else
+				return false;
+		}
+		
+		return true;
+	}
+
 	function getUserCurrent()
 	{
@@ -325,6 +340,13 @@
 				while( _elementNext )
 				{	
-					if( _elementNext.nodeType == 1 )
-						_elementNext.style.display = "block";
+					if( _elementNext.nodeType == 1 && _elementNext.nodeName.toLowerCase() == "div")
+					{
+						var is_off = _elementNext.style.backgroundImage.indexOf("unavailable");	
+
+						if( is_off > 0 && !getShowContactsOffline())	
+							_elementNext.style.display = "none";
+						else
+							_elementNext.style.display = "block";
+					}
 
 					_elementNext = _elementNext.nextSibling;
@@ -515,5 +537,7 @@
 			'lang10' : 'Ausente',
 			'lang11' : 'Definir status de ausente depois de',
-			'lang12' : 'minutos',						   
+			'lang12' : 'minutos',	
+			'lang13' : 'Mostrar Contatos',	
+			'lang14' : 'Mostrar contatos desconectados',
 			'langYes': 'Sim',
 			'langNo' : 'Não'											   
@@ -525,5 +549,5 @@
 				id_window	 : "jabberit_preferences",
 				width		 : 430,
-				height		 : 330,
+				height		 : 410,
 				top		 	 : 150,
 				left		 : 100,
@@ -571,4 +595,12 @@
 		var element3	= document.getElementById(value3[0]);
 		element3.value	= value3[1];
+		
+		// Element showContactsOfflineJabberit
+		var value4			= _preferencesIM[3].split(':');
+		var element4		= document.getElementById(value4[0]);
+		var valueSelect4	= value4[1];
+		for(var i = 0; i < element4.options.length; i++)
+			if( element4.options[i].value == valueSelect4 )
+				element4.options[i].selected = true;
 	}
 	
@@ -757,6 +789,15 @@
 			return false;
 		}
-		
-		
+
+		// Element showContactsOfflineJabberit
+		var elementShowOffline	= document.getElementById('showContactsOfflineJabberit');
+		
+		for(var i = 0 ; i < elementShowOffline.options.length; i++)
+			if( elementShowOffline.options[i].selected == true)
+			{
+				_preferencesIM[3] = 'showContactsOfflineJabberit:' + elementShowOffline.options[i].value;
+				value += '&preferences4=showContactsOfflineJabberit:' + elementShowOffline.options[i].value;
+			}
+
 		// Save Preferences
 		conn.go('p.pf.setPreferences',
@@ -893,5 +934,7 @@
 			// Preferences
 			_preferencesIM = arguments[1].split(";");
-
+			
+			if( !_preferencesIM[3] ) _preferencesIM[3] = "showContactsOfflineJabberit:false";
+				
 			loadScripts(files);
 			
@@ -946,4 +989,5 @@
 	loadIM.prototype.configEvents		= configEvents;
 	loadIM.prototype.getPhotoUser		= getPhotoUser;
+	loadIM.prototype.getShowContactsOffline	= getShowContactsOffline;
 	loadIM.prototype.getUserCurrent		= getUserCurrent;
 	loadIM.prototype.getZIndex			= getZindex;
