function sendLogin(){
	vars = "opc=sendLoginForm&"+$("#login").serializeForm();
	$("#login").addAjaxLoader();
	$.ajax({
	   async: true,
	   type: "POST",
	   url: "_ajax.php",
	   data: vars,
	   success: function(data){
		$("#login").removeAjaxLoader();
		window.location.href='poderes.php';
	   }
	 });
}

function logout(){
	$("#login").addAjaxLoader();
	$.ajax({
	   async: true,
	   type: "POST",
	   url: "_ajax.php",
	   data: "opc=logout",
	   success: function(data){
	      window.location.href='index.php';
	   }
	 });
}

function buscarPoderes(page){
	page = page==undefined?1:page;
	$("#textoTipo").addAjaxLoader();
	vars = "opc=buscarPoderes&page="+page+"&"+$("#filtros").serializeForm();
	$.ajax({
		   async: true,
		   type: "POST",
		   url: "_ajax.php",
		   data: vars,
		   success: function(data){
			  $("#textoTipo").removeAjaxLoader();
		      $("#results").html(data);
		   }
	 });
}

function toggleInfo(el){
	var info = el.parents("li:first").find(".info");
	info.toggle();
	if(info.css("display")=='block'){
		el.html("[-]");
	}
	else{
		el.html("[+]");
	}
}



function goToResultPage(page){
	$("#frmResults input[name='page']").val(page);
	$("#frmResults").trigger("submit");
}
