Index: branches/2.2/jabberit_messenger/jmessenger/xsl/listLdapContacts.xsl
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/xsl/listLdapContacts.xsl	(revision 3102)
+++ branches/2.2/jabberit_messenger/jmessenger/xsl/listLdapContacts.xsl	(revision 3260)
@@ -5,18 +5,25 @@
 	<xsl:param name="lang_addContact" />
 	<xsl:param name="lang_empty" />
+	<xsl:param name="lang_error" />
 	<xsl:param name="lang_many_results" />
 	
 	<xsl:template match="/">
-		<xsl:choose>
-			<xsl:when test="error">
-				<label><xsl:value-of select="$lang_many_results" /></label>
-			</xsl:when>
-			<xsl:when test="empty">
-				<label><xsl:value-of select="$lang_empty" /></label>
-			</xsl:when>
-			<xsl:otherwise>
-				<xsl:apply-templates select="uids/*" mode="uids" />
-			</xsl:otherwise>
-		</xsl:choose>
+
+		<xsl:if test="error">
+			<label style="color:red;"><xsl:value-of select="$lang_error" /></label>
+		</xsl:if>
+		
+		<xsl:if test="empty">
+			<label style="color:red;"><xsl:value-of select="$lang_empty" /></label>
+		</xsl:if>
+		
+		<xsl:if test="manyresults">
+			<label style="color:red;"><xsl:value-of select="$lang_many_results" /></label>
+		</xsl:if>
+
+		<xsl:if test="uids">
+			<xsl:apply-templates select="uids/*" mode="uids" />
+		</xsl:if>
+		
 	</xsl:template>
 
Index: branches/2.2/jabberit_messenger/jmessenger/inc/class.ContactsIm.inc.php
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/inc/class.ContactsIm.inc.php	(revision 3102)
+++ branches/2.2/jabberit_messenger/jmessenger/inc/class.ContactsIm.inc.php	(revision 3260)
@@ -25,5 +25,5 @@
 		// (OU) User
 		$this->ou_User = $this->dn_User;
-		$this->ou_User = substr($this->ou_User,strpos($this->ou_User, "ou="));
+		$this->ou_User = substr($this->ou_User, strpos($this->ou_User, "ou=") );
 		$this->ou_User = strtoupper(substr($this->ou_User, 0, strpos($this->ou_User, ",dc=")));
 		
