Index: /trunk/jabberit_messenger/default.xml
===================================================================
--- /trunk/jabberit_messenger/default.xml	(revision 697)
+++ /trunk/jabberit_messenger/default.xml	(revision 751)
@@ -1,4 +1,7 @@
 <?xml version='1.0'?>
 <preferences>
+	<!-- Message Receive -->
+	<preference key="jeti.toFrontOnNewMessage" value="false"/>
+	
 	<!-- File Transfer -->
 	<preference key="filetransfer.closeOnComplete" value="true"/>
Index: /trunk/jabberit_messenger/templates/default/jabberIM_IE.tpl
===================================================================
--- /trunk/jabberit_messenger/templates/default/jabberIM_IE.tpl	(revision 697)
+++ /trunk/jabberit_messenger/templates/default/jabberIM_IE.tpl	(revision 751)
@@ -22,4 +22,7 @@
 				if( arguments[0] == "cleanStatus" )
 					element.autoStatusIM();
+				
+				if( arguments[0] == "writeSubStatus")
+					element.setItensStatus(arguments[1]);
 			}
 		}
@@ -28,5 +31,9 @@
 		{
 			var url_img = '{path}' + 'templates/default/images/unavailable.gif';
-			elementStatus.style.backgroundImage = 'url(' + url_img +')';
+			try
+			{
+				elementStatus.style.backgroundImage = 'url(' + url_img +')';
+			}
+			catch(e){}
 		}
 		
Index: /trunk/jabberit_messenger/templates/default/jabberIM.tpl
===================================================================
--- /trunk/jabberit_messenger/templates/default/jabberIM.tpl	(revision 697)
+++ /trunk/jabberit_messenger/templates/default/jabberIM.tpl	(revision 751)
@@ -22,4 +22,7 @@
 				if( arguments[0] == "cleanStatus" )
 					element.autoStatusIM();
+				
+				if( arguments[0] == "writeSubStatus")
+					element.setItensStatus(arguments[1]);
 			}
 		}
@@ -28,5 +31,9 @@
 		{
 			var url_img = '{path}' + 'templates/default/images/unavailable.gif';
-			elementStatus.style.backgroundImage = 'url(' + url_img +')';
+			try
+			{
+				elementStatus.style.backgroundImage = 'url(' + url_img +')';
+			}
+			catch(e){}
 		}
 		
Index: /trunk/jabberit_messenger/setup/phpgw_pt-br.lang
===================================================================
--- /trunk/jabberit_messenger/setup/phpgw_pt-br.lang	(revision 697)
+++ /trunk/jabberit_messenger/setup/phpgw_pt-br.lang	(revision 751)
@@ -16,5 +16,6 @@
 available	jabberit_messenger	pt-br	Disponível
 away	jabberit_messenger	pt-br	Volto Logo
-Away	jabberit_messenger	pt-br	Ausente
+Away	jabberit_messenger	pt-br	Volto Logo
+Away Presence	jabberit_messenger	pt-br	Ausente
 Birthday	jabberit_messenger	pt-br	Aniversário
 busy	jabberit_messenger	pt-br	Ocupado
@@ -130,5 +131,5 @@
 unavailable	jabberit_messenger	pt-br	Desconectado
 Vcard	jabberit_messenger	pt-br	Vcard
-Xa	jabberit_messenger	pt-br	Ausente Estendido
+Xa	jabberit_messenger	pt-br	Ausente
 Yes	jabberit_messenger	pt-br	Sim
 You desire to register in service IM?	jabberit_messenger	pt-br	Você deseja registrar no serviço IM?
Index: /trunk/jabberit_messenger/js/images.js
===================================================================
--- /trunk/jabberit_messenger/js/images.js	(revision 697)
+++ /trunk/jabberit_messenger/js/images.js	(revision 751)
@@ -6,4 +6,7 @@
 	var jabberit_group_close = new Image();
 	jabberit_group_close.src = path_jabberit + 'templates/default/images/group_close.gif';
