Index: style.css
===================================================================
--- style.css	(revision 12)
+++ style.css	(revision 13)
@@ -1,17 +1,51 @@
 @CHARSET "UTF-8";
 
-/*
-	<div id="page">
-		<div id="header" />
-		<div id="container">
-			<div id="sidebar-left" />
-			<div id="main" />
-				<div id="squeeze" />
-			</div>
-			<div id="sidebar-right" />
-		</div>
-		<div id="header" />
-	</div>
+/* The XHTML markup of the <body> in page.tpl.php is layed out as follows:
+
+   <div id="page">
+
+      <div id="header">
+         <div id="masthead">
+            <div id="name-and-slogan">
+               <div id="site-name" />
+               <div id="site-slogan" />
+            </div>
+            <div id="navigation">
+               <div id="primary" />
+               <div id="secondary" />
+            </div>
+         </div>
+      </div>
+
+      <div id="container">
+         <div id="main"">
+            <div id="squeeze">
+               <!-- breadcrumb -->
+               <div id="mission" />
+               <div id="content-top" />
+               <!-- title -->
+               <div id="tabs" />
+               <!-- content -->
+               <div id="content-bottom" />
+               <div id="" />
+	    </div>
+         </div>
+         <div id="sidebar-left" />
+         <div id="sidebar-right" />
+      </div>
+
+      <div id="footer-wrapper">
+         <div id="footer-menu" />
+      </div>
+
+      <div id="footer-region">
+         <div id="footer-left" />
+         <div id="footer-mid" />
+         <div id="footer-right" />
+         <div id="footer" />
+      </div>
+
+   </div>
 */
 
 /* ====== diagnostics ====== */
@@ -63,7 +97,6 @@ body {
 	border-top:3px solid #EEEEEE;
 	margin:20px auto;
 	text-align:left;
-	width:965px;
 }
 
 /* ---- header ------ */
@@ -136,10 +169,10 @@ body.sidebar-right #main #squeeze {
 	margin-right: 255px;
 }
 
-body.both-sidebars #main {
+body.two-sidebars #main {
 	margin-right: -530px;
 }
-body.both-sidebars #squeeze {
+body.two-sidebars #squeeze {
 	margin-right: 530px;
 }
 
Index: template.php
===================================================================
--- template.php	(revision 12)
+++ template.php	(revision 13)
@@ -45,27 +45,34 @@ function _phptemplate_variables($hook, $
         $vars['logged_in'] = FALSE;
       }
 
+      // Compile a list of classes that are going to be applied to the body element.
+      // This allows advanced theming based on context (home page, node of certain type, etc.).
       $body_classes = array();
-      // classes for body element
-      // allows advanced theming based on context (home page, node of certain type, etc.)
-      $body_classes[] = ($vars['is_front']) ? 'front' : 'not-front';
-      $body_classes[] = ($vars['logged_in']) ? 'logged-in' : 'not-logged-in';
-      if ($vars['node']->type) {
-        $body_classes[] = 'ntype-'. grid_inspired_id_safe($vars['node']->type);
-      }
-      switch (TRUE) {
-      	case $vars['left_region'] && $vars['right_region'] :
-      		$body_classes[] = 'both-sidebars';
-      		break;
-      	case $vars['left_region'] :
-      		$body_classes[] = 'sidebar-left';
-      		break;
-      	case $vars['right_region'] :
-      		$body_classes[] = 'sidebar-right';
-      		break;
+      // Add a class that tells us whether we're on the front page or not.
+      $body_classes[] = $variables['is_front'] ? 'front' : 'not-front';
+      // Add a class that tells us whether the page is viewed by an authenticated user or not.
+      $body_classes[] = $variables['logged_in'] ? 'logged-in' : 'not-logged-in';
+      // Add arg(0) to make it possible to theme the page depending on the current page
+      // type (e.g. node, admin, user, etc.). To avoid illegal characters in the class,
+      // we're removing everything disallowed. We are not using 'a-z' as that might leave
+      // in certain international characters (e.g. German umlauts).
+      $body_classes[] = preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-'. form_clean_id(drupal_strtolower(arg(0))));
+      // If on an individual node page, add the node type.
+      if (isset($variables['node']) && $variables['node']->type) {
+        $body_classes[] = 'node-type-'. form_clean_id($variables['node']->type);
       }
-      // implode with spaces
-      $vars['body_classes'] = implode(' ', $body_classes);
+      // Add information about the number of sidebars.
+      if ($variables['layout'] == 'both') {
+        $body_classes[] = 'two-sidebars';
+      }
+      elseif ($variables['layout'] == 'none') {
+        $body_classes[] = 'no-sidebars';
+      }
+      else {
+        $body_classes[] = 'one-sidebar sidebar-'. $variables['layout'];
+      }
+      // Implode with spaces.
+      $variables['body_classes'] = implode(' ', $body_classes);
 
       break;
 
