function ver_foto(idimagen,ycoord)
{
window.scrollTo(0,0); //sube arriba de todo para ver la foto
document.getElementById("capa_mensaje").style.zIndex="3";
document.getElementById("banner_flash").style.visibility="hidden";
document.getElementById("capa_mensaje").style.display="block";
document.getElementById("capa_fondo_gris").style.display="block";
document.getElementById("capa_fondo_gris").style.zIndex="2";
document.getElementById("capa_fondo_gris").style.height=window.screen.height+"px" ;
get_imagen(idimagen,ycoord);

}
function ocultar(ycoord)
{
	window.scrollBy(0,ycoord); //sube arriba de todo para ver la foto
document.getElementById("capa_mensaje").style.display="none";
document.getElementById("capa_fondo_gris").style.display="none";
document.getElementById("banner_flash").style.visibility="visible";
}
function get_imagen(idimagen,ycoord)
{ 
xmlHttp_verimagen=GetXmlHttpObject();
if (xmlHttp_verimagen==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
	var url="/ajax/ajax_foto.php?idimagen="+idimagen+"&ycoord="+ycoord;
	xmlHttp_verimagen.onreadystatechange= funcion_ajax_foto; //cuando le paso una funcion sin parametros
	xmlHttp_verimagen.open("GET",url,true);
	xmlHttp_verimagen.send(null);
}

function funcion_ajax_foto () 
{ 
	if (xmlHttp_verimagen.readyState==4)
		{ 
			document.getElementById('capa_pop').innerHTML=xmlHttp_verimagen.responseText;
		}
		else
		{
				document.getElementById('capa_pop').innerHTML="Buscando en la base de datos de Caucana.com ...";
		}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
