// JavaScript Document
function enviaFormulario(form)
		{
			var senhaDigitada = document.getElementById("senha").value;
			var senhaConfirmada = document.getElementById("senhaVerifica").value;
			
			if(senhaDigitada=="" || senhaDigitada != senhaConfirmada) 
			{
				document.getElementById("senha").value = "";
				document.getElementById("senhaVerifica").value = "";
				alert("As senhas digitadas não conferem. Por favor, digite novamente");
				return;
			}
			else
			form.submit();
		}
function enviaLogin(form)
	{
			if (document.getElementById("emailTopo").value=="" || document.getElementById("senhaTopo").value=="")
				{
					
					document.getElementById("cabecalhoLoginTexto").firstChild.nodeValue="Login - Diga-nos seu e-mail e senha!";				
				}
			else
				{
					 
					document.getElementById("cabecalhoLoginTexto").firstChild.nodeValue="Login";
					document.forms.item(form).submit();
				}
	}
	
function enviaCadastro(form)
	{
		
		document.forms.item(form).action="?pagina=cadastro";
		document.forms.item(form).submit();
		return;
	}

function enviaSenha(form)
{
		if (document.getElementById("emailTopo").value=="")
				{
					
					document.getElementById("cabecalhoLoginTexto").firstChild.nodeValue="Login - Diga-nos seu e-mail e senha!";				
				}
			else
				{
					
					document.getElementById("cabecalhoLoginTexto").firstChild.nodeValue="Login";
					document.forms.item(form).action="?pagina=enviaSenha&email="+document.getElementById("emailTopo").value;
					document.forms.item(form).submit();
					return;
				}
}

function submeteTrocaSenha(form)
{
	if (document.getElementById("senhaAntiga").value=="" || document.getElementById("senhaNova").value=="")
	{
		document.getElementById("avisoTrocaSenha").firstChild.nodeValue="É preciso preecher os dois campos!";
		document.getElementById("avisoTrocaSenha").style.visibility="visible";
	}
	else
		document.forms.item(form).submit();
	
}

function limpaAvisoTrocaSenha()
{
	document.getElementById("avisoTrocaSenha").style.visibility="hidden";
}

function teste()
{
	alert("Eu sou um javascript funcionando");
	}
	
function toggleTorneio()
{
	alert("Toggle Torneio - Valor para o check:" + document.getElementById("checkTorneio").checked);
	if (document.getElementById("checkTorneio").checked)
		{
		
		document.getElementById("camposTorneio").className="camposTorneioVisible";
		}
	else
		{
		
		document.getElementById("camposTorneio").className="camposTorneioHidden";
		}
	return;
}
