Index: branches/2.2/mobile/setup/phpgw_pt-br.lang
===================================================================
--- branches/2.2/mobile/setup/phpgw_pt-br.lang	(revision 3723)
+++ branches/2.2/mobile/setup/phpgw_pt-br.lang	(revision 3731)
@@ -17,4 +17,5 @@
 Drafts	mobile	pt-br	Rascunhos
 events	mobile	pt-br	Eventos
+expresso mini	mobile	pt-br	Expresso Mini
 E-mail	mobile	pt-br	Caixa de Entrada
 From	mobile	pt-br	De
@@ -24,8 +25,10 @@
 To	mobile	pt-br	Para
 cc	mobile	pt-br	Cc
-my mail	mobile	pt-br	Meus E-mails
-my contacts	mobile	pt-br	Meus Contatos
-my commitments	mobile	pt-br	Meus Compromissos
-my folders	mobile	pt-br	Minhas Pastas
+mini desktop	mobile	pt-br	Mini Desktop
+mini mobile	mobile	pt-br	Mini Mobile
+my mail	mobile	pt-br	E-mails
+my contacts	mobile	pt-br	Contatos
+my commitments	mobile	pt-br	Compromissos
+my folders	mobile	pt-br	Outras Pastas
 mark as read	mobile	pt-br	marcar como lido
 more	mobile	pt-br	mais
Index: branches/2.2/mobile/inc/class.ui_mobilecalendar.inc.php
===================================================================
--- branches/2.2/mobile/inc/class.ui_mobilecalendar.inc.php	(revision 3696)
+++ branches/2.2/mobile/inc/class.ui_mobilecalendar.inc.php	(revision 3731)
@@ -41,5 +41,6 @@
 			$this->template->set_var('lang_search',lang("search"));
 			
-			$this->template->set_var('search',$this->template->fp('out','search_bar'));
+			if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop")
+				$this->template->set_var('search',$this->template->fp('out','search_bar'));
 			
 			if(!function_exists("get_events")){
Index: branches/2.2/mobile/inc/class.mobiletemplate.inc.php
===================================================================
--- branches/2.2/mobile/inc/class.mobiletemplate.inc.php	(revision 3727)
+++ branches/2.2/mobile/inc/class.mobiletemplate.inc.php	(revision 3731)
@@ -15,8 +15,21 @@
 			$template = $GLOBALS['phpgw']->session->appsession('mobile.layout','mobile');
 			
-			$this->template->set_file(Array('home_t' => $template=="mini"?'pc_template.tpl':'template.tpl'));	
-			$this->template->set_block('home_t', 'mobile_home');	
+			if($template == "mini_desktop") {
+				$this->template->set_file(array('home_t' => 'pc_template.tpl'));
+				$this->template->set_file(array('home_t_search_bar' => 'search_bar.tpl'));
+				$this->template->set_block('home_t_search_bar','search_bar');
+				$this->template->set_var('search',$this->template->fp('out','search_bar'));
+				$this->template->set_var('lang_mini_mobile', lang('mini mobile'));
+				$this->template->set_var('lang_search_error_message',lang("need choose one option"));
+			}	else {
+				$this->template->set_file(array('home_t' => 'template.tpl'));
+				$this->template->set_var('lang_mini_desktop', lang('mini desktop'));
+			}
+			
+
+			
+			$this->template->set_block('home_t', 'mobile_home');
 			$this->template->set_block('home_t','success_message');
-			$this->template->set_block('home_t','error_message');		
+			$this->template->set_block('home_t','error_message');
 		}
 
@@ -51,5 +64,5 @@
 				$this->template->parse("message_box", $type."_message", true);
 			}
-		}		
+		}
 		
 		/*
@@ -79,13 +92,15 @@
 			$this->print_header();
 			$this->init_mobile();
-			$class=='ui_home' && $method=='index'?$this->print_logout():$this->print_navbar();
+			if(!($class == 'ui_home' && $method == 'index')) $this->print_navbar();
 			$filename = 'inc/class.'.$class.'.inc.php';
-			if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')=="mini") {
-				$ui_home = CreateObject('mobile.ui_home');
-				$ui_home->index(array());
-			}
 			include_once($filename);
 			$obj = new $class();		
 			$obj -> $method($_REQUEST);
+			
+			if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile') == "mini_desktop") {
+				$ui_home = CreateObject('mobile.ui_home');
+				$ui_home->index($_REQUEST);
+			}
+			
 			$this->template->pfp('out', 'mobile_home');
 		}
@@ -96,15 +111,11 @@
       // setting timezone preference
       $zones = $obj->getTimezones();
-      $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['timezone'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] : sprintf("%s", array_search("America/Sao_Paulo", $zones));			
-		}
-		
-		/*
-		* @function print_logout
-	 	* @abstract Exibe label e link para Logout
-	 	* @author Diego Moreno
-	 	*/
-		public function print_logout(){
-			$this-> template->set_var('lang_logout', lang('logout'));
-			$this-> template->set_var('href_logout', 'login.php?cd=1');
+      $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['timezone'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] : sprintf("%s", array_search("America/Sao_Paulo", $zones));
+			
+			$this->template->set_var('global_title', lang('expresso mini'));
+			$this->template->set_var('lang_logout', lang('logout'));
+			$this->template->set_var('lang_search', lang('search'));
+			
+			$this->template->set_var('href_logout', 'login.php?cd=1');
 		}
 		
