Index: /trunk/phpgwapi/inc/class.expressolivre.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.expressolivre.inc.php	(revision 2704)
+++ /trunk/phpgwapi/inc/class.expressolivre.inc.php	(revision 2712)
@@ -27,4 +27,30 @@
 		);
 	}
+
+	function lang( $param )
+	{
+		$lang = ( array_key_exists( 'lang', $param ) ) ? $param[ 'lang' ] : false;
+		$module = ( array_key_exists( 'module', $param ) ) ? $param[ 'module' ] : false;
+
+		if ( ! ( $lang && $module ) )
+			return '{}';
+
+		$array_keys = array( );
+		$fn = dirname( __FILE__ ) . "/../../{$module}/setup/phpgw_{$lang}.lang";
+		$lang = array( );
+
+		if ( file_exists( $fn ) )
+		{
+			$fp = fopen( $fn, 'r' );
+			while ( $data = fgets( $fp, 16000 ) )
+			{
+				list( $message_id, $app_name, $null, $content ) = explode( "\t", substr( $data, 0, -1 ) );
+				$lang[ ] = '"' . str_replace( '"', '\"', strtolower( $message_id ) ) . '" : "' . str_replace( '"', '\"', $content ) . '"';
+			}
+			fclose( $fp );
+		}
+
+		return '{' . implode( ",\n", $lang ) . '}';
+	}
 }
 
Index: /trunk/phpgwapi/js/tools/xlink.js
===================================================================
--- /trunk/phpgwapi/js/tools/xlink.js	(revision 2710)
+++ /trunk/phpgwapi/js/tools/xlink.js	(revision 2712)
@@ -17,5 +17,7 @@
 			_action = window.location.protocol + '//' + window.location.host + _action;
 
-		if ( _action == _last_request )
+		var _post = ( arguments.length == 3 && arguments[ 2 ] && arguments[ 2 ].constructor == String ) ? arguments[ 2 ] : null;
+
+		if ( _post == null && _action == _last_request )
 			return false;
 
@@ -36,5 +38,6 @@
 			'access' : _action,
 			'cache' : _cache,
-			'handler' : _handler
+			'handler' : _handler,
+			'post' : _post
 		} );
 
@@ -148,6 +151,10 @@
 		_click( arguments[ 0 ],
 			(
-				( arguments.length > 1 && arguments[ 1 ].constructor == Boolean ) ?
+				( arguments.length > 1 && arguments[ 1 ] && arguments[ 1 ].constructor == Boolean ) ?
 					arguments[ 1 ] : false
+			),
+			(
+				( arguments.length > 2 && arguments[ 2 ] && arguments[ 2 ].constructor == String ) ?
+					arguments[ 2 ] : null
 			)
 		);
Index: /trunk/phpgwapi/js/tools/xobject.js
===================================================================
--- /trunk/phpgwapi/js/tools/xobject.js	(revision 2665)
+++ /trunk/phpgwapi/js/tools/xobject.js	(revision 2712)
@@ -21,5 +21,5 @@
 	String.prototype.trim = function( )
 	{
-		return this.replace( /^ +| +$/g, '' );
+		return this.replace( /^\s+|\s+$/g, '' );
 	};
 
Index: /trunk/phpgwapi/js/tools/xconnector.js
===================================================================
--- /trunk/phpgwapi/js/tools/xconnector.js	(revision 2685)
+++ /trunk/phpgwapi/js/tools/xconnector.js	(revision 2712)
@@ -218,5 +218,5 @@
 			'_ACCESS'	: _argv.access,
 			'_HANDLER'	: { },
-			'_POST'		: ( ( _argv.post ) ? _argv.post : false ),  // [GET | POST]
+			'_POST'		: ( ( _argv.post && _argv.post != null ) ? _argv.post : false ),  // [GET | POST]
 			'_MODE'		: 'TEXT', // [XML | TEXT]
 			'_TYPE'		: null,	// [4 for request | 3 for stream]
Index: /trunk/phpgwapi/js/expressolivre/expressolivre.js
===================================================================
--- /trunk/phpgwapi/js/expressolivre/expressolivre.js	(revision 2707)
+++ /trunk/phpgwapi/js/expressolivre/expressolivre.js	(revision 2712)
@@ -6,7 +6,30 @@
 	var _xlink = null;
 
+	window.array_lang = [ ];
+
+	var _language = [ ]
+
 	function _go( )
 	{
 		_xconnector.go.apply( _xconnector, arguments );
+	}
+
+	function _lang( )
+	{
+		if ( ! ( arguments.length && arguments[ 0 ].constructor == String ) )
+			return false;
+
+		var module = arguments[ 0 ];
+		var lang = document.getElementsByTagName( 'html' ).item( 0 ).getAttribute( 'xml:lang' );
+
+		_xconnector.go( {
+			'access' : 'phpgwapi.expressolivre.lang&lang=' + lang + '&module=' + module,
+			'handler' : function( data )
+			{
+				data = data.JSON( );
+				for ( var key in data )
+					window.array_lang[ key ] = _language[ key ] = data[ key ];
+			}
+		} );
 	}
 
@@ -31,4 +54,17 @@
 	}
 
+	function _translate( )
+	{
+		if ( ! ( arguments.length && arguments[ 0 ].constructor == String ) )
+			return false;
+
+		var _phrase = arguments[ 0 ];
+
+		if ( _language[ _phrase.toLowerCase( ) ] )
+			return _language[ _phrase.toLowerCase( ) ];
+		else
+			return _phrase + '*';
+	}
+
 	function _ExpressoLivre( )
 	{
@@ -36,8 +72,10 @@
 		{
 			this.go = _go;
+			this.lang = _lang;
 			this.link = _link;
 			this.path = _path;
 			this.theme = _theme;
 			this.template = _template;
+			this.translate = _translate;
 		} );
 	}
Index: /trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php	(revision 2604)
+++ /trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php	(revision 2712)
@@ -357,4 +357,5 @@
 			$script .= '</script>';
 
+			echo "<style>{$this -> css( )}</style>";
 			echo $script;
 
Index: /trunk/expressoAdmin1_2/inc/class.maillist.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.maillist.inc.php	(revision 585)
+++ /trunk/expressoAdmin1_2/inc/class.maillist.inc.php	(revision 2712)
@@ -35,5 +35,5 @@
 		function validate_fields($params)
 		{
-			return $this->ldap_functions->validate_fields_maillist($params);
+			return serialize( $this->ldap_functions->validate_fields_maillist($params) );
 		}
 		
Index: /trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php	(revision 2707)
+++ /trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php	(revision 2712)
@@ -126,5 +126,4 @@
 			$p->set_var($var);
 			$GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script_thirst' ] .= "<script>var expressoAdmin_controller = '{$GLOBALS[ 'phpgw' ] -> link( '/expressoAdmin1_2/controller.php' )}?action=';</script>";
-			//echo "<script>var expressoAdmin_controller = '{$GLOBALS[ 'phpgw' ] -> link( '/controller.php' )}?action=';</script>" . $GLOBALS['phpgw']->js->get_script_links( );
 			$p->pfp('out','body');
 		}
@@ -152,5 +151,4 @@
 			// Seta variaveis javascript necessárias
 			$webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url'];
-			$scripts_java = '<script type="text/javascript" src="'.$webserver_url.'/expressoAdmin1_2/js/jscode/expressoadmin.js"></script>';
 			
 			// App, create list of available apps
@@ -206,5 +204,6 @@
 				}
 			}
-			
+
+			$GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script_thirst' ] .= "<script>var expressoAdmin_controller = '{$GLOBALS[ 'phpgw' ] -> link( '/expressoAdmin1_2/controller.php' )}?action=';</script>";
 			echo $p->fp('out','form');
 		}
Index: /trunk/expressoAdmin1_2/inc/class.group.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.group.inc.php	(revision 587)
+++ /trunk/expressoAdmin1_2/inc/class.group.inc.php	(revision 2712)
@@ -34,5 +34,5 @@
 		function validate_fields($params)
 		{
-			return $this->ldap_functions->validate_fields_group($params);
+			return serialize( $this->ldap_functions->validate_fields_group($params) );
 		}
 		
