function cerrar_producto()
{
	document.getElementById("capa_producto").style.display="none";
}
function ver_foto(idimagen)
{
document.getElementById("capa_mensaje").style.zIndex="3";
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);

}
function ocultar()
{
document.getElementById("capa_mensaje").style.display="none";
document.getElementById("capa_fondo_gris").style.display="none";
}
/* grupo ajax 1 */
function get_imagen(idimagen)
{ 
xmlHttp_verimagen=GetXmlHttpObject();
if (xmlHttp_verimagen==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
	var url="ajax/ajax_foto.php?idproyecto_pantalla="+idimagen;
	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 ...";
		}
}
/* fin grupo ajax 1 */
/* inicio grupo ajax 2*/
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
function abrir_producto(idproducto)
{ 
xmlHttp_producto=GetXmlHttpObject();
if (xmlHttp_producto==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
	var url="ajax/ajax_producto.php?idproducto=" + idproducto;
	xmlHttp_producto.onreadystatechange= funcion_ajax_producto; //cuando le paso una funcion sin parametros
	xmlHttp_producto.open("GET",url,true);
	xmlHttp_producto.send(null);
}

function funcion_ajax_producto () 
{ 
	document.getElementById("capa_producto").style.display="block";
	if (xmlHttp_producto.readyState==4)
		{ 
			
			document.getElementById('capa_producto').innerHTML=xmlHttp_producto.responseText;
		}
		else
		{
				document.getElementById('capa_producto').innerHTML="<div style='height:100px; text-align:center; padding-top:50px'>Cargando...<br><br><img src='imagenes/concalma.gif'></div>";
		}
}

//borrar cuando acabe
function ver_producto()
	{
		if (document.getElementById("capa_producto").style.display=="block")
			document.getElementById("capa_producto").style.display="none"
			else
			document.getElementById("capa_producto").style.display="block"
	}	
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
/* fin grupo ajax 2*/

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;
}