<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html<?php echo $direction ?>>
<head>
    <?php echo $meta ?>
    <meta name="keywords" content="moodle, <?php echo $title ?> " />
    <title><?php echo $title ?></title>
    <link rel="shortcut icon" href="<?php echo $CFG->wwwroot.'/theme/'.current_theme() ?>/favicon.ico" />
    <?php include("$CFG->javascript"); ?>
</head>

<body<?php
    echo " $bodytags";
    if ($focus) {
        echo " onload=\"setfocus()\"";
    }
    ?>>
    
<div id="page">

<?php if ($home) {  // This is what gets printed on the home page only  
      if (file_exists($CFG->dirroot.'/logo.jpg')) {
          $standardlogo = $CFG->httpswwwroot.'/logo.jpg';
      } else if (file_exists($CFG->dirroot.'/logo.gif')) {
          $standardlogo = $CFG->httpswwwroot.'/logo.gif';
      } else if (file_exists($CFG->dataroot.'/1/logo.jpg')) {
          if (empty($CFG->slasharguments)) {
              $standardlogo = $CFG->httpswwwroot.'/file.php?file=/1/logo.jpg';
          } else {
              $standardlogo = $CFG->httpswwwroot.'/file.php/1/logo.jpg';
          }
      } else if (file_exists($CFG->dataroot.'/1/logo.gif')) {
          if (empty($CFG->slasharguments)) {
              $standardlogo = $CFG->httpswwwroot.'/file.php?file=/1/logo.gif';
          } else {
              $standardlogo = $CFG->httpswwwroot.'/file.php/1/logo.gif';
          }
      } else {
          $standardlogo = $CFG->httpswwwroot.'/theme/'.current_theme().'/logo.gif';
      }
      
      //Accessibility: warning: ALT text will need editing if logo changes. 'headermain' is now H1.
?>
    <div id="header-home" class="clearfix">
        <h1 class="headermain"><img alt="Moodle" src="<?php echo $standardlogo ?>" /></h1>
        <div class="headermenu"><?php echo $menu ?></div>
    </div>
<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
?>
    <div id="header" class="clearfix">
        <h1 class="headermain"><?php echo $heading ?></h1>
        <div class="headermenu"><?php echo $menu ?></div>
    </div>
<?php } ?>
<?php //Accessibility: breadcrumb trail/navbar now a DIV, not a table.
      if ($navigation) { // This is the navigation table with breadcrumbs  ?>
    <div class="navbar clearfix">
        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
        <div class="navbutton"><?php echo $button; ?></div>
    </div>
<?php } else if ($heading) { // If no navigation, but a heading, then print a line  
?>
        <hr size="1" noshade="noshade" />
<?php } ?>
    <!-- END OF HEADER -->
    <div id="content">
