Index: sandbox/jabberit_messenger/trophy_expresso/xsl/listLdapContacts.xsl
===================================================================
--- sandbox/jabberit_messenger/trophy_expresso/xsl/listLdapContacts.xsl	(revision 2411)
+++ sandbox/jabberit_messenger/trophy_expresso/xsl/listLdapContacts.xsl	(revision 2421)
@@ -24,5 +24,5 @@
 		<xsl:for-each select="data">
 			<xsl:sort select="cn"/>
-			<span value="{mail};{uid}" jid="{jid}" ou="{ou}" photo="{photo}">
+			<span value="{mail};{uid}" jid="{jid}" name="{cn}" ou="{ou}" photo="{photo}">
 				<span id="{mail};{uid}" style="display:none;"><xsl:value-of select="cn" /></span>
 				<b><xsl:value-of select="name(..)"/></b>
Index: sandbox/jabberit_messenger/trophy_expresso/xsl/buttons.xsl
===================================================================
--- sandbox/jabberit_messenger/trophy_expresso/xsl/buttons.xsl	(revision 2421)
+++ sandbox/jabberit_messenger/trophy_expresso/xsl/buttons.xsl	(revision 2421)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	<xsl:output method="html" omit-xml-declaration="yes"/>
+	
+	<xsl:param name="lang1" />
+	<xsl:param name="lang2" />
+	<xsl:param name="onclickClose" />
+	<xsl:param name="onclickSubmit" />
+	
+	<xsl:template match="buttons_main">
+		<table cellspacing="2">
+			<tr>
+				<td>
+					<table cellspacing="0" class="x-btn  x-btn-noicon" style="width: 75px;">
+						<tbody class="x-btn-small x-btn-icon-small-left">
+						<tr>
+							<td class="x-btn-tl"><i> </i></td>
+							<td class="x-btn-tc"></td>
+							<td class="x-btn-tr"><i> </i></td>
+						</tr>
+						<tr>
+							<td class="x-btn-ml"><i> </i></td>
+							<td class="x-btn-mc" onclick="{$onclickSubmit};">
+								<em unselectable="on">
+									<button type="button" class="x-btn-text"><xsl:value-of select="$lang1"/></button>
+								</em>
+							</td>
+							<td class="x-btn-mr"><i> </i></td>
+						</tr>
+						<tr>
+							<td class="x-btn-bl"><i> </i></td>
+							<td class="x-btn-bc"></td>
+							<td class="x-btn-br"><i> </i></td>
+						</tr>
+						</tbody>
+					</table>
+				</td>
+				<td>
+					<table cellspacing="0" class="x-btn  x-btn-noicon" style="width: 75px;">
+						<tbody class="x-btn-small x-btn-icon-small-left">
+							<tr>
+								<td class="x-btn-tl"><i> </i></td>
+								<td class="x-btn-tc"></td>
+								<td class="x-btn-tr"><i> </i></td>
+							</tr>
+							<tr>
+								<td class="x-btn-ml"><i> </i></td>
+								<td class="x-btn-mc"  onclick="{$onclickClose};">
+									<em unselectable="on">
+										<button type="button" class="x-btn-text"><xsl:value-of select="$lang2"/></button>
+									</em>
+								</td>
+								<td class="x-btn-mr"><i> </i></td>
+							</tr>
+							<tr>
+								<td class="x-btn-bl"><i> </i></td>
+								<td class="x-btn-bc"></td>
+								<td class="x-btn-br"><i> </i></td>
+							</tr>
+						</tbody>
+					</table>
+				</td>
+			</tr>
+		</table>
+	</xsl:template>
+	
+</xsl:stylesheet>
Index: sandbox/jabberit_messenger/trophy_expresso/xsl/addUser.xsl
===================================================================
--- sandbox/jabberit_messenger/trophy_expresso/xsl/addUser.xsl	(revision 2411)
+++ sandbox/jabberit_messenger/trophy_expresso/xsl/addUser.xsl	(revision 2421)
@@ -8,4 +8,7 @@
 	<xsl:param name="lang_result" />
 	<xsl:param name="path" />
+	<xsl:param name="group" />
+	<xsl:param name="jid" />
+	<xsl:param name="name" />
 
 	<xsl:template match="userinfo">
@@ -19,6 +22,6 @@
 			</div>
 
-			<div style="margin:7px 0px 5px 5px;">
-				<span style="width:auto;text-decoration:underline;"><xsl:value-of select="$lang_result"/> .: </span>
+			<div class="add_organization_members" style="margin:7px 0px 5px 5px;">
+				<span style="width:auto;"><xsl:value-of select="$lang_result"/> .: </span>
 				<br style="clear:both"/>
 				<div id="list_users_ldap_im"></div>
@@ -30,22 +33,22 @@
 			<xsl:value-of select="$lang_load" /> ...
 		</span>