Index: /trunk/expressoAdmin1_2/inc/class.uimaillists.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.uimaillists.inc.php	(revision 2459)
+++ /trunk/expressoAdmin1_2/inc/class.uimaillists.inc.php	(revision 2712)
@@ -41,4 +41,5 @@
 			$GLOBALS['phpgw']->js->validate_file('jscode','expressoadmin','expressoAdmin1_2');
 			$GLOBALS['phpgw']->js->validate_file('jscode','maillists','expressoAdmin1_2');
+			$GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script_thirst' ] .= "<script>var expressoAdmin_controller = '{$GLOBALS[ 'phpgw' ] -> link( '/expressoAdmin1_2/controller.php' )}?action=';</script>";
 		}
 		
@@ -167,6 +168,4 @@
 		function add_maillists()
 		{
-			$GLOBALS['phpgw']->js->set_onload('get_available_users(document.forms[0].org_context.value, document.forms[0].ea_check_allUsers.checked);');
-
 			$manager_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
 			$manager_acl = $this->functions->read_acl($manager_lid);
@@ -210,4 +209,6 @@
 			$p->set_var($var);
 			$p->set_var($this->functions->make_dinamic_lang($p, 'body'));
+
+			$GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script' ] .= "<script>get_available_users(document.forms[0].org_context.value, document.forms[0].ea_check_allUsers.checked);</script>";
 			$p->pfp('out','create_maillist');
 		}
Index: /trunk/expressoAdmin1_2/inc/class.functions.inc.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/class.functions.inc.php	(revision 1913)
+++ /trunk/expressoAdmin1_2/inc/class.functions.inc.php	(revision 2712)
@@ -416,5 +416,6 @@
 			ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
 			ldap_bind($ldap_conn,$dn,$passwd);
-			
+
+			$sort = array( );
 			if ($type == 'accounts')
 			{
Index: unk/expressoAdmin1_2/inc/load_lang.php
===================================================================
--- /trunk/expressoAdmin1_2/inc/load_lang.php	(revision 2364)
+++ 	(revision )
@@ -1,22 +1,0 @@
-<?php
-
-        /***************************************************************************
-        * Expresso Livre                                                           *
-        * http://www.expressolivre.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.                                              *
-        \**************************************************************************/
-	$lang = array();
-	if (!empty($_SESSION['phpgw_info']['expressoAdmin']['lang']))
-	{
-		foreach($_SESSION['phpgw_info']['expressoAdmin']['lang'] as $message_id=>$content)
-		{
-			$lang[str_replace(" ", "_", (strtolower($message_id)) )] = $content;
-		}
-	}
-	echo serialize($lang);
-	exit;
-?>
Index: /trunk/expressoAdmin1_2/js/jscode/institutional_accounts.js
===================================================================
--- /trunk/expressoAdmin1_2/js/jscode/institutional_accounts.js	(revision 2707)
+++ /trunk/expressoAdmin1_2/js/jscode/institutional_accounts.js	(revision 2712)
@@ -24,5 +24,5 @@
 	{
 		close_lightbox();
-		write_msg(get_lang('Institutional account successful created') + '.', 'normal');
+		write_msg( ExpressoLivre.translate( 'Institutional account successful created' ) + '.', 'normal');
 	}
 	return;
@@ -101,5 +101,5 @@
 	clearTimeout(finderTimeout);
 	var oWait = Element("ea_span_searching");
-	oWait.innerHTML = get_lang('searching') + '...';
+	oWait.innerHTML =  ExpressoLivre.translate( 'searching' ) + '...';
 	finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500);
 }
@@ -188,5 +188,5 @@
 function get_institutional_accounts_timeOut(input)
 {
-	var head_table = '<table border="0" width="90%"><tr bgcolor="#d3dce3"><td width="30%">'+get_lang("full name")+'</td><td width="30%">'+get_lang("mail")+'</td><td width="5%" align="center">'+get_lang("remove")+'</td></tr></table>';
+	var head_table = '<table border="0" width="90%"><tr bgcolor="#d3dce3"><td width="30%">'+ ExpressoLivre.translate( "full name" )+'</td><td width="30%">'+ ExpressoLivre.translate( "mail" )+'</td><td width="5%" align="center">'+ ExpressoLivre.translate( "remove" )+'</td></tr></table>';
 	
 	if (input.length > 4)
@@ -208,5 +208,5 @@
 		if (data.status == 'true')
 		{
-			var table = '<table border="0" width="90%"><tr bgcolor="#d3dce3"><td width="30%">'+get_lang("full name")+'</td><td width="30%">'+get_lang("mail")+'</td><td width="5%" align="center">'+get_lang("remove")+'</td></tr>'+data.trs+'</table>';
+			var table = '<table border="0" width="90%"><tr bgcolor="#d3dce3"><td width="30%">'+ ExpressoLivre.translate( "full name" )+'</td><td width="30%">'+ ExpressoLivre.translate( "mail" )+'</td><td width="5%" align="center">'+ ExpressoLivre.translate( "remove" )+'</td></tr>'+data.trs+'</table>';
 			Element('institutional_accounts_content').innerHTML = table;
 		}
@@ -293,5 +293,5 @@
 		get_institutional_accounts(Element('ea_institutional_account_search').value);
 		close_lightbox();
-		write_msg(get_lang('Institutional account successful saved') + '.', 'normal');
+		write_msg( ExpressoLivre.translate( 'Institutional account successful saved' ) + '.', 'normal');
 	}
 	return;
