<div id="login-form">
    <table style="width:273px; height:213px;">
        <tr><td style="padding:0 3px 3px 0; background: url(http://img.yandex.ru/i/loginform-shadow.gif);"><table style="width:270px; height: 210px;" ><tr><td class="loginForm">
<img src="http://img.yandex.ru/i/logo-passport.gif" style="width: 58px; height: 17px;" alt="Паспорт"><br><form action="{{ login_url }}" method="post" name="login" id="loginform" onsubmit="document.forms['login'].timestamp.value = new Date().getTime();">
    <input type="hidden" name="retpath" value="{{ current_url }}"><input type="hidden" name="timestamp" value="0"><table style="width: 100%;">
<tr>
<td></td>
<td style="padding-bottom: 10px; width: 99%;"><a href="http://passport.yandex.ru/passport?mode=register&amp;retpath={{ current_url|urlencode}}">Зарегистрироваться</a></td>
</tr>
<tr>
<td>Логин:</td>
<td><input name="login" type="text" value="" style="width: 177px;"></td>
</tr>

<tr>
<td>Пароль:</td>
<td><input name="passwd" type="password" value="" style="width: 177px;"></td>
</tr>
<tr>
<td></td>
<td id="check" class="check">
<input name="twoweeks" id="a" value="yes" type="checkbox" class="b"><label for="a">запомнить меня</label><a href="http://help.yandex.ru/passport/?id=922493" target="help"><img alt="[?]" src="http://img.yandex.ru/i/i-help2.gif" height="10" width="10" style="margin: 0 5px;" /></a>
</td>
</tr>
<tr>
<td></td>
<td style="padding-top:5px">
<input type="submit" value="Войти" style="margin-right:9px" id="loginsubmit"><input type="button" value="Закрыть" onclick="hide_login()">
</td>

</tr>
<tr>
<td></td>
<td style="padding-top: 1em;"><a href="http://passport.yandex.ru/passport?mode=remember">Забыли пароль?</a></td>
</tr>
</table>
</form>
</td></tr></table></td></tr></table></div>
<script>
function show_login() {
  document.getElementById('login-form').style.display = 'block';
  return false;
}

function hide_login() {
  document.getElementById('login-form').style.display = 'none';
}

var yauth = document.getElementById('yauth');
if (yauth) {
  var links = document.getElementsByTagName('A');
  for (i = 0; i < links.length; i++) {
    if (links[i].className.match(/\benter\b/)) {
      links[i].onclick = function() {document.forms['login'].retpath.value='{{ current_url|urlencode }}'; return show_login();};
    }
  }
}
</script>
