//função para checar campos dos comentários

function comentarioForm2(idForm){ 
	var nome = document.getElementById("quem"+idForm);
	var email = document.getElementById("emailComentario"+idForm);
	var comment = document.getElementById("commentario"+idForm);
	var post = document.getElementById("idPost"+idForm);
	/*
	nome = document.commentForm+idForm+.quem.value;
	email = document.commentForm+idForm+.emailComentario.value;
	comment = document.commentForm+idForm+.commentario.value;
	post = document.commentForm+idForm+.idPost.value;
	*/
	div = "comentarios"+idForm;
	loadPage(div,'commentsPost&act=write&author='+nome.value+'&email='+email.value+'&comment='+comment.value+'&post='+post.value);
}

function comentarioForm(){
	nome = document.commentForm.quem.value;
	email = document.commentForm.emailComentario.value;
	comment = document.commentForm.commentario.value;
	post = document.commentForm.idPost.value;
	loadPage('comentarios','commentsPost&act=write&author='+nome+'&email='+email+'&comment='+comment+'&post='+post);
}

//Mostra esconde ano

function toggleEstrada(ano,qtd) {
	new Effect.toggle(ano, 'Appear', {duration:1});
	for (x=0 ; x < qtd ; x++) {
		if (document.getElementById('naestrada'+x).style.display != "none") {
			Effect.SlideUp('naestrada'+x, { duration: 0.5 });

		}
		
	}
	
}

function toggleAno(ano,qtd) {
	new Effect.toggle(ano, 'Appear', {duration:1});
	for (x=0 ; x < qtd ; x++) {
		if (document.getElementById('ano'+x).style.display != "none") {
			Effect.SlideUp('ano'+x, { duration: 0.5 });

		}
		
	}
	
}

//função para checar campos dos comentários

function AppearEffect(element){
       new Effect.toggle(element, 'Appear', {duration:1});
   }

//função para checar campos da newsletter
function checkNewsletter(){
	var nomeNews = document.getElementById("nomeNews");
	if (nomeNews.value == '' || nomeNews.value == 'nome') {
		alert("Informe seu nome");
		nomeNews.focus();
		return false;
	 }
	 var emailNews = document.getElementById("emailNews");
	 if(emailNews.value == '' || emailNews.value == 'email'){
	 	 alert("Informe seu email");
		 emailNews.focus();
		 return false;
	 }
	 nomeTemp = nomeNews.value;
	 emailTemp = emailNews.value;
	 loadPage('newsletter','newsletter&act=cad&nome='+nomeTemp+'&email='+emailTemp);
		 
}

function checkContatos(){
	var nomeNews = document.getElementById("nomeContato");
	if (nomeNews.value == '' || nomeNews.value == 'nome') {
		alert("Informe seu nome");
		nomeNews.focus();
		return false;
	 }
	 var emailNews = document.getElementById("emailContato");
	 if(emailNews.value == '' || emailNews.value == 'email'){
	 	 alert("Informe seu email");
		 emailNews.focus();
		 return false;
	 }
	 var msgContato = document.getElementById("msgContato");
	 if(msgContato.value == '' || msgContato.value == 'mensagem'){
	 	 alert("Informe a mensagem!");
		 msgContato.focus();
		 return false;
	 }
	 nomeTemp = nomeNews.value;
	 emailTemp = emailNews.value;
	 msgTemp = msgContato.value;
	 
	 loadPage('1','contatos&act=send&nome='+nomeTemp+'&email='+emailTemp+'&mensagem='+msgTemp);
		 
}


