<meta http-equiv="content-type" content="text/html; charset=<%config.header_charset || iso-8859-1%>" />
<%if Meta_Description%><meta name="description" content="<%Meta_Description%>" /><%endif%>
<%if Meta_Keywords%><meta name="keywords" content="<%Meta_Keywords%>" /><%endif%>
<%if theme%><link type="text/css" rel="stylesheet" href="<%config.build_static_url%>/<%t%>/<%theme%>.css" /><%endif%>
<%~-- If your site is statically built, then the login status will always say 'Login/Register'.  This javascript replaces it with 'Logout' if the user is logged in. --~%>
<%if not d and not user.Username~%>
<script type="text/javascript" src="<%config.build_static_url%>/utils.js"></script>
<script type="text/javascript">
  //<![CDATA[
registerEvent(window, 'onload', function () {
    var loginbar = document.getElementById('loginbar');
    if (!loginbar)
        return;
    var loginlink = loginbar.firstChild;
    if (loginlink.className != 'out')
        return;
    var cookies = document.cookie.split(';');
    for (var i = 0; i < cookies.length; i++) {
        if (cookies[i].match(/^\s*<%config.user_cookie_prefix%>s=[0-9a-f]{32}\s*$/)) {
            loginlink.href = '<%config.db_cgi_url%>/user.cgi?logout=1';
            loginlink.className = 'in';
            loginlink.firstChild.nodeValue = 'Logout';
            break;
        }
    }
});
  //]]>
</script>
<%~endif%>