+
+	var jabberit_group_close_black = new Image();
+	jabberit_group_close_black.src = path_jabberit + 'templates/default/images/group_close_black.gif';
 
 	var jabberit_group_open = new Image();
Index: /trunk/jabberit_messenger/js/load.js
===================================================================
--- /trunk/jabberit_messenger/js/load.js	(revision 697)
+++ /trunk/jabberit_messenger/js/load.js	(revision 751)
@@ -5,5 +5,5 @@
 	var _conn   = new JITConnector(path_jabberit);
 	var _xtools = new JITXTools(path_jabberit);
-	var _showhidden = new ShowHidden(1000);
+	var _showhidden = new ShowHidden(300);
 	var myWindow	  = '';
 	var flagMouseOver = '';
@@ -11,4 +11,5 @@
 	var flagOpenPopup = '';
 	var flagAwayIM	  = '';
+	var itensSubMenu  = [];
     
 	// Sniffer Browser
@@ -242,16 +243,22 @@
 	 		try
 	 		{
+	 			var status	= arguments[0];
+	 			var msg	   	= ( arguments[1] ) ? arguments[1] : "";
+	 		
+//	 			alert("Mensagem Jabber : " + msg);
+	 			
 	 			// If Layer;
 	 			if( elementIframe = document.getElementById('iframe_applet_jabberit') )
 	 			{
 					if( !is_ie )
-						elementIframe.contentDocument.applets[0].changeStatusfromExpresso(arguments[0]);
+						elementIframe.contentDocument.applets[0].changeStatusfromExpresso(status, msg);
 					else
-						elementIframe.contentWindow.document.applets[0].changeStatusfromExpresso(arguments[0]);
+						elementIframe.contentWindow.document.applets[0].changeStatusfromExpresso(status, msg);
 				}
 				else // If Pop-Up
 				{
-					myWindow.document.applets[0].changeStatusfromExpresso(arguments[0]);
+					myWindow.document.applets[0].changeStatusfromExpresso(status, msg);
 				}
+				
 			}
 			catch(e)
@@ -530,5 +537,5 @@
 						   'lang8' : jabberitGetLang('Window'),
 						   'lang9' : jabberitGetLang('Open as Pop-Up Window'),
-						   'lang10' : jabberitGetLang('Away'),
+						   'lang10' : jabberitGetLang('Away Presence'),
 						   'lang11' : jabberitGetLang('Set status to away after'),
 						   'lang12' : jabberitGetLang('minutes'),						   
@@ -582,4 +589,15 @@
 		else
 			alert(jabberitGetLang('Your search argument must be longer than 4 characters.'));
+	}
+
+	function setItensStatusMenu()
+	{
+		if( arguments.length > 0 )
+		{
+			var key = parseInt(arguments[0].substring(0, arguments[0].indexOf('-')));
+			var value = arguments[0].substring(arguments[0].indexOf('-') + 1 );
+			
+			itensSubMenu[key] = value.toString();	
+		} 
 	}
 	
