<mt:setvar name="page_title" value="<__trans phrase="Sign in">">
<mt:setvar name="complete" value="1">
<mt:setvar name="screen_id" value="sign-in">
<mt:setvar name="screen_class" value="sign-in">
<mt:setvarblock name="html_head" append="1">  <meta name='robots' content='noindex,nofollow' /></mt:setvarblock>
<mt:include name="include/chromeless_header.tmpl">

<form method="post" action="<mt:var name="script_url">">
<mt:loop name="query_params">
  <input type="hidden" name="<mt:var name="name" escape="html">" value="<mt:var name="value" escape="html">" />
</mt:loop>

  <div id="msg-block"></div>

<mt:if name="logged_out">
  <mt:if name="delegate_auth">
    <mtapp:statusmsg
       id="delegate_auth_logout"
       class="info"
       can_close="0">
      <__trans phrase="Your Movable Type session has ended.">
    </mtapp:statusmsg>
  <mt:else>
    <mtapp:statusmsg
       id="session_end_logout"
       class="info"
       can_close="0">
      <__trans phrase="Your Movable Type session has ended. If you wish to sign in again, you can do so below.">
    </mtapp:statusmsg>
  </mt:if>
<mt:else>
  <mt:if name="login_again">
    <mtapp:statusmsg
       id="action_logout"
       class="info"
       can_close="0">
      <__trans phrase="Your Movable Type session has ended. Please sign in again to continue this action.">
    </mtapp:statusmsg>
  <mt:else>
    <mt:if name="error">
      <mtapp:statusmsg
         id="generic-error"
         class="error"
         can_close="0">
        <mt:var name="error">
      </mtapp:statusmsg>
    </mt:if>
  </mt:if>
</mt:if>

<mt:unless name="delegate_auth">
  <mt:var name="login_fields">
  <div class="actions-bar actions-bar-login">
    <button
       type="submit"
       id="sign-in-button"
       accesskey="s"
       title="<__trans phrase="Sign In (s)">"
       class="sign-in action primary button">
      <__trans phrase="Sign In">
    </button>
    <mt:if name="can_recover_password">
      <div id="forget-password">
        <a href="<mt:var name="mt_url">?__mode=start_recover"><__trans phrase="Forgot your password?"></a>
      </div>
    </mt:if>
  </div>

</mt:unless>
</form>

<script type="text/javascript">
/* <![CDATA[ */
if (window.top && (window.top.location != window.location)) {
  jQuery('#username')
    .val( window.top.jQuery('#user .username').text())
    .addClass('disabled')
    .attr('disabled','disabled');
  jQuery('#sign-in-button').click(function(){
    jQuery('#username').removeAttr('disabled');
  });
}

jQuery(function() {
    jQuery('#username').focus();
    if (jQuery('#username').focus().val() != '') {
        jQuery('#password').focus();
    }
});
/* ]]> */
</script>
<mt:include name="include/chromeless_footer.tmpl">
