/**
     * Fires immediately after the body element is opened
     *
     */
    protected function OnBodyOpened()
    {
        $mobile_logo = '<img src="' . $this->resource_root . '/images/logos/138x40-trans.png" width="138" height="40" alt="Go to the Stoolball England home page" class="small screen logo-small" />
                        <img src="' . $this->resource_root . '/images/logos/210x61-trans.png" width="210" height="61" alt="Go to the Stoolball England home page" class="print logo" />';
        if (SiteContext::IsWordPress() and is_home()) {
            echo $mobile_logo;
        } else {
            echo '<a href="/">' . $mobile_logo . '</a>';
        }
        ?>
<form id="handle" action="/search/" method="get" class="large"><div><input id="search" type="search" name="q" value="<?php 
        if (isset($_GET['q'])) {
            echo htmlentities($_GET['q'], ENT_QUOTES, "UTF-8", false);
        }
        ?>
" />
	<input type="submit" value="Search" id="go" /></div>
</form>
<div id="bat1"></div>
		<?php 
        if ($this->GetContentCssClass()) {
            echo '<div id="board" class="' . $this->GetContentCssClass() . '">';
        } else {
            echo '<div id="board">';
        }
        ?>
<div id="boardLeft">
	<div id="boardRight">
		<?php 
        # build navbar and add to control tree
        $o_current = $this->GetContext()->GetByHierarchyLevel(2);
        $b_got_category = is_object($o_current);
        $b_section_home = ($this->GetContext()->GetDepth() == 2 and str_replace("/", "", $_SERVER['REQUEST_URI']) == $o_current->GetUrl());
        $o_news = new XhtmlElement('a', 'News');
        $o_rules = new XhtmlElement('a', 'Rules');
        $o_play = new XhtmlElement('a', 'Play!');
        $schools = new XhtmlElement('a', 'Schools');
        $o_about = new XhtmlElement('a', 'About <span class="large"> Us</span>');
        $search = new XhtmlElement('a', 'Search');
        if ($b_got_category and $o_current->GetUrl() == 'news' or SiteContext::IsWordPress() and (is_single() or is_archive() and !is_category())) {
            if (!$b_section_home) {
                $o_news->AddAttribute('href', '/news');
                $o_news->AddAttribute('role', 'menuitem');
                $o_news->SetCssClass('current');
            } else {
                $o_news->SetElementName('em');
            }
        } else {
            $o_news->AddAttribute('href', '/news');
        }
        if ($b_got_category and $o_current->GetUrl() == 'rules') {
            if (!$b_section_home) {
                $o_rules->AddAttribute('href', '/rules');
                $o_rules->AddAttribute('role', 'menuitem');
                $o_rules->SetCssClass('current');
            } else {
                $o_rules->SetElementName('em');
            }
        } else {
            $o_rules->AddAttribute('href', '/rules');
        }
        if ($b_got_category and $o_current->GetUrl() == 'play') {
            if (!$b_section_home) {
                $o_play->AddAttribute('href', '/play');
                $o_play->AddAttribute('role', 'menuitem');
                $o_play->SetCssClass('current');
            } else {
                $o_play->SetElementName('em');
            }
        } else {
            $o_play->AddAttribute('href', '/play');
        }
        if ($b_got_category and $o_current->GetUrl() == 'schools') {
            if (!$b_section_home) {
                $schools->AddAttribute('href', '/schools');
                $schools->AddAttribute('role', 'menuitem');
                $schools->SetCssClass('current');
            } else {
                $schools->SetElementName('em');
            }
        } else {
            $schools->AddAttribute('href', '/schools');
        }
        if ($b_got_category and $o_current->GetUrl() == 'about') {
            if (!$b_section_home) {
                $o_about->AddAttribute('href', '/about');
                $o_about->AddAttribute('role', 'menuitem');
                $o_about->SetCssClass('current');
            } else {
                $o_about->SetElementName('em');
            }
        } else {
            $o_about->AddAttribute('href', '/about');
        }
        if ($b_got_category and $o_current->GetUrl() == 'search') {
            if (!$b_section_home) {
                $search->AddAttribute('href', '/search');
                $search->AddAttribute('role', 'menuitem');
                $search->SetCssClass('current');
            } else {
                $search->SetElementName('em');
            }
        } else {
            $search->AddAttribute('href', '/search');
        }
        ?>
        <nav>
        <ul class="menu screen" role="menubar">
        <?php 
        echo '';
        echo '<li id="news">' . $o_news . '</li>';
        echo '<li id="rules">' . $o_rules . '</li>';
        echo '<li id="play">' . $o_play . '</li>';
        echo '<li id="schools">' . $schools . '</li>';
        echo '<li id="about">' . $o_about . '</li>';
        echo '<li class="search small">' . $search . '</li>';
        echo '';
        ?>
		</ul>
        </nav>
	   <div id="bat2" class="large">
			<div id="involved"></div>
			<ul>
				<li><a href="/rules/what-is-stoolball">What is stoolball?</a></li>
				<li><a href="/rules">Learn the rules</a></li>
				<li><a href="/teams/map">Map of teams</a></li>
			</ul>
		</div>

		<div id="content" class="content">
		<?php 
        # add content
        if ($this->i_constraint_type != StoolballPage::ConstrainNone()) {
            switch ($this->i_constraint_type) {
                case StoolballPage::ConstrainText():
                    echo '<div id="constraint" class="constrainText">';
                    break;
                case StoolballPage::ConstrainColumns():
                case StoolballPage::ConstrainBox():
                    echo '<div id="constraint" class="constrainColumns">';
                    break;
            }
        }
        if ($this->i_constraint_type == StoolballPage::ConstrainColumns()) {
            echo '<div class="supportedContentContainer"><div class="supportedContent">';
            $this->b_col1_open = true;
        }
        $this->Render();
    }