diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php
index 4fa799bb8c3d98c3f4068ce59b52646c2db77106..bd1b2e821c4fb59b2365ae784b919d9e1b92c894 100644
--- a/htdocs/core/lib/security2.lib.php
+++ b/htdocs/core/lib/security2.lib.php
@@ -293,7 +293,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
 	if (function_exists("imagecreatefrompng") && ! empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA))
 	{
 		$captcha=1;
-		$captcha_refresh=img_picto($langs->trans("Refresh"),'refresh');
+		$captcha_refresh=img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"');
 	}
 
 	// Extra link
diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php
index f67bb97d284437fe5dccaa6c27bbbbab0edca9e0..85f5bff41f4acd81a61ba543aa9bc594dfbdd6e3 100644
--- a/htdocs/theme/bureau2crea/style.css.php
+++ b/htdocs/theme/bureau2crea/style.css.php
@@ -293,7 +293,7 @@ div.tmenu {
     white-space: nowrap;
     border-left: 0px;
     padding: 0px;
-    margin: 10px 0px 10px 0px;
+    margin: 5px 0px 10px 0px;
     font-size: 13px;
     background-image : url(<?php echo DOL_URL_ROOT.'/theme/bureau2crea/img/bg_mainNav.jpg' ?>);
     height: 22px;
@@ -527,7 +527,7 @@ li.tmenu a.tmenudisabled {
 div.login_block {
 	position: absolute;
 	<?php print $right; ?>: 5px;
-	top: 6px;
+	top: 2px;
 	font-weight: bold;
 	<?php if (GETPOST("optioncss") == 'print') { ?>
 	display: none;
@@ -1372,13 +1372,12 @@ tr.liste_titre {
     white-space: nowrap;
 }
 
-tr.liste_titre:first-child {
+tr.liste_titre {
     background-image: url(<?php echo DOL_URL_ROOT.'/theme/bureau2crea/img/bg_centerBlock-title.jpg' ?>);
     background-position: top right;
 }
 
-th.liste_titre_sel, td.liste_titre_sel,
-tr.liste_titre:first-child td {
+th.liste_titre_sel, td.liste_titre_sel, th.liste_titre {
     color: #FFFFFF !important;
 }
 
@@ -2199,6 +2198,7 @@ div#logoBox {
     width: 100%;
     height: auto;
     margin-top: 30px;
+    text-align: center;
     }
 
 div#parameterBox {
@@ -2258,6 +2258,10 @@ img#captcha {
 	margin-left: 200px;
     }
 
+#captcha_refresh_img {
+	margin-bottom: 6px;
+}
+
 div#infoLogin {
     width: 100%;
     height: auto;
diff --git a/htdocs/theme/bureau2crea/tpl/login.tpl.php b/htdocs/theme/bureau2crea/tpl/login.tpl.php
index d3e7119cda6255f15387f21141587b69efe28615..cb830ef1cf42b6bc5d39d4173eff556213a4d175 100644
--- a/htdocs/theme/bureau2crea/tpl/login.tpl.php
+++ b/htdocs/theme/bureau2crea/tpl/login.tpl.php
@@ -18,27 +18,44 @@
 
 header('Cache-Control: Public, must-revalidate');
 header("Content-type: text/html; charset=".$conf->file->character_set_client);
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -->
-<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -->
-<!-- <!DOCTYPE html> -->
-<!-- Ce DTD est KO car inhibe document.body.scrollTop -->
-<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -->
 
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <!-- BEGIN PHP TEMPLATE -->
-
 <html>
-<!-- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"> -->
-<head>
+
+<?php
+print '<head>
 <meta name="robots" content="noindex,nofollow" />
-<title><?php echo $langs->trans('Login'); ?></title>
-<script type="text/javascript" src="<?php echo DOL_URL_ROOT ?>/includes/jquery/js/jquery-latest.min.js"></script>
-<link rel="stylesheet" type="text/css" href="<?php echo $conf_css; ?>" />
-<link rel="shortcut icon" type="image/x-icon" href="<?php echo DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/favicon.ico'; ?>" />
-<?php if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER; ?>
-<!-- HTTP_USER_AGENT = <?php echo $_SERVER['HTTP_USER_AGENT']; ?> -->
-</head>
+<meta name="author" content="Dolibarr Development Team">
+<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>
+<title>'.$langs->trans('Login').' '.$title.'</title>'."\n";
+print '<!-- Includes for JQuery (Ajax library) -->'."\n";
+if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n";  // JQuery
+else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n";    // JQuery
+// JQuery. Must be before other includes
+print '<!-- Includes JS for JQuery -->'."\n";
+if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
+else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
+print '<link rel="stylesheet" type="text/css" href="'.$conf_css.'" />
+<style type="text/css">
+<!--
+#login {
+	margin-top: 70px;
+	margin-bottom: 30px;
+}
+.login_table {
+	width: 512px;
+	border: 1px solid #C0C0C0;
+	background: #F0F0F0 url('.$login_background.') repeat-x;
+}
+-->
+</style>'."\n";
+if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER;
+print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
+</head>';
+
+?>
 
 <body class="body">
 
@@ -287,7 +304,7 @@ jQuery(document).ready(function () {
 <!-- cookie name used for this session = <?php echo $session_name ?> -->
 <!-- urlfrom in this session = <?php echo $_SESSION["urlfrom"] ?> -->
 
-<?php echo $conf->global->MAIN_HTML_FOOTER; ?>
+<?php if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?>
 
 </body>
 </html>
diff --git a/htdocs/theme/bureau2crea/tpl/passwordforgotten.tpl.php b/htdocs/theme/bureau2crea/tpl/passwordforgotten.tpl.php
index c1391ece6040efd3d60b5914b7763db2425bf66c..2733d1793d26bce26f5de47b18729e357d7d7111 100644
--- a/htdocs/theme/bureau2crea/tpl/passwordforgotten.tpl.php
+++ b/htdocs/theme/bureau2crea/tpl/passwordforgotten.tpl.php
@@ -1,5 +1,6 @@
 <?php
 /* Copyright (C) 2009-2010 Regis Houssin <regis@dolibarr.fr>
+ * Copyright (C) 2011-2012 Laurent Destailleur <eldy@users.sourceforge.net>
  *
  * 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
@@ -17,29 +18,47 @@
  */
 header('Cache-Control: Public, must-revalidate');
 header("Content-type: text/html; charset=".$conf->file->character_set_client);
-?>
 
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+?>
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <!-- BEGIN PHP TEMPLATE -->
-
 <html>
-<head>
-<meta name="robots" content="noindex,nofollow">
-<title>Dolibarr Authentification</title>
-
-<link rel="stylesheet" type="text/css" href="<?php echo $conf_css; ?>">
 
-
-<script type="text/javascript">
-function donnefocus() {
-	document.getElementById('<?php echo $focus_element; ?>').focus();
+<?php
+print '<head>
+<meta name="robots" content="noindex,nofollow" />
+<meta name="author" content="Dolibarr Development Team">
+<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>
+<title>'.$langs->trans('Login').' '.$title.'</title>'."\n";
+print '<!-- Includes for JQuery (Ajax library) -->'."\n";
+if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n";  // JQuery
+else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n";    // JQuery
+// JQuery. Must be before other includes
+print '<!-- Includes JS for JQuery -->'."\n";
+if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
+else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
+print '<link rel="stylesheet" type="text/css" href="'.$conf_css.'" />
+<style type="text/css">
+<!--
+#login {
+	margin-top: 70px;
+	margin-bottom: 30px;
 }
-</script>
+.login_table {
+	width: 512px;
+	border: 1px solid #C0C0C0;
+	background: #F0F0F0 url('.$login_background.') repeat-x;
+}
+-->
+</style>'."\n";
+if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER;
+print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
+</head>';
 
-</head>
+?>
 
-<body class="body" onLoad="donnefocus();">
+<body class="body">
 <form id="login" name="login" method="post" action="<?php echo $php_self; ?>">
 <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
 <input type="hidden" name="action" value="buildnewpassword">
diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php
index 783a2d249238b7839a9075632351f012261816a2..86b263807bdaca549ec2048740c168880fd1aec6 100644
--- a/htdocs/user/passwordforgotten.php
+++ b/htdocs/user/passwordforgotten.php
@@ -235,7 +235,7 @@ if (! empty($conf->multicompany->enabled)  && empty($conf->global->MULTICOMPANY_
 if (function_exists("imagecreatefrompng") && ! $disabled)
 {
     $captcha = 1;
-    $captcha_refresh = img_picto($langs->trans("Refresh"),'refresh');
+    $captcha_refresh = img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"');
 }
 
 include($template_dir.'passwordforgotten.tpl.php');	// To use native PHP