diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php
index 0001b34c67cbac2a141398a5c5caab16e1be0ce0..556fea2bef184cfb9277ed04631f52158c65b07b 100644
--- a/htdocs/compta/bank/account.php
+++ b/htdocs/compta/bank/account.php
@@ -193,13 +193,16 @@ if ($account > 0)
 	}
 
 
-	$titre=$langs->trans("FinancialAccount")." : ".$acct->label;
-	print_fiche_titre($titre,$mesg);
-
 	// Onglets
 	$head=bank_prepare_head($acct);
 	dolibarr_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0);
 	
+	if (! $_GET["action"]=='addline')
+	{
+		$titre=$langs->trans("FinancialAccount")." : ".$acct->label;
+		print_fiche_titre($titre,$mesg);
+	}
+	
 	print '<table class="notopnoleftnoright" width="100%">';
 
 	/*
@@ -217,8 +220,6 @@ if ($account > 0)
 		print '<input type="hidden" name="vline" value="' . $vline . '">';
 		print '<input type="hidden" name="account" value="' . $acct->id . '">';
 
-		print "<tr class=\"noborder\"><td colspan=\"8\">&nbsp;</td></tr>\n";
-
 		print '<tr>';
 		print '<td align="left" colspan="8"><b>'.$langs->trans("AddBankRecordLong").'</b></td>';
 		print '</tr>';
diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php
index 8ce81fc2b66d93d56a6523429f15961f12b9c064..c6847ca02ddb391fe84f66289b598fa28351fe92 100644
--- a/htdocs/compta/bank/annuel.php
+++ b/htdocs/compta/bank/annuel.php
@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2005      Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2004-2006 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
@@ -18,14 +18,13 @@
  *
  * $Id$
  * $Source$
- *
  */
 
 /**
-	\file        htdocs/compta/bank/annuel.php
-	\ingroup     banque
-	\brief       Page reporting mensuel Entr�es/Sorties d'un compte bancaire
-	\version     $Revision$
+		\file        htdocs/compta/bank/annuel.php
+		\ingroup     banque
+		\brief       Page reporting mensuel Entr�es/Sorties d'un compte bancaire
+		\version     $Revision$
 */
 
 require("./pre.inc.php");
@@ -109,14 +108,14 @@ else
 }
 
 
-$title=$langs->trans("FinancialAccount")." : ".$acct->label;
-$lien=($year_start?"<a href='annuel.php?account=".$acct->id."&year_start=".($year_start-1)."'>".img_previous()."</a> <a href='annuel.php?account=".$acct->id."&year_start=".($year_start+1)."'>".img_next()."</a>":"");
-print_fiche_titre($title,$lien);
-
 // Onglets
 $head=bank_prepare_head($acct);
 dolibarr_fiche_head($head,'annual',$langs->trans("FinancialAccount"),0);
 
+$title=$langs->trans("FinancialAccount")." : ".$acct->label;
+$lien=($year_start?"<a href='annuel.php?account=".$acct->id."&year_start=".($year_start-1)."'>".img_previous()."</a> <a href='annuel.php?account=".$acct->id."&year_start=".($year_start+1)."'>".img_next()."</a>":"");
+print_fiche_titre($title,$lien);
+
 
 // Affiche tableau
 print '<table class="noborder" width="100%">';
diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php
index 4751a1fcf6ed9b1f3926f54808ed2584bcb5b75c..a54331a148309ce93a557dc3b8882e5164f0e5a0 100644
--- a/htdocs/compta/bank/bankid_fr.php
+++ b/htdocs/compta/bank/bankid_fr.php
@@ -104,9 +104,6 @@ $form = new Form($db);
 		/*
 		* Affichage onglets
 		*/
-		$titre=$langs->trans("FinancialAccount")." : ".$account->label;
-		print_fiche_titre($titre,$mesg);
-
 		// Onglets
 		$head=bank_prepare_head($account);
 		dolibarr_fiche_head($head, 'bankid', $langs->trans("FinancialAccount"));
diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php
index d5d8e6482ec07e901d2b46bbe4629902ceb75995..a97aa791f202319dd9af2449aea993581574d0af 100644
--- a/htdocs/compta/bank/fiche.php
+++ b/htdocs/compta/bank/fiche.php
@@ -258,8 +258,6 @@ else
 		/*
 		* Affichage onglets
 		*/
-		$titre=$langs->trans("FinancialAccount")." : ".$account->label;
-		print_fiche_titre($titre,$mesg);
 
 		// Onglets
 		$head=bank_prepare_head($account);
diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php
index 788214bb6191bfbf8f080a6a0b988135a22eda6b..eead38c42a96a8ae43482bcb2d544bea377e6979 100644
--- a/htdocs/compta/bank/graph.php
+++ b/htdocs/compta/bank/graph.php
@@ -158,6 +158,7 @@ if ($account > 0)
     $px->SetWidth($width);
     $px->SetHeight($height);
 	$px->SetType('lines');
