<!DOCTYPE html >
<%~get_cgi_value('from_url')%>
<%~get_cgi_value('from')%>
<% if $cgi_from_url%>
    <%~set url_str = $cgi_from_url%>
<% elsif $url and not $cgi_from%>
    <%~set url_str = $url%>
<% else %>
    <%if $cgi_from eq 'racecalendar'%>
        <% set url_str = "http://calendar.slowtwitch.com/" %>
    <%elsif $cgi_from eq 'retailers'%>
        <% set url_str = "http://www.slowtwitch.com/retailers" %>
    <%elsif $cgi_from eq 'triclubs'%>
        <% set url_str = "http://www.slowtwitch.com/triclubs" %>
    <%elsif $cgi_from eq 'runshops'%>
        <% set url_str = "http://www.slowtwitch.com/runshops" %>
    <%elsif $cgi_from eq 'coaches'%>
        <% set url_str = "http://www.slowtwitch.com/coaches" %>
    <%elsif $cgi_from eq 'fitters'%>
        <% set url_str = "http://www.slowtwitch.com/fitters" %>
    <%elsif $cgi_from eq 'survey'%>
        <% set url_str = "http://forum.slowtwitch.com/survey/?from=gforum" %>
    <%elsif $cgi_from eq 'training'%>
        <% set url_str = "http://training.slowtwitch.com/?from=gforum" %>
    <%elsif $cgi_from eq 'protri'%>
        <% set url_str = "http://www.slowtwitch.com/protri/?from=gforum" %>
    <%elsif $cgi_from eq 'stackreach'%>
        <% set url_str = "http://www.slowtwitch.com/stackreach/index.php?from=gforum" %>
    <%elsif $from and $from ne '' and not $from contains 'do=logout' %>
        <% set url_str = $$from %>
    <%else%>
        <%set self_url = get_self_url() %>
        <%if self_url and not self_url contains 'do=login' and not self_url contains 'do=logout'%>
            <% set url_str = $self_url %>
        <%else%>
            <%set url_str = GForum::SEO::url(forum => 1) %>
        <%endif%>
    <%endif%>
<%endif%>
<html lang="en">
<head>
  <title><%cat_full_name%>: Login</title>
  <%~if current_user_id%>
  <meta http-equiv="refresh" content="0;url=<%url_str%>" />
  <%~endif%>
  <%include include_common_head.html%>
</head>
<body class="page-<%page_id%>">
  <div class="container-b">
    <%include include_header.html%>

    <div class="main">
      <div class="contentwrapper clearfix">
        <div class="sidebar">
            <%include include_sidebar.html%>
        </div>

        <%~set content_header_title = 'Login'%>
        <%~init array breadcrumbs%><%init hash breadcrumbs.0%>
        <%~set breadcrumbs.0.name = 'Login'%>

        <%include include_breadcrumb.html%>

        <div class="content"><%-- start content--%>
          <%include include_content_header.html%>
          <form action="<%GForum::SEO::url()%>" method="post">
            <%hidden_form%>
            <input type="hidden" name="url" value="<%url_str%>">
            <input type="hidden" name="from_url" value="<% url_str %>">
            <div class="clearfix">
              <div class="col-7">
                <div class="dtable form">
                  <div class="drow">
                    <div class="dcell name">Username</div>
                    <div class="dcell divider"></div>
                    <div class="dcell value">
                      <input type="text" id="login_username" name="login_username"<%if user_username%> value="<%user_username%>"<%endif%> class="txt" />
                    </div>
                  </div>
                  <div class="drow">
                    <div class="dcell name">Password</div>
                    <div class="dcell divider"></div>
                    <div class="dcell value">
                      <input type="password" id="login_password" name="login_password" class="txt" />
                    </div>
                  </div>
                  <div class="drow remember-me">
                    <div class="dcell name">Remember me</div>
                    <div class="dcell divider"></div>
                    <div class="dcell value">
                      <input type="checkbox" id="remember_me" name="remember_me" value="1" class="checkbox" title="Remembers your login when you return.  Requires cookies." onclick="document.getElementById('dont_use_cookies').checked = false"<%if in.remember_me%> checked="checked"<%endif%> /> 
                      <label>requires cookies: mandatory for training log, calendar &amp; retailer database</label>
                    </div>
                  </div>
                  <div class="drow">
                    <div class="dcell name">Don't use cookies</div>
                    <div class="dcell divider"></div>
                    <div class="dcell value">
                      <input type="checkbox" id="dont_use_cookies" name="dont_use_cookies" value="1" class="checkbox" onclick="document.getElementById('remember_me').checked = false"<%if in.dont_use_cookies and not in.remember_me%> checked="checked"<%endif%> />
                    </div>
                  </div>
                  <div class="drow actions">
                    <div class="dcell name"></div>
                    <div class="dcell divider"></div>
                    <div class="dcell value">
                      <input type="submit" value="Log In" class="btn default" />
                      <span class="lostpasswd"><a id="lostpass_link" href="<%GForum::SEO::url(params => "?do=lost_password")%>">forgot password?</a></span>
                    </div>
                  </div>
                </div>
              </div>
              <div class="col-5">
                <div class="botbox"></div>
                <div class="no-account clearfix">
                  <div class="col-4">
                    <span class="sprite-logo"></span>
                  </div>
                  <div class="col-8">
                    <h3>Not registered yet?</h3>
                    <p>We can remedy that right now!</p>
                    <a id="signup_link" href="<%GForum::SEO::url(params => "do=user_signup")%>" class="btn default">Sign Up</a>
                  </div>
                </div>
              </div>
            </div>

          </form>

        </div><%-- end content --%>
      </div>
    </div>
    <%include include_footer.html%>
  </div>
</body>
<%~include include_global_js.html%>
</html>
