--- Lib_original.pm	2009-05-15 10:03:58.000000000 +0200
+++ Lib.pm	2009-05-15 14:55:11.000000000 +0200
@@ -449,17 +449,15 @@
 <link rel=stylesheet type="text/css" href="$Conf{CgiImageDirURL}/$Conf{CgiCSSFile}" title="CSSFile">
 $Conf{CgiHeaders}
 <script src="$Conf{CgiImageDirURL}/sorttable.js"></script>
+<script src="$Conf{CgiImageDirURL}/utils.js"></script>
 </head><body onLoad="document.getElementById('NavMenu').style.height=document.body.scrollHeight">
-<a href="http://backuppc.sourceforge.net"><img src="$Conf{CgiImageDirURL}/logo.gif" hspace="5" vspace="7" border="0"></a><br>
+<div class="logo_top"><a href="http://backuppc.sourceforge.net"><img src="$Conf{CgiImageDirURL}/logo.gif" hspace="5" vspace="7" border="0"></a></div><br>
+<div class="NavMenu">
 EOF
 
     if ( defined($Hosts) && defined($host) && defined($Hosts->{$host}) ) {
-	print "<div class=\"NavMenu\">";
 	NavSectionTitle("${EscHTML($host)}");
-	print <<EOF;
-</div>
-<div class="NavMenu">
-EOF
+	NavSectionStart($host);
 	NavLink("?host=${EscURI($host)}",
 		"$host $Lang->{Home}", " class=\"navbar\"");
 	NavLink("?action=browse&host=${EscURI($host)}",
@@ -486,23 +484,16 @@
             NavLink("?action=view&type=config&host=${EscURI($host)}",
                     $Lang->{Config_file}, " class=\"navbar\"");
         }
-	print "</div>\n";
-    }
-    print("<div id=\"Content\">\n$content\n");
-    if ( defined($contentSub) && ref($contentSub) eq "CODE" ) {
-	while ( (my $s = &$contentSub()) ne "" ) {
-	    print($s);
-	}
+	unless ( defined($Hosts) && defined($host) && defined($Hosts->{$host}) ) { 
+		print("<div class=\"NavMenu\">"); 
+     	}
+	print "<br>";
+	NavSectionEnd();
     }
-    print($contentPost) if ( defined($contentPost) );
-    print <<EOF;
-<br><br><br>
-</div>
-<div class="NavMenu" id="NavMenu" style="height:100%">
-EOF
     my $hostSelectbox = "<option value=\"#\">$Lang->{Select_a_host}</option>";
     my @hosts = GetUserHosts($Conf{CgiNavBarAdminAllHosts});
     NavSectionTitle($Lang->{Hosts});
+    NavSectionStart($Lang->{Hosts});
     if ( defined($Hosts) && %$Hosts > 0 && @hosts ) {
         foreach my $host ( @hosts ) {
 	    NavLink("?host=${EscURI($host)}", $host)
@@ -529,18 +520,33 @@
     </form>
 EOF
     }
+    NavSectionEnd();
     NavSectionTitle($Lang->{NavSectionTitle_});
+    NavSectionStart($Lang->{NavSectionTitle_});
     foreach my $l ( @adminLinks ) {
         if ( $PrivAdmin || !$l->{priv} ) {
             my $txt = $l->{lname} ne "" ? $Lang->{$l->{lname}} : $l->{name};
             NavLink($l->{link}, $txt);
         }
     }
-
     print <<EOF;
-<br><br><br>
+<br>
+EOF
+    NavSectionEnd();
+    print <<EOF;
 </div>
 EOF
+	print("<div id=\"Content\">\n$content\n"); 
+	if ( defined($contentSub) && ref($contentSub) eq "CODE" ) { 
+		while ( (my $s = &$contentSub()) ne "" ) { 
+			print($s); 
+		} 
+	} 
+	print($contentPost) if ( defined($contentPost) ); 
+	print <<EOF; 
+<br><br><br> 
+</div> 
+EOF
 }
 
 sub Trailer
@@ -550,21 +556,27 @@
 EOF
 }
 
-
 sub NavSectionTitle
 {
     my($head) = @_;
     print <<EOF;
-<div class="NavTitle">$head</div>
+<div class="NavTitle"><table><tr><td width="95%">$head</td><td width="5%"><a href="#" onclick="expandID('xs$head')">+/-</a></td></tr></table></div>
 EOF
 }
 
 sub NavSectionStart
 {
+    my($headdiv) = @_;
+    print <<EOF;
+<div id="xs$headdiv">
+EOF
 }
 
 sub NavSectionEnd
 {
+    print <<EOF;
+</div>
+EOF
 }
 
 sub NavLink
