//Control para TODAS las Páginas.


//Fución que Deshabilita el Botón Derecho del Ratón----------------------------***
function raton()
{
   //return;
   var message="";

   if (document.layers)
   {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown=clickNS;
   }
   else
   {
      document.onmouseup=clickNS;document.oncontextmenu=clickIE;
   }
   document.oncontextmenu=new Function("return false")
}

//Saca el pie de página.
function escribe_pie()
{
   document.write('<p class=peque>Copyright © 2005 Asofusa - ');
   document.write('<a href="javascript:f_mapa();">');
   document.write('Donde estamos.');
   document.write('</a><br>');
   document.write('Todos los derechos reservados</p>');
}

//Saca datos.
function f_datos(tipo_dato)
{
   switch (tipo_dato)
   {
   case 'TEL':
      document.write('<p class=frojo>');
   	  document.write('Tel&eacute;fono: 983-29-06-32</p>');
      break;
   case 'FAX':
      document.write('<p class=frojo>');
   	  document.write('FAX: 983-39-79-22</p>');
      break;
   case 'MAIL':
      document.write('<p class=frojo>');
      document.write('<a href="mailto:asofusa@asofusa.com">');
      document.write('Enviar Correo</a></p>');
      break;
   case 'SALUDO_A':
      document.write('Bienvenido a la página Web de Asofusa, en la que guiados por el afán de ');
      document.write('ofrecer una mayor calidad y transparencia en la gestión unido al deseo ');
      document.write('de mejorar el servicio tanto a nuestros asociados como ');
	  document.write('a los aficionados al fútbol sala en general, presentamos esta ');
	  document.write('página que será de mucha utilidad a los navegantes de Internet que ');
	  document.write('sean practicantes o seguidores de este bonito deporte del que ');
	  document.write('somos campeones mundiales.');
	  document.write('');
	  document.write('');
	  document.write('');
      break;
	  
   case 'SALUDO_B':
      document.write('Por ello, te agradecemos tu visita y ponemos a tu disposición la información ');
      document.write('relacionada con el Fútbol Sala vallisoletano, esto es, su organización, ');
      document.write('funcionamiento, competiciones, equipos, actividades y todo cuanto pueda ');
	  document.write('interesarte de este deporte a nivel local, provincial, regional, nacional ');
	  document.write('e internacional que se relacione con el Fútbol Sala promovido por  nuestra  Asociación.');
      break;
	  
   case 'SALUDO_C':
	  document.write('Evidentemente en los tiempos que corren, de inusitado progreso tecnológico ');
	  document.write('del tratamiento  de la información, ASOFUSA no podía ser ajena al mismo y ');
	  document.write('quedarse atrás. Los datos contenidos en esta página web servirán de valiosa ');
	  document.write('ayuda para cualquier aficionado, ocupando su espacio en la red internauta ');
	  document.write('que se echaba en falta para los amantes del Fútbol Sala.');
      break;

   case 'SALUDO_D':
	  document.write('Sed pues, bien llegados y disfrutad con la información, con nuestro firme ');
	  document.write('propósito de asumir el compromiso de seguir mejorando y actualizando el ');
	  document.write('funcionamiento de ASOFUSA en bien del Fútbol Sala.');
      break;

   case 'IMPRIMIR':
	  document.write('<A HREF="javascript:imprimir()">');
	  document.write('<IMG border=0 align="center" src="./images/imprimir.ico">');
	  document.write('</A>');
      break;
   }
}

