//pestanas ficha sitio, pio, agenda, guia se utiliza pestSitio en todos los casos
var pestSitio=Array("pestInfo","pestComentarios");
function setSitio(act)
{
	var i;	
	var pst='';
	for(i=0; i<pestSitio.length;i++) 
	{
		if(pestSitio[i]!=act) 
		{ 
			hideDiv(document.getElementById(pestSitio[i])); 
			pst="lk_"+pestSitio[i];
			document.getElementById(pst).className="";
		}
	}
	showDiv(document.getElementById(act));
	pst="lk_"+act;
	document.getElementById(pst).className="marcado";
}


var pestSet=Array("pestInfo","pestFotos","pestMapa");
function setPest(act,id)
{
	var i;	
	var pst='';
	for(i=0; i<pestSet.length;i++) 
	{
		if(pestSet[i]!=act) 
		{ 
			hideDiv(document.getElementById(pestSet[i])); 
			pst="lk_"+pestSet[i];
			document.getElementById(pst).className="";
		}
	}
	showDiv(document.getElementById(act));
	pst="lk_"+act;
	document.getElementById(pst).className="marcado";
	switch(act)
	{
		case 'pestFotos':
		{
			if(document.getElementById("contentFotosTh").innerHTML=='') cargarFotos(id); break;
		}
	}
}

function cargarFotos(id)
{
	var capa=document.getElementById("contentFotosTh");
	capa.innerHTML="cargando...";
	
	var filePHP=pathRoot+"/fauna/ajax_cargar_fotos.php?idFauna="+id;
	
	var content=Request();		
	content.open("GET",filePHP,true);					
	content.onreadystatechange=function(){
		if (content.readyState==4)
			{	capa.innerHTML=content.responseText;
			}
	}
	content.send(null);		
}
function showFoto(url)
{
	var capa=document.getElementById("loadarea");
	var img=pathRoot+"/fauna/fotos/"+url;
	capa.innerHTML="<img src=\""+img+"\"/>";
}
