<!--
function tratarFecha(dia,mes,ano){
	document.location = "?dia="+dia+"&mes="+mes+"&ano="+ano;
	}

function ampliaFotografia(foto_)
{
	foto=window.document.getElementById(foto_);
	alt=foto.descri;
	descri=alt.split("###")[1];
	nombre=alt.split("###")[0];
	src=foto.src;
	txt='<div class="galeria-fotos-tipo3"><ul><li><div class="foto"><img src="'+src+'" alt="'+nombre+'" style="width:425px" /></div><div class="descripcion"><p><strong>'+nombre+'</strong><br />'+descri+'</p></div></li></ul><div class="limpia-flotacion"></div></div>';							
	window.document.getElementById("imagenampliada").innerHTML=txt;
}	

function cargaAjax(url,contenedor)
{
	var aElement=document.createElement("DIV");
	aElement.id="cargando";
	aElement.innerHTML="CARGANDO...";
	aElement.style.top=window.document.body.scrollTop+"px";	
	window.document.body.appendChild(aElement);
	/* - COLOCA UN VELO PARA QUE NO SE PULSE ANTES DE TIEMPO - */
		var aElement2=document.createElement("DIV");
		aElement2.id="cargandovelo";
		aElement2.innerHTML="&nbsp;";
		window.document.body.appendChild(aElement2);	
	/* ------------------------------------------------------- */
	var t = new Date();
	var url = url+"/"+""+t.getTime();
	new Ajax.Request(url, {
		method: 'post',
        encoding: 'UTF-8',
		onSuccess: function(transport) {
			var oChild=$("cargando");
			window.document.body.removeChild(oChild);
			oChild=$("cargandovelo");
			window.document.body.removeChild(oChild);			
			$(contenedor).innerHTML=transport.responseText;
		},
		onFailure: function(transport) {
			var oChild=$("cargando");
			//window.document.body.removeChild(oChild);
			window.document.body.innerHTML="Ha habido un error de comunicación:<br/>"+transport.responseText;	
			window.onclick=funcion;
		}
	});
}

var visores = Array();

function procesaVisores()
{
	var visoxs=$$("div.galeria-fotos-tipo3");
	for(i=0;i<visoxs.length;i++)
	{			
		var vo = visoxs[i];
		vo.id = "visor_"+i;
		procesaVisor(visoxs[i], i, vo);
	}
	
	/* Tenemos un Array visores con las fotos, alts y descripciones. ocultamos*/
}


function procesaVisor(visor, indice, elemento)
{	

	var fotos=visor.getElementsBySelector('[class="foto"]');
	var fotosSrc=Array();
	var fotosAlt=Array();	
	var descripciones=Array();
	var anchos=Array();
	var anchoPadre="";
	
	for(a=0;a<fotos.length;a++)
	{
		fotosSrc[a]=fotos[a].getElementsBySelector('IMG')[0];
		anchoPadre=fotos[a].parentNode.getDimensions().width;
		anchos[a]=fotosSrc[a].getDimensions().width;
	}

	var descripcios=visor.getElementsBySelector('[class="descripcion"]');
	for(b=0;b<descripcios.length;b++)
	{
		
		descripciones[b]=descripcios[b];	
		descripciones[b].style.width=(anchoPadre-anchos[b]-30)+"px";
		descripciones[b].parentNode.style.display="none";
	}	
	
	visores[indice]=Array();
	visores[indice]["posicion"]= 0;	
	descripciones[visores[indice]["posicion"]].parentNode.style.display="";	
	visores[indice]["elemento"]= elemento;	
	visores[indice]["fotos"]= fotosSrc;
	visores[indice]["descripciones"]= descripciones;
	
	
	var ante=visor.getElementsBySelector('[class="ante"]');
	var sigui=visor.getElementsBySelector('[class="sigui"]');
	
	ante[0].onclick = function (e)
	{
		if(visores[indice]["posicion"]>0)
		{
			visores[indice]["descripciones"][visores[indice]["posicion"]].parentNode.style.display="none";
			visores[indice]["posicion"]--;
			visores[indice]["descripciones"][visores[indice]["posicion"]].parentNode.style.display="";			
		}
		ajustaBotones(0, visor);
	}
	
	sigui[0].onclick = function (e)
	{
		if(visores[indice]["posicion"]<visores[indice]["fotos"].length-1)
		{
			visores[indice]["descripciones"][visores[indice]["posicion"]].parentNode.style.display="none";
			visores[indice]["posicion"]++;
			visores[indice]["descripciones"][visores[indice]["posicion"]].parentNode.style.display="";			
		}
		ajustaBotones(indice, visor);
	}	
	ajustaBotones(indice, visor);
	return visores[indice];
}

function ajustaBotones(indice, visor)
{
	var ante=visor.getElementsBySelector('[class="ante"]');
	var sigui=visor.getElementsBySelector('[class="sigui"]');
	
	if(visores[indice]["posicion"]>0)
	{
		ante[0].style.display="";
	}else
	{
		ante[0].style.display="none";
	}
	
	if(visores[indice]["posicion"]==visores[indice]["fotos"].length-1)
	{
		sigui[0].style.display="none";
	}else
	{
		sigui[0].style.display="";
	}
}

function muestradatos(id)
{
	if($("datos"+id))
	{
		$("datos"+id).style.display="";
		$("mapa"+id).style.display="none";
		
		$("pestanero_2_"+id).style.display="none";		
		$("pestanero_1_"+id).style.display="block";	

	}
}

function muestramapa(id)
{
	if($("datos")+id)
	{	
		if($("goo")+id)
		{	
			$("goo"+id).src = $("goo"+id).src;
		}

		$("datos"+id).style.display="none";
		$("mapa"+id).style.display="";
		
		$("pestanero_1_"+id).style.display="none";		
		$("pestanero_2_"+id).style.display="block";		

	}
}

 



-->