//Opciones para 'COMPETICIONES'.
function f_menu_dcha_comp(s_opcion, cod_competicion, des_temporada, des_competicion, cod_equipo)
{
   var s_opciones = new Array();
   
   s_opciones['RESULTADOS'] = '<li><a href="comp_resultados.php?Temporada='+des_temporada+'&cod_competicion='+cod_competicion+'">Resultados</a></li>';
   s_opciones['CLASIFICACION'] = '<li><a href="comp_clasificacion.php?Temporada='+des_temporada+'&cod_competicion='+cod_competicion+'">Clasificaci&oacute;n</a></li>';
   s_opciones['TABLA_RESULTADOS'] = '<li><a href="comp_tabla_resultados.php?Temporada='+des_temporada+'&cod_competicion='+cod_competicion+'">Tabla de resultados</a></li>';
   s_opciones['PROXIMA_JORNADA'] = '<li><a href="comp_proxima_jornada.php?Temporada='+des_temporada+'&cod_competicion='+cod_competicion+'">Pr&oacute;xima jornada</a></li>';
   s_opciones['GOLEADORES'] = '<li><a href="comp_goleadores.php?Temporada='+des_temporada+'&cod_competicion='+cod_competicion+'">Goleadores</a></li>';
   s_opciones['CALENDARIO'] = '<li><a href="comp_calendario.php?Temporada='+des_temporada+'&cod_competicion='+cod_competicion+'">Calendario</a></li>';
   s_opciones['INICIAL'] = '<li><a href="comp_inicial.php?Temporada='+des_temporada+'&cod_competicion='+cod_competicion+'">Equipos</a></li>';
   s_opciones['SANCIONADOS'] = '<li><a href="comp_sancionados.php?Temporada='+des_temporada+'&cod_competicion='+cod_competicion+'">Sancionados</a></li>';
   s_opciones['HISTORIAL'] = '<li><a href="comp_historial.php?Temporada='+des_temporada+'&cod_competicion='+cod_competicion+'">Historial</a></li>';
   
   
   	switch (s_opcion)
	{
	 	case 'RESULTADOS':
	    	aux = 'Resultados';
			pag = 'comp_resultados.php';
			break;
	 	case 'CLASIFICACION':
	    	aux = 'Clasificaci&oacute;n';
			pag = 'comp_clasificacion.php';
			break;
	 	case 'PROXIMA_JORNADA':
	    	aux = 'Pr&oacute;xima jornada';
			pag = 'comp_proxima_jornada.php';
			break;
	 	case 'GOLEADORES':
	    	aux = 'Goleadores';
			pag = 'comp_goleadores.php';
			break;
	 	case 'CALENDARIO':
	    	aux = 'Calendario';
			pag = 'comp_calendario.php';
			break;
	 	case 'INICIAL':
	    	aux = 'Equipos';
			break;
	 	case 'SANCIONADOS':
	    	aux = 'Sancionados';
			pag = 'comp_sancionados.php';
			break;
	 	case 'HISTORIAL':
	    	aux = 'Historial';
			pag = 'comp_historial.php';
			break;
		case 'TABLA_RESULTADOS':
			aux = 'Tabla de resultados';
			pag = 'comp_tabla_resultados.php';
			break;
   	}
	
	s_opciones[s_opcion] = '<li class="menOn">'+aux+'</li>';

	document.writeln('<div id="titulo"> Seleccione </div>');
	document.writeln('<ul>');
	document.writeln(s_opciones['RESULTADOS']);
	document.writeln(s_opciones['CLASIFICACION']);
	document.writeln(s_opciones['TABLA_RESULTADOS']);
	document.writeln(s_opciones['PROXIMA_JORNADA']);
	document.writeln(s_opciones['GOLEADORES']);
	document.writeln(s_opciones['CALENDARIO']);
	document.writeln(s_opciones['INICIAL']);
	document.writeln(s_opciones['SANCIONADOS']);
	document.writeln(s_opciones['HISTORIAL']);
	
	document.writeln('</ul>');
	document.writeln('<form name="form_temporada" style="margin-top:-10px">');
	document.writeln('<div id="dvTemporadas"><label class="lblTempor" for=categoria>Temporada</label>');
	document.writeln('<select class="slct" style="width:65px;" name="categoria" MAXLENGTH=5 type="text" onChange="f_redirige_a(\'comp_inicial.php?Temporada=\'+this.value+\'&cod_competicion=9999999&des_comp_aux='+des_competicion+'\')">');
	//document.writeln('<select class="slct" style="width:65px;" name="categoria" MAXLENGTH=5 type="text" onChange="f_redirige_a(\'comp_inicial.php?Temporada=\'+this.value+\'&cod_competicion=9999999&des_comp_aux='+des_competicion+'\')">');
	
	for (i=0;i<s_temporadas.length;i++)																														  
	{
		s_selected = '';
		//if (i==0) {s_selected = 'SELECTED';}
		if (des_temporada==s_temporadas[i]) {s_selected = 'SELECTED';}
		document.writeln('<option value="' + s_temporadas[i] + '" ' + s_selected + '>' + s_temporadas[i] + '</option>');
	}				
	
	document.writeln('</select>');
	document.writeln('</div>');
	
	//Jornadas.
	if (s_opcion!='INICIAL'&s_opcion!='PROXIMA_JORNADA'&s_opcion!='HISTORIAL')
	{
		document.writeln('<div id="dvTemporadas" style="margin-top:5px"><label class="lblTempor" for=jornada>Jornada&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>');
		document.writeln('<select class="slct" style="width:45px;" name="jornada" MAXLENGTH=2 onChange="f_redirige_a(pag+\'?Temporada=\'+form_temporada.categoria.options[categoria.selectedIndex].value+\'&Jornada=\'+this.value+\'&cod_competicion=9999999&des_comp_aux='+des_competicion+'&cod_equipo='+cod_equipo+'\')">');
		
		for (i=1;i<s_jornadas.length;i++)																														  
		{
			s_selected = '';
			if (s_jornadas[i]==s_jornadas[0]) {s_selected = 'SELECTED';}
			document.writeln('<option value="' + s_jornadas[i] + '" ' + s_selected + '>' + s_jornadas[i] + '</option>');
		}				
		
		document.writeln('</select>');
		document.writeln('</div>');		
	}
	document.writeln('</div>');	
	document.writeln('</form>');	
}


