// JavaScript Document
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 paginar_albun(Pag){
	divResultado = document.getElementById('lista');
	ajax=objetoAjax();
	ajax.open("GET", "lista_alb.php?Pag="+Pag,true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==1) {
			divResultado.innerHTML = "";
			divResultado.style.height = "100px";
			divResultado.style.background = "url('images/loading.gif') no-repeat center"; 
		}else if (ajax.readyState==4) {
			divResultado.innerHTML = ajax.responseText;
			divResultado.style.height = "";
			divResultado.style.background = "none"; 
			divResultado.style.backgroundColor = "none"; 
		}
	}
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send(null)
}

function paginar_foto(Pag,Id_albun){
	divResultado = document.getElementById('lista');
	ajax=objetoAjax();
	ajax.open("GET", "lista_fot.php?Pag="+Pag+"&Id_albun="+Id_albun,true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==1) {
			divResultado.innerHTML = "";
			divResultado.style.height = "100px";
			divResultado.style.background = "url('images/loading.gif') no-repeat center"; 
		}else if (ajax.readyState==4) {
			divResultado.innerHTML = ajax.responseText;
			divResultado.style.height = "";
			divResultado.style.background = "none"; 
			divResultado.style.backgroundColor = "none"; 
		}
	}
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send(null)
}
