
function localiza(url){
	window.open(url,"","width=554, height=396");
}

function abre_video(url){
	window.open(url,"", "width=355, height=310");	
}

function abre_fila(url){
	window.open(url,"", "width=635, height=480");	
}

function abre_fotos(url){
	window.open(url,"", "width=550, height=413");	
}

function abre_transplante(url){
	window.open(url,"", "width=474, height=413, scrollbars=yes");	
}

function popupImageWindow(url) {
  window.open(url,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}

var i=0;
function resize() {
  if (navigator.appName == 'Netscape') i=40;
  if (document.images[0]) window.resizeTo(document.images[0].width +17, document.images[0].height+78-i);
}

function abre_bibliografia(url){
	window.open(url,"", "width=418, height=300, scrollbars=yes");	
}
//função campo desabilitado/abilitado
function campo(id){
// 0 desliga
// 1 liga
document.form1.texto.disabled = id;
document.form1.texto.disabled = (document.form1.texto.disabled) ? 0 : 1;
}

// JavaScript Document
function valida(theForm){
	
	var msgErro = document.getElementById("msgErro");
	msgErro.innerHTML = "";
	msgErro.className = "";
	
	var nome = document.getElementById("nome");
	if (theForm.nome.value == ""){
		nome.style.color = "#ff0000";
		theForm.nome.focus();
		msgErro.innerHTML = "Por favor, verifique o preencimento dos campos indicados e tente novamente.";
		msgErro.className = "erro";
		return (false);
	}else{
		nome.style.color = "#333333";
		//document.form1.nome.value = form1.nome.toUpperCase();
	}
	
	var data_nascimento = document.getElementById("data_nascimento");
	
	  var temp
      var cont=0
      var dia
      var mes
      var ano   
	  
      ano=Math.abs(theForm.data_nascimento.value.substring(6,10))
			
	  if (ano < 1900){
		alert("Ano Incorreto")
		theForm.data_nascimento.focus()
		return false
	    }

 	if (theForm.data_nascimento.value == ""){
		data_nascimento.style.color = "#ff0000";
		theForm.data_nascimento.focus();
		msgErro.innerHTML = "Por favor, verifique o preencimento dos campos indicados e tente novamente.";
		msgErro.className = "erro";
		return (false);
	}else{
		data_nascimento.style.color = "#333333";	
	}
	

	var contato_familia = document.getElementById("contato_familia");
	if (theForm.contato_familia.value == ""){
		contato_familia.style.color = "#ff0000";
		theForm.contato_familia.focus();
		msgErro.innerHTML = "Por favor, verifique o preencimento dos campos indicados e tente novamente.";
		msgErro.className = "erro";
		return (false);
	}else{
		contato_familia.style.color = "#333333";	
	}
	
	
	var endereco = document.getElementById("endereco");
	if (theForm.endereco.value == ""){
		endereco.style.color = "#ff0000";
		theForm.endereco.focus();
		msgErro.innerHTML = "Por favor, verifique o preencimento dos campos indicados e tente novamente.";
		msgErro.className = "erro";
		return (false);
	}else{
		endereco.style.color = "#333333";	
	}
	
	var numero = document.getElementById("numero");
	if (theForm.numero.value == ""){
		numero.style.color = "#ff0000";
		theForm.numero.focus();
		msgErro.innerHTML = "Por favor, verifique o preencimento dos campos indicados e tente novamente.";
		msgErro.className = "erro";
		return (false);
	}else{
		numero.style.color = "#333333";	
	}
	
	var bairro = document.getElementById("bairro");
	if (theForm.bairro.value == ""){
		bairro.style.color = "#ff0000";
		theForm.bairro.focus();
		msgErro.innerHTML = "Por favor, verifique o preencimento dos campos indicados e tente novamente.";
		msgErro.className = "erro";
		return (false);
	}else{
		bairro.style.color = "#333333";	
	}
	
	var cidade = document.getElementById("cidade");
	if (theForm.cidade.value == ""){
		cidade.style.color = "#ff0000";
		theForm.cidade.focus();
		msgErro.innerHTML = "Por favor, verifique o preencimento dos campos indicados e tente novamente.";
		msgErro.className = "erro";
		return (false);
	}else{
		cidade.style.color = "#333333";	
	}
	
	var estado = document.getElementById("estado");
	if (theForm.estado.value == ""){
		estado.style.color = "#ff0000";
		theForm.estado.focus();
		msgErro.innerHTML = "Por favor, verifique o preencimento dos campos indicados e tente novamente.";
		msgErro.className = "erro";
		return (false);
	}else{
		estado.style.color = "#333333";	
	}
	
	var cep = document.getElementById("cep");
	if (theForm.cep.value == ""){
		cep.style.color = "#ff0000";
		theForm.cep.focus();
		msgErro.innerHTML = "Por favor, verifique o preencimento dos campos indicados e tente novamente.";
		msgErro.className = "erro";
		return (false);
	}else{
		cep.style.color = "#333333";	
	}
}

function esconde(){

	formulario.style.display='none';

}

function mostra(){
	data_doacao.style.display='none';
	formulario.style.display='';
	document.form1.data_doador.disabled 
	
}

function mostra2(){
	
	data_doacao.style.display='';
	formulario.style.display='';
	document.form1.data_doador.disabled = (document.form1.data_doador.disabled) ? 0 : 1;
	
}