@@ -115,15 +126,14 @@
 	 	*/
 		private function print_navbar(){
-			$this-> print_logout();			
-			$this-> template->set_var('lang_back', lang('Back'));
-			$this-> template->set_var('lang_home', lang('home'));
-			$this-> template->set_var('lang_email', lang('E-mail'));
-			$this-> template->set_var('lang_contacts', lang('Contact Center'));
-			$this-> template->set_var('lang_calendar', lang('Calendar'));
-			$this-> template->set_var('href_back', 'javascript:history.back()');
-			$this-> template->set_var('href_cc', 'index.php?menuaction=mobile.ui_mobilecc.init_cc');
-			$this-> template->set_var('href_email', "index.php?menuaction=mobile.ui_mobilemail.change_folder&folder=0");
-			$this-> template->set_var('href_calendar', "index.php?menuaction=mobile.ui_mobilecalendar.index");
-			$this-> template->set_var('href_home', "index.php?menuaction=mobile.ui_home.index");
+			$this->template->set_var('lang_back', lang('Back'));
+			$this->template->set_var('lang_home', lang('home'));
+			$this->template->set_var('lang_email', lang('E-mail'));
+			$this->template->set_var('lang_contacts', lang('Contact Center'));
+			$this->template->set_var('lang_calendar', lang('Calendar'));
+			$this->template->set_var('href_back', 'javascript:history.back()');
+			$this->template->set_var('href_cc', 'index.php?menuaction=mobile.ui_mobilecc.init_cc');
+			$this->template->set_var('href_email', "index.php?menuaction=mobile.ui_mobilemail.change_folder&folder=0");
+			$this->template->set_var('href_calendar', "index.php?menuaction=mobile.ui_mobilecalendar.index");
+			$this->template->set_var('href_home', "index.php?menuaction=mobile.ui_home.index");
 		}
 
@@ -135,40 +145,6 @@
 		private function print_header(){
 			$GLOBALS['phpgw']->accounts->read_repository();
-			$var  = Array(
-				'css'	=> $this->get_mobile_css(),
-				'title' => lang("expresso mini")
-			);		
-			$this->template->set_var($var);		
-		}
-
-
-		public function get_mobile_css() {
-			$css = "/mobile/templates/%s.css";
-
-			global $path, $link;
-
-			$path = PHPGW_SERVER_ROOT . str_replace( '/', SEP, $css );
-
-			$link = '<LINK href="%s" type="text/css" rel="StyleSheet">';
-			$link = sprintf( $link,
-				"{$GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ]}{$css}"
-			);
-
-			function _css( $css )
-			{
-				global $link, $path;
-
-				if ( file_exists( sprintf( $path, str_replace( '/', SEP, $css ) ) ) )
-					return sprintf( $link, $css );
-
-				return '';
-			}
-
-			$css = _css( 'css/mobile' );
-			$css .= _css( $GLOBALS['phpgw_info']['server']['template_set'].'/css/base');
-			$css .= _css( $GLOBALS['phpgw_info']['server']['template_set'].'/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']);
-
-			return ( $css );
-
+			$var  = Array('title' => lang("expresso mini"));
+			$this->template->set_var($var);
 		}
 
Index: branches/2.2/mobile/inc/class.ui_home.inc.php
===================================================================
--- branches/2.2/mobile/inc/class.ui_home.inc.php	(revision 3727)
+++ branches/2.2/mobile/inc/class.ui_home.inc.php	(revision 3731)
@@ -22,7 +22,6 @@
 		
 		function change_template($params) {
-			
 			$GLOBALS['phpgw']->session->appsession('mobile.layout','mobile',$params['template']);
-			header("location: index.php");
+			header("location: index.php?menuaction=mobile.ui_mobilemail.change_folder&folder=0");
 		}
 		
@@ -49,6 +48,4 @@
 			$this->template->set_var('lang_selected', lang("selected"));
 			
-			$this->template->set_var('search',$this->template->fp('out','search_bar'));
-			
 			$accountId = $GLOBALS['phpgw_info']['user']['account_id'];
 			
@@ -59,12 +56,6 @@
 			$this->set_folder_block($default_folders, "default_folders_box");
 			
-			if(isset($params["expand_folders"]) && $params["expand_folders"] == 1) 
-			{
-				$personal_folders = $this->imap_functions->get_folders_list(array('noSharedFolders' => true, 'folderType' => 'personal', 'noQuotaInfo' => true));
-				$this->set_folder_block($personal_folders, "personal_folders_box", sizeof($default_folders));
-				$this->template->set_var('expand_folders', 0);			
-			} else {
-				$this->template->set_var('expand_folders', 1);
-			}
+			$personal_folders = $this->imap_functions->get_folders_list(array('noSharedFolders' => true, 'folderType' => 'personal', 'noQuotaInfo' => true));
+			$this->set_folder_block($personal_folders, "personal_folders_box", sizeof($default_folders));
 			
 			$this->template->set_var('quota_percent', $total_quota["quota_percent"]);
@@ -92,5 +83,5 @@
 			) );
 			
-			$events  = $this->bocalendar->cached_events;
+			$events = $this->bocalendar->cached_events;
 			
 			foreach($events[$year.$this->common->complete_string($month,2,"R","0").$this->common->complete_string($day,2,"R","0")] as $index=>$event) 
@@ -105,8 +96,11 @@
 			$GLOBALS['phpgw_info']['mobiletemplate']->set_error_msg($params["error_message"]);
 			$GLOBALS['phpgw_info']['mobiletemplate']->set_success_msg($params["success_message"]);
-			if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')=="mini")
+			
+			if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')=="mini_desktop") {
 				$GLOBALS['phpgw_info']['mobiletemplate']->set_home($this->template->fp('out', 'page'));
-			else
+			} else {
+				$this->template->set_var('search',$this->template->fp('out','search_bar'));
 				$GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out', 'page'));
+			}
 
 		}
@@ -149,15 +143,11 @@
 
 			$p = $this->template;
-			$p->set_file(
-				Array(
-					'search' => 'home_search.tpl',
-					'home_search_bar' => 'search_bar.tpl'
-				)
-			);
+			$p->set_file(array('home_search' => 'home_search.tpl'));
+			$p->set_file(array('home_search_bar' => 'search_bar.tpl'));
 			
 			//Langs gerais da página