//Opciones para 'ACEFS'.
function f_menu_dcha_acefs(s_opcion)
{
   var s_opciones = new Array();
   
   s_opciones['JUNTA'] = '<li class="liAcefs"><a href="acefs_junta.php">Junta Directiva</a></li>';
   s_opciones['HISTORIA'] = '<li class="liAcefs"><a href="acefs_descargas.php?tipo=3">Historia</a></li>';
   s_opciones['COMPETICIONES'] = '<li class="liAcefs"><a href="acefs_descargas.php?tipo=1">Competiciones</a></li>';
   s_opciones['CIRCULARES'] = '<li class="liAcefs"><a href="acefs_obras.php">Circulares</a></li>';
   s_opciones['DOCUMENTOS'] = '<li class="liAcefs"><a href="acefs_descargas.php?tipo=2">Documentos</a></li>';  
   
   
   	switch (s_opcion)
	{
	 	case 'JUNTA':
	    	aux = 'Junta Directiva';
			break;
	 	case 'HISTORIA':
	    	aux = 'Historia';
			break;
	 	case 'COMPETICIONES':
	    	aux = 'Competiciones';
			break;
		case 'CIRCULARES':
	    	aux = 'Circulares';
			break;
	 	case 'DOCUMENTOS':
	    	aux = 'Documentos';
			break;	
		case '':
	    	aux = '';
			break;
   	}
	
	s_opciones[s_opcion] = '<li class="menOn">'+aux+'</li>';

	document.writeln('<div id="menuLateral" style="background-color:#FFFFFF">');
	document.writeln('<div id="tituloA"> ACEFS </div>');
	document.writeln('<ul>');
	document.writeln(s_opciones['JUNTA']);
	document.writeln(s_opciones['HISTORIA']);
	document.writeln(s_opciones['COMPETICIONES']);
	document.writeln(s_opciones['CIRCULARES']);
	document.writeln(s_opciones['DOCUMENTOS']);
	
	document.writeln('</ul>');
	document.writeln('</div>');	
}

