// Funciones mapa interactivo
	function seleccionar_opcion_combo (capa)
	{
		for(i=0; i<document.form_buscador.zona.length; i++)
		{				
			switch(capa) {
				case "m_liebana":
						if (document.form_buscador.zona.options[i].value == "04" || document.form_buscador.zona.options[i].value == 4)
							document.form_buscador.zona.selectedIndex = i;
						break;
				case "m_saja_nansa":
						if (document.form_buscador.zona.options[i].value == "05" || document.form_buscador.zona.options[i].value == 5)
							document.form_buscador.zona.selectedIndex = i;
						break;			
				case "m_campoo":
						if (document.form_buscador.zona.options[i].value == "09" || document.form_buscador.zona.options[i].value == 9)
							document.form_buscador.zona.selectedIndex = i;
						break;			
				case "m_occidental":
						if (document.form_buscador.zona.options[i].value == "02" || document.form_buscador.zona.options[i].value == 2)
							document.form_buscador.zona.selectedIndex = i;
						break;			
				case "m_besaya":
						if (document.form_buscador.zona.options[i].value == "06" || document.form_buscador.zona.options[i].value == 6)
							document.form_buscador.zona.selectedIndex = i;
						break;			
				case "m_central":
						if (document.form_buscador.zona.options[i].value == "01" || document.form_buscador.zona.options[i].value == 1)
							document.form_buscador.zona.selectedIndex = i;
						break;			
				case "m_pas_miera":	
						if (document.form_buscador.zona.options[i].value == "07" || document.form_buscador.zona.options[i].value == 7)
							document.form_buscador.zona.selectedIndex = i;
						break;			
				case "m_oriental":	
						if (document.form_buscador.zona.options[i].value == "08" || document.form_buscador.zona.options[i].value == 8)
							document.form_buscador.zona.selectedIndex = i;
						break;			
				case "m_ason":
						if (document.form_buscador.zona.options[i].value == "03" || document.form_buscador.zona.options[i].value == 3)
							document.form_buscador.zona.selectedIndex = i;
						break;			
				}
		}
	}
	
	function mostrar_mapa(capa)
	{
		document.getElementById(capa).style.visibility = 'visible';	
	}
	
	function ocultar_mapa(capa)
	{
		document.getElementById(capa).style.visibility = 'hidden';		
	}	

// Fin funciones mapa interactivo

function cargar_iframe(valor,iframe)
{
	document.getElementById(iframe).src = valor;	
}

function imprimir ()
{
  	window.open('imprimir.php');
}

function cerrar_enviaraunamigo()
{
	document.getElementById("div_enviaraunamigo").style.display = "none";
	document.getElementById("fr_enviaraunamigo").src = "";
}
	
function abrir_enviaraunamigo(url)
{
	document.getElementById('div_enviaraunamigo').style.display = 'none';
	document.getElementById('div_enviaraunamigo').style.position = 'absolute';
	document.getElementById('div_enviaraunamigo').style.top = "50%";

	document.getElementById('div_enviaraunamigo').style.position = 'fixed';
	document.getElementById('div_enviaraunamigo').style.top = document.documentElement.clientHeight/2 - document.getElementById('div_enviaraunamigo').offsetHeight/2;

	document.getElementById("div_enviaraunamigo").style.display = "block";
	document.getElementById("fr_enviaraunamigo").src = "iframe_enviaraunamigo.php?url="+url;
}

function abrir_contacta()
{
	document.getElementById('div_contacta').style.display = 'none';
	document.getElementById('div_contacta').style.position = 'absolute';
	document.getElementById('div_contacta').style.top = "50%";

	document.getElementById('div_contacta').style.position = 'fixed';
	document.getElementById('div_contacta').style.top = document.documentElement.clientHeight/2 - document.getElementById('div_contacta').offsetHeight/2;

	document.getElementById("div_contacta").style.display = "block";
	document.getElementById("fr_contacta").src = "iframe_contacta.php";
}
function cerrar_contacta()
{
	document.getElementById("div_contacta").style.display = "none";
	document.getElementById("fr_contacta").src = "";
}