-			$p->set_block('search','home_search');
-			$p->set_block("search","row_events");
-			$p->set_block("search","no_events");
+			$p->set_block('home_search','main');
+			$p->set_block("home_search","row_events");
+			$p->set_block("home_search","no_events");
 			$p->set_block('home_search_bar','search_bar');
 			
@@ -184,8 +174,10 @@
 			$p->set_var('show_more_events',"none");
 			$p->set_var('contacts_request_from',
-							isset($params["request_from"])?
-							$params["request_from"]:"none");
-			
-			$p->set_var('search',$p->fp('out','search_bar'));
+				isset($params["request_from"])?
+				$params["request_from"]:"none");
+				
+			if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop") {
+				$p->set_var('search',$p->fp('out','search_bar'));
+			}
 
 			//E-mails
@@ -194,5 +186,5 @@
 				if($params['default_folders']==="1") {
 					if($params['personal_folders']!=="1")
-						$mail_params['folderType'] = 'default';			
+						$mail_params['folderType'] = 'default';
 				}
 				else {
@@ -324,5 +316,5 @@
 			}
 			
-			$GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out','home_search'));
+			$GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out','main'));
 
 		}
Index: branches/2.2/mobile/inc/class.ui_mobilemail.inc.php
===================================================================
--- branches/2.2/mobile/inc/class.ui_mobilemail.inc.php	(revision 3697)
+++ branches/2.2/mobile/inc/class.ui_mobilemail.inc.php	(revision 3731)
@@ -446,5 +446,7 @@
 			$p->set_var("lang_more",lang("more"));
 			$p->set_var("lang_messages",lang("messages"));
-			$p->set_var('search',$p->fp('out','search_bar'));
+			
+			if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop")
+				$p->set_var('search',$p->fp('out','search_bar'));
 			
 			$max_per_page = 
Index: branches/2.2/mobile/inc/class.ui_mobilecc.inc.php
===================================================================
--- branches/2.2/mobile/inc/class.ui_mobilecc.inc.php	(revision 3710)
+++ branches/2.2/mobile/inc/class.ui_mobilecc.inc.php	(revision 3731)
@@ -146,5 +146,6 @@
 										"none":$this->page_info["request_from"]);
 			
-			$this->template->set_var('search',$this->template->fp('out','search_bar'));
+			if($GLOBALS['phpgw']->session->appsession('mobile.layout','mobile')!="mini_desktop")
+				$this->template->set_var('search',$this->template->fp('out','search_bar'));
 			
 			//Combo de catálogos
Index: branches/2.2/mobile/mobile_header.inc.php
===================================================================
--- branches/2.2/mobile/mobile_header.inc.php	(revision 3727)
+++ branches/2.2/mobile/mobile_header.inc.php	(revision 3731)
@@ -18,6 +18,5 @@
 
 	$GLOBALS['phpgw_info']['flags']['currentapp'] = 'mobile';
-	$GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app'] = 
-						$GLOBALS['phpgw']->session->appsession('mobilemail.folders','mobile')=="mini"?'mobilecalendar':'home'; //home, mobilecalendar, mobilecc ou mobilemail
+	$GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app'] = 'home';
 
 	if ( is_null($GLOBALS['phpgw_info']['server']['template_set']) )
Index: branches/2.2/mobile/login.php
===================================================================
--- branches/2.2/mobile/login.php	(revision 3571)
+++ branches/2.2/mobile/login.php	(revision 3731)
@@ -44,6 +44,4 @@
 	if(trim($cd) != "")
 		$tmpl->parse('message_box', (($_GET['cd'] == 1) ? 'success_message' : 'error_message') ,true);
-	
-	$tmpl->set_var('css',CreateObject("mobile.mobiletemplate")->get_mobile_css());
 
 	function check_logoutcode($code) {
@@ -102,5 +100,12 @@
 			$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] .$GLOBALS['phpgw_info']['flags']['currentdir'].'/login.php?cd=' . $GLOBALS['phpgw']->session->cd_reason);
 		}
