function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

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('      <TABLE WIDTH="100%" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0">');
	document.write('        <TR>'); 
	document.write('          <TD HEIGHT="25" BACKGROUND="imagenes/azul_25.jpg" CLASS="top">');
	document.write('            <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="top">');
	document.write('              <TR>'); 
	document.write('                <TD WIDTH="64%">Federaci&oacute;n de Motociclismo de la Comunidad Valenciana</TD>');
	document.write('                <TD WIDTH="36%">');
	document.write('                  <DIV ALIGN="right">'); 
	document.write('                    <SCRIPT LANGUAGE="javascript" TYPE="text/javascript" CLASS="txtBlack">display_date();</SCRIPT>&nbsp;&nbsp;&nbsp;');
	document.write('                  </DIV>');
	document.write('                </TD>');
	document.write('              </TR>');
	document.write('            </TABLE>');
	document.write('          </TD>');
	document.write('        </TR>');
	document.write('        <TR>'); 
	document.write('          <TD WIDTH="100%" HEIGHT="115">');
	document.write('            <div align="left">');
	document.write('              <a href="default.asp"><img alt="" src="imagenes/topsite.jpg" width="903" height="115" border="0"></a>');
	document.write('            </div>');
	document.write('          </td>');
	document.write('        </tr>');
	document.write('        <tr>'); 
	document.write('          <td height="8" background="imagenes/azul_8.jpg">');
	document.write('            <img alt="" src="imagenes/noimatge.gif" width="8" height="8">');
	document.write('          </td>');
	document.write('        </tr>');
	document.write('      </table>');
}

function cabeceraTPV()
{
	document.write('      <TABLE WIDTH="100%" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0">');
	document.write('        <TR>'); 
	document.write('          <TD HEIGHT="25" BACKGROUND="imagenes/azul_25.jpg" CLASS="top">');
	document.write('            <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="top">');
	document.write('              <TR>'); 
	document.write('                <TD WIDTH="64%">Federaci&oacute;n de Motociclismo de la Comunidad Valenciana</TD>');
	document.write('                <TD WIDTH="36%">');
	document.write('                  <DIV ALIGN="right">'); 
	document.write('                    <SCRIPT LANGUAGE="javascript" TYPE="text/javascript" CLASS="txtBlack">display_date();</SCRIPT>&nbsp;&nbsp;&nbsp;');
	document.write('                  </DIV>');
	document.write('                </TD>');
	document.write('              </TR>');
	document.write('            </TABLE>');
	document.write('          </TD>');
	document.write('        </TR>');
	document.write('        <TR>'); 
	document.write('          <TD WIDTH="100%" HEIGHT="115">');
	document.write('            <div align="left">');
	document.write('              <img alt="" src="imagenes/topsite.jpg" width="903" height="115">');
	document.write('            </div>');
	document.write('          </td>');
	document.write('        </tr>');
	document.write('      </table>');
}

function abrirAlta()
  {
   window.open('federado_Insertar.asp','','height=825,width=775,scrollbars=1,resizable=1');
  }

