Index: /branches/2.2/mobile/setup/phpgw_pt-br.lang
===================================================================
--- /branches/2.2/mobile/setup/phpgw_pt-br.lang	(revision 4051)
+++ /branches/2.2/mobile/setup/phpgw_pt-br.lang	(revision 4744)
@@ -64,4 +64,5 @@
 This message don't have attachment(s)	mobile	pt-br	Este e-mail não possui anexo(s)
 This message has the follow attachments:	mobile	pt-br	Esta mensagem possui anexo:
+Tips	mobile	pt-br	Dicas
 Catalog	mobile	pt-br	Catálogo
 Phone	mobile	pt-br	Telefone
Index: /branches/2.2/mobile/inc/class.mobiletemplate.inc.php
===================================================================
--- /branches/2.2/mobile/inc/class.mobiletemplate.inc.php	(revision 4694)
+++ /branches/2.2/mobile/inc/class.mobiletemplate.inc.php	(revision 4744)
@@ -19,13 +19,5 @@
 			if( $template == "mini_desktop" )
 			{
-				$url_expresso = $GLOBALS['phpgw_info']['server']['webserver_url'];
-				$url_expresso = ( !empty($url_expresso) ) ? $url_expresso : '/';
-		
-				if(strrpos($url_expresso,'/') === false || strrpos($url_expresso,'/') != (strlen($url_expresso)-1))
-				{
-					$url_expresso .= '/';
-				}
-
-				$url_expresso .= "index.php";
+				$url_expresso = $this->getUrlExpresso() . "index.php";
 				
 				$this->template->set_file(array('home_t' => 'pc_template.tpl'));
@@ -144,26 +136,27 @@
 			
 			$this->template->set_var('global_title', lang('expresso mini'));
-			// button logout
-			if( isset($_COOKIE['lem']) && isset($_COOKIE['pem']) )
-			{
-				$this->template->set_var('style_1','padding-left:65%;');
-				$this->template->set_var('style_2','position:relative; float: right; display: none');
-			}
-			else
-			{
-				$this->template->set_var('style_1','position:absolute; float: left;');
-				$this->template->set_var('style_2','position:relative; float: right; display: block');
-			}
-
-			if( isset($_SESSION['mobile']['displayIOS']) && $_SESSION['mobile']['displayIOS'] == "true" )
-				$this->template->set_var('display_IOS', "none");
-			else
-				$this->template->set_var('display_IOS', "block");
-				
+			$this->template->set_var('style_1','position:absolute; float: left;');
+			$this->template->set_var('style_2','position:relative; float: right; display: block');
 			$this->template->set_var('lang_tips', lang('Tips'));
 			$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');
+			if( isset($_SESSION['mobile']['displayIOS']) && $_SESSION['mobile']['displayIOS'] == "true" )
+			{
+				$this->template->set_var('display_IOS', "none");
+			}
+			else
+			{
+				$this->template->set_var('display_IOS', "block");
+			}
+
+			if( isset($_COOKIE['lem']) && isset($_COOKIE['pem']) )
+			{
+				$this->template->set_var('href_logout', 'login.php?cd=logout_mobile');
+			}
+			else
+			{
+				$this->template->set_var('href_logout', 'login.php?cd=1');
+			}
 		}
 		
@@ -260,4 +253,17 @@
 			return $url;
 		}
+		
+		private function getUrlExpresso()
+		{
+			$url_expresso = $GLOBALS['phpgw_info']['server']['webserver_url'];
+			$url_expresso = ( !empty($url_expresso) ) ? $url_expresso : '/';
+	
+			if(strrpos($url_expresso,'/') === false || strrpos($url_expresso,'/') != (strlen($url_expresso)-1))
+			{
+				$url_expresso .= '/';
+			}
+
+			return $url_expresso;
+		}
 
 		function get_back_link(){
Index: /branches/2.2/mobile/login.php
===================================================================
--- /branches/2.2/mobile/login.php	(revision 4695)
+++ /branches/2.2/mobile/login.php	(revision 4744)
@@ -17,6 +17,11 @@
 	$GLOBALS['sessionid'] = @$_GET['sessionid'] ? $_GET['sessionid'] : @$_COOKIE['sessionid'];
 	
-	if(isset($GLOBALS['sessionid']) && $_GET['cd'] != 10 && $_GET['cd'] != 1)
-		start_prefered_app();
+	if( isset($GLOBALS['sessionid']) )
+	{
+		if( $_GET['cd'] != 10 && $_GET['cd'] != 1 && $_GET['cd'] !== 'logout_mobile' )
+		{
+			start_prefered_app();
+		}
+	}
 		
 	if ( $GLOBALS['phpgw_info']['server']['use_https'] > 0 )
@@ -83,4 +88,5 @@
 	function check_logoutcode($code) {
 		switch($code) {
+			case 'logout_mobile': 
 			case 1:
 				logout();
@@ -109,4 +115,5 @@
 				}
 				return lang('Your session could not be verified.');
+			
 			default:
 				return '';
@@ -123,13 +130,18 @@
 	elseif(get_var('lem',array('GET','COOKIE')) && get_var('pem',array('GET','COOKIE')))
 	{
-		if(!$_GET['cd'] || $_GET['cd'] == '1' || $_GET['cd'] == '10') { 
-			$submit = True;
-			$login  = base64_decode(get_var('lem',array('GET','COOKIE')));
-			$passwd = base64_decode(get_var('pem',array('GET','COOKIE')));
-			$passwd_type = 'text';
-		}
-		else {
-			$GLOBALS['phpgw']->session->phpgw_setcookie('lem');
-			$GLOBALS['phpgw']->session->phpgw_setcookie('pem');
+		if( $_GET['cd'] !== 'logout_mobile' )
+		{
+			if(!$_GET['cd'] || $_GET['cd'] == '1' || $_GET['cd'] == '10')
+			{ 
+				$submit = True;
+				$login  = base64_decode(get_var('lem',array('GET','COOKIE')));
+				$passwd = base64_decode(get_var('pem',array('GET','COOKIE')));
+				$passwd_type = 'text';
+			}
+			else
+			{
+				$GLOBALS['phpgw']->session->phpgw_setcookie('lem');
+				$GLOBALS['phpgw']->session->phpgw_setcookie('pem');
+			}
 		}
 	}
Index: /branches/2.2/mobile/templates/default/template.tpl
===================================================================
--- /branches/2.2/mobile/templates/default/template.tpl	(revision 4149)
+++ /branches/2.2/mobile/templates/default/template.tpl	(revision 4744)
@@ -13,5 +13,5 @@
 			<div style="position:absolute; float:left; width:50%;">
 				<div style="position:relative; float:left;">
-					<h1 onclick="window.location='index.php?menuaction=mobile.ui_home.index'">{global_title}</h1>
+					<h1 onclick="document.location='index.php?menuaction=mobile.ui_home.index'">{global_title}</h1>
 				</div>
 			</div>
@@ -19,9 +19,9 @@
 			<div style="position:relative; float:right; width:50%; margin:2px;">
 				<div style="{style_1}">
-					<h1 onclick="window.location='index.php?menuaction=mobile.ui_home.dicas'">Dicas</h1>
+					<h1 onclick="document.location='index.php?menuaction=mobile.ui_home.dicas'">{lang_tips}</h1>
 				</div>
 				
 				<div style="{style_2}">
-					<h1 onclick="window.location='{href_logout}'">{lang_logout}</h1>
+					<h1 onclick="document.location='{href_logout}'">{lang_logout}</h1>
 				</div>
 			</div>