@@ -300,5 +300,5 @@
 function delete_institutional_accounts(uid)
 {
-	if (!confirm(get_lang('Are you sure that you want to delete this institutional account') + "?"))
+	if (!confirm( ExpressoLivre.translate( 'Are you sure that you want to delete this institutional account' ) + "?"))
 		return;
 	
@@ -311,5 +311,5 @@
 		else
 		{
-			write_msg(get_lang('Institutional account successful deleted') + '.', 'normal');
+			write_msg( ExpressoLivre.translate( 'Institutional account successful deleted' ) + '.', 'normal');
 			get_institutional_accounts(Element('ea_institutional_account_search').value);
 		}
Index: /trunk/expressoAdmin1_2/js/jscode/managers.js
===================================================================
--- /trunk/expressoAdmin1_2/js/jscode/managers.js	(revision 2030)
+++ /trunk/expressoAdmin1_2/js/jscode/managers.js	(revision 2712)
@@ -2,5 +2,5 @@
 function copy_manager(manager)
 {
-	if (!(new_manager = prompt(get_lang('Type new managers login') + ':',"")))
+	if (!(new_manager = prompt( ExpressoLivre.translate( 'Type new managers login' ) + ':',"")))
 	{
 		return;
@@ -12,5 +12,5 @@
 			location.reload();
 		else
-			alert(get_lang('Error at copy manager') + '.');
+			alert( ExpressoLivre.translate( 'Error at copy manager' ) + '.');
 	}
 	cExecute ('$this.db_functions.copy_manager&manager='+manager+'&new_manager='+new_manager, handler_copy_manager);
@@ -26,5 +26,5 @@
 		if (new_context_value.indexOf(children[i].value) != -1)
 		{
-			document.getElementById("ea_spam_warn").innerHTML = get_lang('Context already added or redundant') + '.';
+			document.getElementById("ea_spam_warn").innerHTML =  ExpressoLivre.translate( 'Context already added or redundant' ) + '.';
 			setTimeout("document.getElementById(\"ea_spam_warn\").innerHTML = '&nbsp;'", 4000);
 			return;
@@ -35,5 +35,5 @@
 			children[i].parentNode.parentNode.removeChild(children[i].parentNode);
 			--i;
-			document.getElementById("ea_spam_warn").innerHTML = get_lang('Removed context redundant') + '.';
+			document.getElementById("ea_spam_warn").innerHTML =  ExpressoLivre.translate( 'Removed context redundant' ) + '.';
 			setTimeout("document.getElementById(\"ea_spam_warn\").innerHTML = '&nbsp;'", 4000);
 		}
@@ -103,7 +103,7 @@
 	{
 		if (data.type == 'create')
-			alert(get_lang('User successful created') + '.');
+			alert( ExpressoLivre.translate( 'User successful created' ) + '.');
 		else
-			alert(get_lang('Manager successful saved') + '.');
+			alert( ExpressoLivre.translate( 'Manager successful saved' ) + '.');
 	}
 	location.href="./index.php?menuaction=expressoAdmin1_2.uimanagers.list_managers";
@@ -118,8 +118,8 @@
 	var spam = document.getElementById('ea_span_searching_manager');
 	if (manager_lid.length <= 3)
-		spam.innerHTML = get_lang('Type more') + ' ' + (4 - manager_lid.length) + ' ' + 'letters' + '.';
+		spam.innerHTML =  ExpressoLivre.translate( 'Type more' ) + ' ' + (4 - manager_lid.length) + ' ' + 'letters' + '.';
 	else
 	{
-		spam.innerHTML = get_lang('Searching') + '...';
+		spam.innerHTML =  ExpressoLivre.translate( 'Searching' ) + '...';
 		searchTimeout = setTimeout("search_user('"+manager_lid+"')",750);
 	}
Index: /trunk/expressoAdmin1_2/js/jscode/groups.js
===================================================================
--- /trunk/expressoAdmin1_2/js/jscode/groups.js	(revision 640)
+++ /trunk/expressoAdmin1_2/js/jscode/groups.js	(revision 2712)
@@ -7,10 +7,10 @@
 	
 	if (document.forms[0].cn.value == ''){
-		alert(get_lang('NAME field is empty') + '.');
+		alert( ExpressoLivre.translate( 'NAME field is empty' ) + '.');
 		return;
 	}
 		
 	if (document.forms[0].description.value == ''){
-		alert(get_lang('DESCRIPTION field is empty') + '.');
+		alert( ExpressoLivre.translate( 'DESCRIPTION field is empty' ) + '.');
 		return;
 	}
@@ -21,8 +21,8 @@
 		if ( (cn_tmp.length < 3) || ((cn_tmp[0] != 'grupo') && (cn_tmp[0] != 'smb')) ){
 			alert(
-				get_lang('NAME field is incomplete') + '.\n' +
-				get_lang('the name field must be formed like') + ':\n' +
-				get_lang('group') + '-' + get_lang('organization') + '-' + get_lang('group name') + '.\n' +
-				get_lang('eg') + ': ' + 'grupo-celepar-rh.');
+				 ExpressoLivre.translate( 'NAME field is incomplete' ) + '.\n' +
+				 ExpressoLivre.translate( 'the name field must be formed like' ) + ':\n' +
+				 ExpressoLivre.translate( 'group' ) + '-' +  ExpressoLivre.translate( 'organization' ) + '-' +  ExpressoLivre.translate( 'group name' ) + '.\n' +
+				 ExpressoLivre.translate( 'eg' ) + ': ' + 'grupo-celepar-rh.');
 			return;
 		}
@@ -33,5 +33,5 @@
 	
 	if(!reCn.test(document.forms[0].cn.value)){
-		alert(get_lang('NAME field contains characters not allowed') + '.');
+		alert( ExpressoLivre.translate( 'NAME field contains characters not allowed' ) + '.');
 		document.forms[0].cn.focus();
 		return;
@@ -39,5 +39,5 @@
 
 	if(!reDesc.test(document.forms[0].description.value)){
-		alert(get_lang('DESCRIPTION field contains characters not allowed') + '.');
+		alert( ExpressoLivre.translate( 'DESCRIPTION field contains characters not allowed' ) + '.');
 		document.forms[0].description.focus();
 		return;
@@ -47,5 +47,5 @@
 	if ( (document.forms[0].email.value != '') && (!reEmail.test(document.forms[0].email.value)) )
 	{
-		alert(get_lang('EMAIL field is empty') + '.');
+		alert( ExpressoLivre.translate( 'EMAIL field is empty' ) + '.');
 		return false;
 	}
@@ -53,4 +53,5 @@
 	var handler_validate_fields = function(data)
 	{
+		data = expresso.connector.unserialize( data.trim( ) );
 		if (!data.status)
 			alert(data.msg);
@@ -71,5 +72,8 @@
 	// O CN do grupo foi alterado ou é um novo grupo.
 	if ((document.forms[0].old_cn.value != document.forms[0].cn.value) || (type == 'create_group')){
-		cExecute ('$this.group.validate_fields&cn='+document.forms[0].cn.value, handler_validate_fields);
+		ExpressoLivre.go( {
+			"access" : 'expressoAdmin1_2.group.validate_fields&cn='+document.forms[0].cn.value,
+			"handler" : handler_validate_fields
+		} );
 	}
 	else if (type == 'edit_group')
@@ -90,5 +94,5 @@
 		alert(data.msg);
 	else{
-		alert(get_lang('Group successful created') + '.');
+		alert( ExpressoLivre.translate( 'Group successful created' ) + '.');
 		location.href="./index.php?menuaction=expressoAdmin1_2.uigroups.list_groups";
 	}
@@ -107,5 +111,5 @@
 		alert(data.msg);
 	else{
-		alert(get_lang('Group successful saved') + '.');
+		alert( ExpressoLivre.translate( 'Group successful saved' ) + '.');
 		location.href="./index.php?menuaction=expressoAdmin1_2.uigroups.list_groups";
 	}
@@ -156,5 +160,5 @@
 	if ((recursive) && (document.forms[0].ldap_context.value == document.getElementById('ea_combo_org_groups').value))
 	{
-		alert(get_lang('It is not allow select all users from the root organization') + '.');
+		alert( ExpressoLivre.translate( 'It is not allow select all users from the root organization' ) + '.');
 		document.getElementById('ea_check_allUsers').checked = false;
 
@@ -165,5 +169,8 @@
 		return;
 	}
-	cExecute ('$this.ldap_functions.get_available_users&context='+context+'&recursive='+recursive, handler_get_available_users);
+	ExpressoLivre.go( {
+		"access" : 'expressoAdmin1_2.ldap_functions.get_available_users&context='+escape(context)+'&recursive='+recursive,
+		"handler" : handler_get_available_users
+	} );
 }
 
@@ -241,5 +248,5 @@
 	clearTimeout(finderTimeout);	
 	var oWait = document.getElementById("ea_span_searching");
-	oWait.innerHTML = get_lang('Searching') + '...';
+	oWait.innerHTML =  ExpressoLivre.translate( 'Searching' ) + '...';
 	var finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500);
 }
@@ -270,5 +277,5 @@
 function delete_group(cn, gidnumber)
 {
-	if (confirm(get_lang('Do you really want delete the group') + ' ' + cn + " ??"))
+	if (confirm( ExpressoLivre.translate( 'Do you really want delete the group' ) + ' ' + cn + " ??"))
 	{
 		var handler_delete_group = function(data)
@@ -277,5 +284,5 @@
 				alert(data.msg);
 			else
-				alert(get_lang('Group success deleted') + '.');
+				alert( ExpressoLivre.translate( 'Group success deleted' ) + '.');
 			
 			location.href="./index.php?menuaction=expressoAdmin1_2.uigroups.list_groups";
Index: /trunk/expressoAdmin1_2/js/jscode/expressoadmin.js
===================================================================
--- /trunk/expressoAdmin1_2/js/jscode/expressoadmin.js	(revision 2707)
+++ /trunk/expressoAdmin1_2/js/jscode/expressoadmin.js	(revision 2712)
@@ -9,30 +9,15 @@
 	\************************************************************************************/
 
-function load_lang(){
-	_controller.cache( ).go( {
-		"access" : "$this/inc/load_lang",
-		"handler" : function( data )
-		{
-			handler_load_lang( expresso.connector.unserialize( data ) );
-		}
-	} );
-}
+ExpressoLivre.lang( 'expressoAdmin1_2' );
 
 var global_langs = new Array();
 var emailSugestion = 1;
 
-function handler_load_lang(data)
-{
-	global_langs = eval(data);
-}
-
-function get_lang(key_raw)
-{
-	key = key_raw.replace(/ /g,"_");
-	key = key.replace(/-/g,"");
-	lang = eval("global_langs."+key.toLowerCase());
-	
+function get_lang( key )
+{
+	var lang = array_lang[ key.toLowerCase( ) ];
+
 	if (typeof(lang)=='undefined')
-		return key_raw + '*';
+		return key + '*';
 	else
 		return lang;
@@ -229,3 +214,2 @@
 		campo.value = vr.substr( 0, tam - 1 );
 }
-load_lang();
Index: /trunk/expressoAdmin1_2/js/jscode/maillists.js
===================================================================
--- /trunk/expressoAdmin1_2/js/jscode/maillists.js	(revision 482)
+++ /trunk/expressoAdmin1_2/js/jscode/maillists.js	(revision 2712)
@@ -6,10 +6,10 @@
 
 	if (document.forms[0].uid.value == ''){
-		alert(get_lang('login field is empty') + '.');
+		alert( ExpressoLivre.translate( 'login field is empty' ) + '.');
 		return;
 	}
 
 	if (document.forms[0].cn.value == ''){
-		alert(get_lang('name field is empty') + '.');
+		alert( ExpressoLivre.translate( 'name field is empty' ) + '.');
 		return;
 	}
@@ -20,8 +20,8 @@
 		if ((uid_tmp.length < 3) || (uid_tmp[0] != 'lista')){
 			alert(
-				get_lang('login field is incomplete') + '.\n' +
-				get_lang('the login field must be formed like') + ':\n' +
-				get_lang('list') + '-' + get_lang('organization') + '-' + get_lang('listname') + '.\n' +
-				get_lang('eg') + ': ' + 'lista-celepar-rh.');
+				 ExpressoLivre.translate( 'login field is incomplete' ) + '.\n' +
+				 ExpressoLivre.translate( 'the login field must be formed like' ) + ':\n' +
+				 ExpressoLivre.translate( 'list' ) + '-' +  ExpressoLivre.translate( 'organization' ) + '-' +  ExpressoLivre.translate( 'listname' ) + '.\n' +
+				 ExpressoLivre.translate( 'eg' ) + ': ' + 'lista-celepar-rh.');
 			return;
 		}
@@ -29,5 +29,5 @@
 		
 	if (document.forms[0].uid.value.split(" ").length > 1){
-		alert(get_lang('LOGIN field contains characters not allowed') + '.');
+		alert( ExpressoLivre.translate( 'LOGIN field contains characters not allowed' ) + '.');
 		document.forms[0].uid.focus();
 		return;
@@ -35,5 +35,5 @@
 	
 	if (document.forms[0].mail.value == ''){
-		alert(get_lang('EMAIL field is empty') + '.');
+		alert( ExpressoLivre.translate( 'EMAIL field is empty' ) + '.');
 		document.forms[0].mail.focus();
 		return;
@@ -41,5 +41,5 @@
 	var reEmail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
 	if(!reEmail.test(document.forms[0].mail.value)){
-		alert(get_lang('Email field is not valid') + '.');
+		alert( ExpressoLivre.translate( 'Email field is not valid' ) + '.');
 		return false;
 	}
@@ -47,5 +47,5 @@
 	select_userInMaillist = document.getElementById('ea_select_usersInMaillist');
 	if (select_userInMaillist.options.length == 0){
-		alert(get_lang('Any user is in the list') + '.');
+		alert( ExpressoLivre.translate( 'Any user is in the list' ) + '.');
 		return;
 	}
@@ -53,4 +53,5 @@
 	var handler_validate_fields = function(data)
 	{
+		data = expresso.connector.unserialize( data.trim( ) );
 		if (!data.status)
 			alert(data.msg);
@@ -76,5 +77,8 @@
 	// O UID da lista foi alterado ou é uma nova lista.
 	if ((document.forms[0].old_uid.value != document.forms[0].uid.value) || (type == 'create_maillist')){
-		cExecute ('$this.maillist.validate_fields&uid='+document.forms[0].uid.value+'&mail='+document.forms[0].mail.value, handler_validate_fields);
+		ExpressoLivre.go( {
+			"access" : 'expressoAdmin1_2.maillist.validate_fields&uid='+document.forms[0].uid.value+'&mail='+document.forms[0].mail.value,
+			"handler" : handler_validate_fields
+		} );
 	}
 	else if (type == 'edit_maillist')
@@ -95,5 +99,5 @@
 		alert(data.msg);
 	else{
-		alert(get_lang('Email list successful created') + '.');
+		alert( ExpressoLivre.translate( 'Email list successful created' ) + '.');
 		location.href="./index.php?menuaction=expressoAdmin1_2.uimaillists.list_maillists";
 	}
@@ -109,8 +113,9 @@
 function return_handler_save(data)
 {
+	alert( data );
 	if (!data.status)
 		alert(data.msg);
 	else{
-		alert(get_lang('Email list successful saved') + '.');
+		alert( ExpressoLivre.translate( 'Email list successful saved' ) + '.');
 		location.href="./index.php?menuaction=expressoAdmin1_2.uimaillists.list_maillists";
 	}
@@ -137,5 +142,5 @@
 		alert(data.msg);
 	else
-		alert(get_lang('SCL successful saved') + '.');
+		alert( ExpressoLivre.translate( 'SCL successful saved' ) + '.');
 	location.href="./index.php?menuaction=expressoAdmin1_2.uimaillists.list_maillists";
 	return;
@@ -181,11 +186,11 @@
 		}
 	}
-	
+
 	//Impede chamada recursiva na raiz das organizações
 	if ((recursive) && (document.forms[0].ldap_context.value == document.getElementById('ea_combo_org_maillists').value))
 	{
-		alert(get_lang('It is not allow select all users from the root organization') + '.');
+		alert( ExpressoLivre.translate( 'It is not allow select all users from the root organization' ) + '.');
 		document.getElementById('ea_check_allUsers').checked = false;
-		
+
 		// Limpa select
 		select_available_users = document.getElementById('ea_select_available_users');
@@ -194,5 +199,8 @@
 		return;
 	}
-	cExecute ('$this.ldap_functions.get_available_users_and_maillist&context='+context+'&recursive='+recursive+'&denied_uidnumber='+document.forms[0].uidnumber.value, handler_get_available_users);
+	ExpressoLivre.go( {
+		"access" : 'expressoAdmin1_2.ldap_functions.get_available_users_and_maillist&context='+escape(context)+'&recursive='+recursive+'&denied_uidnumber='+document.forms[0].uidnumber.value,
+		"handler" : handler_get_available_users
+	} );
 }
 
@@ -325,5 +333,5 @@
 	clearTimeout(finderTimeout);	
 	var oWait = document.getElementById("ea_span_searching");
-	oWait.innerHTML = get_lang('Searching') + '...';
+	oWait.innerHTML =  ExpressoLivre.translate( 'Searching' ) + '...';
 	finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500);
 }
@@ -358,5 +366,5 @@
 function delete_maillist(uid, uidnumber)
 {
-	if (confirm(get_lang('Do you really want delete the email list') + ' ' + uid + " ??"))
+	if (confirm( ExpressoLivre.translate( 'Do you really want delete the email list' ) + ' ' + uid + " ??"))
 	
 	{
@@ -366,5 +374,5 @@
 				alert(data.msg);
 			else
-				alert(get_lang('Email list successful deleted') + '.');
+				alert( ExpressoLivre.translate( 'Email list successful deleted' ) + '.');
 			
 			location.href="./index.php?menuaction=expressoAdmin1_2.uimaillists.list_maillists";
@@ -414,4 +422,7 @@
 	for (x in array_dn)
 	{
+		if ( array_dn[ x ].constructor == Function )
+			continue;
+
 		var tmp = array_dn[x].split("=");
 		ufn += tmp[1] + '.';
Index: /trunk/expressoAdmin1_2/js/jscode/users.js
===================================================================
--- /trunk/expressoAdmin1_2/js/jscode/users.js	(revision 2604)
+++ /trunk/expressoAdmin1_2/js/jscode/users.js	(revision 2712)
@@ -8,9 +8,9 @@
 		
 		if (document.forms[0].uid.value == ''){
-			alert(get_lang('LOGIN field is empty') + '.');
+			alert( ExpressoLivre.translate( 'LOGIN field is empty' )  + '.');
 			return;
 		}
 		else if (document.forms[0].uid.value.length < document.forms[0].minimumSizeLogin.value){
-			alert(get_lang('LOGIN field must be bigger than') + ' ' + document.forms[0].minimumSizeLogin.value + ' ' + get_lang('characters') + '.');
+			alert( ExpressoLivre.translate( 'LOGIN field must be bigger than' )  + ' ' + document.forms[0].minimumSizeLogin.value + ' ' +  ExpressoLivre.translate( 'characters' )  + '.');
 			return;
 		}
@@ -22,5 +22,5 @@
 			var reUid = /^([a-zA-Z0-9_\-])+$/;
 		if(!reUid.test(document.forms[0].uid.value)){
-			alert(get_lang('LOGIN field contains characters not allowed') + '.');
+			alert( ExpressoLivre.translate( 'LOGIN field contains characters not allowed' )  + '.');
 			return;
 		}
@@ -28,9 +28,9 @@
 		//PASSWORD's
 		if (document.forms[0].password1.value == ''){
-			alert(get_lang('Password field is empty') + '.');
+			alert( ExpressoLivre.translate( 'Password field is empty' )  + '.');
 			return;
 		}
 		if (document.forms[0].password2.value == ''){
-			alert(get_lang('repassword field is empty') + '.');
+			alert( ExpressoLivre.translate( 'repassword field is empty' )  + '.');
 			return;
 		}
@@ -38,5 +38,5 @@
 
 	if (document.forms[0].password1.value != document.forms[0].password2.value){
-		alert(get_lang('password and repassword are different') + '.');
+		alert( ExpressoLivre.translate( 'password and repassword are different' )  + '.');
 		return;
 	}
@@ -49,5 +49,5 @@
 		if(!re_employeenumber.test(document.forms[0].corporative_information_employeenumber.value))
 		{
-			alert(get_lang('EmployeeNumber contains characters not allowed') + '. ' + get_lang('Only numbers are allowed') + '.');
+			alert( ExpressoLivre.translate( 'EmployeeNumber contains characters not allowed' )  + '. ' +  ExpressoLivre.translate( 'Only numbers are allowed' )  + '.');
 			document.forms[0].corporative_information_employeenumber.focus();
 			return;
@@ -58,10 +58,10 @@
 	document.forms[0].mail.value = document.forms[0].mail.value.toLowerCase();
 	if (document.forms[0].mail.value == ''){
-		alert(get_lang('Email field is empty') + '.');
+		alert( ExpressoLivre.translate( 'Email field is empty' )  + '.');
 		return;
 	}
 	var reEmail = /^([a-zA-Z0-9_\-])+(\.[a-zA-Z0-9_\-]+)*\@([a-zA-Z0-9_\-])+(\.[a-zA-Z0-9_\-]+)*$/;
 	if(!reEmail.test(document.forms[0].mail.value)){
-		alert(get_lang('Email field is not valid') + '.');
+		alert( ExpressoLivre.translate( 'Email field is not valid' )  + '.');
 		return false;
 	}
@@ -70,9 +70,9 @@
 	var reGivenname = /^[a-zA-Z0-9 \-\.]+$/;
 	if(!reGivenname.test(document.forms[0].givenname.value)){
-		alert(get_lang('First name field contains characters not allowed') + '.');
+		alert( ExpressoLivre.translate( 'First name field contains characters not allowed' )  + '.');
 		return false;
 	}
 	else if (document.forms[0].givenname.value == ''){
-		alert(get_lang('First name field is empty') + '.');
+		alert( ExpressoLivre.translate( 'First name field is empty' )  + '.');
 		return;
 	}
@@ -81,9 +81,9 @@
 	var reSn = /^[a-zA-Z0-9 \-\.]+$/;
 	if(!reSn.test(document.forms[0].sn.value)){
-		alert(get_lang('Last name field contains characters not allowed') + '.');
+		alert( ExpressoLivre.translate( 'Last name field contains characters not allowed' )  + '.');
 		return false;
 	}
 	else if (document.forms[0].sn.value == ''){
-		alert(get_lang('Last name field is empty') + '.');
+		alert( ExpressoLivre.translate( 'Last name field is empty' )  + '.');
 		return;
 	}
@@ -95,5 +95,5 @@
 		if (!reg_tel.exec(document.forms[0].telephonenumber.value))
 		{
-			alert(get_lang('Phone field is incorrect') + '.');
+			alert( ExpressoLivre.translate( 'Phone field is incorrect' )  + '.');
 			return;
 		}
@@ -102,5 +102,5 @@
 	//FORWAR ONLY
 	if ((document.forms[0].deliverymode.checked) && (document.forms[0].mailforwardingaddress.value == '')){
-		alert(get_lang('Forward email is empty') + '.');
+		alert( ExpressoLivre.translate( 'Forward email is empty' )  + '.');
 		return;
 	}
@@ -108,5 +108,5 @@
 	// Email Quota
 	if (document.forms[0].mailquota.value == ''){
-		alert(get_lang('User without email quota') + '.');
+		alert( ExpressoLivre.translate( 'User without email quota' )  + '.');
 		return;
 	}
@@ -114,5 +114,5 @@
 	//GROUPS
 	if (document.getElementById('ea_select_user_groups').length < 1){
-		alert(get_lang('User is not in any group') + '.');
+		alert( ExpressoLivre.translate( 'User is not in any group' )  + '.');
 		return;
 	}
@@ -121,9 +121,9 @@
 	if (document.getElementById('tabcontent6').style.display != 'none'){
 		if ((document.forms[0].sambalogonscript.value == '') && (!document.forms[0].sambalogonscript.disabled)){
-			alert(get_lang('Logon script is empty') + '.');
+			alert( ExpressoLivre.translate( 'Logon script is empty' )  + '.');
 			return;
 		}
 		if ((document.forms[0].sambahomedirectory.value == '') && (!document.forms[0].sambahomedirectory.disabled)){
-			alert(get_lang('Users home directory is empty') + '.');
+			alert( ExpressoLivre.translate( 'Users home directory is empty' )  + '.');
 			return;
 		}
@@ -197,5 +197,5 @@
 function generate_login(first_name,second_name) {
 	if ((first_name=='') || (second_name=='')) {
-		alert(get_lang("You must type the first and the second name before generate the login"));
+		alert( ExpressoLivre.translate( "You must type the first and the second name before generate the login" ) );
 		return;
 	}
@@ -229,5 +229,5 @@
 		alert(data.msg);
 	else
-		alert(get_lang('User successful created') + '.');
+		alert( ExpressoLivre.translate( 'User successful created' )  + '.');
 
 	location.href="./index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users";
@@ -248,5 +248,5 @@
 	}
 	else{
-		alert(get_lang('User successful saved') + '.');
+		alert( ExpressoLivre.translate( 'User successful saved' )  + '.');
 	}
 	location.href="./index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users";
@@ -258,4 +258,5 @@
 	var handler_get_available_groups = function(data)
 	{
+		data = data.trim( );
 		select_available_groups = document.getElementById('ea_select_available_groups');
 
@@ -274,12 +275,9 @@
 			select_available_groups.outerHTML = select_available_groups.outerHTML;
 		}
-	}	
-		
-	_controller.go( {
-		"access" : "$this.ldap_functions.get_available_groups&context="+context,
-		"handler" : function( data )
-		{
-			handler_get_available_groups( expresso.connector.unserialize( data ) );
-		}
+	}
+
+	ExpressoLivre.go( {
+		"access" : "expressoAdmin1_2.ldap_functions.get_available_groups&context="+escape(context),
+		"handler" : handler_get_available_groups
 	} );
 }
@@ -377,10 +375,7 @@
 		}
 	}
-	_controller.go( {
-		"access" : "$this.ldap_functions.get_available_maillists&context=" + context,
-		"handler" : function( data )
-		{
-			handler_get_available_maillists( expresso.connector.unserialize( data ) );
-		}
+	ExpressoLivre.go( {
+		"access" : "expressoAdmin1_2.ldap_functions.get_available_maillists&context=" + context,
+		"handler" : handler_get_available_maillists
 	} );
 }
@@ -483,5 +478,5 @@
 			alert(data.msg);
 		else
-			alert(get_lang('Default password successful saved') + '.');
+			alert( ExpressoLivre.translate( 'Default password successful saved' )  + '.');
 		return;
 	}
@@ -496,5 +491,5 @@
 			alert(data.msg);
 		else
-			alert(get_lang('Users password successful returned') + '.');
+			alert( ExpressoLivre.translate( 'Users password successful returned' )  + '.');
 		return;
 	}
@@ -504,5 +499,5 @@
 function delete_user(uid, uidnumber)
 {
-	if (confirm(get_lang("Do you really want delete the user") + " " + uid + "?"))
+	if (confirm( ExpressoLivre.translate( "Do you really want delete the user" )  + " " + uid + "?"))
 	{
 		var handler_delete_user = function(data)
@@ -511,5 +506,5 @@
 				alert(data.msg);
 			else
-				alert(get_lang('User successful deleted') + '.');
+				alert( ExpressoLivre.translate( 'User successful deleted' )  + '.');
 			
 			location.href="./index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users";
@@ -527,8 +522,8 @@
 		var reUid = /^([a-zA-Z0-9_\-])+$/;
 
-	new_uid = prompt(get_lang('Rename users login from') + ': ' + uid + " " + get_lang("to") + ': ', uid);
+	new_uid = prompt( ExpressoLivre.translate( 'Rename users login from' )  + ': ' + uid + " " +  ExpressoLivre.translate( "to" )  + ': ', uid);
 
 	if(!reUid.test(new_uid)){
-		alert(get_lang('LOGIN field contains characters not allowed') + '.');
+		alert( ExpressoLivre.translate( 'LOGIN field contains characters not allowed' )  + '.');
 		document.forms[0].account_lid.focus();
 		return;
@@ -563,5 +558,5 @@
 		alert(data.msg);
 	else{
-		alert(get_lang('User login successful renamed') + "\n" + data.exec_return);
+		alert( ExpressoLivre.translate( 'User login successful renamed' )  + "\n" + data.exec_return);
 		location.href="./index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users";
 	}
@@ -579,5 +574,5 @@
 	clearTimeout(finderTimeout_maillist);
 	var oWait = document.getElementById("ea_span_searching_maillist");
-	oWait.innerHTML = get_lang('Searching') + '...';
+	oWait.innerHTML =  ExpressoLivre.translate( 'Searching' )  + '...';
 	finderTimeout_maillist = setTimeout("optionFinder_maillist('"+obj.id+"')",500);
 }
@@ -613,5 +608,5 @@
 	clearTimeout(finderTimeout_group);
 	var oWait = document.getElementById("ea_span_searching_group");
-	oWait.innerHTML = get_lang('Searching') + '...';
+	oWait.innerHTML =  ExpressoLivre.translate( 'Searching' )  + '...';
 	finderTimeout_group = setTimeout("optionFinder_group('"+obj.id+"')",500);
 }
@@ -671,5 +666,5 @@
 function empty_inbox(uid)
 {
-	var action = get_lang('Cleanned user mailbox');
+	var action =  ExpressoLivre.translate( 'Cleanned user mailbox' ) ;
 	var handler_write_log = function(){}
 	var handler_empty_inbox = function(data)
@@ -679,5 +674,5 @@
 		else{
 			cExecute ('$this.user.write_log_from_ajax&_action='+action+'&userinfo='+uid, handler_write_log);
-			alert(get_lang('Emptied')+' '+ data.inbox_size + ' ' + get_lang('MB from user inbox'));
+			alert( ExpressoLivre.translate( 'Emptied' ) +' '+ data.inbox_size + ' ' +  ExpressoLivre.translate( 'MB from user inbox' ) );
 			document.getElementById('mailquota_used').value = data.mailquota_used;
 		}
@@ -765,4 +760,2 @@
 		}
 }
-
-
Index: /trunk/expressoAdmin1_2/js/modal/modal.js
===================================================================
--- /trunk/expressoAdmin1_2/js/modal/modal.js	(revision 2459)
+++ /trunk/expressoAdmin1_2/js/modal/modal.js	(revision 2712)
@@ -85,9 +85,9 @@
 	objCaption.setAttribute('id','lightboxFoot');
 
-	var close_button = '<input type=button value="'+get_lang('close')+'" onClick='+close_action+'>';
+	var close_button = '<input type=button value="'+ExpressoLivre.translate( 'close' )+'" onClick='+close_action+'>';
 	if (type == 'create')
-		var create_save_button = '<input type=button value="'+get_lang('create')+'" onClick='+create_action+'>';
+		var create_save_button = '<input type=button value="'+ExpressoLivre.translate( 'create' )+'" onClick='+create_action+'>';
 	else if(type == 'save')
-		var create_save_button = '<input type=button value="'+get_lang('save')+'" onClick='+save_action+'>';
+		var create_save_button = '<input type=button value="'+ExpressoLivre.translate( 'save' )+'" onClick='+save_action+'>';
 	objCaption.innerHTML = '<table width=100% cellspacing="0" cellpadding="0"><tr><td align=left>'+close_button+'</td><td align=right>'+create_save_button+'</td></tr></table>'
 	
@@ -194,27 +194,4 @@
 	return;
 }
-/*
-function load_lang(){
-	cExecute ('$this/js/modal/inc/load_lang', handler_load_lang);
-}
-
-var global_langs = new Array();
-function handler_load_lang(data)
-{
-	global_langs = eval(data);
-}
-
-function get_lang(key_raw)
-{
-	key = key_raw.replace(/ /g,"_");
-
-	try{
-		lang = eval("global_langs."+key.toLowerCase());
-		return lang;
-	}
-	catch(e){
-		return key_raw + '*';
-	}
-}*/
 
 function make_msg(msg, type)
@@ -294,3 +271,2 @@
 
 add_css();
-//load_lang();
Index: /trunk/expressoAdmin1_2/templates/default/maillists.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/maillists.tpl	(revision 493)
+++ /trunk/expressoAdmin1_2/templates/default/maillists.tpl	(revision 2712)
@@ -6,6 +6,6 @@
 	 	<td align="left" width="25%">
 	  		<form name="form" method="POST" action="{add_action}">
-	  			<input type="submit" value="{lang_add_email_lists}" "{add_email_lists_disabled}">
-				<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
+	  			<input type="button" value="{lang_add_email_lists}" "{add_email_lists_disabled}" onclick="ExpressoLivre.link( '{add_action}' )" />
+				<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" />
 	  		</form>
 	 	</td>
@@ -58,5 +58,5 @@
    </tr>
 	<tr>
-		<td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td>
+		<td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )"></td>
 	</tr>
 <!-- END row_empty -->
Index: /trunk/expressoAdmin1_2/templates/default/accounts_form.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/accounts_form.tpl	(revision 2632)
+++ /trunk/expressoAdmin1_2/templates/default/accounts_form.tpl	(revision 2712)
@@ -3,8 +3,5 @@
 <script type="text/javascript">
 var tab = new Tabs(7,'activetab','inactivetab','tab','tabcontent','','','tabpage');
-function initAll()
-{
-	tab.init();
-}
+tab.init();
 {alert_warning};
 </script>
@@ -27,11 +24,11 @@
 <table width="90%" border="0" cellspacing="0" cellpading="0">
 	<tr>
-		<th id="tab1" class="activetab" onclick="javascript:tab.display(1);"><a href="#" tabindex="0" accesskey="1" onfocus="tab.display(1);" onclick="tab.display(1); return(false);">{lang_general_information}</a></th>
-		<th id="tab2" class="activetab" style="display:{display_corporative_information}"onclick="javascript:tab.display(2);"><a href="#" tabindex="0" accesskey="2" onfocus="tab.display(2);" onclick="tab.display(2); return(false);">{lang_corporative_information}</a></th>
-		<th id="tab3" class="activetab" style="display:{display_emailconfig}"	onclick="javascript:tab.display(3);"><a href="#" tabindex="0" accesskey="3" onfocus="tab.display(3);" onclick="tab.display(3); return(false);">{lang_email_config}</a></th>
-		<th id="tab4" class="activetab" style="display:{display_groups}"		onclick="javascript:tab.display(4);"><a href="#" tabindex="0" accesskey="4" onfocus="tab.display(4);" onclick="tab.display(4); return(false);">{lang_groups_permission}</a></th>
-		<th id="tab5" class="activetab" style="display:{display_emaillists}"	onclick="javascript:tab.display(5);"><a href="#" tabindex="0" accesskey="5" onfocus="tab.display(5);" onclick="tab.display(5); return(false);">{lang_email_lists}</a></th>
-		<th id="tab6" class="activetab" style="display:{display_applications}"	onclick="javascript:tab.display(6);"><a href="#" tabindex="0" accesskey="6" onfocus="tab.display(6);" onclick="tab.display(6); return(false);">{lang_aplication_permission}</a></th>
-		<th id="tab7" class="activetab" style="display:{display_samba_suport}"	onclick="javascript:tab.display(7);"><a href="#" tabindex="0" accesskey="7" onfocus="tab.display(7);" onclick="tab.display(7); return(false);">{lang_samba_config}</a></th>
+		<th id="tab1" class="activetab" onclick="javascript:tab.display(1);"><a href="javascript:" tabindex="0" accesskey="1" onfocus="tab.display(1);" onclick="tab.display(1); return(false);">{lang_general_information}</a></th>
+		<th id="tab2" class="activetab" style="display:{display_corporative_information}"onclick="javascript:tab.display(2);"><a href="javascript:" tabindex="0" accesskey="2" onfocus="tab.display(2);" onclick="tab.display(2); return(false);">{lang_corporative_information}</a></th>
+		<th id="tab3" class="activetab" style="display:{display_emailconfig}"	onclick="javascript:tab.display(3);"><a href="javascript:" tabindex="0" accesskey="3" onfocus="tab.display(3);" onclick="tab.display(3); return(false);">{lang_email_config}</a></th>
+		<th id="tab4" class="activetab" style="display:{display_groups}"		onclick="javascript:tab.display(4);"><a href="javascript:" tabindex="0" accesskey="4" onfocus="tab.display(4);" onclick="tab.display(4); return(false);">{lang_groups_permission}</a></th>
+		<th id="tab5" class="activetab" style="display:{display_emaillists}"	onclick="javascript:tab.display(5);"><a href="javascript:" tabindex="0" accesskey="5" onfocus="tab.display(5);" onclick="tab.display(5); return(false);">{lang_email_lists}</a></th>
+		<th id="tab6" class="activetab" style="display:{display_applications}"	onclick="javascript:tab.display(6);"><a href="javascript:" tabindex="0" accesskey="6" onfocus="tab.display(6);" onclick="tab.display(6); return(false);">{lang_aplication_permission}</a></th>
+		<th id="tab7" class="activetab" style="display:{display_samba_suport}"	onclick="javascript:tab.display(7);"><a href="javascript:" tabindex="0" accesskey="7" onfocus="tab.display(7);" onclick="tab.display(7); return(false);">{lang_samba_config}</a></th>
 	</tr>
 </table>
@@ -43,5 +40,5 @@
 		<tr bgcolor={row_on}>
 			<td>{lang_search_organization}:</td>
-			<td><input type="text" id="organization_search" {disabled} autocomplete="off" size=20 onKeyUp="javascript:search_organization(this.value, 'ea_combo_org_info');" onBlur="javascript:sinc_combos_org(context.value); get_associated_domain(context.value); get_available_groups(context.value); get_available_maillists(context.value); get_available_sambadomains(context.value, '{type}')"></td>
+			<td><input type="text" id="organization_search" {disabled} autocomplete="off" size=20 onkeyup="javascript:search_organization(this.value, 'ea_combo_org_info');" onBlur="javascript:sinc_combos_org(context.value); get_associated_domain(context.value); get_available_groups(context.value); get_available_maillists(context.value); get_available_sambadomains(context.value, '{type}')"></td>
 		</tr>
 
@@ -298,5 +295,5 @@
 							{lang_search_organization}:
 							<br>
-							<input type="text" id="organization_search" autocomplete="off" size=20 onKeyUp="javascript:search_organization(this.value, 'ea_combo_org_maillists');" onblur="javascript:get_available_maillists(ea_combo_org_maillists.value);">
+							<input type="text" id="organization_search" autocomplete="off" size=20 onkeyup="javascript:search_organization(this.value, 'ea_combo_org_maillists');" onblur="javascript:get_available_maillists(ea_combo_org_maillists.value);">
 							<br>
 							{lang_organizations}:
@@ -376,5 +373,5 @@
 	<tr>	
 		<td width="90%" align="left"  class="td_left" bgcolor="{color_bg1}">
-			<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
+			<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" />
 		</td>
 		<td width="10%" align="right" class="td_right" bgcolor="{color_bg1}">
Index: /trunk/expressoAdmin1_2/templates/default/logs.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/logs.tpl	(revision 471)
+++ /trunk/expressoAdmin1_2/templates/default/logs.tpl	(revision 2712)
@@ -2,8 +2,19 @@
 <p>
 	<div align="center">
-		<form method="POST" action="{accounts_url}">
+		<script>
+			function search( inputs )
+			{
+				var post = [ ];
+				for ( var i = 0; i < inputs.length; i++ )
+					if ( inputs[ i ].type == 'text' )
+						post[ post.length ] = inputs[ i ].name + '=' + inputs[ i ].value
+
+				return post.join( '&' );
+			}
+		</script>
+		<form method="POST" action="{search_action}" onsubmit="ExpressoLivre.link( '{search_action}', null, search( this.getElementsByTagName( 'input' ) ) ); return false;">
 			<table border="0" width="90%">
 				<tr>
-					<td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td>
+					<td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td>
 				</tr>
 
@@ -85,5 +96,5 @@
 	</tr>
 	<tr>
-		<td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td>
+		<td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td>
 	</tr>
 <!-- END row_empty -->
Index: /trunk/expressoAdmin1_2/templates/default/shared_accounts.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/shared_accounts.tpl	(revision 1913)
+++ /trunk/expressoAdmin1_2/templates/default/shared_accounts.tpl	(revision 2712)
@@ -8,5 +8,5 @@
 				<td align="left" width="25%">
 					<input type="button" value="{lang_create_shared_account}" "{create_share:_account_disabled}" onClick='{onclick_create_shared_account}'>
-					<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
+					<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )">
 				</td>
 				<td align="center" "left" width="50%">