function zonaprivada_home()
{
	document.write('                  <div align="left">');
	document.write('                    <table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('                      <tr>');
	document.write('                        <td height="25" valign="middle" class="secciones">');
	document.write('                          Zona Privada');
	document.write('                        </td>');
	document.write('                      </tr>');
	document.write('                    </table>');
	document.write('                    <table width="100%" border="0" cellpadding="0" cellspacing="10">');
	document.write('                      <tr>');
	document.write('                        <td valign="top">');
	document.write('                          <span class="texto"></span>');
	document.write('                            <form name="form_vip" method="post" action="http://www.fmcv.es/web2/privada_zonaentrar.asp" onSubmit="return comprueba_acceso2();">');
	document.write('                            <table width="100%" border="0" cellspacing="4" cellpadding="0">');
	document.write('                              <tr>');
	document.write('                                <td class="texto">');
	document.write('                                  <select name="zonaprivada" id="zonaprivada" class="texto" 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('                              </tr>');
	document.write('                              <tr>');
	document.write('                                <td class="categoria">usuario:</td>');
	document.write('                              </tr>');
	document.write('                              <tr>');
	document.write('                                <td class="texto"><input class="texto" name="usuario" type="text" size="20" maxlength="15"></td>');
	document.write('                              </tr>');
	document.write('                              <tr>');
	document.write('                                <td class="categoria">password:</td>');
	document.write('                              </tr>');
	document.write('                              <tr>');
	document.write('                                <td class="texto"><input class="texto" name="clave" type="password" size="20" maxlength="15"></td>');
	document.write('                              </tr>');
	document.write('                              <tr>');
	document.write('                                <td align="center"><input name="Submit" type="submit" class="texto" value="entrar" /></td>');
	document.write('                              </tr>');
	document.write('                              <tr><td class="categoria">&nbsp;</td></tr>');
	document.write('                              </tr>');
	document.write('                              <tr>');
	document.write('                                <td align="center" class="categoria"><A HREF="javascript:;" onClick="abrirAlta()">Darse de alta</A></td>');
	document.write('                              </tr>');
	document.write('                            </table>');
	document.write('                          </form>');
	document.write('                        </td>');
	document.write('                      </tr>');
	document.write('                    </table>');
	document.write('                </div>');
}


function pie()
{
	document.write('  <tr bgcolor="#000000">');
	document.write('    <td height="8" valign="middle" background="imagenes/orange_8.jpg" bgcolor="#FFA701"><img alt="" src="imagenes/noimatge.gif" width="8" height="8"></td>');
	document.write('  </tr>');
	document.write('  <tr bgcolor="#000000">');
	document.write('    <td height="89" valign="middle" background="imagenes/topsite_azul.jpg"> ');
	document.write('      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">');
	document.write('        <tr>');
	document.write('          <td width="59%" valign="top"><div align="left" class="bottom"><br>');
	document.write('              <span class="Estilo1"><strong>Federación de Motociclismo de la Comunidad Valenciana</strong> &nbsp; <br>');
	document.write('              </span> <br>');
	document.write('            </div></td>');
	document.write('          <td width="41%" valign="top"><div align="right"><span class="bottom"><a href="avisolegal.asp"><br>');
	document.write('              Aviso legal</a> - <a href="mapaweb.asp">Mapa del Web</a> ');
	document.write('              - <a href="creditos.asp">Créditos</a><br>');
	document.write('              </span> </div></td>');
	document.write('        </tr>');
	document.write('        <tr>');
	document.write('          <td colspan="2" valign="top"><span class="bottom">Avenida Peris y Valero, 188-3º Pta 7 - 46006 Valencia Tel. 963 354 614 - E-Mail: <A HREF="mailto:fmcv@fmcv.org">fmcv@fmcv.org</A><br></span> </td>');
	document.write('        </tr>');
	document.write('        <tr>');
	document.write('          <td colspan="2">&nbsp;</td>');
	document.write('        </tr>');
	document.write('        <tr>');
	document.write('          <td colspan="2" valign="top"><span class="bottom">Av. de Elche 157, nave 3 Vivero de Empresas "Príncipe Felipe" - 03008 Alicante Tel. 965 920 631<br></span> </td>');
	document.write('        </tr>');
	document.write('        <tr>');
	document.write('          <td colspan="2">&nbsp;</td>');
	document.write('        </tr>');
	document.write('      </table>');
	document.write('    </td>');
	document.write('  </tr>');
}

function cambio()
{
  if (document.getElementById("zonaprivada").value=="3")
  { 
    alert("Estamos trabajando en la construccion de esta zona privada. En breve estará disponible. Gracias");
  }
}


		var UsuarioError = "0";

		function handleHttpResponse() 
		{ 
			if (http.readyState == 4) 
			{ 
			   if (http.status == 200) 
			   { 
				  if (http.responseText.indexOf('invalid') == -1) 
				  {
					 results = http.responseText.split("|"); 
					 UsuarioError = results[0];
					 enProceso = false;
				  }
			   }
			}
		}

		function verificaUsuario() 
		{
			if (!enProceso && http) 
			{
			   var zonaprivada = escape(document.getElementById("zonaprivada").value);
			   var usuario = escape(document.getElementById("usuario").value);
			   var clave = escape(document.getElementById("clave").value);
			   var url = "operacions_ajax.asp?id=1&zonaprivada="+zonaprivada+"&usuario="+usuario+"&clave="+clave;
			   http.open("GET", url, true);
			   http.onreadystatechange = handleHttpResponse;
			   enProceso = true;
			   http.send(null);
			}
		}

		function getHTTPObject() {
			var xmlhttp;
			/*@cc_on
			@if (@_jscript_version >= 5)
			   try {
				  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			   } catch (e) {
				  try {
					 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				  } catch (E) { xmlhttp = false; }
			   }
			@else
			xmlhttp = false;
			@end @*/
			if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
			   try {
				  xmlhttp = new XMLHttpRequest();
			   } catch (e) { xmlhttp = false; }
			}
			return xmlhttp;
		}

		var enProceso = false;
		var http = getHTTPObject();

		function comprueba_acceso2() 
		{ 
		 
		  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;

				if (document.getElementById("zonaprivada").value=="5")
				{
					verificaUsuario();
					if (confirm("¿Usuario Correcto?")) 
					  { 
						if (UsuarioError == "1") {alert("Usuario Erróneo"); return false; }
						if (UsuarioError == "2") {alert("No tienes licencia vigente"); return false; }
						form_vip.submit();
						return true;
					  }
				}
				else {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;
		  }

	   }	