-		else{
+		else {
+			if(isset($_POST['max_resolution']) && $_POST['max_resolution'] > 600) {
+				$GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app'] = 'mobilemail';
+				$GLOBALS['phpgw']->session->appsession('mobile.layout','mobile','mini_desktop');
+			} else {
+				$GLOBALS['phpgw']->session->appsession('mobile.layout','mobile','mini_mobile');
+			}
+			
 			start_prefered_app();
 		}
Index: branches/2.2/mobile/templates/default/search_bar.tpl
===================================================================
--- branches/2.2/mobile/templates/default/search_bar.tpl	(revision 3690)
+++ branches/2.2/mobile/templates/default/search_bar.tpl	(revision 3731)
@@ -4,5 +4,5 @@
 			<tr>
 				<td class="gd"><input type="text" name="name" ></td>
-    		<td class="pq"><button name="search_message" class="btn-generico" onClick="document.getElementById('formu_busca').submit();" >buscar </button></td>
+    		<td class="pq"><button name="search_message" class="btn-generico" type="submit" >buscar </button></td>
   		</tr>
   	</table>
Index: branches/2.2/mobile/templates/default/cc_main.tpl
===================================================================
--- branches/2.2/mobile/templates/default/cc_main.tpl	(revision 3710)
+++ branches/2.2/mobile/templates/default/cc_main.tpl	(revision 3731)
@@ -12,5 +12,5 @@
 		</div>
 		
-		<form id="formu_busca" action="index.php" method="post">
+		<form id="form_busca" action="index.php" method="post">
 		<input type="hidden" name="menuaction" value="mobile.ui_home.search">
 		<input type="hidden" name="catalog_to_search" value="{actual_catalog}">
Index: branches/2.2/mobile/templates/default/pc_template.tpl
===================================================================
--- branches/2.2/mobile/templates/default/pc_template.tpl	(revision 3727)
+++ branches/2.2/mobile/templates/default/pc_template.tpl	(revision 3731)
@@ -1,8 +1,8 @@
 <!-- BEGIN mobile_home -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 	<head>
-		<title>
-			Expresso Mini
-		</title>
+		<title>{global_title}</title>
 		<meta content="text/html; width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0; charset=utf-8" http-equiv="Content-Type" name="viewport" />
 		<meta name="format-detection" content="telephone=no" />
@@ -11,28 +11,66 @@
 			<link href="templates/css/ie6.css" type="text/css" rel="StyleSheet">
 		<![endif]-->
+		
+		<script type="text/javascript">
+			function validate_desktop_search() {
+				var default_folders = document.getElementById("hidden_default_folders");
+				var personal_folders = document.getElementById("hidden_personal_folders");
+				var calendar_search = document.getElementById("hidden_calendar_search");
+				var contacts_search = document.getElementById("hidden_contacts_search");
+
+				default_folders.value = (document.getElementById("search_default_folders").checked) ? "1" : ""; 
+				personal_folders.value = (document.getElementById("search_personal_folders").checked) ? "1" : ""; 
+				calendar_search.value = (document.getElementById("search_calendar_search").checked) ? "1" : ""; 
+				contacts_search.value = (document.getElementById("search_contacts_search").checked) ? "1" : "";
+
+ 				if(default_folders.value == "" && personal_folders.value == "" && calendar_search.value == "" && contacts_search.value == "") {
+
+ 					if( document.getElementById("box_aviso_negativo") ) { 
+						document.getElementById("box_aviso_negativo").innerHTML = '<div class="aviso-negativo"><strong>{lang_search_error_message}</strong></div>'; 
+					} else { 
+						var targetElement = document.getElementById("topo_box"); 
+						var newElement = document.createElement('div'); 
+						newElement.className = "bg-neutro"; 
+						newElement.id = "box_aviso_negativo"; 
+						newElement.innerHTML = '<div class="aviso-negativo"><strong>{lang_search_error_message}</strong></div>';
+
+ 						var parent = document.getElementById("topo_box").parentNode;
+
+ 						if(parent.lastchild == targetElement) { 
+							parent.appendChild(newElement); 
+						} else { 
+							parent.insertBefore(newElement, targetElement.nextSibling); 
+						} 
+					}
+
+					return false;
+				} else {
+					return true;
+				}
+			}
+		
+		</script>
+		
 	</head>
 	<body>
 		<div id="global">
-			<div class="topo">
-				<h1>
-					Expresso Mini
-				</h1><span><a href="#">Ajuda</a></span>
+			<div id="topo_box" class="topo">
+				<h1>{global_title}</h1>
+				<span><a href="{href_logout}">{lang_logout}</a></span>
 			</div>
-			<form method="post" action="index.php?menuaction=mobile.ui_home.search" id="form_search"></form>
-			<div id="busca">
-				<table>
-					<tr>
-						<td class="gd">
-							<input type="text" name="name" />
-						</td>
-						<td class="pq">
-							<button name="search_message" class="btn-generico" onclick="document.getElementById('formu_busca').submit();">BUSCAR</button>
-						</td>
-					</tr>
-				</table>
-			</div><!-- INÃCIO NAVEGAÃÃO -->
+			
+			{message_box}
+			<!-- BEGIN mobile_home_content -->
+			
+			<form method="post" action="index.php?menuaction=mobile.ui_home.search" id="form_busca" onSubmit="return validate_desktop_search()">
+				<input type="hidden" name="default_folders" id="hidden_default_folders" value=''/>
+				<input type="hidden" name="personal_folders" id="hidden_personal_folders" value=''/>
+				<input type="hidden" name="calendar_search" id="hidden_calendar_search" value=''/>
+				<input type="hidden" name="contacts_search" id="hidden_contacts_search" value=''/>
+				{search}
+			</form>
 			<div id="navegacao">
 				{home}
-			</div><!-- INÃCIO CONTEÃDO -->
+			</div><!-- INÍCIO CONTEÚDO -->
 			<div id="conteudo">
 				{content}
@@ -40,7 +78,22 @@
 		</div>
 		<div class="rodape">
-			Projeto ExpressoLivre 2004 - 2010 :: LicenÃ§a de Software
+			<p>Projeto ExpressoLivre 2004 - 2010 :: Licen&ccedil;a de Software</p>
+			<p><a href="index.php?menuaction=mobile.ui_home.change_template&template=mini_mobile">{lang_mini_mobile}</a></p>
 		</div>
 	</body>
 </html>
 <!-- END mobile_home -->
+<!-- BEGIN success_message -->
+<div class="bg-neutro" id="box_aviso_positivo">
+	<div class="aviso-positivo">, 
+		<strong>{message}</strong>		
+	</div>
+</div>
+<!-- END success_message -->
+<!-- BEGIN error_message -->
+<div class="bg-neutro" id="box_aviso_negativo">
+	<div class="aviso-negativo">
+		<strong>{message}</strong>
+	</div>
+</div>
+<!-- END error_message -->
Index: branches/2.2/mobile/templates/default/login.tpl
===================================================================
--- branches/2.2/mobile/templates/default/login.tpl	(revision 3714)
+++ branches/2.2/mobile/templates/default/login.tpl	(revision 3731)
@@ -7,5 +7,15 @@
 		<meta content="text/html;width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0; charset=utf-8;" http-equiv="Content-Type" name="viewport" /> 
 		<meta name="format-detection" content="telephone=no" />
-		{css}
+		<link href="templates/css/mobile.css" type="text/css" rel="StyleSheet" />
+
+		<script type="text/javascript">
+
+			function validate_login() {
+				document.getElementById("max_resolution").value = ((screen.width >= screen.height) ? screen.width : screen.height);
+				
+				return true;
+			}
+
+		</script>
 	</head>
 	
@@ -15,8 +25,8 @@
 		</div>
 
-		{message_box}
+		{message_box}		
 		
-		
-		<form name="form_login" method="post" action="./login.php">
+		<form name="form_login" method="post" action="./login.php" id="login_form" onSubmit="return validate_login()">
+			<input type="hidden" name="max_resolution" id="max_resolution" value="">
 			<input type="hidden" name="passwd_type" value="text">
 			<input type="hidden" name="account type" value="u">
@@ -24,16 +34,20 @@
 				<div class="login">
 					<strong>{lang_username}:</strong><br/>
-					<input name="login"/><br/>
-					<script>document.form_login.login.focus();</script>
+					<input name="login" id="login"/><br/>
 					<strong>{lang_password}:</strong><br/>
 					<input name="passwd" type="password" autocomplete=off/><br/>
-					<button name="submitit" class="btn-contexto" style="margin-top:5px">{lang_login}</button>
-				</div> 				
+					<button name="submitit" class="btn-contexto" style="margin-top:5px" type="submit">{lang_login}</button>
+				</div>
 			</dt>
 		</form>
-	
+
 		<div class="rodape">Projeto ExpressoLivre 2004 - 2010 :: Licen&ccedil;a de Software</div>
 	</body>
 </html>
+
+<script type="text/javascript">
+	document.getElementById('login').focus();
+</script>
+
 <!-- END page -->
 <!-- BEGIN success_message -->
Index: branches/2.2/mobile/templates/default/calendar.tpl
===================================================================
--- branches/2.2/mobile/templates/default/calendar.tpl	(revision 3696)
+++ branches/2.2/mobile/templates/default/calendar.tpl	(revision 3731)
@@ -14,5 +14,5 @@
 </form>
 
-<dl id="lista_miolo">	
+<dl id="lista_miolo">	>
 	{events_box}	
 </dl>
@@ -38,7 +38,9 @@
 <!-- END event_block -->
 <!-- BEGIN no_event_block -->
-<dt class="titulo_mensagem {dd_class}">
-	{msg_no_event}
-</dt>
+<div class="dt_branco">
+	<div class="centraliza aumenta-tamanho">
+		<p class="email-item">{msg_no_event}</p>
+	</div>
+</div>
 <!-- END no_event_block -->
 <!-- BEGIN type_option_block -->
Index: branches/2.2/mobile/templates/default/mobilemail.tpl
===================================================================
--- branches/2.2/mobile/templates/default/mobilemail.tpl	(revision 3691)
+++ branches/2.2/mobile/templates/default/mobilemail.tpl	(revision 3731)
@@ -6,5 +6,5 @@
 		</div>
 			
-		<form action="index.php" method="post" id="formu_busca"> 
+		<form action="index.php" method="post" id="form_busca"> 
 		<input type="hidden" name="menuaction" value="mobile.ui_home.search">
 		<input type="hidden" name="folder_to_search" value="{folder_id}">
@@ -24,26 +24,27 @@
 				</select>
 			</dt>
+		
+			<form id="formu" action="index.php" method="post">
+			<input type="hidden" id="menuaction" name="menuaction" value="mobile.ui_mobilemail.delete_msg">
+			<input type="hidden" id="msg_folder" name="msg_folder" value="{folder_id}">
+			<input type="hidden" id="flag" name="flag" value="seen">
+			{mails}
+			</form>
+		
+			<div class="menu-contexto centraliza" style="display:{show_more};">
+				<form method="post" action="index.php">
+					<input type="hidden" name="menuaction" value="mobile.ui_mobilemail.change_page">
+					<input type="hidden" name="page" value="{page}">
+					<button type="submit" name="more_messages" title="{lang_more_messages}" class="btn-contexto"> {lang_more} 10 {lang_messages}</button>
+				</form>
+			</div>
 			
-				<form id="formu" action="index.php" method="post">
-				<input type="hidden" id="menuaction" name="menuaction" value="mobile.ui_mobilemail.delete_msg">
-				<input type="hidden" id="msg_folder" name="msg_folder" value="{folder_id}">
-				<input type="hidden" id="flag" name="flag" value="seen">
-				{mails}
-				</form>
-			
-		<div class="menu-contexto centraliza" style="display:{show_more};">
-			<form method="post" action="index.php">
-				<input type="hidden" name="menuaction" value="mobile.ui_mobilemail.change_page">
-				<input type="hidden" name="page" value="{page}">
-				<button type="submit" name="more_messages" title="{lang_more_messages}" class="btn-contexto"> {lang_more} 10 {lang_messages}</button>
-			</form>
-		</div>
-		
-		<div id="operacao_lista">
-			<div class="margin-rodape">
-				{selecteds}:
-				<button id="selecionar" class="btn-generico" onclick="document.getElementById('menuaction').value='mobile.ui_mobilemail.mark_message_with_flag';document.getElementById('formu').submit();" >marcar como lido</button>
-				<button id="remover" class="btn-generico" onclick="document.getElementById('menuaction').value='mobile.ui_mobilemail.delete_msg';document.getElementById('formu').submit();">remover</button>
+			<div id="operacao_lista">
+				<div class="margin-rodape">
+					{selecteds}:
+					<button id="selecionar" class="btn-generico" onclick="document.getElementById('menuaction').value='mobile.ui_mobilemail.mark_message_with_flag';document.getElementById('formu').submit();" >marcar como lido</button>
+					<button id="remover" class="btn-generico" onclick="document.getElementById('menuaction').value='mobile.ui_mobilemail.delete_msg';document.getElementById('formu').submit();">remover</button>
+				</div>
 			</div>
-		</div>
+		</dl>
 <!-- END main_emails -->
Index: branches/2.2/mobile/templates/default/template.tpl
===================================================================
--- branches/2.2/mobile/templates/default/template.tpl	(revision 3727)
+++ branches/2.2/mobile/templates/default/template.tpl	(revision 3731)
@@ -4,12 +4,12 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
     <head>   
-	    <title>Expresso Mini</title>
+	    <title>{global_title}</title>
 		<meta content="text/html;width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0; charset=utf-8;" http-equiv="Content-Type" name="viewport" /> 
 		<meta name="format-detection" content="telephone=no" />
-		{css}
+		<link href="templates/css/mobile.css" type="text/css" rel="StyleSheet" />
 	</head>	
 	<body>
 		<div class="topo">
-			<h1>Expresso Mini</h1>
+			<h1>{global_title}</h1>
 			<span><a href="{href_logout}">{lang_logout}</a></span>
 		</div>
@@ -30,5 +30,5 @@
 		</div>
 		<div class="rodape">Projeto ExpressoLivre 2004 - 2010 :: Licen&ccedil;a de Software</div>
-		 <div class="rodape center"><a href="index.php?menuaction=mobile.ui_home.change_template&template=mini">Utilizar versão para Desktops</a></div>
+		<div class="rodape center"><a href="index.php?menuaction=mobile.ui_home.change_template&template=mini_desktop">Mini Desktop</a></div>
 	</body>
 </html>
@@ -36,5 +36,5 @@
 <!-- BEGIN success_message -->
 <div class="bg-neutro">
-	<div class="aviso-positivo" style="width:98%;padding-left:1%;padding-right:1%;">
+	<div class="aviso-positivo">
 		<strong>{message}</strong>
 	</div>
@@ -43,5 +43,5 @@
 <!-- BEGIN error_message -->
 <div class="bg-neutro">
-	<div class="aviso-negativo" style="width:98%;padding-left:1%;padding-right:1%;">
+	<div class="aviso-negativo">
 		<strong>{message}</strong>
 	</div>
Index: branches/2.2/mobile/templates/default/home_search.tpl
===================================================================
--- branches/2.2/mobile/templates/default/home_search.tpl	(revision 3713)
+++ branches/2.2/mobile/templates/default/home_search.tpl	(revision 3731)
@@ -1,8 +1,8 @@
-<!-- BEGIN home_search -->
+<!-- BEGIN main -->
 		<div class="menu-contexto">
 			<span><a href="javascript:history.go(-1);">{lang_back}</a></span> <span class="titulo-secao">{lang_search_return}</span>
 		</div>
 			
-			<form method="post" action="index.php">
+			<form method="post" action="index.php" id="form_busca">
 				<input type="hidden" name="menuaction" value="mobile.ui_home.search">
 				<input type="hidden" name="default_folders" value="{default_folders}">
@@ -76,8 +76,8 @@
 			</div>
 		</dl>
-<!-- END home_search -->
+<!-- END main -->
 
 <!-- BEGIN row_events -->
-				<p class="{bg} espacamento_contato_search"><strong>{date}</strong> - {title}</p>				
+				<p class="{bg} espacamento_contato_search"><strong>{date}</strong> - {title}</p>
 <!-- END row_events -->
 <!-- BEGIN no_events -->
Index: branches/2.2/mobile/templates/default/home_index.tpl
===================================================================
--- branches/2.2/mobile/templates/default/home_index.tpl	(revision 3697)
+++ branches/2.2/mobile/templates/default/home_index.tpl	(revision 3731)
@@ -1,4 +1,14 @@
 <!-- BEGIN page -->
-<form method="post" action="index.php?menuaction=mobile.ui_home.search" id="form_search">
+
+<script type="text/javascript">
+
+function expand_folders() {
+	var box = document.getElementById("personal_folder_box");
+	box.style.display = (box.style.display == "none") ? "block" : "none";
+}
+
+</script>
+
+<form method="post" action="index.php?menuaction=mobile.ui_home.search" id="form_busca">
 	{search}
 	
@@ -10,11 +20,20 @@
 	
 	<dl id="lista_miolo">
-		<div class="resultado-titulo"><label><input type="checkbox" name="default_folders" value='1'/><span class="email-item">{lang_my_mail}</span></label><div class="rotulo-complementar">Usados {quota_percent}% [{quota_used}/{quota_limit}]</div></div>
-			{default_folders_box}
-    <div class="limpar_div resultado-titulo"><label><input type="checkbox" name="personal_folders" value='1'><a href="index.php?menuaction=mobile.ui_home.index&expand_folders={expand_folders}" class="email-item"> {lang_my_folders}</a></label></div>
-      {personal_folders_box}			
-		<div class="limpar_div resultado-titulo"><label><input type="checkbox" name="calendar_search" value='1'><a href="index.php?menuaction=mobile.ui_mobilecalendar.index" class="email-item"> {lang_my_commitments}</a></label></div>
-			{commitments_box}
-    <div class="limpar_div resultado-titulo"><label><input type="checkbox" name="contacts_search" value='1'> <a href="index.php?menuaction=mobile.ui_mobilecc.init_cc" class="email-item"> {lang_my_contacts} </a></label></div>			
+		<dd style="margin: 0; padding: 0"><div class="resultado-titulo"><label><input type="checkbox" name="default_folders" value='1' id="search_default_folders" /><span class="email-item">{lang_my_mail}</span></label><div class="rotulo-complementar">{quota_percent}% [{quota_used}/{quota_limit}]</div></div>
+		</dd>
+		{default_folders_box}
+		<dd>
+	    <div class="limpar_div resultado-titulo"><label><input type="checkbox" name="personal_folders" value='1' id="search_personal_folders"><a href="javascript:expand_folders()" class="email-item"> {lang_my_folders}</a></label></div>
+		</dd>
+	  <span id="personal_folder_box" style="display: none;">
+			{personal_folders_box}
+		</span>		
+		<dd>
+			<div class="limpar_div resultado-titulo"><label><input type="checkbox" name="calendar_search" value='1' id="search_calendar_search"><a href="index.php?menuaction=mobile.ui_mobilecalendar.index" class="email-item"> {lang_my_commitments}</a></label></div>
+		</dd>
+		{commitments_box}
+		<dd>
+    	<div class="limpar_div resultado-titulo"><label><input type="checkbox" name="contacts_search" value='1' id="search_contacts_search"> <a href="index.php?menuaction=mobile.ui_mobilecc.init_cc" class="email-item"> {lang_my_contacts} </a></label></div>
+		</dd>
 	</dl>
 </form>
Index: branches/2.2/mobile/templates/css/desktop.css
===================================================================
--- branches/2.2/mobile/templates/css/desktop.css	(revision 3727)
+++ branches/2.2/mobile/templates/css/desktop.css	(revision 3731)
@@ -3,12 +3,9 @@
 /* MACRO ESTRUTURA BROWSER */
 .global{ }
-/*#navegacao{float:left; width:30%}
-#conteudo{float:left; width:70%; min-height:305px;background: #eef7fa } */
+#navegacao{float:left; width:29%; }
+#conteudo{border-left: solid #F6F6F6; border-left-width: 1%; float:left; width:70%; min-height:305px;background: #eef7fa;} 
 
- #navegacao, #conteudo { position: absolute; border: 5px solid #F6F6F6; }
-#navegacao {right: 30%; left: 0; }
-#conteudo {left: 30%; right: 0; } 
-
-#titulo-miolo, .menu-contexto{background-color: #3399CC ;color: #FFFFFF;  font-size: small; min-height: 22px; line-height:22px; padding: 4px 2px; font-weight:bold; }
+#lista_miolo {clear:none; color:#666; width:auto; font-size:small; }
+#titulo-miolo, .menu-contexto{background-color: #3399CC ;color: #FFFFFF;  font-size: small; height: 26px; line-height:22px; padding: 4px 2px; font-weight:bold; width:auto; }
 
 /* CLASSES e IDS MODIFICADAS */
@@ -18,8 +15,6 @@
 .menu-diverso, #palavra-procurada{height:25px}
 .email-data{width:70px;}
-.aviso-positivo, .aviso-negativo {width:50%}
 #titulo-miolo button {height:21px}
 
-/*#corpo_mensagem {margin-left:5px}*/
 #corpo_mensagem #foto {padding:5px 0; text-align:left; margin-left:20px}
 
@@ -28,11 +23,8 @@
 .posiciona-esquerda{margin-left:5px}
 
-
 div.dt-azul p+p {margin-left:5px}
 div.dt-branco p+p  {margin-left:5px}
-/*div.rodape {position:absolute; bottom:0; width:100%}*/
 
-/*Modificadas 31/01/2011*/
-div.rodape {bottom:0; clear:both; display:table; position:fixed; width:100%;}
+div.rodape { margin-top: 4px; background-color:#FFF; }
 div.margin-rodape {  clear: both;   margin: 0 0 21px 5px; }
 
Index: branches/2.2/mobile/templates/css/ie6.css
===================================================================
--- branches/2.2/mobile/templates/css/ie6.css	(revision 3727)
+++ branches/2.2/mobile/templates/css/ie6.css	(revision 3731)
@@ -1,8 +1,6 @@
-@import url("mobile.css");
-
 /* MACRO ESTRUTURA BROWSER */
 .global{ }
-#navegacao{float:left; width:30%}
-#conteudo{float:left; width:70%; min-height:305px;background: #eef7fa }
+#navegacao{float:left; width:29%}
+#conteudo{border-left: solid #F6F6F6; border-left-width: 1%; float:left; width:70%; min-height:305px;background: #eef7fa;} 
 #titulo-miolo{background-color: #3399CC ;color: #FFFFFF;  font-size: small; min-height: 22px; line-height:22px; padding: 4px 0; font-weight:bold; }
 
Index: branches/2.2/mobile/templates/css/mobile.css
===================================================================
--- branches/2.2/mobile/templates/css/mobile.css	(revision 3713)
+++ branches/2.2/mobile/templates/css/mobile.css	(revision 3731)
@@ -17,10 +17,8 @@
 table {border-collapse:separate;border-spacing:0;}
 
-
 #busca table { width:100%;}
 .gd {width:90%; padding:2px 0;}
 .pq {width:10%; padding-left:5px; padding-right:5px; text-align:center;}
 .bt {width:10%; padding-left:10px; }
-
 
 caption, th, td {text-align:left;}
@@ -32,12 +30,7 @@
 li {list-style:none;}
 
-
-
-
-
 /***************Elementos******************/
 
 h1{ padding-top: 5px; height:20px; font-size:small; padding-left:5px; color:#FFFFFF; float:left;  }
-/*dt { padding:3px 3px 3px 10px; font-size:small; color:#3E3E3D; background-color:#CEE5EF; width:100%;}*/
 dt {font-size:small; color:#3E3E3D; background:#CEE5EF; width:100%;}
 .dt-titulo, .dt-azul, .dt-branco {background:#EEF7FA; clear:both; display:table;  width:100%;  }
@@ -49,5 +42,5 @@
 .espacamento, .espacamento_contato_search{padding:5px 0 5px 25px; margin:0 0 5px 0 }
 .espacamento_contato_search{padding-left:5px;}
-#palavra-procurada {background:#C0DCE9; height:22px; padding-top:4px; width:100%}
+#palavra-procurada {background:#C0DCE9; height:22px; padding: 6px 0 0 4px; width:auto}
 #editando{font-size:120%; color:#666; margin-left:5px}
 div > p.dt-azul > strong{ margin-left:8px; float:left }
@@ -68,8 +61,4 @@
 .busca-email-texto {margin-left:25px !important}
 
-
-
-
-
 /*ALTERADOS*/
 /*#text_area{width:98%; margin-top:10px; margin:auto }*/
@@ -93,14 +82,4 @@
 .posiciona-esquerda input[type="checkbox"]{ vertical-align:baseline}
 
-/*07/01/2011*/
-/*.posiciona-esquerda p{ margin:5px 0 5px 5px;}
-.posiciona-direita-busca { font-weight:normal; padding-top:8px; text-align:right; width:56px; float:right; margin-right:6px}
-.posiciona-direita {font-size:x-small; float:left; font-weight:normal; text-align:left; width:20%; padding-top:8px}
-.posiciona-direita p { margin-bottom:3px}
-.posiciona-direita span{ margin:6px 0 ; padding:8px 0; font-size:x-small !important; font-weight:normal;  float:right }
-.posiciona-direita span a{ color:#666;   padding:8px 9px }*/
-
-
-
 .posiciona-esquerda p{ margin:5px 0 5px 5px}
 .posiciona-direita-busca { font-weight:normal; padding-top:8px; text-align:right; width:56px; float:right; margin-right:6px}
@@ -110,5 +89,4 @@
 .posiciona-direita a{height:22px; color:#666;   padding:4px; font-size: x-small; }
 
-
 #lista_miolo {clear:both; color:#666; width:100%; /*min-height:165px;*/font-size:small; }
 #lista_miolo dd {background:#FFFFFF; width:100%; display:table  }
@@ -118,7 +96,4 @@
 #lista_miolo #contagem {font-size:x-small; width:20%; float:left; font-weight:normal; text-align:left;}
 
-
-
-
 /***************Classes******************/
 
@@ -132,6 +107,5 @@
 .limpar_div {
 	clear:both
-	}
-
+}
 
 .resultado-titulo{background:#D4E7F0; min-height:18px; padding:4px 0; font-weight:bold}
@@ -141,5 +115,4 @@
 p.urgente {color:#F00; font-style:italic; font-size:x-small }
 div.urgente {width:14px; height:12px; background:#F00; margin-left:5px; text-align:center; vertical-align:middle;color:#FFF; float:left;font-size:xx-small; padding-top:1px}
-
 
 .topo {width:100%; background:#333; display:table }
@@ -155,5 +128,5 @@
 .nome-item-telefone{margin-left:21px}
 
-.menu-contexto {font-size:small; background-color:#3399CC; color:#FFFFFF; width:100%; min-height:18px; padding:4px 0}
+.menu-contexto {font-size:small; background-color:#3399CC; color:#FFFFFF; width:100%; min-height:18px; padding:4px 2px}
 .menu-contexto span{margin-left:5px }
 .btn-contexto {font-size:x-small; background-color:#2B84AF; color:#FFFFFF; border:none; margin-left:5px }
@@ -163,5 +136,4 @@
 .btn-busca {padding:4px; font-size:x-small; background-color:#2B84AF; color:#FFFFFF; border:none;  min-height:20px;}
 #voltar {margin:0; padding:0}
-
 
 #titulo {width:100%; margin:2px 0; padding:20px 0; background-color:#CEE5EF;  }
@@ -171,5 +143,4 @@
 .titulo-sdt{ padding:2px 0px 0px 5px; height:20px; font-weight:bold; font-size: x-small; color:#3E3E3D; }
 
-
 .menu-diverso{ height:22px; padding-top:4px}
 .margin-geral{margin:0 0 5px 5px}
@@ -181,5 +152,4 @@
 .menu-diverso a:hover,.menu-diverso a.letter-contact-selected {color:#FFFFFF;background-color:#3399CC; padding:3px 9px }
 .btn_off a { margin: 0 1px; display: inline;  }
-
 
 .reset-dt {background-color:#ffffff; width:98%; /*padding:10px 3px 3px 10px;*/}
@@ -191,9 +161,6 @@
 .sobre-mensagem {float:left;}
 
-
 #ver-detalhes {float:left;padding:2px; background-color:#FAD364; width:10%  } /*mudança*/
 #ver-detalhes a {padding:3px;color:#666;font-size:x-small; width:20px}
-
-
 
 .alerta{ font-style:italic; color:#FF3300;}
@@ -219,8 +186,7 @@
 #bg-aviso{background:#EFF8FB; padding-top:20px;}
 .avisos{background-color:#FAE1E1;}
-.aviso-positivo, .aviso-negativo{ padding:5px; font-size:x-small; color:#333333; background-color:#CEE5EF; width:80%; margin:auto  }
+.aviso-positivo, .aviso-negativo{ padding:5px; font-size:x-small; color:#333333; background-color:#CEE5EF; margin:auto; width:98%;padding-left:1%;padding-right:1%;  }
 .aviso-negativo{ background-color:#FAE1E1 }
 .aviso-positivo a,.aviso-negativo a{text-decoration:underline; color:#333333;}
-
 
 .bg-neutro{padding:5px; background-color:#EEF7FA;} 
@@ -263,10 +229,4 @@
 a.outro_mes { background: #E1E1E1; color: #8B8B8B }
 
-
-
-
-
-
-
 /*---------------------------------------- CONTATO ÚNICO ---------------------------------------------*/
 
@@ -282,7 +242,4 @@
 #block-dados{float: left; width:78%; margin-left:5px; font-size:small; font-weight:normal }
 #block-label a {color:#666}
-		
-
-
 
 /*---------------------------------------- EMAIL ---------------------------------------------*/
@@ -290,5 +247,5 @@
 .email-geral{width:100%; padding:5px 0}
 .email-cabecalho,.contato-cabecalho{overflow: hidden; width:74%; height:22px; float:left;}
-.email-cabecalho p,.email-cabecalho a,.email-cabecalho a:visited{font-size:medium; color:#000}
+.email-cabecalho p.email-cabecalho a.email-cabecalho a:visited{font-size:medium; color:#000}
 .contato-cabecalho{font-size:medium}
 .email-anexo{width:16px; height:16px; float:left;  margin-top:5px}
@@ -313,5 +270,4 @@
 /*---------------------------------------- MODIFICAÇÕES ---------------------------------------------*/
 
-
 .email-item{color:#3E3E3D; font:bold small Arial, Helvetica, sans-serif; vertical-align:text-bottom}
 .email-campos, .assunto {color:#3E3E3D; font:bold small Arial, Helvetica, sans-serif; text-decoration:underline !important}