@@ -34,5 +34,5 @@
 		<table border="0" width="90%">
 			<tr>
-				<td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td>
+				<td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td>
 			</tr>
 		</table>
Index: /trunk/expressoAdmin1_2/templates/default/sectors_form.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/sectors_form.tpl	(revision 2459)
+++ /trunk/expressoAdmin1_2/templates/default/sectors_form.tpl	(revision 2712)
@@ -61,5 +61,5 @@
    			<td align="left" colspan="2">
      			<input type="submit" name="button_submit" value={lang_save}>
-     			<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
+				<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" />
 				<!--
      			<input type="hidden" name="context" value="{context}">
Index: /trunk/expressoAdmin1_2/templates/default/institutional_accounts.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/institutional_accounts.tpl	(revision 2459)
+++ /trunk/expressoAdmin1_2/templates/default/institutional_accounts.tpl	(revision 2712)
@@ -7,6 +7,6 @@
 			<tr>
 				<td align="left" width="25%">
-					<input type="button" value="{lang_create_institutional_account}" "{create_institutional_account_disabled}" onClick='{onclick_create_institutional_account}'>
-					<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
+					<input type="button" value="{lang_create_institutional_account}" "{create_institutional_account_disabled}" onclick='{onclick_create_institutional_account}'>
+					<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" />
 				</td>
 				<td align="center" "left" width="50%">
