function verifica(){
  msg = "Tem certeza que deseja continuar?";
  return confirm(msg);
}



function cima_baixo(d) {
	if(d.className=="baixo") d.className = "cima";
	else d.className = "baixo";
}

function acao(id,alt,type) {
  if(type!=3) { 
  olpop = document.getElementById("pop" + id); }
  oc  = document.getElementById("opc" + id);
	
	if(alt==1) { // transparente
		if(type!=3) { 
		             olpop.style.display="none"; 
					}
		else 		{ 
		             oc.style.display="block"; 
					}

	} else { // ação
		
		if(type!=3) { 
		             olpop.style.display="block"; 
					}
		else 		{ 
		             oc.style.display="none"; 
					}
	}
}



function contribui_hist(){
	
ad = document.cad_contr;

if (ad.titulo.value == "") {
			alert("O campo titulo deve ser preenchido.");
			ad.titulo.focus();
			return false;}

if (ad.descricao.value == "") {
			alert("O campo descricao deve ser preenchido.");
			ad.descricao.focus();
			return false;}
			
if (ad.nome.value == "") {
			alert("O campo nome deve ser preenchido.");
			ad.nome.focus();
			return false;}
			
if (ad.email.value == "") {
			alert("O campo email deve ser preenchido.");
			ad.email.focus();
			return false;}
			
if (ad.cidade.value == "") {
			alert("O campo cidade deve ser preenchido.");
			ad.cidade.focus();
			return false;}			
			
			
					//validar email(verificao de endereco eletronico)
		parte1 = ad.email.value.indexOf("@");
		parte2 = ad.email.value.indexOf(".");
		parte3 = ad.email.value.length;
		if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
			alert("O campo " + ad.email.name + " deve ser conter um endereco eletronico!");
			ad.email.focus();
			return false;
		}	
			
return true; 
}






function cad_comentario(){
	
ad = document.comentario;

if (ad.nome.value == "") {
			alert("O campo 'Nome' deve ser preenchido.");
			ad.nome.focus();
			return false;}

if (ad.email.value == "") {
			alert("O campo 'Email' deve ser preenchido.");
			ad.email.focus();
			return false;}
			
if (ad.comentario.value == "") {
			alert("O campo 'Comentario' deve ser preenchido.");
			ad.comentario.focus();
			return false;}
			
return true; 
}





function contribui_foto(){
	
ad = document.cad_foto;

if (ad.arquivo.value == "") {
			alert("O campo arquivo deve ser preenchido.");
			ad.arquivo.focus();
			return false;}

if (ad.titulo.value == "") {
			alert("O campo titulo deve ser preenchido.");
			ad.titulo.focus();
			return false;}

if (ad.autor.value == "") {
			alert("O campo nome deve ser preenchido.");
			ad.autor.focus();
			return false;}
			
if (ad.email.value == "") {
			alert("O campo email deve ser preenchido.");
			ad.email.focus();
			return false;}
			
if (ad.cidade.value == "") {
			alert("O campo cidade deve ser preenchido.");
			ad.cidade.focus();
			return false;}			
			
			
					//validar email(verificao de endereco eletronico)
		parte1 = ad.email.value.indexOf("@");
		parte2 = ad.email.value.indexOf(".");
		parte3 = ad.email.value.length;
		if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
			alert("O campo " + ad.email.name + " deve ser conter um endereco eletronico!");
			ad.email.focus();
			return false;
		}	
			
return true; 
}