Index: /trunk/expressoMail1_2/templates/xsl/sharedFolders.xsl
===================================================================
--- /trunk/expressoMail1_2/templates/xsl/sharedFolders.xsl	(revision 5458)
+++ /trunk/expressoMail1_2/templates/xsl/sharedFolders.xsl	(revision 5458)
@@ -0,0 +1,107 @@
+<?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="button_1" />
+	<xsl:param name="button_2" />
+	<xsl:param name="Note_This_sharing_will_take_action_on_all_of_your_folders_and_messages" />
+	<xsl:param name="Organization" />
+	<xsl:param name="Search_user" />
+	<xsl:param name="Users" />
+	<xsl:param name="Your_mailbox_is_shared_with" />
+	<xsl:param name="Access_right" />
+	<xsl:param name="Read"/>
+	<xsl:param name="Exclusion"/>
+	<xsl:param name="Write"/>
+	<xsl:param name="Send"/>
+	<xsl:param name="Save"/>
+	
+	<xsl:param name="hlp_msg_read_acl"/>
+	<xsl:param name="hlp_msg_delmov_acl"/>
+	<xsl:param name="hlp_msg_addcreate_acl"/>
+	<xsl:param name="hlp_msg_sendlike_acl"/>
+	<xsl:param name="hlp_msg_savelike_acl"/>
+		
+	<xsl:template match="sharedFolders">
+		
+		<div style="margin:5px; height: 390px !important;">
+			<div style="margin-bottom:2px;">
+				<div style="margin-top:5px;">
+					<label style="margin-right:5px;">
+						<xsl:value-of select="$Organization" />
+					</label>
+					
+					<select id="em_combo_org" style="margin-right: 20px;" />
+					
+					<label style="color:red;">
+						<xsl:value-of select="$Note_This_sharing_will_take_action_on_all_of_your_folders_and_messages" />
+					</label>
+					
+				</div>
+				
+				<div style="margin-top:10px;">
+					<label style="margin-right:5px;"><xsl:value-of select="$Search_user" /></label><br/> 
+					<input id="em_input_searchUser" size="35" autocomplete="off" onkeyup="javascript:sharemailbox.optionFinderTimeout(this, event);" />
+					<span style="margin-left:2px; color:red;" id="em_span_searching" />
+				</div>
+			</div>
+		
+			<br clear="all"/>
+
+			<div style="position:absolute; float:left;">
+				<label style="font-size:8pt;"><xsl:value-of select="$Users"/></label><br/>
+				<select id="em_select_available_users" size="13" style="width:250px; height:190px;" multiple="true"/>
+			</div>
+			
+			<div style="position:absolute; left: 267px">
+				<div style="margin-top:60px;">
+					<input type="button" onclick="javascript:sharemailbox.add_user();" value="{$button_1}" class="button ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" />
+				</div>
+				
+				<div style="margin-top:10px;">
+					<input type="button" onclick="javascript:sharemailbox.remove_user();" value="{$button_2}" class="button ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" />
+				</div>
+			</div>
+			
+			<div style="position:absolute; left:330px;">
+				<label style="font-size:8pt;"><xsl:value-of select="$Your_mailbox_is_shared_with"/></label>
+				<br/>
+				<select id="em_select_sharefolders_users" onclick="sharemailbox.getaclfromuser(this.value);" size="13" style="width:250px; height:190px;"/>
+			</div>
+			
+		
+			<div style="position:absolute; left:600px;">
+				<label style="font-size:8pt;"><xsl:value-of select="$Access_right"/></label>
+				<br/>
+				<div style="border:1px solid #cecece;font-size: 8pt;">
+					<div>
+						<img title="hlp_msg_read_acl" src="./templates/default/images/ajuda.jpg" /><label>-</label>
+						<input id="em_input_readAcl" onClick="return sharemailbox.setaclfromuser();" type="checkbox" />
+						<label><xsl:value-of select="$Read"/></label>
+					</div>
+					<div>
+						<img title="hlp_msg_delmov_acl" src="./templates/default/images/ajuda.jpg" /><label>-</label>
+						<input id="em_input_deleteAcl" onClick="return sharemailbox.setaclfromuser();" type="checkbox"/>
+						<label><xsl:value-of select="$Exclusion"/></label>
+					</div>
+					<div>
+						<img title="hlp_msg_addcreate_acl" src="./templates/default/images/ajuda.jpg" /><label>-</label>
+						<input id="em_input_writeAcl" onClick="return sharemailbox.setaclfromuser();" type="checkbox" />
+						<label><xsl:value-of select="$Write"/></label>
+					</div>
+					<div>
+						<img title="hlp_msg_sendlike_acl" src="./templates/default/images/ajuda.jpg" /><label>-</label>
+						<input id="em_input_sendAcl" onClick="return sharemailbox.setaclfromuser();" type="checkbox"/>
+						<label><xsl:value-of select="$Send"/></label>
+					</div>
+					<div>
+						<img title="hlp_msg_savelike_acl" src="./templates/default/images/ajuda.jpg"/><label>-</label>
+						<input id="em_input_saveAcl" onClick="return sharemailbox.setaclfromuser();" type="checkbox" />
+						<label><xsl:value-of select="$Save"/></label>
+					</div>
+				</div>
+			</div>
+		</div>
+		
+	</xsl:template>
+</xsl:stylesheet>
Index: /trunk/expressoMail1_2/setup/phpgw_pt-br.lang
===================================================================
--- /trunk/expressoMail1_2/setup/phpgw_pt-br.lang	(revision 5443)
+++ /trunk/expressoMail1_2/setup/phpgw_pt-br.lang	(revision 5458)
@@ -446,4 +446,5 @@
 Sector	expressoMail1_2	pt-br	Setor
 Seen	expressoMail1_2	pt-br	Lida
