<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
   <head>
   <meta name="description" content="<%= @page.meta_descs if @page %>" />
   <meta name="keywords" content="<%= @page.meta_tags if @page %>" />
      <title><%= @page_title || config_value('site_title') %></title>
      <%= theme_stylesheet_link_tag 'laughingatyou' %>
      <%= stylesheet_link_tag 'overlay' %>
      <%= javascript_include_tag :defaults %>
      <%= javascript_include_tag "behaviour", "weed", "overlay" %>
      <% if @page %>
      <script type="text/javascript">
      <%= @page.behaviour %>
      </script>
      <% end %>
      <%= auto_discovery_link_tag(:rss, {:controller => "admin/feeds", :action => "rss"}) %>
      <%= auto_discovery_link_tag(:atom, {:controller => "admin/feeds", :action => "atom"}) %>
   </head>
   <body>
   <div id="header">
   	<h1><%= link_to config_value('site_title'), { :controller => '/' } %></h1>
   	<p><%= config_value('site_subtitle') %></p>
    </div>
   
   <div id="content">
   
   	<div id="main"><%= @content_for_layout %></div>
   
   	
   	<div id="sidebar">
   	
   	
   	<div class="sidebar-node">
	<h3>Menu</h3>
   	<%= render_component :action => "menu" %>
   	</div>
   	
   	
   	<div class="sidebar-node">
   	<h3>Tags</h3>
   	<ul id="tags">
   	<%= render_component :action => "tags" %>
   	</ul>
   	</div>
   	
   	<div class="sidebar-node">
   	<h3>Feeds</h3>
   	<ul id="rss">
   	<li><a href="<%= url_for :controller => 'admin/feeds', :action => 'rss' %>"><%= theme_image_tag('feed-icon') %> RSS</a></li>
   	<li><a href="<%= url_for :controller => 'admin/feeds', :action => 'atom' %>"><%= theme_image_tag('feed-icon') %> Atom</a></li>
   	</ul>
   	</div>
   	

   	<% if session[:user_id] %>
   	<div class="sidebar-node">
   	<h3>Admin</h3>
   	<ul id="admin">
   	<li><%= link_to_remote('Overlay', { :update => "boxcontent", :loading => "showLoader()", :complete => "showBox()", :url => {:controller => 'admin/page', :action => 'overlay', :id => @page.id } }, { :href => url_for(:action => 'show', :id => @page.id ) } ) if @page %></li>
   	<li><%= link_to_remote('Overlay', { :update => "boxcontent", :loading => "showLoader()", :complete => "showBox()", :url => {:controller => 'admin/tags', :action => 'overlay', :id => @tag.id } }, { :href => url_for(:action => 'show', :id => @tag.id ) } ) if @tag %></li>
   	<li><%= link_to("Edit this", :controller => "admin/page", :action => "fedit", :id => @page.id) if @page %></li>
   	<li><%= link_to("Admin", :controller => "admin") %></li>
   	<li><%= link_to("Logout", :controller => "admin/login", :action => "logout") %></li>
   	</ul>
   	</div>
   	<% end %>
   	
   	
   	
   	</div>
   	
   	
   </div>

   </body>
</html>