function AbrirDivFac(campo)
{
	NVarAlvo = document.getElementById(campo);
	NVarAlvo.style.display = "block";
}

function FecharDivFac(campo)
{
	NVarAlvo = document.getElementById(campo);
	NVarAlvo.style.display = "none";
}

function AutoDivDisplay(id)
{
	NVarAlvo = document.getElementById(id);
	
	if(NVarAlvo.style.display == "none")
	{
		NVarAlvo.style.display = "block";
	}else{
		NVarAlvo.style.display = "none";
	}
	
}

function AutoDivDisplayCEP(id)
{
	NVarAlvo = (id);
	if(NVarAlvo == "Alvo0")
	{
		Alvo0.style.display = "block";
		Alvo1.style.display = "none";		
	}
	else if(NVarAlvo == "Alvo1")
	{
		Alvo1.style.display = "block";
		Alvo0.style.display = "none";		
	}
}

function RegVoto()
{
	var wNum = -1;
	if (document.fEnquete.elements['OpcaoEnquete'].type != "hidden") {
		for (i=0; i < document.fEnquete.OpcaoEnquete.length; i++) 
		{
			if (document.fEnquete.OpcaoEnquete[i].checked) { wNum = i }
		}
		if (wNum == -1) {
			alert('Selecione uma resposta para a enquete');
			document.fEnquete.OpcaoEnquete[0].focus();
			return false;
		}
		var url = 'registra_voto.cfm?OpcaoEnquete='+document.fEnquete.OpcaoEnquete[wNum].value;
		/*Abre(url,450,350);*/
		parent.location = url;
		document.fEnquete.OpcaoEnquete[wNum].checked = false;
	}
	return false;
}