-		<input id="im_jidUser" type="hidden" />
-		<input id="im_jid" type="hidden" />
-		<input id="im_uid" type="hidden" />
-
+		
 	</xsl:template>
 	
 	<xsl:template match="adduser">
-		
+
 		<div class="add_member_info">
-			<span><xsl:value-of select="$lang4"/> : </span>
-			<input id="im_name" type="text" size="39" maxlength="50" onclick="this.select();"/>
-			<br/><br style="line-height:4px"/>
-			<span><xsl:value-of select="$lang5"/> : </span>
-			<input id="im_group" type="text" size="40" maxlength="50" selectboxoptions="" onclick="this.select();"/>
+			<form>
+				<span> <xsl:value-of select="$lang_name_contact"/> : </span>
+				<input id="user_name_jabberIM" type="text" size="39" maxlength="50" value="{$name}" onclick="this.select();" />
+				<br/><br/>
+				<span><xsl:value-of select="$lang_group"/> : </span>
+				<input id="user_group_jabberIM" type="text" size="39" maxlength="50" value="{$group}" onclick="this.select();" />
+				<input id="user_jid_jabberIM" type="hidden" value="{$jid}" />
+			</form>
 		</div>
 		
 		<div id="buttons_adduser" style="padding-top:30px; padding-bottom: 30px; margin-left: 83px;"/>
-	
+		
 	</xsl:template>
 	
Index: sandbox/jabberit_messenger/trophy_expresso/inc/webservice.php
===================================================================
--- sandbox/jabberit_messenger/trophy_expresso/inc/webservice.php	(revision 2411)
+++ sandbox/jabberit_messenger/trophy_expresso/inc/webservice.php	(revision 2421)
@@ -3,5 +3,4 @@
   *  Expresso - Expresso Messenger                                            *
   *  	- Alexandre Correia / Rodrigo Souza							          *
-  *  	- JETI - http://jeti-im.org/										  *
   * ------------------------------------------------------------------------- *
   *  This program is free software; you can redistribute it and/or modify it  *
