Index: src/header.html
===================================================================
--- src/header.html	(revision 0)
+++ src/header.html	(revision 0)
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>$title</title>
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
+<link href="$relpath$$stylesheet" rel="stylesheet" type="text/css" />
+$treeview
+$search
+$mathjax
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+
+<!--BEGIN TITLEAREA-->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <!--BEGIN PROJECT_LOGO-->
+  <td id="projectlogo"><img alt="Logo" src="$relpath$$projectlogo"/></td>
+  <!--END PROJECT_LOGO-->
+  <!--BEGIN PROJECT_NAME-->
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">$projectname
+   <!--BEGIN PROJECT_NUMBER-->&#160;<span id="projectnumber">$projectnumber</span><!--END PROJECT_NUMBER-->
+   </div>
+   <!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
+  </td>
+  <!--END PROJECT_NAME-->
+  <!--BEGIN !PROJECT_NAME-->
+   <!--BEGIN PROJECT_BRIEF-->
+    <td style="padding-left: 0.5em;">
+    <div id="projectbrief">$projectbrief</div>
+    </td>
+   <!--END PROJECT_BRIEF-->
+  <!--END !PROJECT_NAME-->
+  <!--BEGIN DISABLE_INDEX-->
+   <!--BEGIN SEARCHENGINE-->
+   <td>$searchbox</td>
+   <!--END SEARCHENGINE-->
+  <!--END DISABLE_INDEX-->
+ </tr>
+ </tbody>
+</table>
+</div>
+<!--END TITLEAREA-->
Index: src/libdoxygen.t
===================================================================
--- src/libdoxygen.t	(revision 767)
+++ src/libdoxygen.t	(working copy)
@@ -110,6 +110,12 @@
 layout_default.h: layout_default.xml
 	cat layout_default.xml | $(TO_C_CMD) >layout_default.h 
 
+header_html.h: header.html
+	cat header.html | $(TO_C_CMD) >header_html.h
+
+footer_html.h: footer.html
+	cat footer.html | $(TO_C_CMD) >footer_html.h
+
 search_php.h: search.php
 	cat search.php | $(TO_C_CMD) >search_php.h 
 
