Index: sandbox/jabberit_messenger/trophy/xsl/contactsList.xsl
===================================================================
--- sandbox/jabberit_messenger/trophy/xsl/contactsList.xsl	(revision 2325)
+++ sandbox/jabberit_messenger/trophy/xsl/contactsList.xsl	(revision 2345)
@@ -15,5 +15,5 @@
 			
 			<div style="position: absolute; margin-top: -50px; margin-left: 75px;">
-				<button style="width:35px;" alt="Adicionar Contatos" title="Adicionar Contatos" onclick="alert('Adicionar Contatos');">
+				<button style="width:35px;" alt="Adicionar Contatos" title="Adicionar Contatos" onclick="loadIM.addContacts();">
 					<img src="images/users.png"/>
 				</button>
Index: sandbox/jabberit_messenger/trophy/xsl/itensGroup.xsl
===================================================================
--- sandbox/jabberit_messenger/trophy/xsl/itensGroup.xsl	(revision 2340)
+++ sandbox/jabberit_messenger/trophy/xsl/itensGroup.xsl	(revision 2345)
@@ -12,5 +12,5 @@
 	<xsl:template match="itens_group">
 
-			<div id="{$id}" onclick="TrophyIM.rosterClick('{$jid}');" style="background: url('images/{$presence}.gif')no-repeat center left; padding-left: 18px; margin:2px 0px 5px 10px; cursor:pointer;">
+			<div id="{$id}" onmousedown="loadIM.actionButton(event,'{$jid}');" style="background: url('images/{$presence}.gif')no-repeat center left; padding-left: 18px; margin:2px 0px 5px 10px; cursor:pointer;">
 				<xsl:value-of select="$nameContact"/> <br/>
 				<span style="font-size: 8pt; font-style:italic; display:{$statusDisplay};"><xsl:value-of select="$status"/></span>
Index: sandbox/jabberit_messenger/trophy/js/loadIM.js
===================================================================
--- sandbox/jabberit_messenger/trophy/js/loadIM.js	(revision 2339)
+++ sandbox/jabberit_messenger/trophy/js/loadIM.js	(revision 2345)
@@ -5,4 +5,38 @@
 	var _xtools			= null;
 	var zIndex			= 9001;
+
+	
+	function actionButton()
+	{
+		if( arguments.length > 0 )
+		{
+			var e 	= arguments[0];
+			var jid = arguments[1];
+		
+			if ( !e )
+				var e = window.event;
+			
+			( ( e.target ) ? e.target : e.srcElement ).oncontextmenu = function(e)
+			{
+				return false;
+			};
+	
+			if ( ( e.which && e.which > 1 ) || ( e.button && e.button > 1 ) )
+				optionsItensContact(e, jid);
+			else
+				TrophyIM.rosterClick(jid);
+		}
+	}
+
+	function addContacts()
+	{
+		/*
+		var jid		= 'contact@servidor_jabber';
+		var name	= 'Nome Contato';
+		var group	= 'CONTATOS';
+		
+		TrophyIM.addContacts( jid, name, group );
+		*/
+	}
 	
 	function configEvents(pObj, pEvent, pHandler)
@@ -18,53 +52,4 @@
 				pObj.attachEvent('on' + pEvent, pHandler);
 		}
-	}
-	
-	function TrophyIMChatArea()
-	{
-		/*
-		var winImChatArea = 
-		{
-			 id_window		: "window_chat_area",
-			 width			: 490,
-			 height			: 395,
-			 top			: 100,
-			 left			: 400,
-			 draggable		: true,
-			 visible		: "display",
-			 resizable		: true,
-			 zindex			: zIndex++,
-			 title			: "Mensagens - Expresso Messenger",
-			 closeAction	: "remove",
-			 content		: '<div id="trophyimchat"><div id="trophyimchattabs"/></div>'	
-		};
-		
-		_winBuild( winImChatArea );
-		
-		return '<div id="trophyimchat"><div id="trophyimchattabs"/></div>';
-		*/
-	}
-	
-	function TrophyIMChatBox()
-	{
-		var chatBox = '<div>' +
-						'<div id="trophyimchattabs"/>' +
-						'<div class="trophyimchatbox"/>' +
-							'<form name="chat" onsubmit="TrophyIM.sendMessage(this); return(false);">' +
-								'<textarea class="trophyimchatinput" rows="3" cols="50"></textarea>' +
-								'<input type="button" value="Send" onclick="TrophyIM.sendMessage(this)"/>' +
-							'</form>' +
-					   '</div>';
-		
-		return chatBox;
-	}
-	
-	function TrophyIMChatTab()
-	{
-        var chatTab	=	'<div class="trophyimchattab" onclick="TrophyIM.tabClick(this);">' +
-            				'<div class="trophyimchattabjid" />' +
-        					'<div class="trophyimtabclose" onclick="TrophyIM.tabClose(this);">X</div>' +
-            				'<div class="trophyimchattabname" />' +
-            			'</div>';
-		return chatTab;
 	}
 	