+Select a user!	expressoMail1_2	pt-br	Selecione um usuário!
 Select a folder!	expressoMail1_2	pt-br	Selecione uma pasta!
 Select a folder	expressoMail1_2	pt-br	Selecione uma pasta
Index: /trunk/expressoMail1_2/js/sharemailbox.js
===================================================================
--- /trunk/expressoMail1_2/js/sharemailbox.js	(revision 5134)
+++ /trunk/expressoMail1_2/js/sharemailbox.js	(revision 5458)
@@ -1,7 +1,5 @@
 	function cShareMailbox()
 	{
-		this.arrayWin = new Array();
-		this.el;
-		this.alert = false;
+		this.xtools 		= new xtools('../expressoMail1_2/templates/');
 	}
 
@@ -37,18 +35,19 @@
 		var handler_getaclfromuser = function(data)
 		{
-			Element('em_input_readAcl').checked = false;
-			Element('em_input_deleteAcl').checked = false;
-			Element('em_input_writeAcl').checked = false;
-			Element('em_input_sendAcl').checked = false;
-			Element('em_input_saveAcl').checked = false;
-			Element('em_input_saveAcl').disabled = true;
-                        Element('em_input_deleteAcl').disabled = true;
-                        Element('em_input_writeAcl').disabled = true;
+			Element('em_input_readAcl').checked		= false;
+			Element('em_input_deleteAcl').checked	= false;
+			Element('em_input_writeAcl').checked	= false;
+			Element('em_input_sendAcl').checked		= false;
+			Element('em_input_saveAcl').checked		= false;
+			
+			Element('em_input_saveAcl').disabled	= true;
+            Element('em_input_deleteAcl').disabled	= true;
+            Element('em_input_writeAcl').disabled	= true;
 			
 			if (data[user].indexOf('lrs',0) >= 0)
 			{
 				Element('em_input_sendAcl').disabled = false;
-                                Element('em_input_deleteAcl').disabled = false;
-                                Element('em_input_writeAcl').disabled = false ;
+				Element('em_input_deleteAcl').disabled = false;
+                Element('em_input_writeAcl').disabled = false ;
 				Element('em_input_readAcl').checked = true;
 			}
@@ -56,15 +55,16 @@
 			{
 				Element('em_input_sendAcl').disabled = true;
-				
-                        }
+			}
+			
 			if (data[user].indexOf('d',0) >= 0)
 			{
 				Element('em_input_deleteAcl').checked = true;
-                                Element('em_input_deleteAcl').disabled = false;
-			}
+				Element('em_input_deleteAcl').disabled = false;
+			}
+			
 			if (data[user].indexOf('wi',0) >= 0)
 			{
 				Element('em_input_writeAcl').checked = true;
-                                Element('em_input_writeAcl').disabled = false
+                Element('em_input_writeAcl').disabled = false
 			}
 			