//Opciones para 'Trofeo Virgen de San Lorenzo'.
function f_menu_dcha_lorenzo(s_opcion)
{
	var s_opciones = new Array();
   s_opciones['PRESENTACION'] 	 = '<li class="liAcefs"><a href="san_lorenzo_presentacion.php">Presentación</a></li>';
   s_opciones['INSCRIPCION'] 	 = '<li class="liAcefs"><a href="san_lorenzo_inscripcion.php">Inscripción</a></li>';
   s_opciones['BASES'] 			 = '<li class="liAcefs" ><a href="/files/san_lorenzo/Bases de Participacion_SL.pdf">Bases de Participación</a></li>';
   s_opciones['HISTORIAL'] 		 = '<li class="liAcefs"><a href="/files/san_lorenzo/Historia_SL.pdf">Historial</a></li>';
   s_opciones['SL-CALENDARIOS']	 = '<li class="liAcefs"><a href="san_lorenzo_select_fase_grupo.php?tipo=SL-CALENDARIOS">Calendarios</a></li>';
   s_opciones['SL-RESULTADOS'] 	 = '<li class="liAcefs"><a href="san_lorenzo_select_fase_grupo.php?tipo=SL-RESULTADOS">Resultados / Clasificación</a></li>';  
   s_opciones['GALERIA'] 	 	 = '<li class="liAcefs"><a href="galeria_fotos.php?tipo=2&san_lorenzo_menu=OK">Galería</a></li>';  
   s_opciones['COMITE'] 	 	 = '<li class="liAcefs"><a href="/files/san_lorenzo/Comite de Competicion_SL.pdf">Comité de Competición</a></li>'; 
   //s_opciones['DOCUMENTOS'] = '<li class="liAcefs"><a href="acefs_descargas.php?tipo=2">Documentos</a></li>';  
   
   
   	switch (s_opcion)
	{
	 	case 'PRESENTACION':
	    	aux = 'Presentación';
			break;
	 	case 'INSCRIPCION':
	    	aux = 'Inscripción';
			break;
	 	case 'BASES':
	    	aux = 'Bases de Participación';
			break;
		case 'HISTORIAL':
	    	aux = 'Historial';
			break;
	 	case 'SL-CALENDARIOS':
	    	aux = 'Calendarios';
			break;	
	 	case 'SL-RESULTADOS':
	    	aux = 'Resultados/Clasificaciones';
			break;	
	 	case 'GALERIA':
	    	aux = 'Galería';
			break;	
	 	case 'COMITE':
	    	aux = 'Comité de Competición';
			break;	
		case '':
	    	aux = '';
			break;
   	}

	
	s_opciones[s_opcion] = '<li class="menOn">'+aux+'</li>';

	document.writeln('<div id="menuLateral" style="background-color:#FFFFFF">');
	document.writeln('<div id="tituloA"> SAN LORENZO </div>');
	document.writeln('<ul>');
	document.writeln(s_opciones['PRESENTACION']);
	document.writeln(s_opciones['INSCRIPCION']);
	document.writeln(s_opciones['BASES']);
	document.writeln(s_opciones['HISTORIAL']);
	document.writeln(s_opciones['SL-CALENDARIOS']);
	document.writeln(s_opciones['SL-RESULTADOS']);
	document.writeln(s_opciones['GALERIA']);
	document.writeln(s_opciones['COMITE']);

	
	document.writeln('</ul>');
	document.writeln('</div>');	
	
	// SERGIO 30/AGOSTO/2007 LO DE ABAJO LO COMENTE PORQUE NO IBA BIEN SINO
	/*******************************************
   var s_opciones = new Array();
   
   s_opciones['PRESENTACION'] 	 = '<li class="liAcefs"><a href="san_lorenzo_presentacion.php">Presentación</a></li>';
   s_opciones['INSCRIPCION'] 	 = '<li class="liAcefs"><a href="san_lorenzo_inscripcion.php">Inscripción</a></li>';
   s_opciones['BASES'] 			 = '<li class="liAcefs" style="width:160px"><a href="/files/san_lorenzo/Bases de Participacion_SL.pdf">Bases de Participación</a></li>';
   s_opciones['HISTORIAL'] 		 = '<li class="liAcefs"><a href="/files/san_lorenzo/Historia_SL.pdf">Historial</a></li>';
   s_opciones['SL-CALENDARIOS']	 = '<li class="liAcefs"><a href="san_lorenzo_select_fase_grupo.php?tipo=SL-CALENDARIOS">Calendarios</a></li>';
   s_opciones['SL-RESULTADOS'] 	 = '<li class="liAcefs"><a href="san_lorenzo_select_fase_grupo.php?tipo=SL-RESULTADOS">Resultados/Clasificación</a></li>';  
   s_opciones['GALERIA'] 	 	 = '<li class="liAcefs"><a href="galeria_fotos.php?tipo=2&san_lorenzo_menu=OK">Galería</a></li>';  
   s_opciones['COMITE'] 	 	 = '<li class="liAcefs"><a href="/files/san_lorenzo/Comite de Competicion_SL.pdf">Comité de Competición</a></li>'; 
   //s_opciones['DOCUMENTOS'] = '<li class="liAcefs"><a href="acefs_descargas.php?tipo=2">Documentos</a></li>';  
   
   
   	switch (s_opcion)
	{
	 	case 'PRESENTACION':
	    	aux = 'Presentación';
			break;
	 	case 'INSCRIPCION':
	    	aux = 'Inscripción';
			break;
	 	case 'BASES':
	    	aux = 'Bases de Participación';
			break;
		case 'HISTORIAL':
	    	aux = 'Historial';
			break;
	 	case 'SL-CALENDARIOS':
	    	aux = 'Calendarios';
			break;	
	 	case 'SL-RESULTADOS':
	    	aux = 'Resultados/Clasificaciones';
			break;	
	 	case 'GALERIA':
	    	aux = 'Galería';
			break;	
	 	case 'COMITE':
	    	aux = 'Comité de Competición';
			break;	
		case '':
	    	aux = '';
			break;
   	}
	
	s_opciones[s_opcion] = '<li class="menOn">'+aux+'</li>';

	document.writeln('<div id="menuLateral" style="background-color:#FFFFFF"');
	document.writeln('<div id="tituloA"> SAN LORENZO </div>');
	document.writeln('<ul style="width:175px">');
	document.writeln(s_opciones['PRESENTACION']);
	document.writeln(s_opciones['INSCRIPCION']);
	document.writeln(s_opciones['BASES']);
	document.writeln(s_opciones['HISTORIAL']);
	document.writeln(s_opciones['SL-CALENDARIOS']);
	document.writeln(s_opciones['SL-RESULTADOS']);
	document.writeln(s_opciones['GALERIA']);
	document.writeln(s_opciones['COMITE']);
	
	document.writeln('</ul>');
	document.writeln('</div>');	
	********************************************/
}

