// JavaScript Document

window.defaultStatus="SINDMINP";


function redim(iframe)
{
	if(navigator.appName=="Microsoft Internet Explorer")
		var altura = parseInt(document.body.scrollHeight);
	else
		var altura = parseInt(document.body.offsetHeight);

	//alert(altura);
	parent.document.getElementById(iframe).style.height = altura;
}

function AbreDiv(obj, param){	
	
	var div;
	div = obj;
	
	if (document.getElementById(div).style.display == "none")
	{
		document.getElementById(div).style.display = "block";
	}
	else
	{
		document.getElementById(div).style.display = "none";
   	}
 	
}

function ValidaFaleConosco(){

	var f = document.forms['form'];
		
	if (f.nome.value == ''){
		alert('Preencha seu nome');
		f.nome.focus();
		return;
	}
	if (f.email.value == ''){
		alert('Preencha um email para contato');
		f.email.focus();
		return;
	}
	else
	{
		if (f.email.value.indexOf ('@',0) == -1)
		{
			alert (" Atenção! Seu e-mail não foi digitado corretamente. Digite-o novamente ");
			f.email.focus();
			return;
		}
		
		if (f.email.value.indexOf ('.',0) == -1)
		{
	     	alert (" Atenção! Seu e-mail não foi digitado corretamante. Digite-o novamente");
			f.email.focus();
			return;
		}
	
		if (f.email.length < 6)
		{
			alert (" Atenção! Seu e-mail não foi digitado corretamante. Digite-o novamente");
			f.email.focus();
			return;
		}
	}
		
	if (f.mensagem.value == ''){
		alert('Preencha \ mensagem');
		f.mensagem.focus();
		return;
	}
	
	f.action = "funcs/faleConosco.asp"
	f.submit();

}

function ValidaMural(){

	var f = document.forms['form'];

	if (f.email.value == ''){
		alert('Preencha um email para contato');
		f.email.focus();
		return;
	}
	else
	{
		if (f.email.value.indexOf ('@',0) == -1)
		{
			alert (" Atenção! Seu e-mail não foi digitado corretamente. Digite-o novamente ");
			f.email.focus();
			return;
		}
		
		if (f.email.value.indexOf ('.',0) == -1)
		{
	     	alert (" Atenção! Seu e-mail não foi digitado corretamante. Digite-o novamente");
			f.email.focus();
			return;
		}
	
		if (f.email.length < 6)
		{
			alert (" Atenção! Seu e-mail não foi digitado corretamante. Digite-o novamente");
			f.email.focus();
			return;
		}
	}

	if (f.assunto.value == ''){
		alert('Preencha o assunto');
		f.assunto.focus();
		return;
	}
			
	if (f.mensagem.value == ''){
		alert('Preencha a mensagem');
		f.mensagem.focus();
		return;
	}
	
	f.action = "funcs/Mural.asp"
	f.submit();

}

function ValidaFiliacao()
{
	var f = document.forms['form'];
	var cont = 0;
	
	for(i=1;i<=48;i++)
	{
	    if(i!=24 && i!=36)
	    {
	        if(f.elements['txt'+i].value == '')
	        {
	            cont = cont + 1
	        }
	    }
	}
	if(cont>1)
	{
	    alert('Há campos não preenchidos. Por favor preencha todos os campos!');
	    return;
	}
	
	f.action = 'funcs/filiacao.asp';
	f.submit();

}

function VisualizarImpressao()
{
	var f = document.forms['form'];
	var cont = 0;
	
	for(i=1;i<=48;i++)
	{
	    if(i!=24 && i!=36)
	    {
	        if(f.elements['txt'+i].value == '')
	        {
	            cont = cont + 1
	        }
	    }
	}
	if(cont>1)
	{
	    alert('Há campos não preenchidos. Por favor preencha todos os campos!');
	    return;
	}
		
	
	f.action = 'filiacaoVisualizacao.asp';
	f.target = "_blank";
	f.submit();

}

function ResultadoEnquete()
{
  var f = document.forms['Enquete'];  
  
  f.action = 'index.asp';
  f.submit();  
}