@@ -684,21 +702,25 @@
 		{
 			var _itens  = [
-								['Online', 'loadscript.chstatusJava("2")', 'available_jabberit.src'],
-								['Free For Chat', 'loadscript.chstatusJava("1")', 'chat_jabberit.src'],
-								['Xa', 'loadscript.chstatusJava("3")','xa_jabberit.src'],
-								['Dnd', 'loadscript.chstatusJava("4")','dnd_jabberit.src'],
-								['Away', 'loadscript.chstatusJava("5")','away_jabberit.src'],
-								['Invisible', 'loadscript.chstatusJava("6")','invisible_jabberit.src']
+								['Online', 'loadscript.subMnChStIt("2",this);', 'available_jabberit.src','jabberit_group_close_black.src'],
+								['Free For Chat', 'loadscript.subMnChStIt("1",this);', 'chat_jabberit.src','jabberit_group_close_black.src'],
+								['Xa', 'loadscript.subMnChStIt("3",this);','xa_jabberit.src','jabberit_group_close_black.src'],
+								['Dnd', 'loadscript.subMnChStIt("4",this);','dnd_jabberit.src','jabberit_group_close_black.src'],
+								['Away', 'loadscript.subMnChStIt("5",this);','away_jabberit.src','jabberit_group_close_black.src'],
+								['Invisible', 'loadscript.subMnChStIt("6",this);','invisible_jabberit.src']
 						  ];
 	
-			var _itensMenu = "<dl style='padding:1px !important; margin:2px 2px !important;font-size:8pt !important;background: #cecece;color: #000;'>";
+			var _itensMenu = "<dl style='margin:2px 2px !important;font-size:8pt !important;background: #cecece;color: #000;'>";
 			
 			for(var i in _itens)
 			{
-				if( i == 5 )
-					_itensMenu += "<dt onmouseover='elementOnMouseOver(this);' onmouseout='elementOnMouseOut(this, false);' style='cursor: pointer;' onclick=" + _itens[i][1] + ">";
-				else
-					_itensMenu += "<dt onmouseover='elementOnMouseOver(this);' onmouseout='elementOnMouseOut(this, false);' style='cursor: pointer;border-bottom:1px solid #dedede;' onclick=" + _itens[i][1] + ">";
-				_itensMenu += "<img src='" + eval(_itens[i][2]) + "' style='margin-right:3px;'/>" + jabberitGetLang(_itens[i][0]) + "</dt>";
+				_itensMenu += '<dt onmouseover="elementOnMouseOver(this);" onmouseout="elementOnMouseOut(this, false);" style="cursor: pointer;';
+				if ( i != _itens.length - 1 )
+					_itensMenu += 'border-bottom:1px solid #dedede;';
+				_itensMenu += '">';
+
+				_itensMenu += "<div ";
+				if( _itens[i][3] )
+					_itensMenu += "style='background: url(" + eval(_itens[i][3]) + ") no-repeat center right'";
+				_itensMenu += "onclick="+_itens[i][1] +"><img src='" + eval(_itens[i][2]) + "' style='margin-right:3px;'/>" + jabberitGetLang(_itens[i][0]) + "</div></dt>";
 			}
 
@@ -712,6 +734,6 @@
 				_subMenu_div.style.float = 'left';
 				_subMenu_div.style.position = 'absolute';
-				_subMenu_div.style.left = '55px';
-				_subMenu_div.style.width = '120px';
+				_subMenu_div.style.left = '55px'; 
+				_subMenu_div.style.width = ( is_ie ) ? '160px': '140px';;
 				_subMenu_div.style.zindex = '99999';
 				_subMenu_div.innerHTML = _itensMenu; 
@@ -721,4 +743,79 @@
 		}
 	}