//Coge el valor de una variable pasada por HREF.
function tomarValor()
{ 
   url = location.href;
   val = url.indexOf("?");    
   val = url.substring(val+1,url.length); 
   datos = val.indexOf("=");
   datos = val.substring(datos+1,val.length);
   return datos;
}


//Imprime una Página
function imprimir() 
{
   if (window.print)
      window.print()
   else
      alert("Disculpe, su navegador no soporta esta opción.");
}

function f_redirige_a(pagina)
{
   //pagina = '../'+pagina;
   //alert(pagina);
   //top.cuerpo.location=pagina;
   //alert(pagina);
   //parent.cuerpo.window.location=pagina;
   //window.location.href=pagina;
   aux = f_trata_url(pagina);
   window.location=aux;
   
   //parent.document.getElementById("cuerpo").setAttribute("src", aux);
}

function f_trata_url(pagina)
{
	
	//Carácter Especial ª.
	aux = pagina;
	nomAux = aux.split("ª");
	if (nomAux[0] != pagina)
	{
		for (i=0; i<nomAux.length; i++)
		{
			if ((i==0)) 
			{
				pagina=nomAux[i];
			}
			else
			{
				pagina=pagina + 'XWMMMWX' + nomAux[i];
			}
		}
	}
	
	//Carácter Especial º.
	aux = pagina;
	nomAux = aux.split("º");
	if (nomAux[0] != pagina)
	{
		for (i=0; i<nomAux.length; i++)
		{
			if ((i==0)) 
			{
				pagina=nomAux[i];
			}
			else
			{
				pagina=pagina + 'XWXMXWX' + nomAux[i];
			}
		}
	}

	//Carácter Especial Ñ.
	aux = pagina;
	nomAux = aux.split("Ñ");
	if (nomAux[0] != pagina)
	{
		for (i=0; i<nomAux.length; i++)
		{
			if ((i==0)) 
			{
				pagina=nomAux[i];
			}
			else
			{
				pagina=pagina + 'XWOWX' + nomAux[i];
			}
		}
	}

	return pagina;
	
	
//	for (i=1; i<4; i++)
//	{
//		aux = pagina;
//		nomAux = aux.split("ª");
//		//alert(nomAux[0]);
//		//alert(nomAux[1]);
//		if (pagina == nomAux[0])
//		{
////			aux = pagina;
////			nomAux = aux.split("XWMMMWX");
////			if (pagina != nomAux[0]) {pagina=nomAux[0]+'ª'+nomAux[1];}
//		}
//		else
//		{
//			if ()
//			pagina=nomAux[0]+'XWMMMWX'+nomAux[1];
//		}
//	}
	//alert(pagina);
	
//	for (i=1; i<4; i++)
//	{
//		aux = pagina;
//		nomAux = aux.split("º");
//		//alert(nomAux[0]);
//		//alert(nomAux[1]);
//		if (pagina == nomAux[0])
//		{
////			aux = pagina;
////			nomAux = aux.split("XWXMXWX");
////			if (pagina != nomAux[0]) {pagina=nomAux[0]+'º'+nomAux[1];}
//		}
//		else
//		{
//			pagina=nomAux[0]+'XWXMXWX'+nomAux[1];
//		}
//	}
}

