Index: trunk/MagicSoft/Mars/mbase/MEnv.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEnv.cc	(revision 7450)
+++ trunk/MagicSoft/Mars/mbase/MEnv.cc	(revision 7458)
@@ -263,14 +263,20 @@
     case (unsigned)-1400748595/*2894218701*/: return kMagenta+offset;
     case 1851881955: return kCyan+offset;
-    case 749623518: return 18; // grey1
-    case 749623517: return 17; // grey2
-    case 749623516: return 16; // grey3
-    case 749623515: return 15; // grey4
-    case 749623514: return 14; // grey5
-    case 741234910: return 18; // gray1
-    case 741234909: return 17; // gray2
-    case 741234908: return 16; // gray3
-    case 741234907: return 15; // gray4
-    case 741234906: return 14; // gray5
+    case 749623518: return 19; // grey1
+    case 749623517: return 18; // grey2
+    case 749623516: return 17; // grey3
+    case 749623515: return 16; // grey4
+    case 749623514: return 15; // grey5
+    case 749623513: return 14; // grey6
+    case 749623512: return 13; // grey7
+    case 749623511: return 12; // grey8
+    case 741234910: return 19; // gray1
+    case 741234909: return 18; // gray2
+    case 741234908: return 17; // gray3
+    case 741234907: return 16; // gray4
+    case 741234906: return 15; // gray5
+    case 741234905: return 14; // gray6
+    case 741234904: return 13; // gray7
+    case 741234903: return 12; // gray8
     }
     return str.Atoi();
@@ -307,9 +313,12 @@
     case kMagenta: val += "Magenta"; break;
     case kCyan:    val += "Cyan";    break;
-    case 18:       val += "White";   break;
-    case 17:       val += "White";   break;
-    case 16:       val += "White";   break;
-    case 15:       val += "White";   break;
-    case 14:       val += "White";   break;
+    case 19:       val += "Grey1";   break;
+    case 18:       val += "Grey2";   break;
+    case 17:       val += "Grey3";   break;
+    case 16:       val += "Grey4";   break;
+    case 15:       val += "Grey5";   break;
+    case 14:       val += "Grey6";   break;
+    case 13:       val += "Grey7";   break;
+    case 12:       val += "Grey8";   break;
     }
 
Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 7450)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 7458)
@@ -18,5 +18,5 @@
 !   Author(s): Thomas Bretz, 4/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2003-2005
+!   Copyright: MAGIC Software Development, 2003-2006
 !
 !
@@ -250,4 +250,5 @@
     filemenu->AddEntry("New &Canvas",       kFileCanvas);
     filemenu->AddEntry("New &Browser",      kFileBrowser);
+    filemenu->AddEntry("New &Tab",          kFileTab);
     filemenu->AddSeparator();
 
@@ -474,5 +475,5 @@
 
     // Add copyright notice
-    l = new TGLabel(f, "(c) MAGIC Software Development, 2000-2005");
+    l = new TGLabel(f, "(c) MAGIC Software Development, 2000-2006");
     fList->Add(l);
     f->AddFrame(l, layb);
@@ -1457,4 +1458,8 @@
         return kTRUE;
 
+    case kFileTab:
+        AddTab(MString::Form("%d", fTab->GetNumberOfTabs()));
+        return kTRUE;
+
     case kFileReset:
         Reset();
@@ -2472,8 +2477,6 @@
         // Print overlaying text (NDC = %)
         //
-        ps->SetTextColor(kBlack);
-        ps->SetTextSize(0.015);
-        ps->SetTextFont(22);
-        ps->SetTextAlign(11); // left top
+        // align phi col font size (11=left top)
+        TAttText(11, 0, kBlack, 22, 0.015).Copy(*ps);
         PSToolsTextNDC(*ps, 0, 1.015, TString("  ")+n->GetName());
         ps->SetTextAlign(21); // cent top
@@ -2490,5 +2493,5 @@
             PSToolsTextNDC(*ps, 0, -0.015, TString("  ")+txt);
             ps->SetTextAlign(31); // right top
-            PSToolsTextNDC(*ps, 1, -0.015, "(c) 2000-2005, Thomas Bretz  ");
+            PSToolsTextNDC(*ps, 1, -0.015, "(c) 2000-2006, Thomas Bretz  ");
         }
 
Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.h	(revision 7450)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.h	(revision 7458)
@@ -43,5 +43,5 @@
     typedef enum {
         // kFile
-        kFileBrowser, kFileCanvas, kFileOpen, kFileSave, kFileSaveAs,
+        kFileBrowser, kFileCanvas, kFileTab, kFileOpen, kFileSave, kFileSaveAs,
         kFileSaveAsPS, kFileSaveAsPDF, kFileSaveAsSVG, kFileSaveAsRoot,
         kFileSaveAsPNG, kFileSaveAsGIF, kFileSaveAsJPG, kFileSaveAsXPM,
Index: trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 7450)
+++ trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 7458)
@@ -480,46 +480,73 @@
 // --------------------------------------------------------------------------
 //