@@ -34,5 +34,5 @@
 		<table border="0" width="90%">
 			<tr>
-				<td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td>
+				<td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td>
 			</tr>
 		</table>
Index: /trunk/expressoAdmin1_2/templates/default/groups.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/groups.tpl	(revision 309)
+++ /trunk/expressoAdmin1_2/templates/default/groups.tpl	(revision 2712)
@@ -5,8 +5,6 @@
     <tr>
 	 	<td align="left" width="25%">
-	  		<form name="form" method="POST" action="{add_action}">
-	  			<input type="submit" value="{lang_add_groups}" "{add_group_disabled}">
-				<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
-	  		</form>
+	  		<input type="button" value="{lang_add_groups}" "{add_group_disabled}" onclick="ExpressoLivre.link( '{add_action}' )" />
+			<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" />
 	 	</td>
 	 	<td align="center" "left" width="50%">
@@ -14,7 +12,7 @@
 	 	</td>
      	<td align="right" "left" width="25%">
-     		<form method="POST" action="{accounts_url}">
+     		<form method="POST" action="{accounts_url}" onsubmit="ExpressoLivre.link( '{accounts_url}', false, 'query='+this.query.value ); return false;">
      			{lang_search}:
-     			<input type="text" name="query" autocomplete="off" value="{query}">
+     			<input type="text" name="query" autocomplete="off" value="{query}" />
       		</form>
      	</td>
