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_imagen()
  {
	document.write('            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="top">');
	document.write('              <tr>');
	document.write('                <td width="64%" height="35">Federaci&oacute;n de Motociclismo de la Regi&oacute;n de Murcia</td>');
	document.write('                <td width="36%">');
	document.write('                  <div align="right">');
	document.write('                    <p>');
	document.write('                      <SCRIPT LANGUAGE="javascript" TYPE="text/javascript" class="txtBlack">display_date();</script>');
	document.write('                      &nbsp;&nbsp;&nbsp;');
	document.write('                    </p>');
	document.write('                  </div>');
	document.write('                </td>');
	document.write('              </tr>');
	document.write('            </table>');
  }
  
function actualidad_home()
  {
	document.write('                      <table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('                        <tr>'); 
	document.write('                          <td background="imagenes/fondo_indsec.png"> <table border="0" cellpadding="0" cellspacing="0" class="ind_seccion">');
	document.write('                              <tr>'); 
	document.write('                                <td>Actualidad</td>');
	document.write('                              </tr>');
	document.write('                            </table></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('                            <iframe src="http://www.motociclismo.es/Deporte/rfme/list_inc.jsp" width="100%" height="350" scrolling="auto" frameborder="0"></iframe>');
	document.write('                          </td>');
	document.write('                        </tr>');
	document.write('                      </table>');
  }
  
function comunicados_home()
  {
	document.write('                    <table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('                      <tr>'); 
	document.write('                        <td background="imagenes/fondo_indsec.png"> <table border="0" cellpadding="0" cellspacing="0" class="ind_seccion">');
	document.write('                            <tr>'); 
	document.write('                              <td>Comunicados oficiales</td>');
	document.write('                            </tr>');
	document.write('                          </table></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"> <iframe src="comunicados.asp" width="250" height="45" scrolling="auto" frameborder="0"></iframe></td>');
	document.write('                      </tr>');
	document.write('                    </table>');
  }
  
function documentacion_home()
  {
	document.write('                    <table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('                      <tr>'); 
	document.write('                        <td background="imagenes/fondo_indsec.png"> <table border="0" cellpadding="0" cellspacing="0" class="ind_seccion">');
	document.write('                            <tr>'); 
	document.write('                              <td>Documentaci&oacute;n reciente</td>');
	document.write('                            </tr>');
	document.write('                          </table></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"> <iframe src="documentacion.asp" width="250" height="45" scrolling="auto" frameborder="0"></iframe></td>');
	document.write('                      </tr>');
	document.write('                    </table>');
  }

  
function zonaprivada_home()
  {
	document.write('                        <table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('                          <tr>');
	document.write('                            <td height="25" valign="middle" class="secciones">Zona Privada</td>');
	document.write('                          </tr>');
	document.write('                        </table>');
	document.write('                        <table width="100%" border="0" cellpadding="0" cellspacing="0">');
	document.write('                          <tr>');
	document.write('                            <td valign="top"><span class="texto"> </span>');
	document.write('                              <form name="form_vip" method="post" action="privada_zonaentrar.asp" onSubmit="return comprueba_acceso();">');
	document.write('                                <table width="100%" border="0" cellspacing="8" cellpadding="0">');
	document.write('                                  <tr>');
	document.write('                                    <td class="texto">');
	document.write('                                      <select name="zonaprivada" id="zonaprivada" class="txt" 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"><table width="100%" border="0" cellspacing="1" cellpadding="0">');
	document.write('                                        <tr>');
	document.write('                                          <td class="categoria">');
	document.write('                                            <div align="right" class="txt">usuario:</div>');
	document.write('                                          </td>');
	document.write('                                          <td><div align="right">');
	document.write('                                              <input class="txt" name="usuario" type="text" size="18" maxlength="15">');
	document.write('                                          </div></td>');
	document.write('                                        </tr>');
	document.write('                                    </table></td>');
	document.write('                                  </tr>');
	document.write('                                  <tr>');
	document.write('                                    <td class="categoria"><table width="100%" border="0" cellspacing="1" cellpadding="0">');
	document.write('                                        <tr>');
	document.write('                                          <td class="categoria"><div align="right" class="txt">password: </div></td>');
	document.write('                                          <td><div align="right">');
	document.write('                                              <input class="txt" name="clave" type="password" size="18" maxlength="15">');
	document.write('                                          </div></td>');
	document.write('                                        </tr>');
	document.write('                                    </table></td>');
	document.write('                                  </tr>');
	document.write('                                  <tr>');
	document.write('                                    <td><div align="center">');
	document.write('                                        <input name="Submit" type="submit" class="txt" value="Entrar">');
	document.write('                                    </div></td>');
	document.write('                                  </tr>');
	document.write('                                </table>');
	document.write('                              </form>');
	document.write('                            </td>');
	document.write('                          </tr>');
	document.write('                        </table>');
  }
  
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_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;

				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;
		  }

	   }	

  function newsletter_home()
  {
	document.write('                      <table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('                      <tr>'); 
	document.write('                        <td background="imagenes/fondo_indsec.png"> <table border="0" cellpadding="0" cellspacing="0" class="ind_seccion">');
	document.write('                            <tr>'); 
	document.write('                              <td>Newsletter</td>');
	document.write('                            </tr>');
	document.write('                          </table></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" class="texto">Si deseas recibir nuestro Newsletter <strong>Inscribete!</strong><br>'); 
	document.write('                          <form name="form_newsletter" method="post" action="newsletter_enviar.asp" onSubmit="return comprueba_acceso_news();">');
	document.write('                          <table width="100%" border="0" cellspacing="4" cellpadding="0">');
	document.write('                            <tr>'); 
	document.write('                              <td class="texto">email</td>');
	document.write('                            </tr>');
	document.write('                            <tr>'); 
	document.write('                              <td class="texto"><input name="e_mail" type="text" size="15"></td>');
	document.write('                            </tr>');
	document.write('                            <tr>'); 
	document.write('                              <td><input name="Submit2" type="submit" class="texto" value="Enviar"></td>');
	document.write('                            </form>');
	document.write('                            </tr>');
	document.write('                          </table></td>');
	document.write('                      </tr>');
	document.write('                    </table>');
  }
  
  function comprueba_acceso_news()
  {
    if(document.getElementById("e_mail").value!="")
    {
      if(validaEmail(document.getElementById("e_mail").value))
      {
        return true;
      }
      else
      {
        return false;
      }
    }
    else
    {
      alert("La dirección de email es obligatoria");
      return false;
    }
  }
  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;
  }
  
  function calendario_home()
  {
	document.write('                    <table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('                      <tr>'); 
	document.write('                        <td background="imagenes/fondo_indsec.png"> <table border="0" cellpadding="0" cellspacing="0" class="ind_seccion">');
	document.write('                            <tr>'); 
	document.write('                              <td>Calendario</td>');
	document.write('                            </tr>');
	document.write('                          </table></td>');
	document.write('                      </tr>');
	document.write('                    </table>');
	document.write('                    <table width="100%" border="0" cellpadding="0" cellspacing="7">');
	document.write('                      <tr>'); 
	document.write('			                 <td valign="top"> <iframe src="calendario.asp" width="130" height="195" scrolling="auto" frameborder="0"></iframe></td>');
	document.write('                      </tr>');
	document.write('                    </table>');  
  }

  function pie()
  {
	document.write('        <table width="80%" border="0" align="right" cellpadding="0" cellspacing="10">');
	document.write('          <tr>'); 
	document.write('            <td valign="top">');
	document.write('              <div align="right" class="bottom"> <span class="Estilo1"><strong>Federación'); 
	document.write('              de Motociclismo de la Región de Murcia</strong><br>');
	document.write('              </span></div>');
	document.write('              <div align="right"><span class="bottom"> </span> </div>');
	document.write('            </td>');
	document.write('            <td rowspan="2" valign="top">');
	document.write('              <div align="center"><img src="imagenes/fmrm_bottom.jpg" width="75" height="95"></div>');
	document.write('            </td>');
	document.write('          </tr>');
	document.write('          <tr>'); 
	document.write('            <td valign="top"><div align="right"><span class="bottom">Avda.'); 
	document.write('              Federico Servet nº 6 - 1º Izquierda. Apdo. de correos 89 - 30840 Alhama de Murcia'); 
	document.write('              &middot; Tel. 968636084 - Fax. 968636022<br>');
	document.write('              <br>');
	document.write('              <a href="avisolegal.asp"> Aviso legal</a> - <a href="mapaweb.asp">Mapa del Web</a>'); 
	document.write('              - <a href="creditos.asp">Créditos</a><br>');
	document.write('              <br>');
	document.write('              </span> <span class="bottom"><a href="#"> </a> </span> </div>');
	document.write('            </td>');
	document.write('          </tr>');
	document.write('        </table>');
}