<h2>{if $userinfo.logged}{t}Menu{/t}{else}{t}Members{/t}{/if}</h2>

<div class="login">

{if $userinfo.logged != 1}
{literal}
<script language=javascript>
function checklogin() {   
  if (document.loginform.username.value=='') {
    alert("Please enter your username!");
    document.loginform.username.focus();
    return false;
  }
  if (document.loginform.password.value=='') {
    alert("Please enter your password!");
    document.loginform.password.focus();
    return false;
  }
  return true;
}
</script>
{/literal}
<form method="post" name="loginform" onsubmit="return checklogin()">
<input type=hidden name="a" value="do_login">
<input type=hidden name="referrer" value="{$smarty.server.REQUEST_URI|escape:html}">
<table class="form" style="width: 230px">
<tr>
 <th>{t}Username:{/t}</th>
 <td><input type="text" name="username"></td>
</tr>
<tr>
 <th>{t}Password:{/t}</th>
 <td><input type="password" name="password"></td>
</tr>
<tr>
 <th colspan=2><input type=checkbox name="remember" value=1 style="width:15px"> {t}Remeber me{/t}</th>
</tr>
{if $settings.use_turing}
<tr>
  <th><img src="{"?a=turing&`$sesname`=`$sesid`&r=`$rand`"|encurl}"></th>
  <td><input type=text name="turing" maxlength=6 size=6></td>
</tr>
{/if}
<tr>
 <th>&nbsp;</th>
 <td><input type="submit" value="{t}Login{/t}"></td>
</tr>
</table>
</form>
<p class="links"><a href="{"?a=signup"|encurl}">{t}Sign Up{/t}</a> | <a href="{"?a=forgot_password"|encurl}">{t}Forgot Password?{/t}</a></p>

{else}
<ul class="menu">
<li><a href="{"?a=bookmarks"|encurl}">{t}My Programs' List{/t}</a></li>
<li><a href="{"?a=refback_requests"|encurl}">{t}RCB Requests{/t}</a></li>
<li><a href="{"?a=profile"|encurl}">{t}Edit Profile{/t}</a></li>
<li><a href="{"?a=logout"|encurl}">{t}Logout{/t}</a></li>
{/if}
</div>