function cerrar_leyendasimbolos()
{
	document.getElementById("div_leyendasimbolos").style.display = "none";
	document.getElementById("fr_leyendasimbolos").src = "";
}
	
function abrir_leyendasimbolos(img)
{
	document.getElementById('div_leyendasimbolos').style.display = 'none';
	document.getElementById('div_leyendasimbolos').style.position = 'absolute';
	document.getElementById('div_leyendasimbolos').style.top = "50%";

	document.getElementById('div_leyendasimbolos').style.position = 'fixed';
	document.getElementById('div_leyendasimbolos').style.top = document.documentElement.clientHeight/2 - document.getElementById('div_leyendasimbolos').offsetHeight/2;

	document.getElementById("div_leyendasimbolos").style.display = "block";
	document.getElementById("fr_leyendasimbolos").src = "iframe_leyendasimbolos.php?img="+img;
}

function cerrar_ampliar_imagen(capa)
{
	document.getElementById(capa).style.display = "none";
}

function ampliar_imagen(capa)
{
	document.getElementById(capa).style.display = 'none';
	document.getElementById(capa).style.position = 'absolute';
	document.getElementById(capa).style.top = "50%";
	
	document.getElementById(capa).style.position = 'fixed';
	document.getElementById(capa).style.top = document.documentElement.clientHeight/2 - document.getElementById(capa).offsetHeight/2;
	
	document.getElementById(capa).style.display = "block";
}

var principal = '';

function mostrar_capa(elemento)
{
	anterior = principal;
	principal = elemento;
	
	if(anterior == '')
	{
		document.getElementById(principal).style.display='block';
		if (document.getElementById("imagen_"+principal))
			{
				document.getElementById("imagen_"+principal).src = 'images/icono_flecha_abajo.gif';	
			}
	}
	else
	{
		if (anterior == principal)
		{
			if (document.getElementById(principal).style.display == "none")
			{
				document.getElementById(principal).style.display='block';
				if (document.getElementById("imagen_"+principal))
				{
					document.getElementById("imagen_"+principal).src = 'images/icono_flecha_abajo.gif';	
				}
			}
			else
			{
				document.getElementById(principal).style.display='none';
				if (document.getElementById("imagen_"+principal))
				{
					document.getElementById("imagen_"+principal).src = 'images/icono_flecha.gif';	
				}
			}
		}
		else
		{
			document.getElementById(anterior).style.display='none';
			document.getElementById(principal).style.display='block';
			if (document.getElementById("imagen_"+principal))
			{
				document.getElementById("imagen_"+anterior).src = 'images/icono_flecha.gif';					
				document.getElementById("imagen_"+principal).src = 'images/icono_flecha_abajo.gif';	
			}
		}
	}
}

function MENUcambia(id, clase)
{
	document.getElementById(id).className = clase;
}

function MENUresetea(id, clase)
{
	document.getElementById(id).className = clase;
}

function validarBuscadorPrincipal()
{
	if (document.bgeneral.tbus_general.value == '')
	{
		alert("Introduzca el texto a buscar");
		document.bgeneral.tbus_general.focus();
		return false;
	}
	else if ((document.bgeneral.tbus_general.value).length < 3)
	{
		alert("El texto a buscar debe tener al menos 3 caracteres");
		document.bgeneral.tbus_general.focus();
		return false;	
	}
}

function cerrar_Micapa(capa)
{
	document.getElementById('div_'+capa).style.display = 'none';
	if(document.getElementById('fr_'+capa)) document.getElementById('fr_'+capa).src = '';
}
	
function abrir_Micapa(capa)
{
	document.getElementById('div_'+capa).style.display = 'none';
	document.getElementById('div_'+capa).style.position = 'absolute';
	document.getElementById('div_'+capa).style.top = "50%";

	document.getElementById('div_'+capa).style.position = 'fixed';
	document.getElementById('div_'+capa).style.top = document.documentElement.clientHeight/2 - document.getElementById('div_'+capa).offsetHeight/2;

	document.getElementById('div_'+capa).style.display = "block";
	if(document.getElementById('fr_'+capa)) document.getElementById('fr_'+capa).src = 'iframe_'+capa+'.php';
}