Index: src/header_html.h
===================================================================
--- src/header_html.h	(revision 0)
+++ src/header_html.h	(revision 0)
@@ -0,0 +1,47 @@
+"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
+"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
+"<head>\n"
+"<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n"
+"<title>$title</title>\n"
+"<link href=\"$relpath$tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
+"<link href=\"$relpath$$stylesheet\" rel=\"stylesheet\" type=\"text/css\" />\n"
+"$treeview\n"
+"$search\n"
+"$mathjax\n"
+"</head>\n"
+"<body>\n"
+"<div id=\"top\"><!-- do not remove this div! -->\n"
+"\n"
+"<!--BEGIN TITLEAREA-->\n"
+"<div id=\"titlearea\">\n"
+"<table cellspacing=\"0\" cellpadding=\"0\">\n"
+" <tbody>\n"
+" <tr style=\"height: 56px;\">\n"
+"  <!--BEGIN PROJECT_LOGO-->\n"
+"  <td id=\"projectlogo\"><img alt=\"Logo\" src=\"$relpath$$projectlogo\"/></td>\n"
+"  <!--END PROJECT_LOGO-->\n"
+"  <!--BEGIN PROJECT_NAME-->\n"
+"  <td style=\"padding-left: 0.5em;\">\n"
+"   <div id=\"projectname\">$projectname\n"
+"   <!--BEGIN PROJECT_NUMBER-->&#160;<span id=\"projectnumber\">$projectnumber</span><!--END PROJECT_NUMBER-->\n"
+"   </div>\n"
+"   <!--BEGIN PROJECT_BRIEF--><div id=\"projectbrief\">$projectbrief</div><!--END PROJECT_BRIEF-->\n"
+"  </td>\n"
+"  <!--END PROJECT_NAME-->\n"
+"  <!--BEGIN !PROJECT_NAME-->\n"
+"   <!--BEGIN PROJECT_BRIEF-->\n"
+"    <td style=\"padding-left: 0.5em;\">\n"
+"    <div id=\"projectbrief\">$projectbrief</div>\n"
+"    </td>\n"
+"   <!--END PROJECT_BRIEF-->\n"
+"  <!--END !PROJECT_NAME-->\n"
+"  <!--BEGIN DISABLE_INDEX-->\n"
+"   <!--BEGIN SEARCHENGINE-->\n"
+"   <td>$searchbox</td>\n"
+"   <!--END SEARCHENGINE-->\n"
+"  <!--END DISABLE_INDEX-->\n"
+" </tr>\n"
+" </tbody>\n"
+"</table>\n"
+"</div>\n"
+"<!--END TITLEAREA-->\n"
Index: src/definition.cpp
===================================================================
--- src/definition.cpp	(revision 767)
+++ src/definition.cpp	(working copy)
@@ -1343,7 +1343,6 @@
 void Definition::writeNavigationPath(OutputList &ol) const
 {
   static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
-  static bool hasCustomFooter = !Config_getString("HTML_FOOTER").isEmpty();
 
   ol.pushGeneratorState();
   ol.disableAllBut(OutputGenerator::Html);
@@ -1356,14 +1355,8 @@
   ol.writeString("  <div id=\"nav-path\" class=\"navpath\">\n");
   ol.writeString("    <ul>\n");
   writePathFragment(ol);
-  if (!hasCustomFooter && generateTreeView) // write the doxygen logo as part of the navigation bar
+  if (!generateTreeView)
   {
-    ol.writeString("      <li class=\"footer\">");
-    ol.writeLogo();
-    ol.writeString("</li>\n");
-  }
-  if (!hasCustomFooter || !generateTreeView)
-  {
     ol.writeString("    </ul>\n");
     ol.writeString("  </div>\n");
   }
Index: src/footer_html.h
===================================================================
--- src/footer_html.h	(revision 0)
+++ src/footer_html.h	(revision 0)
@@ -0,0 +1,16 @@
+"<!--BEGIN GENERATE_TREEVIEW-->\n"
+"    <li class=\"footer\">$generatedby\n"
+"    <a href=\"http://www.doxygen.org/index.html\">\n"
+"    <img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/></a> $doxygenversion </li>\n"
+"   </ul>\n"
+" </div>\n"
+"<!--END GENERATE_TREEVIEW-->\n"
+"<!--BEGIN !GENERATE_TREEVIEW-->\n"
+"<hr class=\"footer\"/><address class=\"footer\"><small>\n"
+"$generatedby &#160;<a href=\"http://www.doxygen.org/index.html\">\n"
+"<img class=\"footer\" src=\"$relpath$doxygen.png\" alt=\"doxygen\"/>\n"
+"</a> $doxygenversion\n"
+"</small></address>\n"
+"<!--END !GENERATE_TREEVIEW-->\n"
+"</body>\n"
+"</html>\n"
\ No newline at end of file
Index: src/search.php
===================================================================
--- src/search.php	(revision 767)
+++ src/search.php	(working copy)
@@ -246,6 +246,7 @@
       echo "  <tr>\n";
       echo "    <td align=\"right\">$num.</td>";
       echo     "<td><a class=\"el\" href=\"".$doc["url"]."\">".$doc["name"]."</a></td>\n";
+      echo "  </tr>\n";
       echo "  <tr>\n";
       echo "    <td></td><td class=\"tiny\">".report_matches()." ";
       foreach ($doc["words"] as $wordInfo)
@@ -309,7 +310,6 @@
   // report results to the user
   report_results($sorted);
   echo "</div>\n";
-  end_page();
   fclose($file);
 }
 
Index: src/htmlgen.h
===================================================================
--- src/htmlgen.h	(revision 767)
+++ src/htmlgen.h	(working copy)
@@ -194,7 +194,7 @@
     void endClassDiagram(const ClassDiagram &,const char *,const char *);
     void startPageRef() {}
     void endPageRef(const char *,const char *) {}
-    void startQuickIndices();
+    void startQuickIndices() {};
     void endQuickIndices();
     void writeSplitBar(const char *name);
     void writeLogo();
