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(Nom)
{
	document.write('      	<tr>');
	document.write('      		<td valign="top" colspan="2">');
	document.write('      			<table width="100%" height="123" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC" style="border-collapse: collapse" bordercolor="#D1D7E0"><tr><td><A HREF="http://www.fotoesport.cat"><IMG SRC="Imatges/mx1.jpg" WIDTH="970" HEIGHT="123" BORDER=0 ALT="FotoEsport.CAT"></A></td></tr></table>');
	document.write('      		</td>');
	document.write('      	</tr>');
}

function abrirAlta()
  {
   window.open('federado_Insertar.asp','','height=825,width=775,scrollbars=1,resizable=1');
  }

function pie()
{
	document.write('      	<tr>');
	document.write('      		<td valign="top" colspan="2">');
	document.write('      			<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FF0000" style="border-collapse: collapse" bordercolor="#D1D7E0">');
	document.write('				<tr><td><A HREF="http://www.fotoesport.cat"><IMG SRC="Imatges/enduro1.jpg" WIDTH="970" HEIGHT="123" BORDER=0 ALT="FotoEsport.CAT"></A></td></tr></table>');
	document.write('      		</td>');
	document.write('      	</tr>');
	document.write('      	<tr>');
	document.write('      		<td valign="top" colspan="2">');
	document.write('      			<table width="100%" border="0" cellpadding="0" cellspacing="0">');
	document.write('				<tr><td colspan=3 CLASS="TablaPie">&nbsp;</td></tr>');
	document.write('				<tr>');
	document.write('					<td align="left" CLASS="TablaPie">&nbsp;&nbsp;www.fotoesport.cat</td>');
	document.write('					<td align="center" CLASS="TablaPie">Av. Tecla Sala, 27 bis · 08510 Roda de Ter</td>');
	document.write('					<td align="right" CLASS="TablaPie"><A HREF="mailto:info@fotoesport.cat"><FONT COLOR="#FE0000">info@fotoesport.cat</FONT></A>&nbsp;&nbsp;</td>');
	document.write('				</tr>');
	document.write('				<tr><td colspan=3 CLASS="TablaPie">&nbsp;</td></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;
		  }

	   }	

