function tiraEspaco(texto){
	while(texto.indexOf(" ") != -1){
	  texto = texto.replace(" ","");
	}
    return texto;
}

function setFocus() {
	document.getElementById("login").focus();
}
function submeterLogin(){
	if(tiraEspaco(document.getElementById("login").value) == ""){	
		alert("Login incorreto.");
		document.getElementById("login").focus();
		return;
	}
	if(tiraEspaco(document.getElementById("senha").value) == ""){	
		alert("Senha incorreta.");
		document.getElementById("senha").focus();
		return;
	}
	var login = document.getElementById('login').value;
	var senha = document.getElementById('senha').value;
	enviaRequisicao('loginForm','loginResults.php?login='+login+'&senha='+senha,'Autenticando...');	
}
function submeterLogin1(){
	if(tiraEspaco(document.getElementById("login").value) == ""){	
		alert("Login incorreto.");
		document.getElementById("login").focus();
		return;
	}
	if(tiraEspaco(document.getElementById("senha").value) == ""){	
		alert("Senha incorreta.");
		document.getElementById("senha").focus();
		return;
	}
	var login = document.getElementById('login').value;
	var senha = document.getElementById('senha').value;
	enviaRequisicao('loginForm','loginResults1.php?login='+login+'&senha='+senha,'Autenticando...');	
}
