// JavaScript Document

//funcion para validar que solo se pueda inreoducir numeros
function valida_numero(evento)
{
	//e = e || window.event;    
    
        //alert("ELSE");    
         
        var key; 
         
        if(window.event) // IE 
        { 
            key = evento.keyCode; 
            if (key < 48 || key > 57 )  
            { 
                alert('Introduce solo numeros');
				window.event.keyCode=0; 
                return false;
				
            } 
        } 
        
		if(evento.which) // Netscape/Firefox/Opera 
        { 
            key = evento.which;
			
			if (key==8) return true;//esta devuelve el valor vedadero a la tecla backspace
			if (key < 48 || key >  57  )  
            { 
                alert('Introduce solo numeros');
				return false; 
            } 
			
        } 
         
    
	
}	

//este codigo mo activo valida solo letras
function valida_letra(e) { // 1
    tecla = (document.all) ? e.keyCode : e.which; // 2
    if (tecla==8) return true; // 3
    patron =/[A-Za-z\s]/; // 4
    te = String.fromCharCode(tecla); // 5
    return patron.test(te); // 6
	
}



