// JavaScript Document
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function AlternarVisibilidadeDaLayerServidor() {
  var lyobj = document.getElementById("lyservidor")
  var chkobj = document.Logon.servidor
  if (lyobj) {
    if (chkobj) {
	  if (chkobj.checked) {
	    lyobj.style.visibility = "visible"
	  } else {
	    lyobj.style.visibility = "hidden"
	  }
	}
  }
}

function AoCarregarPagina() {
  document.Logon.matricula.focus(); 
  document.Logon.servidor.checked = false;
}

function VerificarCamposObrigatorios() {
  if (document.Logon.senha.value == "") {
    alert("Você deve informar uma senha.");
    return false;
  };
  if (document.Logon.servidor.checked) {
    if ((document.Logon.matriculaservidor.value == "") || (document.Logon.orgaoservidor.value == "")) {
	  alert("Você deve informar a sua matrícula funcional e o órgão de origem.");
	  return false;
	};
  };
  return true;
}