function objetoAjax()
{ 
	var xmlhttp=false; 
	try { 
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
	} catch (e) { 
		try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
		} catch (E) { xmlhttp = false; 
			} 
		} if (!xmlhttp && typeof XMLHttpRequest!='undefined') {   
		xmlhttp = new XMLHttpRequest();   
		}  
return xmlhttp;
}

function mostrar(cod){
	//donde se mostrará el formulario con los datos
	divFormulario = document.getElementById('myGallery');
	//instanciamos el objetoAjax
	ajax=objetoAjax(); 
	//uso del medotod GET
	ajax.open("POST", "vista-acc.php?id_mat="+cod);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			//mostrar resultados en esta capa
			divFormulario.innerHTML = ajax.responseText
			//mostrar el formulario
			divFormulario.style.visibility="visible";
		}else {divFormulario.innerHTML = "Procesando..."}   
	}
	
	//como hacemos uso del metodo GET
	//colocamos null
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	//enviando los valores
	ajax.send(null)
}

function cerrar(){
	//donde se mostrará el formulario con los datos
	divFormulario = document.getElementById('img');
//	ajax=objetoAjax();
	
	divFormulario.style.visibility="hidden";
	
	//instanciamos el objetoAjax
	//ajax.send(null)
}