Index: src/index.cpp
===================================================================
--- src/index.cpp	(revision 767)
+++ src/index.cpp	(working copy)
@@ -317,7 +317,6 @@
 void endFile(OutputList &ol,bool skipNavIndex)
 {
   static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
-  static bool hasCustomFooter = !Config_getString("HTML_FOOTER").isEmpty();
   ol.pushGeneratorState();
   ol.disableAllBut(OutputGenerator::Html);
   if (!skipNavIndex)
@@ -328,14 +327,6 @@
       ol.writeString("</div>\n");
       ol.writeString("  <div id=\"nav-path\" class=\"navpath\">\n");
       ol.writeString("    <ul>\n");
-      if (!hasCustomFooter)
-      {
-        ol.writeString("      <li class=\"footer\">");
-        ol.writeLogo();
-        ol.writeString("</li>\n");
-        ol.writeString("    </ul>\n");
-        ol.writeString("  </div>\n");
-      }
     }
   }
   ol.writeFooter(); // write the footer
Index: src/footer.html
===================================================================
--- src/footer.html	(revision 0)
+++ src/footer.html	(revision 0)
@@ -0,0 +1,16 @@
+<!--BEGIN GENERATE_TREEVIEW-->
+    <li class="footer">$generatedby
+    <a href="http://www.doxygen.org/index.html">
+    <img class="footer" src="doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
+   </ul>
+ </div>
+<!--END GENERATE_TREEVIEW-->
+<!--BEGIN !GENERATE_TREEVIEW-->
+<hr class="footer"/><address class="footer"><small>
+$generatedby &#160;<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="$relpath$doxygen.png" alt="doxygen"/>
+</a> $doxygenversion
+</small></address>
+<!--END !GENERATE_TREEVIEW-->
+</body>
+</html>
\ No newline at end of file
Index: src/search_php.h
===================================================================
--- src/search_php.h	(revision 767)
+++ src/search_php.h	(working copy)
@@ -246,6 +246,7 @@
 "      echo \"  <tr>\\n\";\n"
 "      echo \"    <td align=\\\"right\\\">$num.</td>\";\n"
 "      echo     \"<td><a class=\\\"el\\\" href=\\\"\".$doc[\"url\"].\"\\\">\".$doc[\"name\"].\"</a></td>\\n\";\n"
+"      echo \"  </tr>\\n\";\n"
 "      echo \"  <tr>\\n\";\n"
 "      echo \"    <td></td><td class=\\\"tiny\\\">\".report_matches().\" \";\n"
 "      foreach ($doc[\"words\"] as $wordInfo)\n"
@@ -309,7 +310,6 @@
 "  // report results to the user\n"
 "  report_results($sorted);\n"
 "  echo \"</div>\\n\";\n"
-"  end_page();\n"
 "  fclose($file);\n"
 "}\n"
 "\n"
Index: src/libdoxygen.pro.in
===================================================================
--- src/libdoxygen.pro.in	(revision 767)
+++ src/libdoxygen.pro.in	(working copy)
@@ -47,10 +47,12 @@
 		example.h \
 		filedef.h \
 		filename.h \
+		footer_html.h \
 		formula.h \
 		ftextstream.h \
 		ftvhelp.h \
 		groupdef.h \
+		header_html.h \
 		htags.h \
 		htmlattrib.h \
                 htmldocvisitor.h \
Index: src/htmlgen.cpp
===================================================================
--- src/htmlgen.cpp	(revision 767)
+++ src/htmlgen.cpp	(working copy)
@@ -45,6 +45,14 @@
 //#define DBG_HTML(x) x;
 #define DBG_HTML(x) 
 
+static const char defaultHtmlHeader[] =
+#include "header_html.h"
+;
+
+static const char defaultHtmlFooter[] =
+#include "footer_html.h"
+;
+
 static const char defaultStyleSheet[] = 
 #include "doxygen_css.h"
 ;
