function nuevoAjax()
{ 
	/* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por
	lo que se puede copiar tal como esta aqui */
	var xmlhttp=false; 
	try 
	{ 
		// Creacion del objeto AJAX para navegadores no IE
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch(e)
	{ 
		try
		{ 
			// Creacion del objet AJAX para IE 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch(E) { xmlhttp=false; }
	}
	if (!xmlhttp && typeof XMLHttpRequest!="undefined") { xmlhttp=new XMLHttpRequest(); } 

	return xmlhttp; 
}

function borrar_foto(id){
ruta = "operaciones.php?modo=b&id="+id;
// Creo la conexion con el servidor y le envio la variable evento (que le indica si debe ingresar o verificar) y el dato a utilizar
var ajax=nuevoAjax();
ajax.open("GET", ruta, true);
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajax.send(null);

ajax.onreadystatechange=function()
	{
		if (ajax.readyState==4)
		{
		// Muestro el mensaje enviado desde el servidor
		alert(ajax.responseText);
		}
	}
}

function salvaredicion(id){//Edita info de la foto desde edicion
f = document.getElementById("f"+id).value;
l = document.getElementById("l"+id).value;
c = document.getElementById("c"+id).value;
ruta = "operaciones.php?modo=e&id="+id+"&l="+l+"&f="+f+"&c="+c;
// Creo la conexion con el servidor y le envio la variable evento (que le indica si debe ingresar o verificar) y el dato a utilizar
var ajax=nuevoAjax();
ajax.open("GET", ruta, true);
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajax.send(null);

ajax.onreadystatechange=function()
	{
		if (ajax.readyState==4)
		{
		// Muestro el mensaje enviado desde el servidor
		alert(ajax.responseText);
		}
	}
}

function hideDiv(id)
{
document.getElementById(id).style.visibility = "hidden"; 
document.getElementById(id).style.display = "none";
}