@@ -52,5 +50,5 @@
 	</tr>
 	<tr>
-		<td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td>
+		<td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td>
 	</tr>
 <!-- END row_empty -->
Index: /trunk/expressoAdmin1_2/templates/default/sectors.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/sectors.tpl	(revision 1516)
+++ /trunk/expressoAdmin1_2/templates/default/sectors.tpl	(revision 2712)
@@ -1,4 +1,4 @@
 <!-- BEGIN list -->
-<form method="POST" action="{action}">
+<form method="POST" action="{action}" onsubmit="ExpressoLivre.link( '{action}' ); return false;">
 <p>
   <table border="0" width="55%" align="center">
@@ -11,5 +11,5 @@
    <td align="left">
 		{input_add}
-		<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
+		<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" />
     </form>
    </td>
@@ -46,5 +46,5 @@
    </tr>
 	<tr>
-		<td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td>
+		<td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td>
 	</tr>
 <!-- END row_empty -->
Index: /trunk/expressoAdmin1_2/templates/default/maillists_form.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/maillists_form.tpl	(revision 621)
+++ /trunk/expressoAdmin1_2/templates/default/maillists_form.tpl	(revision 2712)
@@ -6,6 +6,6 @@
 		</td>
 		<td valign="top">
-			<table border="0" width=100% cellspacing="4">
-				<form action="{form_action}" method="POST" name="app_form">
+			<form action="{form_action}" method="POST" name="app_form">
+				<table border="0" width=100% cellspacing="4">
 					<input type="hidden" name="uidnumber" value="{uidnumber}">
 					<input type="hidden" name="old_uid" value="{uid}">
