function desconectar()
	{
	document.fDatosDes.submit();
	}

function display_date()
{
  date = new Date();
  var day_of_week_number = date.getDay();
  var day_of_month = date.getDate();
  var month_number = date.getMonth();
  var year = date.getYear();
  if(year < 1900)
    year += 1900;
  var day_of_week = '';
  var month = ''
  if(month_number == 0){month = 'Enero';}
  if(month_number == 1){month = 'Febrero';}
  if(month_number == 2){month = 'Marzo';}
  if(month_number == 3){month = 'Abril';}
  if(month_number == 4){month = 'Mayo';} 
  if(month_number == 5){month = 'Junio';}
  if(month_number == 6){month = 'Julio';}
  if(month_number == 7){month = 'Agosto';}
  if(month_number == 8){month = 'Septiembre';}
  if(month_number == 9){month = 'Octubre';}
  if(month_number == 10){month = 'Noviembre';}
  if(month_number == 11){month ='Diciembre';}
  if(day_of_week_number == 0){day_of_week = 'Domingo';}
  if(day_of_week_number == 1){day_of_week = 'Lunes';}
  if(day_of_week_number == 2){day_of_week = 'Martes';}
  if(day_of_week_number == 3){day_of_week = 'Miercoles';}
  if(day_of_week_number == 4){day_of_week = 'Jueves';}
  if(day_of_week_number == 5){day_of_week = 'Viernes';}
  if(day_of_week_number == 6){day_of_week = 'Sábado';}
  var date_to_show = day_of_week + ', ' + day_of_month + ' de ' + month + ' del ' + year; 
  document.write('<font size="1" face="arial">' + date_to_show.fontcolor("#ffffff") + '</font>');
} 

function cabecera()
{
	document.write('            <form name="form_vip" method="post" action="privada_zonaentrar.asp" onSubmit="return comprueba_acceso();">');
	document.write('            <table width="100%" border="0" align="right" cellpadding="10" cellspacing="0">');
	document.write('              <tr>');
	//document.write('                <td width="200" bgcolor="#FFFFFF" class="intranet">');
	//document.write('                  <SCRIPT LANGUAGE="javascript" TYPE="text/javascript">display_date();</script>');
	//document.write('                </td>');
	document.write('                <td bgcolor="#FFFFFF" class="intranet">');
	document.write('                  <div align="center" class="calendario">INTRANET</div>');
	document.write('                </td>');
	document.write('                <td valign="middle" bgcolor="#FFFFFF" class="intranet">');
	document.write('                  <select name="zonaprivada" id="zonaprivada" class="txt_pr" onChange="javascript:cambio()">');
	document.write('                    <option selected>Elige tu categoria</option>');
	document.write('                    <option value="4">Club</option>');
	document.write('                    <option value="5">Federado</option>');
	document.write('                    <!-- <option value="3">Prensa</option> -->');
	document.write('                  </select>');
	document.write('                </td>');
	document.write('                <td valign="middle" bgcolor="#FFFFFF" class="intranet">');
	document.write('                  usuario:');
	document.write('                  <input name="usuario" class="txt_pr" type="intranet" size="15" MAXLENGTH="15">');
	document.write('                </td>');
	document.write('                <td valign="middle" bgcolor="#FFFFFF" class="categoria">');
	document.write('                  <span class="intranet">password</span>:');
	document.write('                  <input name="clave" class="txt_pr" type="password" size="8" MAXLENGTH="15">');
	document.write('                </td>');
	document.write('                <td bgcolor="#FFFFFF">');
	document.write('                  <div align="left">');
	document.write('                    <input name="Submit" class="txt_pr" type="submit" value="entrar">');
	document.write('                  </div>');
	document.write('                </td>');
	document.write('                <td width="200" bgcolor="#FFFFFF">');
	document.write('                  &nbsp;');
	document.write('                </td>');	
	document.write('                <td width="30" bgcolor="#FFFFFF">');
	document.write('                  <table border="0" align="right" cellpadding="5" cellspacing="0">');
	document.write('                    <tr>');
	document.write('                      <td width="8" valign="baseline" class="top"><a href="#2" onclick=javascript:setActiveStyleSheet("medida1");>A</a></td>');
	document.write('                      <td width="8" valign="baseline" class="top2"><a href="#2" onclick=javascript:setActiveStyleSheet("medida2");>A</a></td>');
	document.write('                      <td width="8" valign="baseline" class="top3"><a href="#2" onclick=javascript:setActiveStyleSheet("medida3");>A</a></td>');
	document.write('                    </tr>');
	document.write('                  </table>');
	document.write('                </td>');
	document.write('              </tr>');
	document.write('            </table>');
	document.write('            </form>');
}

