nextfield = ""; // nome do primeiro campo do site
netscape = "";
versao = navigator.appVersion;
tamanho = versao.length;
for(iln = 0; iln < tamanho; iln++) if (versao.charAt(iln) == "(") break;
	netscape = (versao.charAt(iln+1).toUpperCase() != "C");
	
function keyDown(DnEvents) {
	// ve quando e o netscape ou IE
	k = (netscape) ? DnEvents.which : window.event.keyCode;
	if (k == 13) { // preciona tecla enter
		teste = nextfield.substr(nextfield.length-6,nextfield.length);
		if (teste == 'submit') {
			return(true);
		} else {
			// se existem mais campos vai para o proximo
			if ( netscape ) {
				eval('document.' + nextfield + '.focus()');
			} else {
				window.event.keyCode = 9;
			}
			return;
		}
	}
}

document.onkeydown = keyDown; // work together to analyze keystrokes
if (netscape) document.captureEvents(Event.KEYDOWN|Event.KEYUP);

function moveFoco( form ) {
	formulario = document.getElementById( form );
	for (var i=0;i<formulario.elements.length;i++) {
		var x = formulario.elements[i];
		if (x.type != 'hidden' && x.disabled !== true) { 
			x.focus();
			return;
		}
	}
}