@@ -17,5 +17,5 @@
 					<tr>
 						<td colspan="3" align="right" bgcolor="{color_bg1}">
-							<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
+							<input type="button" value="{lang_back}" onClick="ExpressoLivre.link( '{back_url}' )" />
 							<input type="button" value="{lang_save}" onClick="javascript:validate_fields('{type}');">
 						</td>
@@ -80,9 +80,9 @@
 						<td colspan="3" align="left" bgcolor="{color_bg1}">
 							<input type="button" value="{lang_save}" onClick="javascript:validate_fields('{type}');">
-							<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
+							<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" />
 						</td>
 					</tr>
-				</form>
-			</table>
+				</table>
+			</form>
 		</td>
 	</tr>
Index: /trunk/expressoAdmin1_2/templates/default/groups_form.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/groups_form.tpl	(revision 2476)
+++ /trunk/expressoAdmin1_2/templates/default/groups_form.tpl	(revision 2712)
@@ -17,6 +17,6 @@
 					<tr>
 						<td colspan="3" align="right" bgcolor="{color_bg1}">
-							<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
-							<input type="button" value="{lang_save}" onClick="javascript:validate_fields('{type}','{restrictionsOnGroup}');">
+							<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" />
+							<input type="button" value="{lang_save}" onclick="javascript:validate_fields('{type}','{restrictionsOnGroup}');">
 						</td>
 					</tr>