function cabeceraTPV()
{
	document.write('      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">');
	document.write('        <tr>');
	document.write('          <td width="100%">');
	document.write('            <table width="100%" border="0" cellpadding="0" cellspacing="0" background="imagenes/header.jpg">');
	document.write('              <tr>');
	document.write('                <td height="15">&nbsp;</td>');
	document.write('                <td>&nbsp;</td>');
	document.write('              </tr>');
	document.write('              <tr>');
	document.write('                <td height="110">');
	document.write('                  <div align="left" style="height:110px">');
	document.write('                    <a href="default.asp">');
	document.write('                      <img src="images/noimatge.gif" width="400" height="110" border="0">');
	document.write('                    </a>');
	document.write('                  </div>');
	document.write('                </td>');
	document.write('              </tr>');
	document.write('            </table>');
	document.write('          </td>');
	document.write('        </tr>');
	document.write('      </table>');
}

function pie()
{
	document.write('            <table width="100%" border="0" align="center" cellpadding="20" cellspacing="0">');
	document.write('              <tr>');
	document.write('                <td width="140" valign="top">');
	document.write('                  <img src="imagenes/logo_fam.gif" width="130" height="104">');
	document.write('                </td>'); 
	document.write('                <td valign="middle">'); 
	document.write('                  <span class="bottom"><strong>Federaci&oacute;n Andaluza de Motociclismo</strong></span><br>');
	document.write('                  <strong class="bottom">Calle Lora del Rio n&ordm; 1<br>'); 
	document.write('                  Instalaciones Deportivas Tiro de L&iacute;nea <br>');
	document.write('                  41013 SEVILLA<br>');
	document.write('                  Tel. 954 61 38 97&nbsp;&nbsp;&nbsp;&nbsp;Fax. 954 61 06 00&nbsp;&nbsp;&nbsp;&nbsp;Móvil. 667 485 487</strong>');
	document.write('                </td>');
	document.write('                <td valign="bottom">');
	document.write('                  <table width="100%" border="0" align="center" cellpadding="10" cellspacing="0">');
	document.write('                    <tr>');
	document.write('                      <td valign="middle">');
	document.write('                        <div align="right" class="bottom">');
	document.write('                          <div align="center">');
	document.write('                            <a href="avisolegal.asp">Aviso legal</a> -'); 
	document.write('                            <a href="mapaweb.asp">Mapa del Web</a> -'); 
	document.write('                            <a href="creditos.asp">Créditos</a>');
	document.write('                          </div>');
	document.write('                        </div>');
	document.write('                      </td>');
	document.write('                    </tr>');
	document.write('                  </table>');
	document.write('                </td>');
	document.write('              </tr>');
	document.write('            </table>');
}

function prePie()
{
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('  <tr><td background="imagenes/bottom.jpg">&nbsp;</td></tr>');
	document.write('</table>');
}

function comprueba_acceso()
{
  if(document.getElementById("zonaprivada").value!="")
  {
    txt_zonaprivada=document.getElementById("zonaprivada").value;
    if(document.getElementById("usuario").value!="")
    {
      txt_usuario=document.getElementById("usuario").value;
      if(document.getElementById("clave").value!="")
      {
        txt_clave=document.getElementById("clave").value;
        form_vip.submit();
        return true;
      }
      else
      {
        alert("El campo password está vacío");
        return false;
      }
    }
    else
    {
      alert("El campo usuario está vacío");
      return false;
    }
  }
  else
  {
    alert("Debe seleccionar una categoría");
    return false;
  }
}

function cambio()
{
  if (document.getElementById("zonaprivada").value=="3")
  { 
    alert("Estamos trabajando en la construccion de esta zona privada. En breve estará disponible. Gracias");
  }
}

function validaEmail(mail)
{
  var re = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
  if (!re.test(mail))
  {
    alert ("La dirección de email es incorrecta.");
    return false;
  }
  return true;
}