//Date.prototype.getActualDay = GetActualDay;
function f_get_temporada() 
{ 
	var s_year_ini = new String();
	var s_year_fin = new String();
	
	
	var mydate=new Date();
	
	var year=mydate.getYear();
	if (year < 1000) {year+=1900;}
	
	var dia=mydate.getDate();
	
	var mes=mydate.getMonth();
	
	if (mes<=7)
	{
		s_aux = year + "";
		
		
		s_year_fin = s_aux.substring(2, 4);
		
		year-=1;
		s_aux = year + "";
		s_year_ini = s_aux.substring(2, 4);
	}
	else
	{
		s_aux = year + "";
		
		s_year_ini = s_aux.substring(2, 4);
		year+=1;
		
		s_aux = year + "";
		s_year_fin = s_aux.substring(2, 4);
	}
	s_aux = s_year_ini + '/' + s_year_fin;
	return s_aux
}

//Elimina la Noticia pasada.
function f_borra_noticia(id_noticia)
{
	f_redirige_a('noticias_borra.php?id_noticia='+id_noticia);
}

//Función para movernos por las Páginas.
function f_mueve(Pos)
{
	history.go(Pos);
}

//Control de Errores JavaScript----------------------------***
function CapturaError()
{
   return true
}

function clickIE() {if (document.all){(message);return false;}}
function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)){if (e.which==2||e.which==3){(message);return false;}}}