@@ -103,5 +103,5 @@
 						<td colspan="3" align="left" bgcolor="{color_bg1}">
 							<input type="button" value="{lang_save}" onClick="javascript:validate_fields('{type}','{restrictionsOnGroup}');">
-							<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
+							<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" />
 						</td>
 					</tr>
Index: /trunk/expressoAdmin1_2/templates/default/totalsessions.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/totalsessions.tpl	(revision 2)
+++ /trunk/expressoAdmin1_2/templates/default/totalsessions.tpl	(revision 2712)
@@ -9,5 +9,5 @@
 	</Font>
 	<br>
-	<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
+	<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" />
 </center>
 <!-- END list -->
Index: /trunk/expressoAdmin1_2/templates/default/accounts.tpl
===================================================================
--- /trunk/expressoAdmin1_2/templates/default/accounts.tpl	(revision 477)
+++ /trunk/expressoAdmin1_2/templates/default/accounts.tpl	(revision 2712)
@@ -7,8 +7,6 @@
 			<tr>
 				<td align="left" width="25%">
-					<form name="form" method="POST" action="{add_action}">
-						<input type="submit" value="{lang_create_user}" "{create_user_disabled}">
-						<input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'">
-					</form>
+					<input type="button" value="{lang_create_user}" "{create_user_disabled}" onclick="ExpressoLivre.link( '{add_action}' )" />
+					<input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" />
 				</td>
 				<td align="center" "left" width="50%">
@@ -16,5 +14,5 @@
 				</td>
 				<td align="right" "left" width="25%">
-					<form method="POST" action="{accounts_url}">
+					<form method="POST" action="{accounts_url}" onsubmit="ExpressoLivre.link( '{accounts_url}', false, 'query='+this.query.value ); return false;">
 						{lang_search}:
 						<input type="text" name="query" autocomplete="off" value="{query}">
@@ -37,5 +35,5 @@
 			{rows}
 			<tr>
-				<td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td>
+				<td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td>
 			</tr>
 		</table>
Index: /trunk/expressoMail1_2/js/jscode/load_lang.js
===================================================================
--- /trunk/expressoMail1_2/js/jscode/load_lang.js	(revision 2630)
+++ /trunk/expressoMail1_2/js/jscode/load_lang.js	(revision 2712)
@@ -1,13 +1,1 @@
-( function( )
-{
-	var lang = document.getElementsByTagName( 'html' ).item( 0 ).getAttribute( 'xml:lang' );
-	var _connector = new XConnector;
-
-	var request = _connector.cache( ).go( {
-		'access' : URL_SERVER + 'expressoMail1_2/inc/load_lang.php?lang=' + lang,
-		'handler' : function( data )
-		{
-			window.array_lang = data.JSON( );
-		}
-	} );
-} )();
+ExpressoLivre.lang( 'expressoMail1_2' );
Index: /trunk/expressoMail1_2/js/jscode/globals.js
===================================================================
--- /trunk/expressoMail1_2/js/jscode/globals.js	(revision 2645)
+++ /trunk/expressoMail1_2/js/jscode/globals.js	(revision 2712)
@@ -12,5 +12,4 @@
 var sort_box_reverse = 1;
 var last_message_selected = '';
-//var array_lang = new Array();
 var cyrus_delimiter = '';
 var ccaddress_array = new Array();