+	
+	function subMenuChangeStatusItens()
+	{
+		if( arguments.length > 0 )
+		{
+			var status	= arguments[0];
+			var element	= arguments[1];
+			var msg		= "";
+
+			if( itensSubMenu.length > 0 )
+			{
+				var string = "";
+				for( var i = 0; i < itensSubMenu.length ; i++ )
+				{
+					if( itensSubMenu[i] != undefined )
+					{
+						string = itensSubMenu[i].substring(1);
+						string = string.substring(0, string.indexOf("]")).toString();
+
+						if( string != "" )
+						{
+							if( status == i )
+							{
+								if ( ! ( string.indexOf( ',' ) < 0 ) )
+								{
+									var phases = string.split(',');
+									var _itensMenu = "<dl style='padding:1px !important; margin:2px 2px !important;font-size:8pt !important;background: #cecece;color: #000;'>";
+									for ( var m = 0; m < phases.length; m++ )
+									{
+										_itensMenu += "<dt onmouseover='elementOnMouseOver(this);' onmouseout='elementOnMouseOut(this, false);' style='cursor: pointer;border-bottom:1px solid #dedede;'>";
+										_itensMenu += "<div onclick='loadscript.chgStatusJava(\""+i+"\", \""+phases[m]+"\")'><img src='" + jabberit_group_close.src + "' style='margin-right:3px;'/>" + phases[m] + "</div></dt>";	
+									}
+									_itensMenu += "</dl>";
+								}
+								else
+								{
+									var _itensMenu  = "<dl style='padding:1px !important; margin:2px 2px !important;font-size:8pt !important;background: #cecece;color: #000;'>";
+										_itensMenu += "<dt onmouseover='elementOnMouseOver(this);' onmouseout='elementOnMouseOut(this, false);' style='cursor: pointer;'>";								
+										_itensMenu += "<div onclick='loadscript.chgStatusJava(\""+i+"\", \""+string+"\");'><img src='" + jabberit_group_close.src + "' style='margin-right:3px;'/>" + string + "</div></dt>";
+										_itensMenu += "</dl>";
+								}
+							}
+
+							for( var j = 0 ; j < 6 ; j++ )
+							{
+								if( document.getElementById('ItemSubMenuJabberd_' + j) != null )
+								{
+									var ElementItem = document.getElementById('ItemSubMenuJabberd_' + j);
+										ElementItem.parentNode.removeChild(ElementItem);
+								}
+							}
+						}
+					}
+				}
+				
+				if( _itensMenu ) 
+				{
+					var _subMenuItem_div = document.createElement("div");
+					_subMenuItem_div.setAttribute('id','ItemSubMenuJabberd_' + status);
+					_subMenuItem_div.style.margin = ( is_ie ) ? '-3px 5px 0px 0px' : '-20px 5px 0px 0px';
+					_subMenuItem_div.style.background = '#cecece';
+					_subMenuItem_div.style.border = '1px dashed #000';
+					_subMenuItem_div.style.float = 'left';
+					_subMenuItem_div.style.position = 'absolute';
+					_subMenuItem_div.style.left = ( is_ie ) ? '157px' : '140px'; 
+					_subMenuItem_div.style.width = ( is_ie ) ? '180px': '160px';
+					_subMenuItem_div.style.zindex = '99999';
+					_subMenuItem_div.innerHTML = _itensMenu; 
+					
+					element.appendChild( _subMenuItem_div );
+				}else
+					changeStatusJava(status,"");
+			}
+		}
+	}
 
 	function Load()
@@ -733,16 +830,18 @@
 	}
 
-	Load.prototype.adIcon		= addIcon;
-	Load.prototype.autoStatusIM	= autoStatus;
-	Load.prototype.chstatusJava	= changeStatusJava;
-	Load.prototype.closeW		= closeWindow;
-	Load.prototype.cLabel		= changeLabel;
-	Load.prototype.getElement	= getElementStatus;
-	Load.prototype.keyPress		= keyPressSearch;
-	Load.prototype.openWinParExt = openWindowParticipantsExternal;
-	Load.prototype.search		= searchUser;
-	Load.prototype.setPrefe 	= setPreferences;
-	Load.prototype.show			= showDiv;
-	Load.prototype.showW		= showWindow;
+	Load.prototype.adIcon			= addIcon;
+	Load.prototype.autoStatusIM		= autoStatus;
+	Load.prototype.chgStatusJava	= changeStatusJava;
+	Load.prototype.closeW			= closeWindow;
+	Load.prototype.cLabel			= changeLabel;
+	Load.prototype.getElement		= getElementStatus;
+	Load.prototype.keyPress			= keyPressSearch;
+	Load.prototype.openWinParExt	= openWindowParticipantsExternal;
+	Load.prototype.search			= searchUser;
+	Load.prototype.setItensStatus	= setItensStatusMenu;
+	Load.prototype.setPrefe 		= setPreferences;
+	Load.prototype.show				= showDiv;
+	Load.prototype.showW			= showWindow;
+	Load.prototype.subMnChStIt		= subMenuChangeStatusItens;
 	
 	window.loadscript = new Load;