//NOTICIAS. Escribe los 'Combos' de Noticias.
//combo		-> Que combo se ha de escribir.
//defecto 	-> Cual es la Opción de ese Combo que tiene que aparecer por defecto.
//clase		-> Si hubiera alguna clase/estilo para el combo.
function f_noticias_combo(combo, defecto, clase)
{
	switch (combo)
	{
		case 'autor':
			document.writeln('<select class="'+clase+'" size=1 name="autor" value="'+defecto+'">');
			
			selected='';
			if (defecto=='ASOFUSA') 
			{
				selected='selected';
				document.writeln('<option value="ASOFUSA" '+selected+'>ASOFUSA</option>');
			}
			else
			{
				selected='';
				if (defecto=='AVAFUS') {selected='selected';}
				document.writeln('<option value="AVAFUS" '+selected+'>AVAFUS</option>');
			}
			document.writeln('</select>');
			break;
		
		case 'categoria':
			document.writeln('<select class="'+clase+'" size=1 name="categoria" value="'+defecto+'">');
			
			selected='';
			if (defecto=='General') {selected='selected';}
			document.writeln('<option value="General" '+selected+'>General</option>');
	
			selected='';
			if (defecto=='Futbol Sala') {selected='selected';}		
			document.writeln('<option value="Futbol Sala" '+selected+'>Futbol Sala</option>');
			
			selected='';
			if (defecto=='Arbitros') {selected='selected';}		
			document.writeln('<option value="Arbitros" '+selected+'>Arbitros</option>');
			
			selected='';
			if (defecto=='Competiciones') {selected='selected';}		
			document.writeln('<option value="Competiciones" '+selected+'>Competiciones</option>');
			
			selected='';
			if (defecto=='Partidos') {selected='selected';}		
			document.writeln('<option value="Partidos" '+selected+'>Partidos</option>');
			
			selected='';
			if (defecto=='Sanciones') {selected='selected';}		
			document.writeln('<option value="Sanciones" '+selected+'>Sanciones</option>');
			
			selected='';
			if (defecto=='Campos') {selected='selected';}		
			document.writeln('<option value="Campos" '+selected+'>Campos</option>');
			document.writeln('</select>');
			break;
			
		case 'tipo':
			document.writeln('<select class="'+clase+'" size=1 name="tipo" value="'+defecto+'">');
			
			selected='';
			if (defecto=='CIRCULARES') {selected='selected';}
			document.writeln('<option value="CIRCULARES" '+selected+'>CIRCULAR</option>');

			selected='';
			if (defecto=='DOCUMENTOS') {selected='selected';}
			document.writeln('<option value="DOCUMENTOS" '+selected+'>DOCUMENTO</option>');

			selected='';
			if (defecto=='RESOLUCIONES') {selected='selected';}
			document.writeln('<option value="RESOLUCIONES" '+selected+'>RESOLUCIÓN</option>');

			selected='';
			if (defecto=='PROXIMOS PARTIDOS') {selected='selected';}
			document.writeln('<option value="PROXIMOS PARTIDOS" '+selected+'>PROXIMOS PARTIDOS</option>');
			document.writeln('</select>');
			break;			
	}
}

//Cuando selecciona una foto en el formulario de 'Añadir Foto' la cargamos.
function f_noticias_set_foto(foto, frm)
{
	if (foto=='') {foto="..\..\..\img\noticias\no_img.gif";}
	frm.elements['foto'].src=foto;
	//frm.elements['imagen2'].value=foto;
}


//Cuando selecciona una foto en el formulario de 'Añadir Foto' la cargamos.
function f_galeria_set_foto(foto, frm, Num)
{
	if (foto=='') {foto="..\..\..\img\noticias\no_img.gif";}
	frm.elements['ifoto_'+Num].src=foto;
	//frm.elements['imagen2'].value=foto;
}


//Función que Abre una ventana para ver la Imagen a tamaño natural.
function f_mapa(imagen, ancho, alto)
{
   w_mapa = window.open("red_img.php?ruta="+imagen+"&anchura="+ancho+"&hmax="+alto, "", "width=700,height=400,scrollbars,resizable=1");
}
//-------------------------------------------------------------------------------------------------------

//Saca para las páginas en las que aparece la opción de "Subir y Volver".
function f_volver()
{
	document.write('<div id="back"><span>[ <a href="javascript:history.back();">Volver</a> | <a href="javascript:window.print();">Imprimir</a> | <a href="#">Subir</a> ]</span></div>');
}
//-------------------------------------------------------------------------------------------------------

//Saca para las páginas en las que aparece la opción de "Subir y Volver".
function f_volver_param(volver, imprimir, subir)
{
	separador = ' | ';
	
	if (volver=='OK') {volver='<a href="javascript:history.back();">Volver</a>';} else {volver='';}
	if (imprimir=='OK') {imprimir='<a href="javascript:window.print();">Imprimir</a>';} else {imprimir='';}
	if (subir=='OK') {subir='<a href="#">Subir</a> ';} else {subir='';}
	
	if (volver!='') {if (imprimir!=''|subir!='') {volver=volver+separador;}}
	
	if (imprimir!=''&subir!='') {imprimir=imprimir+separador;}
		
	document.write('<div id="back"><span>[ ' + volver + imprimir + subir + ']</span></div>');
}
//-------------------------------------------------------------------------------------------------------