@@ -120,29 +105,8 @@
 	}
 	
-	function TrophyIMRosterGroup()
-	{
-		return '<div class="trophyimrostergroup"><div class="trophyimrosterlabel"/></div>';
-	}
-	
-	function TrophyIMRosterItem()
-	{
-		var rosterItem = '<div class="trophyimrosteritem" onclick="TrophyIM.rosterClick(this)">' + 
-        					'<div class="trophyimrosterjid" />' +
-        					'<div class="trophyimrostername" />' +
-        				 '</div>';
-        
-        return rosterItem;
-	}
-	
 	function HTMLSnippets( pType )
 	{
 		return new ( function( )
 		{
-			//this.chatArea		= TrophyIMChatArea;
-	
-			this.chatBox		= TrophyIMChatBox;
-	
-			this.chatTab		= TrophyIMChatTab;
-				
 			this.loggingDiv		= TrophyIMLoggingDiv;
 		
@@ -150,9 +114,4 @@
 				
 			this.rosterDiv		= TrophyIMRosterDiv;
-				
-			this.rosterGroup	= TrophyIMRosterGroup;
-	
-			this.rosterItem		= TrophyIMRosterItem;
-
 		} );
 	}
@@ -244,4 +203,44 @@
 	}
 
+	
+	function optionsItensContact()
+	{
+		if( arguments.length > 0 )
+		{
+			var element = ( arguments[0].target ) ? arguments[0].target : arguments[0].srcElement;
+			var jid 	= arguments[1];
+			
+			if( _showhidden == null )
+				_showhidden = new ShowHidden(300);
+
+			var _options = [
+			                	['Autorizar', 'Autorizar : ' + jid ],
+			                	['Remover', 'Remover : ' + jid ],
+			                	['Renomear', 'Renomear : ' + jid],
+			                	['Trocar grupo', 'Trocar grupo : ' + jid],
+						   ];
+
+			var _itens = "";
+			
+			for( var i in _options )
+			{
+				_itens += '<img src="images/arrow_right.gif"/><span style="cursor:pointer; margin:3px;" onclick="alert(\'' +_options[i][1] + '\');">';
+				_itens += _options[i][0] + '</span><br/>';
+			}
+			
+			var _optionsItens = document.createElement("div");
+				_optionsItens.setAttribute("style", "margin: -5px 0px 0px 20px;");
+				_optionsItens.className		= "x-menu";
+				_optionsItens.style.zIndex	= '99999';
+				_optionsItens.innerHTML		= _itens;  
+										  
+				_showhidden.action('onmouseover', 'onmouseout', _optionsItens);
+				
+			element.parentNode.onmouseout	= function(){ _showhidden.hiddenObject(false); };
+			element.parentNode.onmouseover	= function(){ _showhidden.hiddenObject(true); };
+			element.parentNode.appendChild( _optionsItens );
+		}
+		
+	}
 	
 	function setPresence()
@@ -310,5 +309,5 @@
 		           	 'js/show_hidden.js',
 		           	 'css/trophyim.css',
-		           	 'css/window_azul.css'
+		           	 //'css/window_azul.css'
 		           	 //'css/window_cataratas.css'
 		           	 //'css/window_celepar.css'
@@ -317,5 +316,5 @@
 		           	 //'css/window_escritorio.css'
 		           	 //'css/window_metropole.css'
-		           	 //'css/window_rochas.css'
+		           	 'css/window_rochas.css'
 		            ];
 		
@@ -324,4 +323,6 @@
 	}
 	
+	loadIM.prototype.actionButton		= actionButton;
+	loadIM.prototype.addContacts		= addContacts;
 	loadIM.prototype.configEvents		= configEvents;
 	loadIM.prototype.getZIndex			= getZindex;
Index: sandbox/jabberit_messenger/trophy/js/trophyim.js
===================================================================
--- sandbox/jabberit_messenger/trophy/js/trophyim.js	(revision 2340)
+++ sandbox/jabberit_messenger/trophy/js/trophyim.js	(revision 2345)
@@ -61,23 +61,14 @@
  *
  */
+
 HTMLSnippets = {
 
-		//chatArea	: loadIM.HTMLSnippets.chatArea( ),
-		
-        chatBox		: loadIM.HTMLSnippets.chatBox( ),
-
-        chatTab		: loadIM.HTMLSnippets.chatTab( ),
-		
-		//loginPage	: loadIM.HTMLSnippets.loginPage( ),
-    
+        //chatBox		: loadIM.HTMLSnippets.chatBox( ),
+
+        //chatTab		: loadIM.HTMLSnippets.chatTab( ),
+
         loggingDiv	: loadIM.HTMLSnippets.loggingDiv( ),
     
         rosterDiv	: loadIM.HTMLSnippets.rosterDiv( ),
-    
-        rosterGroup	: loadIM.HTMLSnippets.rosterGroup( ),
-        
-        rosterItem	: loadIM.HTMLSnippets.rosterItem( ),
-    
-        //statusDiv	: loadIM.HTMLSnippets.statusDiv( ),
 };
 