@@ -49,14 +49,23 @@
 	public final function getListContacts($param)
 	{
-		
 		$order		= array();
 		$ou_User	= substr($this->ou_User, (strpos($this->ou_User,"=")+1));
-		$return		= '<empty/>';
+		$return		= "<empty></empty>";
 		$users		= $this->getUsersIm($param['name']);
-
-		
-		if (!is_array($users) && trim($users) === 'Many Results')
-			return "<error>Many Results</error>";
-
+		
+		if ( !is_array($users) )
+			return "<error></error>";
+		
+		if( count($users) == 0  )
+			return "<empty></empty>";
+		
+		if( count($users) > $this->ldap->getMaxResults() )
+		{
+			if( isset($_SESSION['phpgw_info']['jabberit_messenger']['photo']) )
+				unset($_SESSION['phpgw_info']['jabberit_messenger']['photo']);
+			
+			return "<manyresults></manyresults>";
+		}
+				
 		// Hosts Jabber
 		$hostsJabber = unserialize($_SESSION['phpgw_info']['jabberit_messenger']['map_org_realm_jabberit']);
@@ -113,147 +122,78 @@
         $result			= array();
         $uidType		= "uid";
-		$serversLdap	= unserialize(trim($_SESSION['phpgw_info']['jabberit_messenger']['groups_search']));
-
-        if( $serversLdap )
-        {
-	        if( array_key_exists($this->serverLdap, $serversLdap) )
-	        {
-	        	$groups = unserialize($serversLdap[$this->serverLdap]);
-	        }
-
-	        if( count($groups) > 0 )
-	        {
-				foreach($groups as $tmp)
-				{
-					$group = explode(":",$tmp);
-					$array_result = $this->ldap->getGroupsMemberUid($group[0], $this->serverLdap );
-					@array_shift($array_result[0]['memberuid']);
-					$array_uids = @array_merge($array_uids, $array_result[0]['memberuid']);
-					unset($array_result);
-				}
-	        }
-        }        			
-		
-        if( count($array_uids) == 0 )
-        {
+		$serversLdap	= unserialize( trim($_SESSION['phpgw_info']['jabberit_messenger']['groups_search']) );
+
+		if( $serversLdap )
+		{
+			// Usa Grupos Ldap
+			
+			$filters = array( );
+			
+			foreach( $serversLdap as $servers => $groups )
+			{
+				$filter = '';
+				foreach( unserialize($groups) as $group )
+					$filter .= '(gidnumber' . strstr( $group, ':' ) . ')';
+
+				$filters[ $servers ] = str_replace( ':', '=', $filter );
+			}
+			
+			foreach( $serversLdap as $key => $tmp )
+			{
+				if( $key === $this->serverLdap )
+				{
+					$result[$key] = $this->ldap->getUsersLdapRoot("cn=*".$pName."*");
+				}
+				else
+				{
+					if( !$this->groupsLocked() )
+						$result[$key] =  $this->ldap->getUsersLdapCatalog("cn=*".$pName."*", $key );
+				}
+			}
+				
+			$_RESULT = $this->ldap->getMembers($result, $filters);
+			
+			foreach( $_RESULT as $key => $value )
+				$array_uids = array_merge($array_uids, $_RESULT[$key]); 
+		}
+		else
+		{
+        	// Consulta Banco
         	$array_uids = $this->db->get_accounts_acl();
-        	$uidType = "uidnumber";	
-        }        
-
-        for( $i = 0; $i < count($array_uids) ; $i+=50 )
-        {   
-            $partial_uids = array_slice($array_uids,$i,50);
-            $filter_uid = implode(")(".$uidType."=",$partial_uids);
-            $filter_uid = "(".$uidType."=". $filter_uid. ")";
-
-			if( $this->groupsLocked() )
-			{
-	            $orgs[] = $this->ou_User;
-	            $orgsGroupsLocked = explode(",", $_SESSION['phpgw_info']['jabberit_messenger']['organizationsGroupsLocked']); 
-	            
-				foreach( $orgsGroupsLocked as $tmp )
-				{
-					if( $tmp != "" )
+        	$uidType = "uidnumber";
+		}
+
+		if( $this->groupsLocked() )
+		{
+            $orgs[] 			= substr($this->ou_User, ( strpos($this->ou_User, "ou=") + 3 ) );
+            $orgsGroupsLocked	= explode(",", $_SESSION['phpgw_info']['jabberit_messenger']['organizationsGroupsLocked']); 
+            
+			foreach( $orgsGroupsLocked as $tmp )
+			{
+				if( $tmp != "")
+					$orgs[] = $tmp;
+			}
+
+            $orgs = array_unique($orgs);
+
+			$_restrict = array();
+			
+			for( $i = 0 ; $i < count($orgs) ; $i++ )
+			{
+				for( $j = 0 ; $j < count($array_uids) ; $j++ )
+				{
+					if( trim($array_uids[$j]['ou']) === trim($orgs[$i]) )
 					{
-						if( strpos($tmp, "/") !== false )
-						{
-							$tt = explode("/", $tmp);
-							$newOU = implode(",OU=",array_reverse($tt));
-							$orgs[] = "OU=". $newOU ;
-						}
-						else 
-							$orgs[] = "OU=". $tmp;
-					}            
-				}
-
-	            $orgs = array_unique($orgs);
-
-				foreach( $orgs as $orgB )
-					$result[] = $this->ldap->getUsersLdapRoot("cn=*".$pName."*", $filter_uid, $orgB );
-
-			}
-			else
-				$result[] = $this->ldap->getUsersLdapRoot("cn=*".$pName."*", $filter_uid);
-        }
-	
-        if( !$this->groupsLocked() )
-        {
-			unset($serversLdap[$this->serverLdap]);
-
-			if( $serversLdap  && count($serversLdap))
-			{
-				foreach( $serversLdap as $key => $tmp )
-				{
-					$array_uids_external = array( );
-					$groupsExternal = unserialize($tmp);
-
-					if( count($groupsExternal) )
-					{
-						foreach( $groupsExternal as $tmpExt )
-						{
-							$group = explode(":",$tmpExt);
-							$array_result = $this->ldap->getGroupsMemberUid( $group[0], $key );
-							
-							if( $array_result[0]['memberuid']['count'] )
-								unset($array_result[0]['memberuid']['count']);
-
-							$array_uids_external = @array_merge($array_uids_external, $array_result[0]['memberuid']);
-						}
-						
-						
-						if( is_array($array_uids_external) )
-						{
-							for( $i = 0; $i < count( $array_uids_external ) ; $i+=50 )
-		        			{   
-			            		$partial_uids_external	= array_slice($array_uids_external,$i,50);
-			            		$filter_uid_external	= implode(")(".$this->attribute."=",$partial_uids_external);
-		    	        		$filter_uid_external	= "(".$this->attribute."=". $filter_uid_external. ")";
-		    	        		$result[] = $this->ldap->getUsersLdapCatalog("cn=*".$pName."*", $filter_uid_external, $key );
-		        			}
-		        		}
-					}
-				}
-			}
-
-			if( count($this->hostsJabberLdap) )
-			{
-				for($i = 0 ; $i < count($this->hostsJabberLdap); $i++)
-				{
-					if( !@array_key_exists($this->hostsJabberLdap[$i]['serverLdap'], $serversLdap) )
-					{
-						$result[] = $this->ldap->getUsersLdapCatalog("cn=*".$pName."*", false, $this->hostsJabberLdap[$i]['serverLdap'] );
-					}
-				}
-			}
-        }
-        
-        if ( is_array($result) )
-        {
-          	for( $i = 0; $i < count($result); $i++ )
-           		if( is_array($result[$i]) )
-           			$members = @array_merge($members,$result[$i]);
-        }
-	     
-        if( count($members) > 150)
-        {
-	    	$ou = substr( $this->ou_User, strpos($this->ou_User, "=") + 1 );
-	    	
-			for($i = 0 ; $i < count($members); $i++ )
-			{
-				if( $ou == $members[$i]['ou'] )
-				{
-					$uids_org[] = $members[$i];
-				}
-				else
-				{
-					if(isset($_SESSION['phpgw_info']['jabberit_messenger']['photo']))
-						unset($_SESSION['phpgw_info']['jabberit_messenger']['photo'][$members[$i]['ou']]);
-				}
-			}
-			
-			return $uids_org;
-        }            
-
-		return $members;        
+						$_restrict[] = $array_uids[$j];
+					}	
+				}	
+			}
+			
+			return $_restrict;
+		}
+		else
+		{	
+			return $array_uids;
+		}	
 	}
 	
