var rec_ano=2013; var rec_pessoa=0; function request() { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } return xmlhttp; } function limpar(objID) { document.getElementById(nomeID).innerHTML=""; } function mudarAno(ano) { rec_ano=ano; mostrarRecibos(); if(rec_ano<2013) mostrarEmpregados(); else esconderEmpregados(); } function mudarPessoa(pessoa,nome) { if(rec_pessoa!=0) document.getElementById("empregado"+ rec_pessoa).className="naoseleccionado"; rec_pessoa=pessoa; document.getElementById("empregado"+ pessoa).className="seleccionado"; mostrarRecibos(); } function mostrarRecibos() { var xmlhttp=request(); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("recibos").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","pages/ax_listarecibos.php?cod_user=&ano="+ rec_ano +"&cod_pessoa="+ rec_pessoa,true); xmlhttp.send(); } function mostrarEmpregados() { var xmlhttp=request(); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("empregados").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","pages/ax_listaempregados.php?cod_user=&ano="+ rec_ano,true); xmlhttp.send(); } function esconderEmpregados() { document.getElementById("empregados").innerHTML=""; }