@@ -753,7 +761,7 @@
 static void writeServerSearchBox(FTextStream &t,const char *relPath,bool highlightSearch)
 {
   t << "        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
-  t << "          <span class=\"left\">\n";
+  t << "          <div class=\"left\">\n";
   t << "            <form id=\"FSearchBox\" action=\"" << relPath << "search.php\" method=\"get\">\n";
   t << "              <img id=\"MSearchSelect\" src=\"" << relPath << "search/mag.png\" alt=\"\"/>\n";
   if (!highlightSearch)
@@ -763,7 +771,7 @@
     t << "                     onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n";
     t << "                     onblur=\"searchBox.OnSearchFieldFocus(false)\"/>\n";
     t << "            </form>\n";
-    t << "          </span><span class=\"right\"></span>\n";
+    t << "          </div><div class=\"right\"></div>\n";
     t << "        </div>\n";
   }
 }
@@ -783,64 +791,6 @@
   return "";
 }
 
-static void writeTitleArea(FTextStream &t,const char *relPath,
-            const char *projectName,const char *projectBrief,
-            const char *projectNumber,const char *projectLogo)
-{
-  QCString logoName = getLogoName(projectLogo);
-  static bool disableIndex = Config_getBool("DISABLE_INDEX"); 
-  static bool searchEngine      = Config_getBool("SEARCHENGINE");
-  static bool serverBasedSearch = Config_getBool("SERVER_BASED_SEARCH");
-  if (!(logoName.isEmpty() && QCString(projectName).isEmpty() && 
-        QCString(projectBrief).isEmpty()) ||
-      (disableIndex && searchEngine))
-  {
-    t << "<div id=\"titlearea\">" << endl;
-    t << "<table cellspacing=\"0\" cellpadding=\"0\">" << endl;
-    t << " <tbody>" << endl;
-    t << " <tr style=\"height: 56px;\">" << endl;
-    if (!logoName.isEmpty())
-    {
-      t << "  <td id=\"projectlogo\"><img alt=\"Logo\" src=\"" << relPath << logoName << "\"/></td>" << endl;
-    }
-    if (!(QCString(projectName).isEmpty() && QCString(projectBrief).isEmpty()))
-    {
-      t << "  <td style=\"padding-left: 0.5em;\">" << endl;
-      if (!QCString(projectName).isEmpty())
-      {
-        t << "   <div id=\"projectname\">" << projectName;
-        if (!QCString(projectNumber).isEmpty())
-        {
-          t << "&#160;<span id=\"projectnumber\">" << projectNumber << "</span>";
-        }
-        t << "</div>" << endl;
-      }
-      if (!QCString(projectBrief).isEmpty())
-      {
-        t << "   <div id=\"projectbrief\">" << projectBrief << "</div>" << endl;
-      }
-      t << "  </td>" << endl;
-    }
-    if (disableIndex && searchEngine)
-    {
-      t << "  <td>" << endl;
-      if (serverBasedSearch)
-      {
-        writeServerSearchBox(t,relPath,FALSE);
-      }
-      else
-      {
-        writeClientSearchBox(t,relPath);
-      }
-      t << "  </td>" << endl;
-    }
-    t << " </tr>" << endl;
-    t << " </tbody>" << endl;
-    t << "</table>" << endl;
-    t << "</div>" << endl;
-  }
-}
-
 //------------------------------------------------------------------------
 
 /// substitute all occurrences of \a src in \a s by \a dst
