
function verificaUsuario(str)
{
if (str != ""){
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
  	{
  		alert ("O seu browser não suporta AJAX!");
  		return;
  	}
	var url="cadastro_verifica.asp?usuario=" + str;
	xmlhttp.onreadystatechange=retornaUsuario;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
} else {
	document.getElementById("spn_login").innerHTML="Campo em Branco";
	document.getElementById("spn_login").className="spanCadastroErrado";
}
}

function retornaUsuario()
{
if (xmlhttp.readyState==4)
  {
	  var texto = xmlhttp.responseText;
	  if (texto=="cadastrado"){
  		document.getElementById("spn_login").innerHTML="Usuário já Cadastrado";
  		document.getElementById("spn_login").className="spanCadastroErrado";
	  } else if (texto == "userOK"){
  		document.getElementById("spn_login").innerHTML="Usuário Disponível"
  		document.getElementById("spn_login").className="spanCadastroCerto"; 
	  }
  }
}



function verificaEmail(str)
{
if (str != ""){
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("O seu browser não suporta AJAX!");
  return;
  }
var url="cadastro_verifica.asp?email=" + str;
xmlhttp.onreadystatechange=retornaEmail;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}else{
	document.getElementById("spn_email").innerHTML="Campo em Branco";
  		document.getElementById("spn_email").className="spanCadastroErrado"; 
}
}

function retornaEmail()
{
if (xmlhttp.readyState==4)
  {
	  var texto = xmlhttp.responseText;
	  if (texto=="cadastrado"){
  		document.getElementById("spn_email").innerHTML="Email já cadastrado!";
  		document.getElementById("spn_email").className="spanCadastroErrado";
	  } else if (texto == "emailOK"){
		document.getElementById("spn_email").innerHTML="Email Disponível";
  		document.getElementById("spn_email").className="spanCadastroCerto"; 
	  } else if (texto == "invalido"){
		document.getElementById("spn_email").innerHTML="Email Inválido";
  		document.getElementById("spn_email").className="spanCadastroErrado"; 
	  }
  }
}



function verificaSenha(){
	if (document.getElementById("txtSenha").value != "" && document.getElementById("txtSenha2").value != ""){
	if (document.getElementById("txtSenha").value==document.getElementById("txtSenha2").value){
		document.getElementById("spn_pass").innerHTML=""
  		document.getElementById("spn_pass").className="spanCadastroCerto"; 
	} else {
		document.getElementById("spn_pass").innerHTML="Senhas Diferentes";
  		document.getElementById("spn_pass").className="spanCadastroErrado"; 
	}
	} else { document.getElementById("spn_pass").innerHTML=""; }
}

function verificaNome(str){
	if (str == "") {
	    document.getElementById("spn_nome").innerHTML="Campo em Branco";
  		document.getElementById("spn_nome").className="spanCadastroErrado"; }
}

function verificaNome2(str){
	if (str == "") {
	    document.getElementById("spn_nome2").innerHTML="Campo em Branco";
  		document.getElementById("spn_nome2").className="spanCadastroErrado"; }
}


function time(t1)
{
document.getElementById("spn_time").innerHTML="&nbsp;&nbsp;<img  height'15' src='imagens/escudos/"+t1+".png' />";  
}