+// Return Mjd of the first day (a monday) which belongs to week 1 of
+// the year give as argument. The returned Mjd might be a date in the
+// year before.
+//
+//  see also MTime::Week()
+//
+Int_t MTime::GetMjdWeek1(Short_t year)
+{
+    MTime t;
+    t.Set(year, 1, 4);
+
+    return (Int_t)t.GetMjd() + t.WeekDay() - 6;
+}
+
+// --------------------------------------------------------------------------
+//
 // Get the week of the year. Valid week values are between 1 and 53.
-// 54 is returned if the day belongs to Week=1 of the next year,
-// 0 if it belongs to the Week=53 and -1 if it belongs to the Week=52
-// of the last year (In this case there is no week 53!)
-//
-Int_t MTime::Week() const
-{
-    static const Int_t kFrSaSo = BIT(kFriday)  | BIT(kSaturday)  | BIT(kSunday);
-    static const Int_t kTuWeTh = BIT(kTuesday) | BIT(kWednesday) | BIT(kThursday);
-
-    MTime t;
-    t.Set(Year(), 1, 1);
-
-    // The weekday of Jan 1st.
-    const Int_t day1st = 1<<t.WeekDay();
-
-    // The number of weeks since the first Monday in the year
-    Int_t week = (DayOfYear()-1 + (t.WeekDay()+6)%7) / 7 + 1;
-
-    // Correct the week number if the year has started with Fr, Sa or So
-    if (day1st & kFrSaSo)
-        week--;
-
-    // If the week number is 53 it might already belong to the next year
-    if (week == 53)
+// If for a january date a week number above 50 is returned the
+// week belongs to the previous year. If for a december data 1 is
+// returned the week already belongs to the next year.
+//
+// The year to which the week belongs is returned in year.
+//
+// Die Kalenderwochen werden für Jahre ab 1976 berechnet, da mit
+// Geltung vom 1. Januar 1976 der Wochenbeginn auf Montag festgelegt
+// wurde. Die erste Woche ist definiert als die Woche, in der
+// mindestens 4 der ersten 7 Januartage fallen (also die Woche, in der
+// der 4. Januar liegt). Beides wurde damals festgelegt in der DIN 1355
+// (1974). Inhaltlich gleich regelt das die Internationale Norm
+// ISO 8601 (1988), die von der Europäischen Union als EN 28601 (1992)
+// übernommen und in Deutschland als DIN EN 28601 (1993) umgesetzt
+// wurde.
+//
+Int_t MTime::Week(Short_t &year) const
+{
+    // Possibilities for Week 1:
+    //
+    //    Mo 4.Jan:   Mo  4. - So 10.    -0   6-6
+    //    Di 4.Jan:   Mo  3. - So  9.    -1   6-5
+    //    Mi 4.Jan:   Mo  2. - So  8.    -2   6-4
+    //    Do 4.Jan:   Mo  1. - So  7.    -3   6-3
+    //    Fr 4.Jan:   Mo 31. - So  6.    -4   6-2
+    //    Sa 4.Jan:   Mo 30. - So  5.    -5   6-1
+    //    So 4.Jan:   Mo 29. - So  4.    -6   6-0
+    //
+    const Int_t mjd2 = GetMjdWeek1(Year()-1);
+    const Int_t mjd0 = GetMjdWeek1(Year());
+    const Int_t mjd3 = GetMjdWeek1(Year()+1);
+
+    // Today
+    const Int_t mjd = (Int_t)GetMjd();
+
+    // Week belongs to last year, return week of last year
+    if (mjd<mjd0)
     {
-        t.Set(Year()+1, 1, 1);
-
-        const Int_t daynext = 1<<t.WeekDay();
-        return daynext&kTuWeTh ? 54 : 53;
+        year = Year()-1;
+        return (mjd-mjd2)/7 + 1;
     }
 
-    // If the week number is 53 it might still belong to the last year
-    if (week == 0)
+    // Check if Week belongs to next year (can only be week 1)
+    if ((mjd3-mjd)/7==1)
     {
-        t.Set(Year()-1, 1, 1);
-
-        const Int_t dayprev = 1<<t.WeekDay();
-        return !(dayprev&kFrSaSo) && (day1st&kFrSaSo) ?  0  :  -1;
+        year = Year()+1;
+        return 1;
     }
 
-    return week;
+    // Return calculated Week
+    year = Year();
+    return (mjd-mjd0)/7 + 1;
 }
 
Index: trunk/MagicSoft/Mars/mbase/MTime.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.h	(revision 7450)
+++ trunk/MagicSoft/Mars/mbase/MTime.h	(revision 7458)
@@ -125,5 +125,6 @@
     UInt_t Sec() const     { Byte_t h, m, s; GetTime(h,m,s); return s; }
     UInt_t DayOfYear() const;
-    Int_t  Week() const;
+    Int_t  Week() const    { Short_t y; return Week(y); }
+    Int_t  Week(Short_t &year) const;
 
     Bool_t IsMidnight() const { return (Long_t)fTime==0 && fNanoSec==0; }
@@ -165,4 +166,5 @@
 
     static MTime GetEaster(Short_t year=-1);
+    static Int_t GetMjdWeek1(Short_t year);
 
     ClassDef(MTime, 3)	//A generalized MARS time stamp