@@ -959,10 +909,14 @@
                                        const QCString &relPath)
 {
   // Build CSS/Javascript tags depending on treeview, search engine settings
+  QCString cssFile;
+  QCString generatedBy;
   QCString treeViewCssJs;
   QCString searchCssJs;
   QCString searchBox;
   QCString mathJaxJs;
+
+  static bool timeStamp = Config_getBool("HTML_TIMESTAMP");
   static bool treeView = Config_getBool("GENERATE_TREEVIEW");
   static bool searchEngine = Config_getBool("SEARCHENGINE");
   static bool serverBasedSearch = Config_getBool("SERVER_BASED_SEARCH");
@@ -974,6 +928,19 @@
   static bool hasProjectLogo = !Config_getString("PROJECT_LOGO").isEmpty();
   static bool titleArea = (hasProjectName || hasProjectBrief || hasProjectLogo || (disableIndex && searchEngine));
 
+  cssFile = Config_getString("HTML_STYLESHEET");
+  if (cssFile.isEmpty())
+  {
+    cssFile = "doxygen.css";
+  }
+
+  if (timeStamp) {
+    generatedBy = theTranslator->trGeneratedAt(dateToString(TRUE), Config_getString("PROJECT_NAME"));
+  }
+  else {
+    generatedBy = theTranslator->trGeneratedBy();
+  }
+
   if (treeView)
   {
     treeViewCssJs = "<link href=\"$relpath$navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
@@ -1025,10 +992,12 @@
   QCString result = substituteKeywords(s,title);
 
   // additional HTML only keywords
+  result = substitute(result,"$stylesheet",cssFile);
   result = substitute(result,"$treeview",treeViewCssJs);
   result = substitute(result,"$searchbox",searchBox);
   result = substitute(result,"$search",searchCssJs);
   result = substitute(result,"$mathjax",mathJaxJs);
+  result = substitute(result,"$generatedby",generatedBy);
   result = substitute(result,"$relpath$",relPath); //<-- must be last
   
   // additional HTML only conditional blocks
@@ -1072,11 +1041,18 @@
     g_header=fileToString(Config_getString("HTML_HEADER"));
     //printf("g_header='%s'\n",g_header.data());
   }
+  else {
+    g_header = defaultHtmlHeader;
+  }
+
   if (!Config_getString("HTML_FOOTER").isEmpty()) 
   {
     g_footer=fileToString(Config_getString("HTML_FOOTER"));
     //printf("g_footer='%s'\n",g_footer.data());
   }
+  else {
+    g_footer = defaultHtmlFooter;
+  }
   createSubDirs(d);
 
   QCString fileName=dname+"/tabs.css";
@@ -1141,126 +1117,6 @@
   t << replaceColorMarkers(defaultStyleSheet);
 }
 
