/*by Juarezfn 11/05/06*/
/*Tecla enter executa botao correpondente ao input hidden "botaoPress" da pagina*/


netscape = "";
ver = navigator.appVersion; 
len = ver.length;
//botao = "";

//verifica tipo de navegador
for(iln = 0; iln < len; iln++) if (ver.charAt(iln) == "(") break;
netscape = (ver.charAt(iln+1).toUpperCase() != "C");

function keyDown(DnEvents){
	var tecla;
	var botao;
	//pegando tecla pressionada
	var tecla = (netscape) ? DnEvents.which : window.event.keyCode;

	if(tecla==13 || tecla == 10)//evento do botao enter 
	{
		//alert('botao enter');
		botao = document.getElementById('botaoPress').value;//recebe o parâmetro do botão
		if (botao != "nao"){
			//alert para o progrmador saber qual botão foi acionado
			//alert("enter em: " + botao );
			//coloca o foco no botão desejado
			eval('document.getElementById("'+ botao +'").focus()');
			return true;
		}else{
			//alert("nao");
			return false;
		}
		
	}

}
document.onkeydown = keyDown; // work together to analyze keystrokes
if (netscape) document.captureEvents(Event.KEYDOWN|Event.KEYUP);