@@ -355,5 +295,5 @@
 			if( count($search) > 0 )
 			{
-				// Verifica permissÃµes do grupo
+				// Verifica permissões do grupo
 				foreach($groupsLocked as $value)
 				{							
@@ -392,5 +332,5 @@
 				if( array_search($this->ou_User, $search) === false )
 				{
-					// Verifica permissÃµes do grupo
+					// Verifica permissões do grupo
 					foreach($groupsLocked as $value)
 					{							
Index: branches/2.2/jabberit_messenger/jmessenger/inc/class.LdapIM.inc.php
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/inc/class.LdapIM.inc.php	(revision 3102)
+++ branches/2.2/jabberit_messenger/jmessenger/inc/class.LdapIM.inc.php	(revision 3260)
@@ -42,5 +42,5 @@
 		
 		// Result Ldap
-		$this->max_result = 20;
+		$this->max_result = 15;
 		
 		if ( file_exists('inc/attributeLdap.php') )
@@ -73,4 +73,9 @@
 	private final function ldapRoot()
 	{
+		$this->ldap_host 	= $_SESSION['phpgw_info']['jabberit_messenger']['server_ldap_jabberit'];
+		$this->ldap_context	= $_SESSION['phpgw_info']['jabberit_messenger']['context_ldap_jabberit'];
+		$this->ldap_user	= $_SESSION['phpgw_info']['jabberit_messenger']['user_ldap_jabberit'];
+		$this->ldap_pass	= $_SESSION['phpgw_info']['jabberit_messenger']['password_ldap_jabberit'];
+
 		$this->ldapConn();
 	}
@@ -102,4 +107,9 @@
 
 		return $conn;
+	}
+	
+	private function getLdapHost()
+	{
+		return	$_SESSION['phpgw_info']['jabberit_messenger']['server_ldap_jabberit'];
 	}
 
@@ -169,4 +179,82 @@
 
 		return $result_groups;
+	}
+
+	public final function getMaxResults()
+	{
+		return $this->max_result;
+	}
+
+	public final function getMembers( $pMembers, $pServers )
+	{
+		$members = $pMembers;
+		
+		foreach( $pServers as $servers => $groups )
+		{
+			if( $servers == $this->getLdapHost() || $servers == 'localhost')
+			{
+				$this->ldapRoot();
+				
+				$count = count($members[$servers]);
+				
+				for( $i = 0; $i < $count; $i++ )
+				{
+					if ( ! $this->getMemberUid($groups, $members[$servers][$i]['uid'] ) )
+						unset( $members[$servers][$i] );
+				}
+
+				if( $this->ldap )
+					@ldap_close($this->ldap);
+			}
+			else
+			{
+				$confHosts	= $this->hostsJabber;
+			
+				for($i = 0; $i < count($confHosts); $i++ )
+				{
+					if( $this->ldap )
+						@ldap_close($this->ldap);
+						
+					if( trim($servers) === trim($confHosts[$i]['serverLdap']) )
+					{
+						$this->ldap_host 	= $confHosts[$i]['serverLdap'];
+						$this->ldap_context = $confHosts[$i]['contextLdap'];
+						$this->ldap_user	= $confHosts[$i]['user'];
+						$this->ldap_org		= $confHosts[$i]['org'];
+						$this->ldap_pass	= $confHosts[$i]['password'];
+						$this->ldap 		= $this->ldapCatalog();
+
+						$count = count($members[$servers]);
+						
+						for( $i = 0; $i < $count; $i++ )
+						{
+							if ( ! $this->getMemberUid($groups, $members[$servers][$i]['uid'] ) )
+								unset( $members[$servers][$i] );
+						}
+		
+						if( $this->ldap )
+							@ldap_close($this->ldap);
+					}
+				}
+			}
+		}
+		
+		return $members;
+	}
+
+	private function getMemberUid( $pGidNumber, $pMemberUid )
+	{
+		$filter		= "(&(phpgwAccountType=g)(|{$pGidNumber})(memberuid={$pMemberUid}))";
+		$justthese	= array("memberuid");
+	
+		if( $this->ldap )
+		{
+			$search = ldap_search($this->ldap, $this->ldap_context, $filter, $justthese );
+			$result = ldap_get_entries($this->ldap,$search);
+			if( $result["count"] )
+				return true;
+		}
+
+		return false;
 	}
 
@@ -360,5 +448,5 @@
 	}
 
-	public final function getUsersLdapCatalog( $search, $uid = false, $pLdap = false )
+	public final function getUsersLdapCatalog( $search, $pLdap = false, $uid = false )
 	{
 		$confHosts	= $this->hostsJabber;
@@ -390,5 +478,5 @@
 			          	$return = array_merge($return, $result);
 					else
-						$return = $result;				
+						$return = $result;
 				}
 				
@@ -401,6 +489,7 @@
 	}
 
