
function logarAreaRestrita() {
	if($F('res_usuario') == ""){
		alert('O campo Usuário é obrigatório!');
		$('res_usuario').focus();
		return false;
	}
	if($F('res_senha') == ""){
		alert('O campo senha é obrigatório!');
		$('res_senha').focus();
		return false;
	}
	
	return true;
}

function logarAreaRestrita2() {
	var url = "control/Service.php?classe=ExpositorServ&metodo=logar";
	
	new Ajax.Request(
		url, {
			method: 'post',
			postBody: $('frm_arearestrita').serialize(),
            onSuccess: function(transport) {
                  var response = transport.responseText || "Erro desconhecido";
                  
                  if(response.indexOf("OK") == -1) {
                  	alert(response);
                  }
                  else {
                  	//document.location.href="area_restrita/index.php";
                  }
            },
            onFailure: function() {
                  alert("Falha.");
            }
		}
	);
}