+	$px->setBgColor('onglet');
     $px->draw($file);
 
 	
@@ -248,6 +249,7 @@ if ($account > 0)
     $px->SetWidth($width);
     $px->SetHeight($height);
 	$px->SetType('lines');
+	$px->setBgColor('onglet');
     $px->draw($file);
 
 
@@ -322,6 +324,7 @@ if ($account > 0)
     $px->SetWidth($width);
     $px->SetHeight($height);
 	$px->SetType('lines');
+	$px->setBgColor('onglet');
     $px->draw($file);
 
 
@@ -398,12 +401,9 @@ if ($account > 0)
     $px->SetHeight($height);
 	$px->SetType('bars');
 	$px->SetShading(8);
+	$px->setBgColor('onglet');
     $px->draw($file);
 
-
-	$titre=$langs->trans("FinancialAccount")." : ".$acct->label;
-	print_fiche_titre($titre,$mesg);
-
 	// Onglets
 	$head=bank_prepare_head($acct);
 	dolibarr_fiche_head($head,'graph',$langs->trans("FinancialAccount"),0);
diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php
index 444e70be8f76c10003169a7d2b76ca1bc2d91589..34ef233634772c2e9911496b7df9b9bf5ce647da 100644
--- a/htdocs/compta/bank/releve.php
+++ b/htdocs/compta/bank/releve.php
@@ -87,13 +87,13 @@ if (! isset($_GET["num"]))
 		$numrows = $db->num_rows($result);
 		$i = 0;
 
-		$titre=$langs->trans("FinancialAccount")." : ".$acct->label;
-		print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], "&amp;account=".$_GET["account"], $sortfield, $sortorder,'',$numrows);
-
 		// Onglets
 		$head=bank_prepare_head($acct);
 		dolibarr_fiche_head($head,'statement',$langs->trans("FinancialAccount"),0);
 
+		$titre=$langs->trans("FinancialAccount")." : ".$acct->label;
+		print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], "&amp;account=".$_GET["account"], $sortfield, $sortorder,'',$numrows);
+
 		print '<table class="noborder" width="100%">';
 		print "<tr class=\"liste_titre\">";
 		print '<td>'.$langs->trans("AccountStatement").'</td></tr>';
diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php
index 9d258e3642d343f578f6a2e23a3be8b25c229312..42cec6ca7dfaccc95fbee80e47e320d488967dfe 100644
--- a/htdocs/compta/facture/stats/index.php
+++ b/htdocs/compta/facture/stats/index.php
@@ -1,6 +1,6 @@
 <?php
-/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (c) 2004 Laurent Destailleur  <eldy@users.sourceforge.net>
+/* Copyright (C) 2003      Rodolphe Quiedeville <rodolphe@quiedeville.org>
+ * Copyright (c) 2004-2006 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
@@ -18,7 +18,6 @@
  *
  * $Id$
  * $Source$
- *
  */
 
 /**
@@ -34,10 +33,7 @@ require_once(DOL_DOCUMENT_ROOT."/dolgraph.class.php");
 $WIDTH=500;
 $HEIGHT=250;
 
-
-/*
- * S�curit� acc�s client
- */
+// S�curit� acc�s client
 if ($user->societe_id > 0) 
 {
   $action = '';
@@ -67,6 +63,7 @@ if (! $mesg)
     $px->SetLegend(array($year - 1, $year));
     $px->SetWidth($WIDTH);
     $px->SetHeight($HEIGHT);
+    $px->SetShading(4);
     $px->draw($filename);
 }
       
@@ -76,7 +73,7 @@ if ($socidp)
   $sql .= " AND fk_soc = $socidp";
 }
 $sql .= " GROUP BY dm DESC ";
-$result=$db->query($sql);
+$resql=$db->query($sql);
 if ($resql)
 {
 	$num = $db->num_rows($resql);
@@ -104,7 +101,7 @@ if ($resql)
 }
 else
 {
-  dolibarr_print_error($db);
+	dolibarr_print_error($db);
 }
 
 
diff --git a/htdocs/dolgraph.class.php b/htdocs/dolgraph.class.php
index 559d78e9a043ed4bbabb76f63f0a666d131c2557..6f994ed3c709e90f60b459eb8492683dd8ab1cd5 100644
--- a/htdocs/dolgraph.class.php
+++ b/htdocs/dolgraph.class.php
@@ -63,6 +63,7 @@ class DolGraph
 	function DolGraph()
 	{
 		global $conf;
+		global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
 	
 		// Test si module GD pr�sent
 		$modules_list = get_loaded_extensions();
@@ -92,12 +93,12 @@ class DolGraph
 		$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
 		if (is_readable($color_file))
 		{
-			include($color_file);
+			include_once($color_file);
 			if (isset($theme_bordercolor)) $this->bordercolor = $theme_bordercolor;
 			if (isset($theme_datacolor))   $this->datacolor   = $theme_datacolor;
 			if (isset($theme_bgcolor))     $this->bgcolor     = $theme_bgcolor;
 		}
-	
+		//print 'bgcolor: '.join(',',$this->bgcolor).'<br>';
 		return 1;
 	}
 	