-	public final function getUsersLdapRoot( $search, $uidnumber, $ous = false )
-	{
+	public final function getUsersLdapRoot( $search, $uidnumber = false, $ous = false )
+	{
+		
 		$result = array();
 		$this->ldapRoot();
@@ -409,5 +498,5 @@
 		{
 			$searchRoot	= ( $ous ) ? $ous.",".$this->ldap_context : $this->ldap_context ;
-			$filter		= "(&(phpgwaccounttype=u)(|".$uidnumber.")(".$search ."))";
+			$filter		= ($uidnumber) ? "(&(phpgwaccounttype=u)(|".$uidnumber.")(".$search ."))" : "(&(phpgwaccounttype=u)(".$search ."))";
 			$justthese	= array( $this->attribute, "uidNumber", "cn", "mail", "phpgwAccountVisible", "dn", "jpegPhoto" );								
 			$search		= @ldap_search( $this->ldap, $searchRoot, $filter, $justthese, 0, $this->max_result + 1);
Index: branches/2.2/jabberit_messenger/jmessenger/js/lang/i18n_pt_Br.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/lang/i18n_pt_Br.js	(revision 3102)
+++ branches/2.2/jabberit_messenger/jmessenger/js/lang/i18n_pt_Br.js	(revision 3260)
@@ -8,28 +8,36 @@
 i18n =
 {
+	ADD : 'Adicionar',
+	ADD_CONTACT : 'Adicionar Contatos',
+	ADD_CONTACTS : 'Adicionar Contatos',
+	ASK_NEW_NAME_QUESTION : 'Informe um novo nome para ',
+	ASK_NEW_GROUP_QUESTION : 'Informe um novo grupo ou deixe em branco',
+	ASK_FOR_AUTH : 'PEDIR AUTORIZAÇÃO !',
+	AUTHORIZED : 'AUTORIZADO !',
+	AUTH_SENT : 'AUTORIZAÇÃO ENVIADA !',
+	ASK_FOR_AUTH_QUESTION : 'QUERO ADICIONÁ-LO(A) ! POSSO ?',
+	CLOSE : 'Fechar',
+	COMPOSING : ' está digitando...',
+	CONTACT_ASK_FOR_AUTH : 'CONTATO PEDE AUTORIZAÇÃO !',
+	GONE : ' saiu da conversa.',
+	GROUP : 'Grupo',
+	INACTIVE : ' está inativo.',
+	LEAVE_CHATROOM : 'Sair da Sala',
+	LOAD : 'Carregando',
+	MANY_RESULTS_PLEASE_TRY_TO_REFINE_YOUR_SEARCH : 'Muitos Resultados ! Por favor tente refinar sua busca !',
 	ME : 'Eu',
-	INACTIVE : ' está inativo.',
-	COMPOSING : ' está digitando...',
-	GONE : ' saiu da conversa.',
-	LEAVE_CHATROOM : 'Sair da Sala',
+	NAME_CONTACT : 'Nome do Contato',
+	NEW_USER : 'Novo Usuário',
+	NONE_RESULT_WAS_FOUND : 'Nenhum resultado encontrado !',
 	PAUSED : ' está parado.',
 	SEND : 'Enviar',
+	SEARCH_RESULT : 'Resulta da busca',
+	SEARCH_USERS : 'Procurar contatos',
 	STATUS_ANAVAILABLE : 'Desconectado',
 	STATUS_AVAILABLE : 'Disponível',
 	STATUS_ANAVAILABLE : 'Desconectado',
-	   
-	ASK_NEW_NAME_QUESTION : 'Informe um novo nome para ',
-	ASK_NEW_GROUP_QUESTION : 'Informe um novo grupo ou deixe em branco',
-	ASK_FOR_AUTH : 'PEDIR AUTORIZAÇÃO !',
-	CONTACT_ASK_FOR_AUTH : 'CONTATO PEDE AUTORIZAÇÃO !',
-	AUTHORIZED : 'AUTORIZADO !',
-	AUTH_SENT : 'AUTORIZAÇÃO ENVIADA !',
-	ASK_FOR_AUTH_QUESTION : 'QUERO ADICIONÁ-LO(A) ! POSSO ?',
-	
+	TRY_AGAIN: 'Tente Novamente!',
 	TYPE_YOUR_MESSAGE_HERE_STATUS : 'Digite aqui sua mensagem de Status',
 	TYPE_YOUR_MSG : 'Digite sua mensagem !!!',
-	YOUR_SEARCH_ARGUMENT_MUST_BE_LONGER_THAN_3_CHARACTERS : 'Sua busca precisa ter mais que 3 dígitos',
-		
-	NEW_USER : 'Novo Usuário'
-		
+	YOUR_SEARCH_ARGUMENT_MUST_BE_LONGER_THAN_3_CHARACTERS : 'Sua busca precisa ter mais que 3 dígitos'
 };
Index: branches/2.2/jabberit_messenger/jmessenger/js/lang/i18n_pt_Br.mini.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/lang/i18n_pt_Br.mini.js	(revision 3102)
+++ branches/2.2/jabberit_messenger/jmessenger/js/lang/i18n_pt_Br.mini.js	(revision 3260)
@@ -1,2 +1,2 @@
 
-i18n={ME:'Eu',INACTIVE:' está inativo.',COMPOSING:' está digitando...',GONE:' saiu da conversa.',LEAVE_CHATROOM:'Sair da Sala',PAUSED:' está parado.',SEND:'Enviar',STATUS_ANAVAILABLE:'Desconectado',STATUS_AVAILABLE:'Disponível',STATUS_ANAVAILABLE:'Desconectado',ASK_NEW_NAME_QUESTION:'Informe um novo nome para ',ASK_NEW_GROUP_QUESTION:'Informe um novo grupo ou deixe em branco',ASK_FOR_AUTH:'PEDIR AUTORIZAÇÃO !',CONTACT_ASK_FOR_AUTH:'CONTATO PEDE AUTORIZAÇÃO !',AUTHORIZED:'AUTORIZADO !',AUTH_SENT:'AUTORIZAÇÃO ENVIADA !',ASK_FOR_AUTH_QUESTION:'QUERO ADICIONÁ-LO(A) ! POSSO ?',TYPE_YOUR_MESSAGE_HERE_STATUS:'Digite aqui sua mensagem de Status',TYPE_YOUR_MSG:'Digite sua mensagem !!!',YOUR_SEARCH_ARGUMENT_MUST_BE_LONGER_THAN_3_CHARACTERS:'Sua busca precisa ter mais que 3 dígitos',NEW_USER:'Novo Usuário'};
+i18n={ADD:'Adicionar',ADD_CONTACT:'Adicionar Contatos',ADD_CONTACTS:'Adicionar Contatos',ASK_NEW_NAME_QUESTION:'Informe um novo nome para ',ASK_NEW_GROUP_QUESTION:'Informe um novo grupo ou deixe em branco',ASK_FOR_AUTH:'PEDIR AUTORIZAÇÃO !',AUTHORIZED:'AUTORIZADO !',AUTH_SENT:'AUTORIZAÇÃO ENVIADA !',ASK_FOR_AUTH_QUESTION:'QUERO ADICIONÁ-LO(A) ! POSSO ?',CLOSE:'Fechar',COMPOSING:' está digitando...',CONTACT_ASK_FOR_AUTH:'CONTATO PEDE AUTORIZAÇÃO !',GONE:' saiu da conversa.',GROUP:'Grupo',INACTIVE:' está inativo.',LEAVE_CHATROOM:'Sair da Sala',LOAD:'Carregando',MANY_RESULTS_PLEASE_TRY_TO_REFINE_YOUR_SEARCH:'Muitos Resultados ! Por favor tente refinar sua busca !',ME:'Eu',NAME_CONTACT:'Nome do Contato',NEW_USER:'Novo Usuário',NONE_RESULT_WAS_FOUND:'Nenhum resultado encontrado !',PAUSED:' está parado.',SEND:'Enviar',SEARCH_RESULT:'Resulta da busca',SEARCH_USERS:'Procurar contatos',STATUS_ANAVAILABLE:'Desconectado',STATUS_AVAILABLE:'Disponível',STATUS_ANAVAILABLE:'Desconectado',TRY_AGAIN:'Tente Novamente!',TYPE_YOUR_MESSAGE_HERE_STATUS:'Digite aqui sua mensagem de Status',TYPE_YOUR_MSG:'Digite sua mensagem !!!',YOUR_SEARCH_ARGUMENT_MUST_BE_LONGER_THAN_3_CHARACTERS:'Sua busca precisa ter mais que 3 dígitos'};
Index: branches/2.2/jabberit_messenger/jmessenger/js/AddUser.mini.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/AddUser.mini.js	(revision 3102)
+++ branches/2.2/jabberit_messenger/jmessenger/js/AddUser.mini.js	(revision 3260)
@@ -7,5 +7,5 @@
 {_groups+=group+";";}
 _groups=_groups.substring(0,(_groups.length-1));}
-var _paramNewUser={'name_contact':name,'jidFrom':jidFrom,'jidTo':jidTo,'selectBoxOptions':_groups};var winNewUser={id_window:"new_user_jabberit",width:320,height:165,top:100,left:350,draggable:true,visible:"display",resizable:true,zindex:loadscript.getZIndex(),title:'Expresso Messenger - '+i18n.NEW_USER,closeAction:"remove",content:Xtools.parse(Xtools.xml('new_user'),'newUser.xsl',_paramNewUser)};_winBuild(winNewUser);loadscript.setSelectEditable(document.getElementById('name_group_new_user_jabberit'),5,99);var _pButtons={'lang1':'Adicionar','lang2':'Fechar','onclickClose':'_winBuild("new_user_jabberit","remove");','onclickSubmit':'loadscript.addNewUser();'};document.getElementById('buttons_newuser').innerHTML=Xtools.parse(Xtools.xml('buttons_main'),'buttons.xsl',_pButtons);}
+var _paramNewUser={'name_contact':name,'jidFrom':jidFrom,'jidTo':jidTo,'selectBoxOptions':_groups};var winNewUser={id_window:"new_user_jabberit",width:320,height:165,top:100,left:350,draggable:true,visible:"display",resizable:true,zindex:loadscript.getZIndex(),title:'Expresso Messenger - '+i18n.NEW_USER,closeAction:"remove",content:Xtools.parse(Xtools.xml('new_user'),'newUser.xsl',_paramNewUser)};_winBuild(winNewUser);loadscript.setSelectEditable(document.getElementById('name_group_new_user_jabberit'),5,99);var _pButtons={'lang1':i18n.ADD,'lang2':i18n.CLOSE,'onclickClose':'_winBuild("new_user_jabberit","remove");','onclickSubmit':'loadscript.addNewUser();'};document.getElementById('buttons_newuser').innerHTML=Xtools.parse(Xtools.xml('buttons_main'),'buttons.xsl',_pButtons);}
 else
 {var jidFrom=Base64.decode(loadscript.getUserCurrent().jid);var jidTo=getElement('user_jid_jabberIM').value;var name=getElement('user_name_jabberIM').value;var group=getElement('user_group_jabberIM').value;_winBuild('add_user_info','remove');if(jidFrom!=jidTo)
@@ -24,5 +24,5 @@
 _input.value=_input.value.substring(0,(_input.value.length-1));if(_input.value.substring(0,1)==="*")
 _input.value=_input.value.substring(1,_input.value.length);conn.go('p.cc.getListContacts',function(data)
-{var _paramsVar={'lang_addContact':'Adicionar Contatos','lang_empty':'None result was found.','lang_many_results':'Many results. Please, try to refine your search.'};_div.innerHTML=Xtools.parse(data,'listLdapContacts.xsl',_paramsVar);var _newUser=_div.firstChild;while(_newUser)
+{var _paramsVar={'lang_addContact':i18n.ADD_CONTACTS,'lang_empty':i18n.NONE_RESULT_WAS_FOUND,'lang_error':i18n.TRY_AGAIN,'lang_many_results':i18n.MANY_RESULTS_PLEASE_TRY_TO_REFINE_YOUR_SEARCH};_div.innerHTML=Xtools.parse(data,'listLdapContacts.xsl',_paramsVar);var _newUser=_div.firstChild;while(_newUser)
 {if(_newUser.getAttribute('photo')==='1')
 {var jid=_newUser.getAttribute('jid');var ou=_newUser.getAttribute('ou');var _img_path=path_jabberit+'inc/WebService.php?'+Date.parse(new Date);_img_path+='&photo_session='+jid+'&ou='+ou;_newUser.style.backgroundImage='url('+_img_path+')';}
@@ -38,5 +38,5 @@
 else if(element.parentNode.getAttribute('value'))
 {var infoUser={'email':element.parentNode.getAttribute('value').substring(0,element.parentNode.getAttribute('value').indexOf(';')),'jid':element.parentNode.getAttribute('jid'),'lang_group':"Grupo",'lang_name_contact':"Contato",'group':element.parentNode.getAttribute('ou'),'name':element.parentNode.getAttribute('name').substring(0,element.parentNode.getAttribute('name').indexOf(' ')),'ou':element.parentNode.getAttribute('ou'),'selectBoxOptions':_groups,'uid':element.parentNode.getAttribute('value').substring(element.parentNode.getAttribute('value').indexOf(';')+1)};}
-var winAddUser={id_window:"add_user_info",width:370,height:200,top:85,left:220,draggable:true,visible:"display",resizable:true,zindex:loadscript.getZIndex(),title:'Expresso Messenger - Add Contact',closeAction:"remove",content:Xtools.parse(Xtools.xml('adduser'),'addUser.xsl',infoUser)};_winBuild(winAddUser);var _pButtons={'lang1':'Adicionar','lang2':'Fechar','onclickClose':'_winBuild("'+winAddUser.id_window+'","remove");','onclickSubmit':'loadscript.addContact(this);'};document.getElementById('buttons_adduser').innerHTML=Xtools.parse(Xtools.xml('buttons_main'),'buttons.xsl',_pButtons);loadscript.setSelectEditable(document.getElementById('user_group_jabberIM'),35,155);var _img=null;if(element.style.backgroundImage)
+var winAddUser={id_window:"add_user_info",width:370,height:200,top:85,left:220,draggable:true,visible:"display",resizable:true,zindex:loadscript.getZIndex(),title:'Expresso Messenger - '+i18n.ADD_CONTACT,closeAction:"remove",content:Xtools.parse(Xtools.xml('adduser'),'addUser.xsl',infoUser)};_winBuild(winAddUser);var _pButtons={'lang1':i18n.ADD,'lang2':i18n.CLOSE,'onclickClose':'_winBuild("'+winAddUser.id_window+'","remove");','onclickSubmit':'loadscript.addContact(this);'};document.getElementById('buttons_adduser').innerHTML=Xtools.parse(Xtools.xml('buttons_main'),'buttons.xsl',_pButtons);loadscript.setSelectEditable(document.getElementById('user_group_jabberIM'),35,155);var _img=null;if(element.style.backgroundImage)
 _img=element.cloneNode(false);if(element.parentNode.style.backgroundImage)
 _img=element.parentNode.cloneNode(false);if(_img!=null)
@@ -50,5 +50,5 @@
 appendChild(_img);}}
 function showForm()
-{var _paramsWindAddUser={'lang_group':'Grupo','lang_load':'Carregando','lang_name_contact':'Nome do Contato','lang_result':'Resultado da Busca','path':path_jabberit};var windAddUser={id_window:"add_user_im",width:440,height:350,top:80,left:200,draggable:true,visible:"display",resizable:true,zindex:loadscript.getZIndex(),title:'Expresso Messenger - Search users',closeAction:"remove",content:Xtools.parse(Xtools.xml('userinfo'),'addUser.xsl',_paramsWindAddUser)};_winBuild(windAddUser);}
+{var _paramsWindAddUser={'lang_group':i18n.GROUP,'lang_load':i18n.LOAD,'lang_name_contact':i18n.NAME_CONTACT,'lang_result':i18n.SEARCH_RESULT,'path':path_jabberit};var windAddUser={id_window:"add_user_im",width:440,height:350,top:80,left:200,draggable:true,visible:"display",resizable:true,zindex:loadscript.getZIndex(),title:'Expresso Messenger - '+i18n.SEARCH_USERS,closeAction:"remove",content:Xtools.parse(Xtools.xml('userinfo'),'addUser.xsl',_paramsWindAddUser)};_winBuild(windAddUser);}
 function loadAddUser()
 {if(arguments.length>0)
Index: branches/2.2/jabberit_messenger/jmessenger/js/AddUser.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/AddUser.js	(revision 3102)
+++ branches/2.2/jabberit_messenger/jmessenger/js/AddUser.js	(revision 3260)
@@ -56,6 +56,6 @@
 				var _pButtons =
 				{
-					'lang1' 		: 'Adicionar',
-					'lang2'			: 'Fechar',
+					'lang1' 		: i18n.ADD,
+					'lang2'			: i18n.CLOSE,
 					'onclickClose'	: '_winBuild("new_user_jabberit","remove");',
 					'onclickSubmit'	: 'loadscript.addNewUser();'
@@ -144,7 +144,8 @@
 						var _paramsVar =
 						{
-							'lang_addContact'	: 'Adicionar Contatos',
-							'lang_empty' 		: 'None result was found.',
-							'lang_many_results' : 'Many results. Please, try to refine your search.'
+							'lang_addContact'	: i18n.ADD_CONTACTS ,
+							'lang_empty' 		: i18n.NONE_RESULT_WAS_FOUND,
+							'lang_error'		: i18n.TRY_AGAIN,
+							'lang_many_results' : i18n.MANY_RESULTS_PLEASE_TRY_TO_REFINE_YOUR_SEARCH
 						};	
 						
@@ -170,5 +171,5 @@
 							_newUser = _newUser.nextSibling;
 						}
-
+						
 						_input.focus();
 						_input.value	 	= "";
@@ -176,4 +177,5 @@
 						
 					},'name=' + _input.value );
+			
 		}
 		
@@ -237,5 +239,5 @@
 					resizable	 : true,
 					zindex		 : loadscript.getZIndex(),
-					title		 : 'Expresso Messenger - Add Contact',
+					title		 : 'Expresso Messenger - ' + i18n.ADD_CONTACT,
 					closeAction  : "remove",
 					content		 : Xtools.parse( Xtools.xml('adduser'), 'addUser.xsl', infoUser )
@@ -247,6 +249,6 @@
 			var _pButtons =
 			{
-				'lang1' 		: 'Adicionar',
-				'lang2'			: 'Fechar',
+				'lang1' 		: i18n.ADD,
+				'lang2'			: i18n.CLOSE,
 				'onclickClose'	: '_winBuild("' + winAddUser.id_window + '","remove");',
 				'onclickSubmit'	: 'loadscript.addContact(this);'
@@ -303,8 +305,8 @@
 			var _paramsWindAddUser =
 			{
-					'lang_group'		: 'Grupo',
-					'lang_load'			: 'Carregando',
-					'lang_name_contact'	: 'Nome do Contato',
-					'lang_result'		: 'Resultado da Busca',
+					'lang_group'		: i18n.GROUP,
+					'lang_load'			: i18n.LOAD,
+					'lang_name_contact'	: i18n.NAME_CONTACT,
+					'lang_result'		: i18n.SEARCH_RESULT,
 					'path'				: path_jabberit	
 			};
@@ -321,5 +323,5 @@
 					resizable	 : true,
 					zindex		 : loadscript.getZIndex(),
-					title		 : 'Expresso Messenger - Search users',
+					title		 : 'Expresso Messenger - ' + i18n.SEARCH_USERS,
 					closeAction  : "remove",
 					content		 : Xtools.parse( Xtools.xml('userinfo'), 'addUser.xsl', _paramsWindAddUser )
Index: branches/2.2/jabberit_messenger/jmessenger/js/SnifferBrowser.mini.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/SnifferBrowser.mini.js	(revision 3260)
+++ branches/2.2/jabberit_messenger/jmessenger/js/SnifferBrowser.mini.js	(revision 3260)
@@ -0,0 +1,18 @@
+
+(function()
+{var agt=navigator.userAgent.toLowerCase();var appVer=navigator.appVersion.toLowerCase();var is_minor=parseFloat(appVer);var is_major=parseInt(is_minor);var iePos=appVer.indexOf('msie');if(iePos!=-1)
+{is_minor=parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));is_major=parseInt(is_minor);}
+var is_konq=false;var kqPos=agt.indexOf('konqueror');if(kqPos!=-1)
+{is_konq=true;is_minor=parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos)));is_major=parseInt(is_minor);}
+var is_khtml=(((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))&&(is_konq));var is_opera=(agt.indexOf("opera")!=-1);var is_ie=((iePos!=-1)&&(!is_opera)&&(!is_khtml));var is_gecko=((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;var is_gver=0;if(is_gecko)
+is_gver=navigator.productSub;var is_moz=((agt.indexOf('mozilla/5')!=-1)&&(agt.indexOf('spoofer')==-1)&&(agt.indexOf('compatible')==-1)&&(agt.indexOf('opera')==-1)&&(agt.indexOf('webtv')==-1)&&(agt.indexOf('hotjava')==-1)&&(is_gecko)&&((navigator.vendor=="")||(navigator.vendor=="Mozilla")));var _browser=[['epiphany2',(agt.indexOf('epiphany/2')!=-1)],['firefox1',(agt.indexOf('firefox/1')!=-1)],['firefox2',(agt.indexOf('firefox/2')!=-1)],['firefox3',(agt.indexOf('firefox/3')!=-1)],['iceweasel3',(agt.indexOf('iceweasel/3')!=-1)],['ie3',(((iePos!=-1)&&(!is_opera)&&(!is_khtml))&&(is_major<4))],['ie4',(((iePos!=-1)&&(!is_opera)&&(!is_khtml))&&(is_major==4))],['ie5',(((iePos!=-1)&&(!is_opera)&&(!is_khtml))&&(is_major==5))],['ie55',(((iePos!=-1)&&(!is_opera)&&(!is_khtml))&&(agt.indexOf("msie 5.5")!=-1))],['ie6',(((iePos!=-1)&&(!is_opera)&&(!is_khtml))&&(is_major==6))],['ie7',(((iePos!=-1)&&(!is_opera)&&(!is_khtml))&&(is_major==7))],['ie8',(((iePos!=-1)&&(!is_opera)&&(!is_khtml))&&(is_major==8))],['is_ie',((iePos!=-1)&&(!is_opera)&&(!is_khtml))],['is_gecko',is_gecko],['is_opera',is_opera],['is_khtml',is_khtml],['is_moz',is_moz],['is_opera',is_opera],['opera2',(agt.indexOf("opera 2")!=-1||agt.indexOf("opera/2")!=-1)],['opera3',(agt.indexOf("opera 3")!=-1||agt.indexOf("opera/3")!=-1)],['opera4',(agt.indexOf("opera 4")!=-1||agt.indexOf("opera/4")!=-1)],['opera5',(agt.indexOf("opera 5")!=-1||agt.indexOf("opera/5")!=-1)],['opera6',(agt.indexOf("opera 6")!=-1||agt.indexOf("opera/6")!=-1)],['opera7',(agt.indexOf("opera 7")!=-1||agt.indexOf("opera/7")!=-1)],['opera8',(agt.indexOf("opera 8")!=-1||agt.indexOf("opera/8")!=-1)],['opera9',(agt.indexOf("opera 9")!=-1||agt.indexOf("opera/9")!=-1)],['safari',((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))],['khtml',is_khtml]];function isCompatible()
+{if(arguments.length>0)
+{var _args=arguments;for(i=0;i<_args.length;i++)
+{for(j=0;j<_browser.length;j++)
+{if(_args[i].toLowerCase()===_browser[j][0])
+{if(_browser[j][1])
+return true;}}}
+return false;}}
+function SnifferBrowser()
+{}
+SnifferBrowser.prototype.isCompatible=isCompatible;window.SnifferBrowser=new SnifferBrowser;})();