-static void writeDefaultNavTree(FTextStream &t,const char *relPathStr)
-{
-  static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
-  if (generateTreeView)
-  {
-    t << "<link href=\"" << relPathStr << "navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n";
-    t << "<script type=\"text/javascript\" src=\"" << relPathStr << "jquery.js\"></script>\n";
-    t << "<script type=\"text/javascript\" src=\"" << relPathStr << "navtree.js\"></script>\n";
-    t << "<script type=\"text/javascript\" src=\"" << relPathStr << "resize.js\"></script>\n";
-    t << "<script type=\"text/javascript\">" << endl;
-    t << "$(document).ready(initResizable);" << endl;
-    t << "</script>" << endl;
-  }
-}
-
-static void writeDefaultHeaderFile(FTextStream &t, const char *name,
-                                   const char *title,
-                                   const char *relPath,bool usePathCmd,
-                                   bool searchPage=FALSE)
-{
-  QString relPathStr;
-  if (usePathCmd) 
-    relPathStr="$relpath$";
-  else
-    relPathStr=relPath;
-
-  QCString id = name;
-  if (id.right(Doxygen::htmlFileExtension.length())==Doxygen::htmlFileExtension) 
-  {
-    id=id.left(id.length()-Doxygen::htmlFileExtension.length());
-  }
-
-  static bool searchEngine = Config_getBool("SEARCHENGINE");
-  static bool serverBasedSearch = Config_getBool("SERVER_BASED_SEARCH");
-  //if (searchEngine && !generateTreeView)
-  //{
-  //  t << "<!-- This comment will put IE 6, 7 and 8 in quirks mode -->" << endl;
-  //}
-  //  t << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
-  //  t << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
-  t << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
-  t << "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n"
-       "<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n"
-       "<title>"; 
-  t << convertToHtml(title);
-  t << "</title>\n";
-  
-  t << "<link href=\"" << relPathStr << "tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n";
-  if (searchEngine /* && !generateTreeView*/ )
-  {
-    t << "<link href=\"" << relPathStr << "search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n";
-    t << "<script type=\"text/javascript\" src=\"" << relPathStr << "search/search.js\"></script>\n";
-  }
-
-  writeDefaultNavTree(t,relPathStr);
-
-  if (Config_getBool("USE_MATHJAX"))
-  {
-    QCString path = Config_getString("MATHJAX_RELPATH");
-    if (!path.isEmpty() && path.at(path.length()-1)!='/')
-    {
-      path+="/";
-    }
-    if (path.isEmpty() || path.left(2)=="..") // relative path
-    {
-      path.prepend(relPathStr);
-    }
-    t << "<script src=\"" << path << "MathJax.js\">\n";
-    t << "  MathJax.Hub.Config({\n";
-    t << "    extensions: [\"tex2jax.js\"],\n";
-    t << "    jax: [\"input/TeX\",\"output/HTML-CSS\"],\n";
-    t << "});\n";
-    t << "</script>\n";
-  }
-  t << "<link ";
-  t << "href=\"";
-  QCString cssname=Config_getString("HTML_STYLESHEET");
-  if (cssname.isEmpty())
-  {
-    t << relPathStr << "doxygen.css";
-  }
-  else
-  {
-    if (usePathCmd)
-    {
-      t << relPathStr << cssname;
-    }
-    else
-    {
-      QFileInfo cssfi(cssname);
-      if (!cssfi.exists())
-      {
-        err("error: user specified HTML style sheet file does not exist!\n");
-      }
-      t << relPathStr << cssfi.fileName();
-    }
-  }
-  
-  t << "\" rel=\"stylesheet\" type=\"text/css\"/>\n";
-  t << "</head>\n";
-  if (searchEngine && /*!generateTreeView &&*/ !serverBasedSearch)
-  {
-    // for the javascript based search select the default filter
-    t << "<body onload='searchBox.OnSelectItem(0);'>\n";
-  }
-  else
-  {
-    if (searchPage) // keep focus on search result's box when loading 
-                    // search results page
-    {
-      t << "<body onload='searchBox.DOMSearchField().focus()'>\n";
-    }
-    else
-    {
-      t << "<body>\n";
-    }
-  }
-}
-
-
 void HtmlGenerator::writeHeaderFile(QFile &file, const char *cssname)
 {
   FTextStream t(&file);
@@ -1274,78 +1130,16 @@
   {
     id=id.left(id.length()-Doxygen::htmlFileExtension.length());
   }
-
-  t << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
-  t << "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n"
-       "<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n"
-       "<title>$title</title>\n";
-  t << "<link href=\"$relpath$tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n";
-  t << "<link href=\"$relpath$" << cssname << "\" rel=\"stylesheet\" type=\"text/css\" />\n";
-  t << "$treeview\n";
-  t << "$search\n";
-  t << "$mathjax\n";
-  t << "</head>\n";
-  t << "<body>\n";
-  t << "<div id=\"top\"><!-- do not remove this div! -->\n";
-  
-  t << "<!--BEGIN TITLEAREA-->\n";
-  t << "<div id=\"titlearea\">\n";
-  t << "<table cellspacing=\"0\" cellpadding=\"0\">\n";
-  t << " <tbody>\n";
-  t << " <tr style=\"height: 56px;\">\n";
-  t << "  <!--BEGIN PROJECT_LOGO-->\n";
-  t << "  <td id=\"projectlogo\"><img alt=\"Logo\" src=\"$relpath$$projectlogo\"/></td>\n";
-  t << "  <!--END PROJECT_LOGO-->\n";
-  t << "  <!--BEGIN PROJECT_NAME-->\n";
-  t << "  <td style=\"padding-left: 0.5em;\">\n";
-  t << "   <div id=\"projectname\">$projectname\n";
-  t << "   <!--BEGIN PROJECT_NUMBER-->&#160;<span id=\"projectnumber\">$projectnumber</span><!--END PROJECT_NUMBER-->\n";
-  t << "   </div>\n";
-  t << "   <!--BEGIN PROJECT_BRIEF--><div id=\"projectbrief\">$projectbrief</div><!--END PROJECT_BRIEF-->\n";
-  t << "  </td>\n";
-  t << "  <!--END PROJECT_NAME-->\n";
-  t << "  <!--BEGIN !PROJECT_NAME-->\n";
-  t << "   <!--BEGIN PROJECT_BRIEF-->\n";
-  t << "    <td style=\"padding-left: 0.5em;\">\n";
-  t << "    <div id=\"projectbrief\">$projectbrief</div>\n";
-  t << "    </td>\n";
-  t << "   <!--END PROJECT_BRIEF-->\n";
-  t << "  <!--END !PROJECT_NAME-->\n";    
-  t << "  <!--BEGIN DISABLE_INDEX-->\n";
-  t << "   <!--BEGIN SEARCHENGINE-->\n";
-  t << "   <td>$searchbox</td>\n";
-  t << "   <!--END SEARCHENGINE-->\n";
-  t << "  <!--END DISABLE_INDEX-->\n";
-  t << " </tr>\n";
-  t << " </tbody>\n";
-  t << "</table>\n";
-  t << "</div>\n";
-  t << "<!--END TITLEAREA-->\n";
+  QCString contents(defaultHtmlHeader);
+  contents = substitute(contents, "$stylesheet", cssname);
+  t << contents;
 }
 
 void HtmlGenerator::writeFooterFile(QFile &file)
 {
   FTextStream t(&file);
-  
-  t << "<!--BEGIN GENERATE_TREEVIEW-->\n";
-  t << "    <li class=\"footer\">";
-  t << theTranslator->trGeneratedAt( "$datetime", "$projectname" ) << endl;
-  t << "    <a href=\"http://www.doxygen.org/index.html\">\n";
-  t << "    <img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/></a> $doxygenversion </li>\n";
-  t << "   </ul>\n";
-  t << " </div>\n";
-  t << "<!--END GENERATE_TREEVIEW-->\n";
-  t << "<!--BEGIN !GENERATE_TREEVIEW-->\n";
-  t << "<hr class=\"footer\"/><address class=\"footer\"><small>\n";
-  t << theTranslator->trGeneratedAt( "$datetime", "$projectname" );
-  t << "&#160;<a href=\"http://www.doxygen.org/index.html\">"
-    << "<img class=\"footer\" src=\"$relpath$doxygen.png\" alt=\"doxygen\"/>"
-    << "</a> $doxygenversion";
-  t << "</small></address>\n";
-  t << "<!--END !GENERATE_TREEVIEW-->\n";
-
-  t << "</body>\n"
-    << "</html>\n";
+  QCString contents(defaultHtmlFooter);
+  t << contents;
 }
 
 static void generateDynamicSections(FTextStream &t,const QCString &relPath)