@@ -13,299 +12,4 @@
 class webService
 {
-	private $attribute;
-	private $conn;
-	private $contextLdap;
-	private $userLDAP;	
-	private $jabberName = null;
-	private $passwd;
-	private $photo_user = array();
-	private $refer;
-	private $serverLdap;
-	private $fileLdapInternal = false;
-	private $fileLdapExternal = false;
-	private $version3;
-	
-	function __construct()
-	{
-		if ( file_exists('confLDAPInternal.php') )
-		{
-			require_once('confLDAPInternal.php');
-			$handle   = unserialize(base64_decode($LDAP_INTERNAL));
-	
-			$this->jabberName	= $handle['jabberName'];
-			$this->serverLdap	= $handle['serverLdap'];
-			$this->contextLdap	= $handle['contextLdap'];
-			$this->userLDAP		= $handle['user'];
-			$this->passwd		= $handle['password'];
-			
-			$this->refer  	= true;
-			$this->version3 = true;
-			
-			$this->fileLdapInternal = true;
-		}
-		
-		$this->attribute = "uid";
-		
-		if ( file_exists('attributeLdap.php') )
-		{
-			require_once('attributeLdap.php');
-			$this->attribute = trim($attributeTypeName);
-		}
-	}
-	
-	private final function ldapConnect()
-	{
-		if(!function_exists('ldap_connect'))
-			return False;
-		
-		if(!$this->conn = ldap_connect($this->serverLdap))
-			return False;
-
-		if( $this->version3 )
-			if( !ldap_set_option($this->conn,LDAP_OPT_PROTOCOL_VERSION,3) )
-				$this->version3 = false;
-
-		ldap_set_option($this->conn, LDAP_OPT_REFERRALS, $this->refer);
-
-		// Bind as Admin
-		if( $this->userLDAP && $this->passwd && !ldap_bind($this->conn, $this->userLDAP . "," . $this->contextLdap, $this->passwd) )
-			return False;
-		
-		// Bind as Anonymous
-		if( !$this->userLDAP && !$this->passwd && !@ldap_bind($this->conn) )
-			return False;
-	}
-
-	private final function ldapConnectExternal($pHostJabber)
-	{
-		if( file_exists('confLDAPExternal.php'))
-		{
-			require_once('confLDAPExternal.php');
-			$handle   = unserialize(base64_decode($LDAP_EXTERNAL));
-	
-			foreach($handle as $itens)
-			{
-				if(trim($pHostJabber) == $itens['jabberName'])
-				{
-					$this->jabberName	= $itens['jabberName'];
-					$this->serverLdap	= $itens['serverLdap'];
-					$this->contextLdap	= $itens['contextLdap'];
-					$this->userLDAP		= $itens['user'];
-					$this->passwd		= $itens['password'];
-					
-					$this->fileLdapExternal = true;
-				}
-			}		
-	
-			$this->refer  	= true;
-			$this->version3 = true;
-			
-			$this->ldapConnect();
-		}
-	}
-	
-	public final function CallVoipConnect($pVoipFrom, $pVoipTo)
-	{
-		$this->ldapConnect();
-
-		if( $this->conn )
-		{
-			$filter  = "(|(&(phpgwaccounttype=u)(uid=".$pVoipFrom."))(&(phpgwaccounttype=u)(uid=".$pVoipTo.")))";
-			$justthese = array("telephoneNumber", "uid");
-			$search = ldap_search($this->conn,$this->contextLdap,$filter,$justthese);
-			$entry = ldap_get_entries($this->conn,$search);
-
-			$fromNumber = $entry[0]['telephonenumber'][0];
-			$toNumber = $entry[1]['telephonenumber'][0];
-
-			if ( trim($entry[0]['uid'][0]) !== trim($pVoipFrom) )
-			{
-				$fromNumber = $entry[1]['telephonenumber'][0];
-				$toNumber = $entry[0]['telephonenumber'][0];
-			}
-		}
-		
-		if( $fromNumber && $toNumber )
-		{
-			$voipServer	= "www.pabx.celepar.parana";
-			$voipUrl	= "/telefoniaip/servicos/voip.php";
-			$voipPort	= "80";
-	
-			if( !$voipServer || !$voipUrl || !$voipPort )
-				return false;
-			
-			$url		= "http://".$voipServer.":".$voipPort.$voipUrl."?magic=1333&acao=liga&ramal=".$fromNumber."&numero=".$toNumber;
-			$sMethod	= 'GET ';
-			$crlf		= "\r\n";
-			$sRequest	= " HTTP/1.1" . $crlf;
-			$sRequest	.= "Host: localhost" . $crlf;
-			$sRequest	.= "Accept: */* " . $crlf;
-			$sRequest	.= "Connection: Close" . $crlf . $crlf;            
-			$sRequest	= $sMethod . $url . $sRequest;    
-			$sockHttp	= socket_create(AF_INET, SOCK_STREAM, SOL_TCP);            
-			
-			if ( !$sockHttp )
-			    return false;
-			
-			$resSocketConnect = socket_connect($sockHttp, $voipServer, $voipPort);
-			
-			if ( !$resSocketConnect )
-			    return false;
-	
-			$resSocketWrite = socket_write($sockHttp, $sRequest, strlen($sRequest));
-	
-			if ( !$resSocketWrite )
-			    return false;
-	    
-			$sResponse = '';    
-	
-			while ($sRead = socket_read($sockHttp, 512))
-			{
-			    $sResponse .= $sRead;
-			}            
-			
-			socket_close($sockHttp);            
-			
-			$pos = strpos($sResponse, $crlf . $crlf);
-			
-			return substr($sResponse, $pos + 2 * strlen($crlf));
-		}
-		
-		return "ERRO";									
-	}
-	
-	
-	public final function getNameOrganization($pJid, $pCharset)
-	{
-		$uid = substr($pJid, 0, strpos($pJid,"@"));
-		$return = utf8_encode("Nome : Não Identificado ;Organização : Não Identificado");
-		
-		if( $this->jabberName == (substr($pJid, strpos($pJid, "@") + 1 )))
-		{
-			$this->ldapConnect();
-
-			if( $this->fileLdapInternal )
-			{
-				if( $this->conn )
-				{
-					$filter = "(&(phpgwaccounttype=u)(".$this->attribute."=".$uid.")(!(phpgwaccountvisible=-1)))";
-					$justthese = array($this->attribute,"cn","dn");
-					$search = ldap_search( $this->conn, $this->contextLdap, $filter,$justthese);
-					$get_entries = ldap_get_entries( $this->conn, $search);
-		
-					if( $get_entries['count'] > 0 )
-					{					
-						$cn = $get_entries[0]['cn'][0];
-						$ou = explode("dc=", $get_entries[0]['dn']);
-						$ou = explode("ou=",$ou[0]);
-						$ou = array_pop($ou);
-						$dn = strtoupper(substr($ou,0,strlen($ou)-1));
-						$return = utf8_encode("Nome : " . $cn . ";Organização : " . $dn);
-					}
-				}
-			}
-		}
-		else
-		{
-			$this->ldapConnectExternal(substr($pJid, strpos($pJid, "@") + 1 ));
-			
-			if( $this->fileLdapExternal )
-			{
-				if( $this->conn )
-				{
-					$filter = "(&(phpgwaccounttype=u)(".$this->attribute."=".$uid.")(!(phpgwaccountvisible=-1)))";
-					$justthese = array($this->attribute,"cn","dn");
-					$search = ldap_search( $this->conn, $this->contextLdap, $filter, $justthese);
-					$get_entries = ldap_get_entries( $this->conn, $search);
-					
-					if( $get_entries['count'] > 0 )
-					{
-						$cn = $get_entries[0]['cn'][0];
-						$ou = explode("dc=", $get_entries[0]['dn']);
-						$ou = explode("ou=",$ou[0]);
-						$ou = array_pop($ou);
-						$dn = strtoupper(substr($ou,0,strlen($ou)-1));
-						$return = utf8_encode("Nome : " . $cn . ";Organização : " . $dn);
-					}
-				}
-			}
-		}
-
-		if( $pCharset === "1" || $pCharset === 1 )
-			return $return;
-		else
-			return mb_convert_encoding($return, "ISO-8859-1", "UTF-8");
-
-	}
-	
-	public final function getPhotoLdap( $pJid , $pLdapInternal )
-	{
-		$uid = substr($pJid, 0, strpos($pJid, "@"));
-
-		if( $pLdapInternal )
-		{
-			if( !$this->fileLdapInternal )
-				return false;
-
-			if( $this->jabberName == (substr($pJid, strpos($pJid, "@") + 1 )))
-			{
-				
-				$this->ldapConnect();
-				
-				if( $this->conn )
-				{
-					$filter			= "(&(phpgwaccounttype=u)(".$this->attribute."=".$uid.")(!(phpgwaccountvisible=-1)))";
-					$justthese		= array($this->attribute,"jpegPhoto");
-					$search			= ldap_search($this->conn,$this->contextLdap,$filter,$justthese);
-					$get_entries	= ldap_get_entries($this->conn,$search);
-					
-					if( $get_entries['count'] > 0 )
-					{
-						$first_entry = ldap_first_entry( $this->conn, $search );
-						$photo = @ldap_get_values_len($this->conn, $first_entry, 'jpegphoto');
-						
-						if ( $photo )
-							return $photo[0];
-						
-						return false;								
-					}
-				}
-			}
-		}
-		else
-		{					
-			if( !$this->fileLdapExternal )
-				return false;
-				
-			$jabberName = substr($pJid, strpos($pJid, "@") + 1 );
-
-			if( strpos($jabberName, "/") )
-				$jabberName = substr($jabberName, 0, strpos($jabberName, "/"));
-
-			$this->ldapConnectExternal($jabberName);
-
-			if( $this->conn )
-			{
-				$filter			= "(&(phpgwaccounttype=u)(".$this->attribute."=".$uid.")(!(phpgwaccountvisible=-1)))";
-				$justthese		= array($this->attribute,"jpegPhoto");
-				$search			= ldap_search($this->conn,$this->contextLdap,$filter,$justthese);
-				$get_entries	= ldap_get_entries($this->conn,$search);
-				
-				if( $get_entries['count'] > 0 )
-				{
-					$first_entry = ldap_first_entry( $this->conn, $search );
-					$photo = @ldap_get_values_len($this->conn, $first_entry, 'jpegphoto');
-					
-					if ( $photo )
-						return $photo[0];
-					
-					return false;								
-				}
-			}
-		}
-		
-		return false;
-	}
-	
 	public final function getPhotoSession($pUid, $pOu)
 	{
@@ -336,70 +40,10 @@
 }
 
-// Applet - utilizando o serviço Voip;
-if(trim($_REQUEST['javaVoipFrom']) != "" && trim($_REQUEST['javaVoipTo']) != "" )
-{
-	$obj = new webService();
-	$voipFrom = $_REQUEST['javaVoipFrom'];
-	$voipTo = $_REQUEST['javaVoipTo'];
-	printf("%s",$obj->CallVoipConnect($voipFrom, $voipTo));
-}
-
-// Applet - fotos pelo applet; 
-if(trim($_REQUEST['javaPhoto']) != "" )
-{
-	$obj = new webService();
-	$jid = $_REQUEST['javaPhoto'];
-	$jid = ( strpos($jid, "/") !== false ) ? substr($jid, 0, strpos($jid, "/")) : $jid;
-	
-	$photo = $obj->getPhotoLdap( $jid, true );
-	$photoWidth = 70;
-	$photoHeight = 90;
-	$newImage = imagecreatetruecolor($photoWidth,$photoHeight);		
-
-	if( $photo )
-	{
-		$photo = imagecreatefromstring($photo);
-		imagecopyresized($newImage,$photo,0,0,0,0,$photoWidth,$photoHeight,imagesx($photo),imagesy($photo));
-	}
-	else
-	{
-		$photo = $obj->getPhotoLdap($jid, false);
-		if( $photo )
-		{
-			$photo = imagecreatefromstring($photo);
-			imagecopyresized($newImage,$photo,0,0,0,0,$photoWidth,$photoHeight,imagesx($photo),imagesy($photo));
-		}
-		else
-		{
-			$photo = @imagecreatefrompng("../templates/default/images/photo.png");
-			imagecopyresized($newImage,$photo,0,0,0,0,$photoWidth,$photoHeight,imagesx($photo),imagesy($photo));
-		}
-	}
-	
-	ob_start();
-	imagepng($newImage);
-	$imagePhoto = ob_get_contents();
-	imagedestroy($newImage);
-	ob_end_clean();
-	printf("%s",base64_encode($imagePhoto));
-}
-
-// Applet - jid;
-if(trim($_REQUEST['jid']) != "")
-{
-	
-	$jid = trim($_REQUEST['jid']);
-	$charset = trim($_REQUEST['charset']);
-	$obj = new webService();
-	
-	printf("%s",$obj->getNameOrganization($jid, $charset));
-}
-
 // Php - fotos pelo php;
 if(trim($_REQUEST['phpPhoto']) != "")
 {
-	$obj = new webservice();
-	$ou = $_REQUEST['phpOu'];
-	$jid = $_REQUEST['phpPhoto'];
+	$obj	= new webservice();
+	$ou		= $_REQUEST['phpOu'];
+	$jid	= $_REQUEST['phpPhoto'];
 	
 	$obj->getPhotoSession($jid, $ou);
Index: sandbox/jabberit_messenger/trophy_expresso/inc/class.ContactsIm.inc.php
===================================================================
--- sandbox/jabberit_messenger/trophy_expresso/inc/class.ContactsIm.inc.php	(revision 2411)
+++ sandbox/jabberit_messenger/trophy_expresso/inc/class.ContactsIm.inc.php	(revision 2421)
@@ -40,7 +40,4 @@
 	{
 		
-		// TESTE REMOVER 
-		$param['name'] = "alexandre*correia";
-		
 		$order		= array();
 		$ou_User	= substr($this->ou_User, (strpos($this->ou_User,"=")+1));
@@ -54,5 +51,5 @@
 		// Hosts Jabber
 		$hostsJabber = unserialize($_SESSION['phpgw_info']['jabberit_messenger']['map_org_realm_jabberit']);
-
+		
 		if( is_array($users) )
 		{	
@@ -107,5 +104,5 @@
         $uidType		= "uid";
 		$serversLdap	= unserialize(trim($_SESSION['phpgw_info']['jabberit_messenger']['groups_search']));
-		
+
         if( $serversLdap )
         {
Index: sandbox/jabberit_messenger/trophy_expresso/inc/class.LdapIM.inc.php
===================================================================
--- sandbox/jabberit_messenger/trophy_expresso/inc/class.LdapIM.inc.php	(revision 2411)
+++ sandbox/jabberit_messenger/trophy_expresso/inc/class.LdapIM.inc.php	(revision 2421)
@@ -49,4 +49,6 @@
 			$this->attribute = trim($attributeTypeName);
 		}
+		else
+			$this->attribute = "uid";
 	}
 
Index: sandbox/jabberit_messenger/trophy_expresso/inc/attributeLdap.php
===================================================================
--- sandbox/jabberit_messenger/trophy_expresso/inc/attributeLdap.php	(revision 2421)
+++ sandbox/jabberit_messenger/trophy_expresso/inc/attributeLdap.php	(revision 2421)
@@ -0,0 +1,16 @@
+<?php
+ 
+  /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  *  	- JETI - http://jeti-im.org/										  *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
+  
+	$attributeTypeName = "uid";
+
+?>
Index: sandbox/jabberit_messenger/trophy_expresso/js/loadIM.js
===================================================================
--- sandbox/jabberit_messenger/trophy_expresso/js/loadIM.js	(revision 2411)
+++ sandbox/jabberit_messenger/trophy_expresso/js/loadIM.js	(revision 2421)
@@ -44,5 +44,8 @@
 	function addContacts()
 	{
-		addUser.show();
+		if( arguments.length > 0 )
+			addUser.add();
+		else
+			addUser.show();
 	}
 	
@@ -374,5 +377,10 @@
 	function searchUser()
 	{
-		addUser.search();
+		var _input	= document.getElementById('search_user_jabber');
+		
+		if( _input.value.length >= 3 )
+			addUser.search();
+		else
+			alert('Your search argument must be longer than 3 characters.');
 	}
 	
@@ -450,5 +458,6 @@
 			            	 	path_jabberit + 'js/trophyim.js',
 			            	 	path_jabberit + 'js/AddUser.js',
-			            	 	path_jabberit + 'templates/default/css/trophyim.css',
+			            	 	path_jabberit + 'templates/default/css/button.css',
+			            	 	path_jabberit + 'templates/default/css/common.css',
 			            	 	path_jabberit + 'templates/default/css/' + theme_jabberit
 			            ];
Index: sandbox/jabberit_messenger/trophy_expresso/js/AddUser.js
===================================================================
--- sandbox/jabberit_messenger/trophy_expresso/js/AddUser.js	(revision 2411)
+++ sandbox/jabberit_messenger/trophy_expresso/js/AddUser.js	(revision 2421)
@@ -6,13 +6,13 @@
 		function addContacts()
 		{
-			if( arguments.length > 0 )
-			{
-				var jidFrom		= loadIM.getUserCurrent().jid;
-				var jidTo		= arguments[0];
-				var name		= arguments[1];
-				var group		= arguments[2];
+			var jidFrom		= loadIM.getUserCurrent().jid;
+			var jidTo		= document.getElementById('user_jid_jabberIM').value;
+			var name		= document.getElementById('user_name_jabberIM').value;
+			var group		= document.getElementById('user_group_jabberIM').value;
 			
-				TrophyIM.addContacts( jidFrom, jidTo, name, group );
-			}
+			alert( jidFrom + "\n" + jidTo + "\n" + name + "\n" + group );
+			
+			//TrophyIM.addContacts( jidFrom, jidTo, name, group );
+			
 		}
 		
@@ -24,4 +24,10 @@
 
 			_span.style.display = "block";
+			
+			if( _input.value.substring((_input.value.length-1),_input.value.length) === "*" )
+				_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',
@@ -37,22 +43,22 @@
 						_div.innerHTML = Xtools.parse( data, 'listLdapContacts.xsl', _paramsVar );
 
-						var _member = _div.firstChild;
+						var _newUser = _div.firstChild;
 						
-						while ( _member )
+						while ( _newUser )
 						{
-							if( _member.getAttribute('photo') === '1' )
+							if( _newUser.getAttribute('photo') === '1' )
 							{
-								var jid		= _member.getAttribute('jid'); 
-								var ou	 	= _member.getAttribute('ou');
+								var jid		= _newUser.getAttribute('jid'); 
+								var ou	 	= _newUser.getAttribute('ou');
 
 								var _img_path  = path_jabberit + 'inc/webservice.php?' + Date.parse( new Date );
 									_img_path += '&phpPhoto=' + jid + '&phpOu=' + ou;
 
-								_member.style.backgroundImage = 'url(' + _img_path + ')';
+								_newUser.style.backgroundImage = 'url(' + _img_path + ')';
 							}
 							
-							//_config(_member, 'onclick', _show);
+							loadIM.configEvents(_newUser, 'onclick', showContact);
 							
-							_member = _member.nextSibling;
+							_newUser = _newUser.nextSibling;
 						}
 
@@ -61,5 +67,67 @@
 						_span.style.display = "none";
 						
-					});
+					},'name=' + _input.value );
+		}
+		
+		function showContact(Element)
+		{
+			var element		= ( Element.target ) ? Element.target : Element.srcElement;
+			var infoUser	= null;		
+			
+			if( element.getAttribute('value') )
+			{
+				var infoUser = 
+				{
+					'email'				: element.getAttribute('value').substring( 0, element.getAttribute('value').indexOf(';')),
+					'jid'				: element.getAttribute('jid'),
+					'lang_group'		: "Grupo",
+					'lang_name_contact'	: "Contato",					
+					'group'				: element.getAttribute('ou'),
+					'name'				: element.getAttribute('name').substring( 0, element.getAttribute('name').indexOf(' ')),
+					'uid'				: element.getAttribute('value').substring( element.getAttribute('value').indexOf(';') + 1 )
+				};
+			}
+			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(' ')),					
+					'uid'				: element.parentNode.getAttribute('value').substring( element.parentNode.getAttribute('value').indexOf(';') + 1)
+				};
+			}
+			
+			var winAddUser =
+			{ 
+					id_window	 : "add_user_info",
+					width		 : 355,
+					height		 : 190,
+					top		 	 : 85,
+					left		 : 220,
+					draggable	 : true,
+					visible	 	 : "display",
+					resizable	 : true,
+					zindex		 : loadIM.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'	: 'loadIM.addContacts(this);'
+			}; 
+
+			document.getElementById('buttons_adduser').innerHTML = Xtools.parse(Xtools.xml('buttons_main'), 'buttons.xsl', _pButtons); 
 		}
 		
