<!-- Sidebar *************************************************************** -->
<div id="sidebar">
  <div class="header">
      <a style="border:none" href="{{ Site.url(channel='home') }}"><img class="icon" src="{{ Site.icon.large }}" alt="Site icon" title="{{ Site.name }}" /></a>
      <a style="border: none" href="{{ User.link.login.url }}" title="{{ User.link.login.tip }}">
        <img class="headerIcon" src="{{ Script.path('/media/icons/user/') }}{{ User.link.login.action }}.png"/></a>
      Welcome, <a href="{{ User.link.profile.url }}" title="View your profile">{{ User.name }}</a>
  </div>
  <div id="navigation">
    <div class="header">You are <span class="active">here</span></div>
    <div id="tree">
      <p style="text-align: center">
        Loading navigation...<br/>
        <small>You must have JavaScript enabled for navigation to work.</small>
      </p>
    </div>
    <script type="text/javascript" src="{{ View.libs.url }}/ui/navigation.js"></script>
    <script type="text/javascript">
        var ChannelTree = new ATree("tree");
        ChannelTree.currentChannel = "{{ Channel.name }}";
        ChannelTree.fetch("{{ Site.url(channel='$site/channels/list') }}", true);
        //delete ChannelTree;
    </script>
  </div>
</div>