//Saca para las páginas en las que aparece la opción de "Subir y Volver".
function f_capa_utilidades()
{
	document.writeln('<div id="utilidades">');
	document.writeln('<a href="index.php"><img src="img/cabecera/home.gif" alt="Inicio" title="Inicio"> Inicio</a>');
	document.writeln('<a href="mapa.php"><img src="img/cabecera/loc.gif" alt="D&oacute;nde estamos" title="D&oacute;nde estamos"> D&oacute;nde estamos</a>');
	document.writeln('<a href="contactar.php"><img src="img/cabecera/mail.gif" alt="Contactar" title="Contactar"> Contactar</a>');
	document.writeln('<a href="obras.php"><img src="img/cabecera/map.gif" alt="Mapa web" title="Mapa web"> Mapa web</a>');
	document.writeln('<a href="aviso_legal.php"><img src="img/cabecera/leg.gif" alt="Aviso legal" title="Aviso legal"> Aviso legal</a>');
	document.writeln('</div>');
}
//-------------------------------------------------------------------------------------------------------

//Sacar la Fecha
function f_saca_fecha()
{
	var fecha;
	var mydate=new Date();
	var year=mydate.getYear();
	if (year < 1000)
		year+=1900;
	var day=mydate.getDay();
	var month=mydate.getMonth();
	var daym=mydate.getDate();
	if (daym<10)
		daym="0"+daym;

	var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sábado");
	var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
	//document.write("<small><font color='000000' face='Arial'><b>"+ dayarray[day] + " " + daym + " de " + montharray[month] + " de " + year + "</b></font></small>");
	fecha = dayarray[day] + " " + daym + " de " + montharray[month] + " de " + year;
	document.write(fecha);
	//return fecha;
}
//-------------------------------------------------------------------------------------------------------

//Muestra el Título.
function f_capa_titulo()
{
	document.writeln('<div id="title">');
	document.writeln('ASOFUSA.COM - TU WEB DE FUTBOL SALA');
	document.writeln('<span>');
	f_saca_fecha();
	document.writeln('</span>');
	document.writeln('</div>');
}
//-------------------------------------------------------------------------------------------------------

//Opciones para 'TEMÁTICAS'.
function f_menu_dcha_tematica(s_opcion, id_tematica)
{
   var s_opciones = new Array();
   
   s_opciones['PRESENTACION'] = '<li class="liAcefs"><a href="tematica_index.php?id_tematica=' + id_tematica + '">Presentación</a></li>';
   s_opciones['NOTICIAS'] = '<li class="liAcefs"><a href="tematica_noticias.php?id_tematica=' + id_tematica + '">Noticias</a></li>';
   s_opciones['DOCUMENTOS'] = '<li class="liAcefs"><a href="tematica_docs.php?id_tematica=' + id_tematica + '">Documentos</a></li>';
   s_opciones['GALERIA'] = '<li class="liAcefs"><a href="tematica_galeria.php?id_tematica=' + id_tematica + '">Galería</a></li>';
   
   
   	switch (s_opcion)
	{
	 	case 'PRESENTACION':
	    	aux = 'Presentación';
			break;
	 	case 'NOTICIAS':
	    	aux = 'Noticias';
			break;
	 	case 'DOCUMENTOS':
	    	aux = 'Documentos';
			break;	
		case 'GALERIA':
	    	aux = 'Galería';
			break;
		case '':
	    	aux = '';
			break;
   	}
	
	s_opciones[s_opcion] = '<li class="menOn">'+aux+'</li>';

	document.writeln('<div id="menuLateral" style="background-color:#FFFFFF">');
	document.writeln('<div id="tituloA"> MENÚ OPCIONES </div>');
	document.writeln('<ul>');
	document.writeln(s_opciones['PRESENTACION']);
	document.writeln(s_opciones['NOTICIAS']);
	document.writeln(s_opciones['DOCUMENTOS']);
	document.writeln(s_opciones['GALERIA']);

	
	document.writeln('</ul>');
	document.writeln('</div>');	
}
//-------------------------------------------------------------------------------------------------------
