function list_dados(){
	document.getElementById("res_fotos").innerHTML = '<img src="../images/spinner.gif" />';
	// Passando os dados para a página result.php através do método GET.
	var nome_mae = document.getElementById('nome_mae').value;
	var nome_pai = document.getElementById('nome_pai').value;
	var nome_crianca = document.getElementById('nome_crianca').value;
	var dia = document.getElementById('dia').value;
	var mes = document.getElementById('mes').value;
	var ano = document.getElementById('ano').value;
	
	
	if (((dia != "todas") && (mes != "todas") && (ano != "todas")) || ((dia == "todas") && (mes == "todas") && (ano == "todas"))){
		if((nome_mae != "") || (nome_pai != "") || (nome_crianca != "") || (dia != "todas")){
			http.open("GET", "../res_fotos2.php?nome_mae=" + nome_mae + "&nome_pai="+ nome_pai + "&nome_crianca=" + nome_crianca + "&dia=" + dia + "&mes=" + mes + "&ano=" + ano, true);    
			http.onreadystatechange = handleHttpResponse;      
			http.send(null);
			document.getElementById("res_fotos").innerHTML = '<img src="../images/spinner.gif" />';
		}else{
			document.getElementById("res_fotos").innerHTML = '<center><b><font color="red">Favor preencher pelo menos um campo.</font></b></center>';
		}
	} else {
		document.getElementById("res_fotos").innerHTML = '<center><b><font color="red">Favor preencher data completa ou deixar em branco.</font></b></center>';
	}
}

function handleHttpResponse(){    
		//campo_select = document.forms[0].subcategoria;    
		if (http.readyState == 4) {       
			//campo_select.options.length = 0;        
			results = http.responseText; 
			document.getElementById("res_fotos").innerHTML = results;
			document.getElementById("test3-content").style.height='auto';
		}
}
// Essa função é somente para identificar o Navegador e suporte ao XMLHttpRequest.
function getHTTPObject(){   
	var req;    
	try {       
		if (window.XMLHttpRequest) {            
			req = new XMLHttpRequest();           
			if (req.readyState == null) {               
				req.readyState = 1;               
				req.addEventListener("load", function() {                   
					req.readyState = 4;                    
					if (typeof req.onReadyStateChange == "function") {                        
						req.onReadyStateChange();                    
					}                
				}, false);              
			}           
			return req;         
		}        
		if (window.ActiveXObject) {            
			var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];            
			for (var i = 0; i < prefixes.length; i++) {               
				try {                   
					req = new ActiveXObject(prefixes[i] + ".XmlHttp");                   
					return req;               
				} catch (ex) {};            
			}        
		}    
	} catch (ex) {}   
	alert("Seu navegador nao tem suporte a esse tipo de tecnologia.");
}
var http = getHTTPObject();
// Logo após fazer a verificação, é chamada a função e passada 
// o valor à variável global http.
