Validacao = {
		somenteNumero: function(e)
		{
		    //var tecla=(window.event)?event.keyCode:e.which;
			this.e = e;
		    var tecla = e.code;
		    
		    if((tecla > 47 && tecla < 58) || (tecla >=96 && tecla <= 105) || tecla == 9) return true;
		    else{
		    	if (tecla != 8) return false;
		    	else return true;
		    }
		},
		
		nextSibling: function(e){
            if(this.value.length >= this.get('maxlength')){
            	if(this.nextElementSibling){
            		this.nextElementSibling.focus();
            	}
            }
		},
		
		init: function(){
			// Aplica a validacao aos campos que devem ser preenchidos apenas com
			// numeros
			$$('.inputNumber').each(function(item, i){
				item.addEvent('keydown',  Validacao.somenteNumero);
			});
			
			// Aplica a validação que o campo deve mudar o foco para o proximo
			// campo quando atingir o maxlength
			$$('.nextSibling').each(function(input){
				input.addEvent('keyup', Validacao.nextSibling) 
			})
		}	
}

window.addEvent('domready', Validacao.init)