<script language="JavaScript" type="text/JavaScript">
function check() {
  if(entrada.user.value=="" || entrada.pass.value=="") {
    alert("S'ha d'entrar un nom d'usuari i una clau");
    return;
  }
  entrada.submit();
}
function check2() {
  resp=confirm('Dessitja sortir ?');
  if(resp) entrada.submit();
}
</script>
<form name=entrada action=login.php method=post>
<input type=hidden name=querystring value="<?php echo $querystring; ?>">
     <table width="100%"  border="0" cellpadding="2" cellspacing="2" bgcolor="#E7E5DD" class="tablalogin">
      <tr bgcolor="#07294E">
        <td colspan="2" class="verblanc"><div align="center"><strong>Accès col.legiats </strong></div></td>
      </tr>
<?php if($current_valid==0) { ?>
      <input type=hidden name=action value="Entrar">
      <tr>
        <td class="verddeu"><div align="center">Nom:</div></td>
        <td>
          <div align="left">
            <input name="user" type="text" class="verddeu" size="10" value="">
          </div></td>
      </tr>
      <tr>
        <td class="verddeu"><div align="center">Clau:</div></td>
        <td>
          <div align="left">
            <input name="pass" type="password" class="verddeu" size="10" value="">
          </div></td>
      </tr>
      <tr>
        <td colspan="2" class="verddeu"><div align="center">
          <input type="button" class="verdneg" value="Entrar" onclick="javascript:check();">
        </div></td>
      </tr>
      <tr bgcolor="#F5F4F1">
        <td colspan="2"></form>
<div align="center"><span class="verddeu"><a href="inicio.php?page=registrar">Enregistra't per accedir </a></span></div>
</td>
      </tr>
    </table>
<?php } else { ?>
      <input type=hidden name=action value="Sortir">
      <tr>
        <td colspan="2" class="verddeu"><div align="center">
          <a href="inicio.php?page=pass">Modificar Clau</a>&nbsp;&nbsp;<input type="button" class="verdneg" value="Sortir" onclick="javascript:check2();">
        </div></td>
      </tr>
      <tr bgcolor="#F5F4F1">
        <td colspan="2"></form><div align="center"><span class="verddeu">Zona privada</span></div></td>
      </tr>
    </table>
<?php } ?>