@@ -161,12 +162,26 @@ class DolGraph
 		$this->graph->SetPrecisionX(0);
 	
 		// Set areas
-		$this->graph->SetNewPlotAreaPixels(80, 40, $this->width-10, $this->height-40);
+		$left_space=80;								// For y labels
+		$right_space=10;							// If no legend
+		if (isset($this->Legend)) $right_space=70;	// For legend
+
+		$this->graph->SetNewPlotAreaPixels($left_space, 40, $this->width-$right_space, $this->height-40);
 		if (isset($this->MaxValue))
 		{
 			$this->graph->SetPlotAreaWorld(0,$this->MinValue,sizeof($this->data),$this->MaxValue);
 		}
 
+		// Define title
+		if (strlen($this->title)) $this->graph->SetTitle($this->title);
+	
+		// D�fini position du graphe (et legende) au sein de l'image
+		if (isset($this->Legend))
+		{
+			$this->graph->SetLegendPixels($this->width-$right_space+8,40,'');
+			$this->graph->SetLegend($this->Legend);
+		}
+
 		if (isset($this->SetShading))
 		{
 			$this->graph->SetShading($this->SetShading);
@@ -186,20 +201,7 @@ class DolGraph
 
 		$this->graph->SetPlotBorderType("left");		// Affiche axe y a gauche uniquement
 		$this->graph->SetVertTickPosition('plotleft');	// Affiche tick axe y a gauche uniquement
-
-
-	
-
-	
-		// Define title
-		if (strlen($this->title)) $this->graph->SetTitle($this->title);
 	
-		// D�fini position du graphe (et legende) au sein de l'image
-		if (isset($this->Legend))
-		{
-			$this->graph->SetLegend($this->Legend);
-		}
-
 		$this->graph->SetOutputFile($file);
 	}
 	
@@ -264,9 +266,29 @@ class DolGraph
 		unset($this->bgcolor);
 	}
 	
+	/**
+	*	\brief		Definie la couleur de fond du graphique
+	*	\param		bg_color		array(R,G,B) ou 'onglet' ou 'default'
+	*/
 	function SetBgColor($bg_color = array(255,255,255))
 	{
-		$this->bgcolor = $bg_color;
+		global $theme_bgcolor,$theme_bgcoloronglet;
+		if (! is_array($bg_color))
+		{
+			if ($bg_color == 'onglet')
+			{
+				//print 'ee'.join(',',$theme_bgcoloronglet);
+				$this->bgcolor = $theme_bgcoloronglet;
+			}
+			else
+			{
+				$this->bgcolor = $theme_bgcolor;
+			}
+		}
+		else
+		{
+			$this->bgcolor = $bg_color;
+		}
 	}
 	
 	function ResetDataColor()
diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php
index f4f6ccd275535914169f082882e55e331c6c3cee..161dc850e727fb940356342aafbd557f7f81e6e2 100644
--- a/htdocs/facture.class.php
+++ b/htdocs/facture.class.php
@@ -1623,7 +1623,6 @@ class Facture extends CommonObject
 				return $langs->trans('Bill'.$prefix.'StatusPayed').' '.img_picto($langs->trans('BillStatusPayed'),'statut6');
 			}
 		}
-
 	}
 
     /**
diff --git a/htdocs/socnote.php b/htdocs/socnote.php
index ec425a02e1ebe23ba7fd3b23bea02cf2a623dd49..8e8905074370e5542ff2ade0da5a3b046bf0462f 100644
--- a/htdocs/socnote.php
+++ b/htdocs/socnote.php
@@ -118,9 +118,9 @@ if ($socidp > 0)
 		print "<input type=\"hidden\" name=\"action\" value=\"add\">";
 		print "<input type=\"hidden\" name=\"socid\" value=\"".$societe->id."\">";
 
-	    // �diteur wysiwyg
 		if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE)
 	    {
+		    // Editeur wysiwyg
 			require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
 			$doleditor=new DolEditor('note',$societe->note,280,'dolibarr_notes','In',true);
 			$doleditor->Create();
@@ -129,7 +129,6 @@ if ($socidp > 0)
 	    {
 			print '<textarea name="note" cols="70" rows="10">'.$societe->note.'</textarea>';
 	    }
-
 	}
 	else
 	{