@@ -74,13 +74,21 @@
 				Element('em_input_sendAcl').checked = true;
 			}
+			
 			if (data[user] != "false" && data[user].indexOf('p',0) >= 0)
 			{
 				Element('em_input_saveAcl').disabled = false;
 				Element('em_input_saveAcl').checked = true;
-			} 
-			if( data[user] != "false" && Element('em_input_writeAcl').checked && Element('em_input_sendAcl').checked ){
+			}
+			
+			if( data[user] != "false" && Element('em_input_writeAcl').checked && Element('em_input_sendAcl').checked )
+			{
 				Element('em_input_saveAcl').disabled = false;
-			} else Element('em_input_saveAcl').disabled = true;
-		}
+			}
+			else
+			{
+				Element('em_input_saveAcl').disabled = true;
+			}
+		}
+		
 		cExecute ("$this.imap_functions.getaclfromuser&user="+user, handler_getaclfromuser);
 	}
@@ -91,23 +99,27 @@
 		var select 	= Element('em_select_sharefolders_users');
 
-		if(select.selectedIndex == "-1"){
-			alert("Selecione antes um usuário!");
+		if( select.selectedIndex == "-1" )
+		{
+			alert(get_lang("Select a user!"));
 			return false;
 		}
+		
 		var user = select.options[select.selectedIndex].value;
 		
-		if (Element('em_input_readAcl').checked) {
-			Element('em_input_sendAcl').disabled = false;
-                        Element('em_input_deleteAcl').disabled = false;
-                        Element('em_input_writeAcl').disabled = false;
+		if ( Element('em_input_readAcl').checked ) 
+		{
+			Element('em_input_sendAcl').disabled	= false;
+			Element('em_input_deleteAcl').disabled	= false;
+            Element('em_input_writeAcl').disabled	= false;
 			acl = 'lrs';
 		}
-		else{
-			Element('em_input_sendAcl').disabled = true;
-			Element('em_input_sendAcl').checked = false;
-                        Element('em_input_deleteAcl').disabled = true;
-                        Element('em_input_deleteAcl').checked = false;
-                        Element('em_input_writeAcl').disabled = true;
-                        Element('em_input_writeAcl').checked = false;
+		else
+		{
+			Element('em_input_sendAcl').disabled	= true;
+			Element('em_input_sendAcl').checked		= false;
+			Element('em_input_deleteAcl').disabled	= true;
+            Element('em_input_deleteAcl').checked	= false;
+            Element('em_input_writeAcl').disabled	= true;
+            Element('em_input_writeAcl').checked	= false;
                         
 		}
@@ -140,176 +152,148 @@
 	}
 	
-	cShareMailbox.prototype.makeWindow = function(options)
-	{
-		_this = this;
-	
-		var el = document.createElement("DIV");
-		el.style.visibility = "hidden";
-		el.style.position = "absolute";
-		el.style.left = "0px";
-		el.style.top = "0px";
-		el.style.width = "0px";
-		el.style.height = "0px";
-		el.id = 'dJSWin_sharefolders';
-		document.body.appendChild(el);
-
-		if (Element('em_select_sharefolders_users'))
-		{
-			var select_users = Element('em_select_sharefolders_users');
-			select_users.innerHTML = '#' + options;
-			select_users.outerHTML = select_users.outerHTML;
-			
-			Element('em_input_readAcl').checked = false;
-			Element('em_input_deleteAcl').checked = false;
-			Element('em_input_writeAcl').checked = false;
-			Element('em_input_sendAcl').checked = false;
-			Element('em_input_saveAcl').checked = false;
-		}
-		else
-		{
-			el.innerHTML = "<table border=0><tbody><tr>"+
-							
-							"<td valign='bottom'>"+
-								'<font color="red">'+
-									get_lang('Note: This sharing will take action on all of your folders and messages.')+
-									'<br><br>'+
-								'</font>'+
-								get_lang('Your mailbox is shared with')
-								+":<br><br>"+
-								"<select onchange=sharemailbox.getaclfromuser(this.value); id='em_select_sharefolders_users' size='13' style='width:250px;height:200px'>" + options + "</select>"+
-							"</td>"+
-							
-							"<td>"+
-								'<br><br><br><br><br><br>'+
-								'<img onClick="javascript:sharemailbox.add_user();" src="templates/'+template+'/images/arrow_left.gif" style="vertical-align:middle;cursor:pointer;">' +
-								'<br><br>'+
-								'<img onClick="javascript:sharemailbox.remove_user();" src="templates/'+template+'/images/arrow_right.gif" style="vertical-align:middle;cursor:pointer;">' +
-							"</td>"+
-							
-							"<td valign='bottom'><br>"+
-								get_lang('Organization')+":&nbsp;" + 
-								"<select id='em_combo_org'></select>"+
-								
-								"<br><br>"+get_lang('Search user')+":<br>" +
-								'<input id="em_input_searchUser" size="35" autocomplete="off"  onkeyup="javascript:sharemailbox.optionFinderTimeout(this, event);"><br>'+
-								
-								'<font color="red"><span id="em_span_searching">&nbsp;</span></font><br>'+
-								
-								"<select id='em_select_available_users' style='width:250px;height:200px' multiple></select></td>"+
-							'</tr>'+
-							'<tr><td>'+
-								'<table border=0><tbody><tr><td colspan=2>'+
-									get_lang('Access right')+':'+
-								'</td></tr>'+
-								'<tr><td>'+get_lang('Read')+':</td><td><input id=\'em_input_readAcl\' onClick="return sharemailbox.setaclfromuser();" type="checkbox"><img title="'+get_lang("hlp_msg_read_acl")+'." src=\'./templates/'+template+'/images/ajuda.jpg\'></td></tr>'+
-								'<tr><td>'+get_lang('Exclusion')+':</td><td><input id=\'em_input_deleteAcl\' onClick="return sharemailbox.setaclfromuser();" type="checkbox"><img title="'+get_lang('hlp_msg_delmov_acl')+'." src=\'./templates/'+template+'/images/ajuda.jpg\'></td></tr>'+
-								'<tr><td>'+get_lang('Write')+':</td><td><input id=\'em_input_writeAcl\' onClick="return sharemailbox.setaclfromuser();" type="checkbox"><img title="'+get_lang('hlp_msg_addcreate_acl')+'." src=\'./templates/'+template+'/images/ajuda.jpg\'></td></tr>'+
-								'<tr><td>'+get_lang('Send')+':</td><td><input id=\'em_input_sendAcl\' onClick="return sharemailbox.setaclfromuser();" type="checkbox"><img title="'+get_lang('hlp_msg_sendlike_acl')+'." src=\'./templates/'+template+'/images/ajuda.jpg\'></td></tr>'+
-								'<tr><td>'+get_lang('Save')+':</td><td><input id=\'em_input_saveAcl\' onClick="return sharemailbox.setaclfromuser();" type="checkbox"><img title="'+get_lang('hlp_msg_savelike_acl')+'." src=\'./templates/'+template+'/images/ajuda.jpg\'></td></tr></tbody></table>'+
-							'</td></tr>'+
-			"</tbody></table>";
-		}
-
-		var handler_organizations = function(data){
-			var user_organization = Element('user_organization').value;
-			
-			for(i = 0; i < data.length; i++) {
-				Element('em_combo_org').options[i] = new Option(data[i].ou,data[i].dn);
-				if(data[i].ou.indexOf("dc=") != -1 || user_organization.toUpperCase() == data[i].ou.toUpperCase())
+	cShareMailbox.prototype.makeWindow =  function(optionsData)
+	{
+		var div  = null;
+		var args = null;
+		
+		args =
+		{
+			'button_1' : ">>",
+			'button_2' : "<<",
+			'Note_This_sharing_will_take_action_on_all_of_your_folders_and_messages' : get_lang('Note: This sharing will take action on all of your folders and messages.'),
+			'Organization' : get_lang('Organization'),
+			'Search_user'  : get_lang('Search user'),
+			'Users'		   : get_lang('Users'), 			
+			'Your_mailbox_is_shared_with' : get_lang('Your mailbox is shared with'),
+			'Access_right'			: get_lang('Access right'),
+			'Read'					: get_lang('Read'),
+			'Exclusion'				: get_lang('Exclusion'),
+			'Write'					: get_lang('Write'),
+			'Send'					: get_lang('Send'),
+			'Save'					: get_lang('Save'),
+			'hlp_msg_read_acl'		: get_lang('hlp_msg_read_acl'),
+			'hlp_msg_delmov_acl'	: get_lang('hlp_msg_delmov_acl'),
+			'hlp_msg_addcreate_acl'	: get_lang('hlp_msg_addcreate_acl'),
+			'hlp_msg_sendlike_acl'	: get_lang('hlp_msg_sendlike_acl'),
+			'hlp_msg_savelike_acl'	: get_lang('hlp_msg_savelike_acl')
+		};
+		
+		div					= document.createElement("div");
+		div.innerHTML		= this.xtools.parse(this.xtools.xml('sharedFolders'), 'sharedFolders.xsl', args );
+		div.setAttribute( "style","overflow:hidden");
+		
+		$(div).dialog(
+		{
+				resizable	: false,
+				title		: get_lang("Mailbox Sharing"),
+				position	: 'center',
+				width		: 750,
+				height		: 400,
+				modal		: false,
+				buttons		: [
+								{
+									text: get_lang("Close"),
+									click: function()
+									{
+										$(this).dialog("destroy");
+										div.removeChild(div.firstChild);
+									},
+									style: "margin-top: -2.1em" 
+								},
+								{
+									text: get_lang("Save"),
+									click: function()
+									{
+										// Needed select all options from select
+										var users_setacl = new Array();
+										var select_users = Element('em_select_sharefolders_users');
+
+										for(var i = 0; i < select_users.options.length; i++)
+										{
+											users_setacl[i] = select_users.options[i].value;
+										}
+										var attributes = connector.serialize(users_setacl);
+										
+										var handler_save = function(data)
+										{
+											if (data)
+											{
+												var sharedFoldersUsers = document.getElementById('em_select_sharefolders_users');
+												
+												for( var i = 0;i < sharedFoldersUsers.options.length; i++ )
+												{
+													if( sharedFoldersUsers.options[i].selected )
+													{
+														var value	= sharedFoldersUsers.options[i].value;
+														var text	= sharedFoldersUsers.options[i].text;
+														sharedFoldersUsers.options[i].parentNode.removeChild(sharedFoldersUsers.options[i]);
+														sharedFoldersUsers.options[sharedFoldersUsers.options.length] = new Option( text, value, false, false);
+													}
+												}
+												
+												Element('em_input_readAcl').checked		= false;
+												Element('em_input_deleteAcl').checked	= false;
+												Element('em_input_writeAcl').checked	= false;
+												Element('em_input_sendAcl').checked		= false;
+												Element('em_input_saveAcl').checked		= false;
+												
+									            Element('em_input_deleteAcl').disabled	= true;
+									            Element('em_input_writeAcl').disabled 	= true;
+												Element('em_input_sendAcl').disabled	= true;
+												Element('em_input_saveAcl').disabled 	= true;
+
+												write_msg(get_lang('Shared options saved with success'));
+											}
+										}
+										cExecute ("$this.imap_functions.setacl", handler_save, 'users='+attributes);
+									},
+									style: "margin-top: -2.1em" 
+								}
+				],
+				beforeClose	: function()
+				{ 
+					$(this).dialog("destroy");
+					div.removeChild(div.firstChild);
+				}
+		});
+
+
+		setTimeout(function()
+		{
+			var handler_organizations = function(data)
+			{
+				var user_organization = Element('user_organization').value;
+				
+				for(i = 0; i < data.length; i++)
 				{
-					Element('em_combo_org').options[i].selected = true;
-					_this.get_available_users(data[i].dn);
+					Element('em_combo_org').options[i] = new Option(data[i].ou,data[i].dn);
+					
+					if(data[i].ou.indexOf("dc=") != -1 || user_organization.toUpperCase() == data[i].ou.toUpperCase())
+					{
+						Element('em_combo_org').options[i].selected = true;
+						sharemailbox.get_available_users(data[i].dn);
+					}
 				}
 			}
-		}
-		cExecute ("$this.ldap_functions.get_organizations2&referral=false", handler_organizations);
-
-		var butt = Element('dJSWin_wfolders_bok')
-		if (!butt){
-			butt = document.createElement('INPUT');
-			butt.id = 'dJSWin_wfolders_bok';
-			butt.type = 'button';
-			butt.value = get_lang('Save');
-			el.appendChild(butt);
-		}
-		butt.onclick = function ()
-		{
-			// Needed select all options from select
-			var users_setacl = new Array();
-			select_users = Element('em_select_sharefolders_users');
-			for(var i=0; i<select_users.options.length; i++)
-			{
-				users_setacl[i] = select_users.options[i].value;
-			}
-			attributes = connector.serialize(users_setacl);
-			
-			var handler_save = function(data)
-			{
-				if (data)
-				{
-					alert(get_lang('Shared options saved with success'));
-					sharemailbox.arrayWin[el.id].close();
-				}
-			}
-
-			cExecute ("$this.imap_functions.setacl", handler_save, 'users='+attributes);
-
-		}
-		
-		var space = document.createElement('SPAN');
-		space.innerHTML = "&nbsp;&nbsp;";
-		el.appendChild(space);
-		
-		var butt = document.createElement('BUTTON');
-		var buttext = document.createTextNode(get_lang('Close'));
-		butt.appendChild(buttext);
-		butt.onclick = function () {sharemailbox.arrayWin[el.id].close();};
-		el.appendChild(butt);
-		
-		_this.showWindow(el);
-	}
-	
-	cShareMailbox.prototype.showWindow = function (div)
-	{
-		if(! div) {
-			alert(get_lang('This list has no participants'));
-			return;
-		}
-		
-		if(! this.arrayWin[div.id])
-		{
-			div.style.height = "480px";
-			div.style.width = "540px";
-			var title = ":: "+get_lang("Mailbox Sharing")+" ::";
-			var wHeight = div.offsetHeight + "px";
-			var wWidth =  div.offsetWidth   + "px";
-			div.style.width = div.offsetWidth - 5;
-
-			win = new dJSWin({
-				id: 'win_'+div.id,
-				content_id: div.id,
-				width: wWidth,
-				height: wHeight,
-				title_color: '#3978d6',
-				bg_color: '#eee',
-				title: title,
-				title_text_color: 'white',
-				button_x_img: '../phpgwapi/images/winclose.gif',
-				border: true });
-			
-			this.arrayWin[div.id] = win;
-			win.draw();
-		}
-		else {
-			win = this.arrayWin[div.id];
-		}
-		Element('em_input_sendAcl').disabled = true;
-		Element('em_input_saveAcl').disabled = true;
-                Element('em_input_deleteAcl').disabled = true;
-                Element('em_input_writeAcl').disabled = true;
-		win.open();
+			
+			cExecute ("$this.ldap_functions.get_organizations2&referral=false", handler_organizations);
+			
+		},100);
+		
+		Element('em_input_sendAcl').disabled	= true;
+		Element('em_input_saveAcl').disabled	= true;
+		Element('em_input_deleteAcl').disabled	= true;
+		Element('em_input_writeAcl').disabled	= true;
+
+		var selectSharedFolders = Element('em_select_sharefolders_users');
+		
+		for( var i in optionsData )
+		{
+			selectSharedFolders.options[selectSharedFolders.options.length] = new Option(optionsData[i].cn, optionsData[i].uid, false, false);
+		}
 	}
 	
 	var finderTimeout = '';
+	
 	cShareMailbox.prototype.optionFinderTimeout = function(obj, event)
 	{
@@ -322,11 +306,10 @@
 	}
 	
-	cShareMailbox.prototype.optionFinder = function(id) {
+	cShareMailbox.prototype.optionFinder = function(id)
+	{
 			
 		var sentence = Element(id).value;
 		
-		var url = '$this.ldap_functions.get_available_users2&context=' +
-			    Element('em_combo_org').value +
-			    ( sentence ? '&sentence=' + sentence: '' );
+		var url = '$this.ldap_functions.get_available_users2&context=' + Element('em_combo_org').value + ( sentence ? '&sentence=' + sentence: '' );
 
 		return userFinder( sentence, 'em_select_available_users', url, 'em_span_searching');
@@ -371,5 +354,5 @@
 		}
 
-		if (new_options != '')
+		if ( new_options != '' )
 		{
 			select_users.innerHTML = '#' + new_options + select_users.innerHTML;
@@ -382,7 +365,11 @@
 		select_users = document.getElementById('em_select_sharefolders_users');
 	
-		for(var i = 0;i < select_users.options.length; i++)
-			if(select_users.options[i].selected)
+		for( var i = 0 ; i < select_users.options.length; i++ )
+		{
+			if( select_users.options[i].selected )
+			{
 				select_users.options[i--] = null;
+			}
+		}
 				
 		Element('em_input_readAcl').checked = false;
@@ -392,7 +379,5 @@
 		Element('em_input_saveAcl').checked = false;
 	}
-	
-	
+		
 /* Build the Object */
-	var sharemailbox;
-	sharemailbox = new cShareMailbox();
+var sharemailbox = new cShareMailbox();
Index: /trunk/expressoMail1_2/js/common_functions.js
===================================================================
--- /trunk/expressoMail1_2/js/common_functions.js	(revision 5456)
+++ /trunk/expressoMail1_2/js/common_functions.js	(revision 5458)
@@ -651,11 +651,7 @@
 	var handler_imap_getacl = function(data)
 	{
-		var options = '';
-		for (var x in data)
-		{
-			options += "<option value='"+data[x].uid+"'>"+data[x].cn+"</option>";
-		}
 		connector.loadScript("finder", "../services/");
 		connector.loadScript("sharemailbox");
+		
 		if (typeof(sharemailbox) == 'undefined')
 		{
@@ -663,5 +659,6 @@
 			return false;
 		}
-		sharemailbox.makeWindow(options);
+		
+		sharemailbox.makeWindow(data);
 	}
 	cExecute ("$this.imap_functions.getacl", handler_imap_getacl);
