Index: trunk/jabberit_messenger/js/load.js
===================================================================
--- trunk/jabberit_messenger/js/load.js	(revision 751)
+++ trunk/jabberit_messenger/js/load.js	(revision 792)
@@ -42,9 +42,9 @@
 
 	var _window = new JITWindows(_xtools, _jabberit_content);
-	var _ldap	= new JITLdap( _conn, _xtools, _window);
+	var _ldap	= new JITLdap( _conn, _xtools, _window );
 
 	function addContacts()
 	{
-		_ldap.add();
+		_ldap.add(myWindow);
 	}
 
@@ -246,6 +246,4 @@
 	 			var msg	   	= ( arguments[1] ) ? arguments[1] : "";
 	 		
-//	 			alert("Mensagem Jabber : " + msg);
-	 			
 	 			// If Layer;
 	 			if( elementIframe = document.getElementById('iframe_applet_jabberit') )
Index: trunk/jabberit_messenger/js/ldap.js
===================================================================
--- trunk/jabberit_messenger/js/ldap.js	(revision 697)
+++ trunk/jabberit_messenger/js/ldap.js	(revision 792)
@@ -4,7 +4,13 @@
 	var _xtools;
 	var _window;
+	var _myWindow;
 
 	function _add_user()
 	{
+		if( arguments.length > 0 )
+		{
+			_myWindow = arguments[0];
+		}
+		
 		var _win_add = _window.load('add_user_im');
 			_win_add.title('.:: Adicionar Novos Contatos ::.');
@@ -51,11 +57,5 @@
 				_name.previousSibling.style.color = "#000";
 
-				if ( !_jid )
-				{
-					_status.innerHTML = 'Selecione uma organização no campo da esquerda e em<br/>'
-										+ ' seguida, no campo da direita, um membro da organização<br/>'
-										+ ' para adicionar como contato';
-				}
-				else
+				if ( _jid )
 				{
 					_name.value = _name.value.replace(/^( )*|( )*$/g, '');
@@ -98,18 +98,24 @@
 									{	
 										
+										var result;
 										_name.parentNode.style.display = 'none';
 										_name.parentNode.nextSibling.style.display = 'none';
 										_status.innerHTML = '<br/>Adicionando contato, aguarde....<br/>';
 				
-										_conn.go(
-											'$this.ujabber.AddNewContact',
-											function()
-											{
-												_status.innerHTML = '<br/>Contato adicionado !<br/>';
-												setTimeout('cleanStatusAddContactIM();',2500);
-											},
-											'uid='+_uid+'&name='+_name.value+'&group='+_group.value
-										);
-
+							 			if( elementIframe = document.getElementById('iframe_applet_jabberit') )
+							 			{
+											if( !is_ie )
+												result = elementIframe.contentDocument.applets[0].addContact( _uid, _name.value, _group.value );
+											else
+												result = elementIframe.contentWindow.document.applets[0].addContact( _uid, _name.value, _group.value );
+										}
+										else // If Pop-Up
+										{
+											result = _myWindow.document.applets[0].addContact( _uid, _name.value, _group.value );
+										}
+
+										_status.innerHTML = '<br/>Contato adicionado !<br/>';
+										setTimeout('cleanStatusAddContactIM();',2500);
+										
 										_name.value = '';
 										_group.value = '';
@@ -185,4 +191,6 @@
 				
 				var _name = document.getElementById('im_name');
+				var groups = "";
+				var data;
 
 				var first_name = document.getElementById(m).innerHTML;
@@ -195,19 +203,34 @@
 					_name.parentNode.nextSibling.nextSibling.innerHTML = '';
 				
-				_conn.go('$this.ujabber.getGroupsJabber',
-						function(data)
-						{
-							if( data = data.replace(/(^\s*)|(\s*$)/g,''))
-							{
-								var _group = document.getElementById('im_group');
-								var _groupOptions = '';
-
-								_group.setAttribute('selectBoxOptions', data);
-								if( document.getElementById('selectBox0') == null)
-									editS.create(document.getElementById('im_group'));
-							}
-							document.getElementById('__span_load_im_group').style.display = 'none';
-						});
-
+	 			// If Layer;
+	 			if( elementIframe = document.getElementById('iframe_applet_jabberit') )
+	 			{
+					if( !is_ie )
+						groups = elementIframe.contentDocument.applets[0].getGroupsToExpresso();
+					else
+						groups = elementIframe.contentWindow.document.applets[0].getGroupsToExpresso();
+				}
+				else // If Pop-Up
+				{
+					groups = _myWindow.document.applets[0].getGroupsToExpresso();
+				}
+		
+				if( typeof(groups) == 'object')
+				{
+					data = groups + ";";
+					data = data.substring(0,(data.length-2));
+				}
+				else			
+					data = groups.substring(0,(groups.length-1));
+				
+				if( data )
+				{
+					document.getElementById('im_group').setAttribute('selectBoxOptions', data);
+					
+					if( document.getElementById('selectBox0') == null )
+						editS.create(document.getElementById('im_group'));
+				}
+
+				document.getElementById('__span_load_im_group').style.display = 'none';
 				document.getElementById('im_group').value = '';
 				document.getElementById('im_group').focus();
@@ -228,5 +251,4 @@
 				_member = _member.nextSibling;
 			}
-		
 		}
 
@@ -280,7 +302,7 @@
 	function LDAP()
 	{
-		_conn = arguments[0];
-		_xtools = arguments[1];
-		_window = arguments[2];
+		_conn		= arguments[0];
+		_xtools		= arguments[1];
+		_window		= arguments[2];
 	}
 
