function DigitaNumero(campo)
{
 var valid    = "0123456789";
 var numerook = "";
 var temp;
  
    
  for (var i=0; i< campo.value.length; i++) {
    temp = campo.value.substr(i, 1);
    if (valid.indexOf(temp) != "-1") 
      numerook = numerook + temp;
  }
   
 campo.value = numerook;

}

function MascaraData(campo,w)
{
   var Data = SoNumero(campo.value);
   var DataAux = ''; 
   var campo1 = campo.value;

   if (w.keyCode == 8) {      
     if (campo1.length == 2 || campo1.length == 5) {
        Data = Data.substr(0,Data.length-1);
       } 
    }
    
   if (Data.length < 9) {
     for (var i=0; i < Data.length; i++) {
       DataAux = DataAux + Data.substr(i,1);     
       if (i == 1 || i == 3) {
         DataAux = DataAux + "/";
        }
      }  
     campo.value = DataAux;
    }
   else {
      campo.value = campo.value.substr(0,10);
     }
}

function SoNumero(nro)
{
 var valid    = "0123456789";
 var numerook = "";
 var temp;

  for (var i=0; i< nro.length; i++) {
    temp = nro.substr(i, 1);
    if (valid.indexOf(temp) != -1)
      numerook = numerook + temp;
   }
 return(numerook);
}