@@ -1464,14 +1258,8 @@
   }
  
   lastFile = fileName;
-  if (g_header.isEmpty()) 
-  {
-    writeDefaultHeaderFile(t,name,dispTitle,relPath,FALSE);
-  }
-  else
-  {
-    t << substituteHtmlKeywords(g_header,convertToHtml(dispTitle),relPath);
-  }
+  t << substituteHtmlKeywords(g_header,convertToHtml(dispTitle),relPath);
+
   t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen " 
     << versionString << " -->" << endl;
   //static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
@@ -1539,37 +1327,14 @@
 
 void HtmlGenerator::writePageFooter(FTextStream &t,const QCString &lastTitle,const QCString &relPath)
 {
-  static bool generateTreeView  = Config_getBool("GENERATE_TREEVIEW");
   static bool searchEngine      = Config_getBool("SEARCHENGINE");
   static bool serverBasedSearch = Config_getBool("SERVER_BASED_SEARCH");
   if (searchEngine /*&& !generateTreeView*/ && !serverBasedSearch)
   {
     HtmlGenerator::writeSearchFooter(t,relPath);
   }
-  if (g_footer.isEmpty())
-  {
-    if (!generateTreeView)
-    {
-      t << "<hr class=\"footer\"/><address class=\"footer\"><small>";
-      t << writeLogoAsString(relPath);
-      t << "</small></address>";
-      if (Debug::isFlagSet(Debug::Validate))
-      {
-        t << "<p><a href=\"http://validator.w3.org/check/referer\">"
-          "<img class=\"footer\" src=\"http://www.w3.org/Icons/valid-html401\""
-          " height=\"31\" width=\"88\" alt=\"This page is Valid HTML 4.01 "
-          "Transitional!\"></a><a href=\"http://jigsaw.w3.org/css-validator/\">"
-          "<img class=\"footer\" style=\"border:0;width:88px;height:31px\" "
-          "src=\"http://jigsaw.w3.org/css-validator/images/vcss\" "
-          "alt=\"This page uses valid CSS!\"/></a></p>";
-      }
-    }
-    t << "\n</body>\n</html>\n";
-  }
-  else
-  {
-    t << substituteHtmlKeywords(g_footer,convertToHtml(lastTitle),relPath);
-  }
+
+  t << substituteHtmlKeywords(g_footer,convertToHtml(lastTitle),relPath);
 }
 
 void HtmlGenerator::writeFooter()