@@ -535,8 +526,9 @@
      *  Roster iq handler
      */
-    onRoster : function(msg) {
+    onRoster : function(msg)
+	{
         Strophe.debug("Roster handler");
         var roster_items = msg.firstChild.getElementsByTagName('item');
-        for (var i = 0; i < roster_items.length; i++) {
+		for (var i = 0; i < roster_items.length; i++) {
             var groups = roster_items[i].getElementsByTagName('group');
             var group_array = new Array();
@@ -656,4 +648,26 @@
 		);
     },
+
+	/** Function addContacts
+	 * 
+	 *  Parameters:
+	 *  	(string) jid 
+	 * 		(string) name
+	 * 		(string) group	 
+	 */
+	
+	addContacts : function( jid, name, group )
+	{
+		var newPresence = $pres({from:'alexandrecorreia@ecelepar10612.celepar.parana', to: jid, type: 'subscribe'}).tree();
+		
+		TrophyIM.connection.send(newPresence);
+
+		var newContact = $iq({type: 'set', id: 'set1'});
+			newContact = newContact.c('query').attrs({xmlns : 'jabber:iq:roster'});
+			newContact = newContact.c('item').attrs({jid: jid, name: name, ask:'subscribe', subscription :'none'});
+			newContact = newContact.c('group').t(group).tree();
+
+		TrophyIM.connection.send(newContact);
+	},
 
     /** Function: addMessage
@@ -878,5 +892,5 @@
 		if( arguments.length > 0 )
 		{
-			TrophyIM.connection.send($pres( ).c('show').t(arguments[0]));
+			TrophyIM.connection.send($pres( ).c('show').t(arguments[0]).tree());
 		}
 	},
@@ -1326,90 +1340,4 @@
 }
 
-/** Function: getElementsByClassName
- *
- *  DOMObject.getElementsByClassName implementation for browsers that don't
- *  support it yet.
- *
- *  Developed by Robert Nyman, http://www.robertnyman.com
- *  Code/licensing: http://code.google.com/p/getelementsbyclassname/
-*/
-var getElementsByClassName = function (className, tag, elm){
-    if (document.getElementsByClassName) {
-        getElementsByClassName = function (className, tag, elm) {
-            elm = elm || document;
-            var elements = elm.getElementsByClassName(className),
-                nodeName = (tag)? new RegExp("\\b" + tag + "\\b", "i") : null,
-                returnElements = [],
-                current;
-            for(var i=0, il=elements.length; i<il; i+=1){
-                current = elements[i];
-                if(!nodeName || nodeName.test(current.nodeName)) {
-                    returnElements.push(current);
-                }
-            }
-            return returnElements;
-        };
-    } else if (document.evaluate) {
-        getElementsByClassName = function (className, tag, elm) {
-            tag = tag || "*";
-            elm = elm || document;
-            var classes = className.split(" "),
-                classesToCheck = "",
-                xhtmlNamespace = "http://www.w3.org/1999/xhtml",
-                namespaceResolver = (document.documentElement.namespaceURI ===
-                    xhtmlNamespace)? xhtmlNamespace : null,
-                returnElements = [],
-                elements,
-                node;
-            for(var j=0, jl=classes.length; j<jl; j+=1){
-                classesToCheck += "[contains(concat(' ', @class, ' '), ' " +
-                    classes[j] + " ')]";
-            }
-            try {
-                elements = document.evaluate(".//" + tag + classesToCheck,
-                    elm, namespaceResolver, 0, null);
-            } catch (e) {
-                elements = document.evaluate(".//" + tag + classesToCheck,
-                    elm, null, 0, null);
-            }
-            while ((node = elements.iterateNext())) {
-                returnElements.push(node);
-            }
-            return returnElements;
-        };
-    } else {
-        getElementsByClassName = function (className, tag, elm) {
-            tag = tag || "*";
-            elm = elm || document;
-            var classes = className.split(" "),
-                classesToCheck = [],
-                elements = (tag === "*" && elm.all)? elm.all :
-                     elm.getElementsByTagName(tag),
-                current,
-                returnElements = [],
-                match;
-            for(var k=0, kl=classes.length; k<kl; k+=1){
-                classesToCheck.push(new RegExp("(^|\\s)" + classes[k] +
-                    "(\\s|$)"));
-            }
-            for(var l=0, ll=elements.length; l<ll; l+=1){
-                current = elements[l];
-                match = false;
-                for(var m=0, ml=classesToCheck.length; m<ml; m+=1){
-                    match = classesToCheck[m].test(current.className);
-                    if (!match) {
-                        break;
-                    }
-                }
-                if (match) {
-                    returnElements.push(current);
-                }
-            }
-            return returnElements;
-        };
-    }
-    return getElementsByClassName(className, tag, elm);
-};
-
 /**
  *
