
var req;
function loadXMLDocI(url){
	 req = null;
	
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChangeI;
		req.open("GET", url, true); 
		req.send(null);
		
	} else if (window.ActiveXObject) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP.4.0");
		} catch(e) {
			try {
				req = new ActiveXObject("Msxml2.XMLHTTP.3.0");
			} catch(e) {
				try {
					req = new ActiveXObject("Msxml2.XMLHTTP");
				} catch(e) {
					try {
						req = new ActiveXObject("Microsoft.XMLHTTP");
					} catch(e) {
						req = false;
					}
				}
			}
		}
		if (req) {
			req.onreadystatechange = processReqChangeI;
			req.open("GET", url, true);
			req.send();
		}
	}
}


function processReqChangeI(){
    var atualiza=document.getElementById("imagens");
    atualiza.innerHTML='<span style="padding-left:15px;">Carregando...</span>';
	if (req.readyState == 4) {
		if (req.status == 200) {
			document.getElementById("imagens").innerHTML = req.responseText;
		} else {
			alert("Houve um problema ao obter os dados:\n" + req.statusText);
		}
	}
}

function atualizaI(valor){
	loadXMLDocI("ajax/imagens.php?id="+valor);
}