@@ -2870,26 +2635,6 @@
   }
 }
 
-void HtmlGenerator::startQuickIndices()
-{
-  static bool customHeader = !Config_getString("HTML_HEADER").isEmpty();
-  static QCString projectName = Config_getString("PROJECT_NAME");
-  static QCString projectBrief = Config_getString("PROJECT_BRIEF"); 
-  static QCString projectNumber = Config_getString("PROJECT_NUMBER"); 
-  static QCString projectLogo = Config_getString("PROJECT_LOGO");
-
-  if (!customHeader)
-  {
-    t << "<div id=\"top\"";
-    //if (generateTreeView)
-    //{
-    //  t << " onmouseout=\"return navLeave()\" onmouseover=\"navEnter()\"";
-    //}
-    t << ">" << endl;
-    writeTitleArea(t,relPath,projectName,projectBrief,projectNumber,projectLogo);
-  }
-}
-
 void HtmlGenerator::endQuickIndices()
 {
   t << "</div>" << endl;
@@ -2956,14 +2701,7 @@
   if (f.open(IO_WriteOnly))
   {
     FTextStream t(&f);
-    if (g_header.isEmpty()) 
-    {
-      writeDefaultHeaderFile(t,"search",theTranslator->trSearch().data(),0,FALSE,TRUE);
-    }
-    else
-    {
-      t << substituteHtmlKeywords(g_header,"Search","");
-    }
+    t << substituteHtmlKeywords(g_header,"Search","");
 
     t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen " 
       << versionString << " -->" << endl;
@@ -2976,10 +2714,8 @@
         << "search\",false,'" << theTranslator->trSearch() << "');\n";
       t << "--></script>\n";
     }
-    t << "<div id=\"top\">" << endl;
-    writeTitleArea(t,"",projectName,projectBrief,projectNumber,projectLogo);
-    if (!Config_getBool("DISABLE_INDEX")) 
-    { 
+    if (!Config_getBool("DISABLE_INDEX"))
+    {
       writeDefaultQuickLinks(t,TRUE,HLI_Search,"");
     }
     else
@@ -3025,7 +2761,7 @@
         << "onfocus=\\\"searchBox.OnSearchFieldFocus(true)\\\" "
         << "onblur=\\\"searchBox.OnSearchFieldFocus(false)\\\"/>\\n"
         << "            </form>\\n"
-        << "          </span><span class=\\\"right\\\"></span>\\n"
+        << "          </div><div class=\\\"right\\\"></div>\\n"
         << "        </div>\\n"
         << "      </li>\\n"
         << "    </ul>\\n"
@@ -3040,28 +2776,18 @@
     }
     t << "\";\n";
     t << "}\n";
-    t << "function end_page()\n";
-    t << "{\n";
-    t << "  echo \"";
-    if (generateTreeView)
-    {
-      t << "</div>\\n";
-      t << "<div id=\\\"nav-path\\\" class=\\\"navpath\\\">\\n";
-      t << "  <ul>\\n";
-      t << "    <li class=\\\"footer\\\">";
-      t << substitute(substitute(writeLogoAsString(""),
-                                 "\"","\\\""),
-                      "\n","\\n");
-      t << "</li>\\n";
-      t << "  </ul>\\n";
-      t << "</div>\\n";
-    }
-    t << "</body></html>\";\n";
-    t << "}\n";
     t << "\n";
     t << search_script;
     t << "\n";
     t << "</script>\n";
+
+    // Write empty navigation path, to make footer connect properly
+    if (generateTreeView)
+    {
+      t << "</div><div id=\"nav-path\" class=\"navpath\">\n";
+      t << "    <ul>\n";
+    }
+
     writePageFooter(t,"Search","");
   }
   QCString scriptName = Config_getString("HTML_OUTPUT")+"/search/search.js";
