		
function fncIndice(){
	document.frmLista.submit();
};

function fncAcoes(acao,chave){
	
	document.frmAcoes.acao.value 	 = acao ;
	document.frmAcoes.codigo.value = chave;
  
  switch(acao){
  	case 'excluir':
  		var str="Você deseja realmente EXCLUIR esse registro?\nEsta operação não poderá ser desfeita.";
      if(confirm(str)) document.frmAcoes.submit();
      break;

  	case 'limpa_log':
  		var str="Você deseja realmente LIMPAR COMPLETAMENTE os registro de log?\nEsta operação não poderá ser desfeita.";
      if(confirm(str)) document.frmAcoes.submit();
      break;
  	
  	case 'desbloqueia':
  		var str="Você deseja realmente LIBERAR este exame?";
      if(confirm(str)) document.frmAcoes.submit();
      break;
  	
    case 'reset':
      document.frmAcoes.termo.value = '';
      document.frmAcoes.campo.value = '';
      document.frmAcoes.tipo.value  = '';
      document.frmAcoes.submit();   
      break;
        
    case 'filtro_reset':
      document.frmAcoes.mes.value = 'mês';
      document.frmAcoes.ano.value = 'ano';   
      document.frmAcoes.submit();
      break;
    
    default:
      document.frmAcoes.submit();
          
  };

};


function fncOrdem(campo){
  document.frmAcoes.ordem.value = campo;
  document.frmAcoes.submit();
};


function fncBusca(acao){
  
	switch(acao){	
		case 'busca':
			document.frmLista.acao.value = acao;
  		document.frmLista.submit();
  		break;

		case 'filtra':
			document.frmLista.acao.value = acao;
  		document.frmLista.submit();
  		break;
  	
		case 'reset':
      document.frmLista.termo.value = '';
      document.frmLista.campo.value = '';
      document.frmLista.tipo.value  = '';
      document.frmLista.submit();
			break;
  	
  }

};


function fncBusca_aula(campo,tipo){
  document.frmPrincipal.termo.value = document.frmPrincipal.idmed.value; 
  document.frmPrincipal.submit();
};


function fncGravar(){
	var str="Você confima as modificações feitas neste registros?\nEsta operação não poderá ser desfeita.";
	acao = document.frmPrincipal.acao.value;
	
  switch(acao){
	 case 'editar':
    if(confirm(str)){
      return true;
    }
    else{
      return false;
    };
    break;
       
   case 'incluir':
    return true;
    break;
   };
};


function fncDownload(original,arquivo,prefixo,retorno){

	document.frmDownload.original.value = original;
	document.frmDownload.arquivo.value  = arquivo;
	document.frmDownload.prefixo.value 	= prefixo;
  document.frmDownload.retorno.value 	= retorno;				
	
	document.frmDownload.submit();			
};

function fncTela(tela,id){

	document.frmTela.tela.value = tela;
	document.frmTela.id.value  = id;		
	
	document.frmTela.submit();			
};


function exibe_exame(pag,win){
  window.open(pag,win,"toolbar=no,scrollbars=no,width=770,height=420,resizable=yes,directories=no,location=no,menubar=no")
}

function exibe_lista(pag,win){
	window.open(pag,win,"toolbar=no,scrollbars=yes,width=770,height=420,resizable=no,directories=no,location=no,menubar=no")
}