Index: sandbox/jabberit_messenger/trophy_expresso/templates/default/css/common.css
===================================================================
--- sandbox/jabberit_messenger/trophy_expresso/templates/default/css/common.css	(revision 2421)
+++ sandbox/jabberit_messenger/trophy_expresso/templates/default/css/common.css	(revision 2421)
@@ -0,0 +1,124 @@
+/* IM:WINDOW - ADD USER */
+
+div.add_organization_members
+{
+	margin-bottom: 30px;
+}
+
+div.add_organization_members span
+{
+	border-bottom: 1px solid #809aa9;
+	float:left;
+	font-size: 8pt !important;
+	font-family: Arial, Verdana, helvetica, sans-serif !important;
+	font-weight: bold;
+	position:aboslute;
+	width: 200px;
+}
+
+div.add_organization_members div
+{
+	font-weight: normal;
+	margin: 2px;
+	padding: 3px;
+	height: 230px;
+	overflow: auto;
+}
+
+div.add_organization_members div span
+{
+	background: url(../images/photo.png) no-repeat;
+	border-bottom: 1px dashed #809aa9;
+	clear:both;
+	float:left;
+	font-weight: normal;
+	height: 65px;
+	letter-spacing: 0.2em;
+	padding: 4px 0 4px 80px;
+	margin-bottom: 20px;
+	width: 300px;
+}
+
+div.add_organization_members div#im_ldap_ou
+{
+	float: left;
+	width: 200px;
+}
+
+div.add_member_info
+{
+	margin: 10px 0px 0px 0px;
+}
+
+div.add_member_info span
+{
+	float: left;
+	font: 9pt Verdana, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	margin-right: 3px;
+	text-align: right;
+	width: 80px;
+}
+
+div.search_user 
+{
+	font-size: 8pt !important;
+	font-family: Arial, Verdana, helvetica, sans-serif !important;
+	font-weight: bold;
+	margin: 0 0 0 5px;
+}
+
+.search_user_button
+{
+	border: 1px solid #000 !important;
+}
+
+span.im_button
+{
+	background: #dedede;
+	border: 1px solid;
+	font: 8pt Verdana, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	letter-spacing: 1px;
+	padding: 0 15px;
+	text-align: center;
+	line-height: 1.5em;
+}
+
+div.loading
+{
+	background: #fdd url(../images/loading.gif) no-repeat 1px 1px;
+	border: 1px dashed #f00;
+	margin:	2px;
+	padding: 3px 3px 3px 20px;
+	text-align: center;
+}
+
+span.message_time
+{
+	color: #aaa;
+	font: 8pt Verdana, Arial, Helvetica, sans-serif;
+}
+
+.font_menu
+{
+	font: 8pt Verdana, Arial, Helvetica, sans-serif;
+}
+
+.layer
+{
+	background: url(../images/photo.png) no-repeat 2px 2px;
+	border:	1px solid #dedede;
+	height: 65px;
+	margin:	2px;
+	padding: 2px 0px 2px 54px;
+}
+
+/* Disconnected */
+
+.disconnected
+{
+	font: 9pt Verdana, Arial, Helvetica, sans-serif;
+	border: 1px solid #dedede;
+	margin: 2px;
+}
Index: sandbox/jabberit_messenger/trophy_expresso/templates/default/css/button.css
===================================================================
--- sandbox/jabberit_messenger/trophy_expresso/templates/default/css/button.css	(revision 2421)
+++ sandbox/jabberit_messenger/trophy_expresso/templates/default/css/button.css	(revision 2421)
@@ -0,0 +1,176 @@
+.x-btn
+{
+	-x-system-font:none;
+	font-family:tahoma,verdana,helvetica;
+	font-size:11px;
+	font-size-adjust:none;
+	font-stretch:normal;
+	font-style:normal;
+	font-variant:normal;
+	font-weight:normal;
+	line-height:normal;
+	white-space:nowrap;
+}
+
+.x-btn td 
+{
+	padding:0 !important;
+}
+
+.x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc 
+{
+	background-image: url(../images/btn.gif) !important;
+}
+
+.x-btn-tl 
+{
+	-moz-background-clip:border;
+	-moz-background-inline-policy:continuous;
+	-moz-background-origin:padding;
+	background:transparent none no-repeat scroll 0 0;
+	height:3px;
+	width:3px;
+}
+
+.x-btn-tr i, .x-btn-tl i, .x-btn-br i, .x-btn-bl i
+{
+	height:3px;
+}
+
+.x-btn-tc
+{
+	-moz-background-clip:border;
+	-moz-background-inline-policy:continuous;
+	-moz-background-origin:padding;
+	background:transparent none repeat-x scroll 0 -6px;
+	height:3px;
+}
+
+.x-btn-tr 
+{
+	-moz-background-clip:border;
+	-moz-background-inline-policy:continuous;
+	-moz-background-origin:padding;
+	background:transparent none no-repeat scroll -3px 0;
+	height:3px;
+	width:3px;
+}
+
+.x-btn-tr i, .x-btn-tl i, .x-btn-mr i, .x-btn-ml i, .x-btn-br i, .x-btn-bl i
+{
+	display:block;
+	font-size:1px;
+	line-height:1px;
+	overflow:hidden;
+	width:3px;
+}
+
+.x-btn-ml
+{
+	-moz-background-clip:border;
+	-moz-background-inline-policy:continuous;
+	-moz-background-origin:padding;
+	background:transparent none no-repeat scroll 0 -24px;
+	width:3px;
+}
+
+.x-btn-mc
+{
+	-moz-background-clip:border;
+	-moz-background-inline-policy:continuous;
+	-moz-background-origin:padding;
+	background:transparent none repeat-x scroll 0 -1096px;
+	cursor:pointer;
+	padding:0 5px;
+	text-align:center;
+	vertical-align:middle;
+	white-space:nowrap;
+}
+
+.x-btn em
+{
+	font-style:normal;
+	font-weight:normal;
+}
+
+.x-btn-noicon .x-btn-small .x-btn-text
+{
+	height:16px;
+}
+
+.x-btn button
+{
+	-x-system-font:none;
+	font-family:arial,tahoma,verdana,helvetica;
+	font-size:11px;
+	font-size-adjust:none;
+	font-stretch:normal;
+	font-style:normal;
+	font-variant:normal;
+	font-weight:normal;
+	line-height:normal;
+}
+
+.x-btn button 
+{
+	-moz-background-clip:border;
+	-moz-background-inline-policy:continuous;
+	-moz-background-origin:padding;
+	background:transparent none repeat scroll 0 0;
+	border:0 none !important;
+	cursor:pointer;
+	margin:0;
+	outline-color:-moz-use-text-color;
+	outline-style:none;
+	outline-width:0;
+	overflow:visible;
+	padding-left:3px;
+	padding-right:3px;
+	width:auto;
+}
+
+.x-btn-text
+{
+	color: #000 !important;
+	cursor:pointer;
+	padding:0;
+	white-space:nowrap;
+}
+
+.x-btn-mr
+{
+	-moz-background-clip:border;
+	-moz-background-inline-policy:continuous;
+	-moz-background-origin:padding;
+	background:transparent none no-repeat scroll -3px -24px;
+	width:3px;
+}
+
+.x-btn-bl
+{
+	-moz-background-clip:border;
+	-moz-background-inline-policy:continuous;
+	-moz-background-origin:padding;
+	background:transparent none no-repeat scroll 0 -3px;
+	height:3px;
+	width:3px;
+}
+
+.x-btn-bc
+{
+	-moz-background-clip:border;
+	-moz-background-inline-policy:continuous;
+	-moz-background-origin:padding;
+	background:transparent none repeat-x scroll 0 -15px;
+	height:3px;
+}
+
+.x-btn-br
+{
+	-moz-background-clip:border;
+	-moz-background-inline-policy:continuous;
+	-moz-background-origin:padding;
+	background:transparent none no-repeat scroll -3px -3px;
+	height:3px;
+	width:3px;
+}
Index: sandbox/jabberit_messenger/trophy_expresso/templates/default/css/trophyim.css
===================================================================
--- sandbox/jabberit_messenger/trophy_expresso/templates/default/css/trophyim.css	(revision 2397)
+++ 	(revision )
@@ -1,120 +1,0 @@
-div.trophyimtabclose {
-    color: #000000;
-    font-size: 8px;
-    text-align: right;
-    cursor: default;
-    float: right;
-    border: 1px black solid;
-    margin-left: 1px;
-    padding-left: 1px;
-}
-div#trophyimclient {
-}
-div#trophyimlogin {
-	text-align: center;
-}
-div#trophyimroster {
-	/*width: 200px;
-	height: 400px;*/
-	/*overflow: scroll;*/
-    clear: none;
-    float: left;
-}
-div#trophyimchat {
-	/*border: 1px black solid;*/
-    clear: right;
-    float: left;
-}
-div#trophyimstatus {
-    width: 200px;
-	border: 2px black solid;
-    clear: both;
-}
-div#trophyimlog {
-	width: 480px;
-	height: 300px;
-	overflow: auto;
-}
-div.trophyimlogitem {
-	border: 1px black solid;
-}
-div.trophyimrosteritem {
-	border: 1px black solid;
-}
-div.trophyimchattab_av { /*Available*/
-	color: #000000;
-}
-div.trophyimchattab_aw { /*Away*/
-	color: #a00000;
-}
-div.trophyimchattab_off { /*Offline*/
-	color: #808080;
-	font-style: italic;
-}
-div.trophyimrosteritem_av { /*Available*/
-	color: #000000;
-}
-div.trophyimrosteritem_aw { /*Away*/
-	color: #a00000;
-}
-div.trophyimrosteritem_off { /*Offline*/
-	color: #808080;
-	font-style: italic;
-}
-div.trophyimchattabjid {
-    display: none;
-}
-div.trophyimchattabname {
-    font-size: 11px;
-	margin-right: 1px;
-    padding: 2px;
-}
-div.trophyimrosterjid {
-    display: none;
-}
-div.trophyimrostername {
-    padding-left: 3px;
-}
-div.trophyimrostergroup {
-	border: 2px blue solid;
-}
-div.trophyimrosterlabel {
-	font-weight: bold;
-}
-div#trophyimchattabs {
-	border: 1px green solid;
-    width: 400px;
-    overflow: auto;
-}
-div.trophyimchattab {
-    clear: none;
-    float: left;
-    cursor: pointer;
-}
-div.trophyimchattab_f { /*Foreground*/
-	border: 2px blue solid;
-}
-div.trophyimchattab_b { /*Background*/
-	border: 1px green solid;
-    margin: 1px;
-}
-div.trophyimchattab_a { /*Alert (background/has new message)*/
-	border: 1px red solid;
-    margin: 1px;
-}
-/*div.trophyimchatbox { /*Collection of chat messages*/
-/*	height: 200px;
-	width: 380px;
-	overflow-y: scroll;
-}*/
-
-textarea.trophyimchatinput {
-}
-div.trophyimchatmessage { /*Each individual chat message*/
-	white-space: pre-wrap;
-	width: 100%;
-    border-bottom: 1px black dotted;
-}
-div#trophyimstatuslist {
-	text-align: center;
-}
