//Começo Funções Gerais
//--------------------------------------------------------------------------------------------------
function Ucase(valor)
  {      
  return valor.toUpperCase();  
  }
//--------------------------------------------------------------------------------------------------
function Len(valor)
  {      
  return valor.length;           
  }
//--------------------------------------------------------------------------------------------------
function InStr(valor1,valor2)
  {    
  var wl_caracter
  var i 
      
  for (i=0;i<valor1.length;i++)
    {
      wl_caracter = valor1.charAt(i);
      
      if (wl_caracter == valor2) 
        return i;           
     }      
           
    return 0;         
  }
//--------------------------------------------------------------------------------------------------
function ReplaceString(numero,valor)
 {
  var i
  var wl_retorno = ""
  
  for (i=1;i<=numero;i++)
    {
    wl_retorno += valor;
    } 
  
  return wl_retorno;    
 }
//-----------------------------------------------------           
function Left(valor,numero)
 {
  var i
  var wl_retorno = ""
  
  for (i=0;i<=numero-1;i++)
    {
    wl_retorno += valor.charAt(i);
    } 
  
  return wl_retorno;    
 }
//-----------------------------------------------------           
function Right(valor,numero)
 {
  var i 
  var wl_retorno = ""
  
  for (i=valor.length-numero;i<=valor.length;i++)
    {
    wl_retorno += valor.charAt(i);
    } 
  
  return wl_retorno;    
 }
//------------------------------------------------------
function Trim(obj) 
{
  while (obj.value.indexOf('  ') != -1) {
    obj.value = obj.value.substring(0,obj.value.indexOf('  ')) + obj.value.substring(obj.value.indexOf('  ')+1,obj.value.length);
  }

  if (obj.value.indexOf(' ') == 0) {
    obj.value = obj.value.substring(1,obj.value.length);
  }

  if (obj.value.charAt(obj.value.length-1) == ' ') {
    obj.value = obj.value.substring(0,obj.value.length-1);
  }

  return(true);
}
//----------------------------------------------------------------------------------------- 
//Fim Funções Gerais


//Começo FF_KeyPress
//----------------------------------------------------------------------------------------- 
function FF_KeyPress(Controle)
 {              
     if (Controle.mask == "")        
        SL_FormatarMoeda(event.keyCode,Controle);       
     else
        SL_FormatarMascara(event.keyCode,Controle);
     
     event.keyCode=0;
 }    
//----------------------------------------------------------------------------------------- 
function SL_FormatarMoeda(Valor,Controle)
 {            
    var wl_separadorentrada = Controle.SeparadorEntrada;
    var wl_separadorsaida   = Controle.SeparadorSaida;    
       
    //Testar se numero ou , ou .
    if ((Valor>=48 && Valor<=57) || (Valor==wl_separadorentrada.charCodeAt(0)) || (Valor==wl_separadorsaida.charCodeAt(0)))
    {              
      if ((Valor==wl_separadorentrada.charCodeAt(0)) || (Valor==wl_separadorsaida.charCodeAt(0))) 
         {
          if ((InStr(Controle.value,Controle.SeparadorEntrada)==0) && (InStr(Controle.value,Controle.SeparadorSaida)==0)) 
              Controle.value += Controle.SeparadorEntrada;
          }    
      else
          {          
          Controle.value += String.fromCharCode(Valor);
          }
    }      
  }    
//-----------------------------------------------------------------------------------------
function SL_FormatarMascara(Valor,Controle)
 {
      var wl_mask = Controle.mask;
      var wl_sair = true;
         
      if (Controle.mask == "9999-9999") 
        {
         if (InStr("0123456789",String.fromCharCode(Valor))==0)
           {
             event.keyCode=0;
             return;
           }           
         else  
           {
             if ((String.fromCharCode(Valor)==0) && (Controle.Value==""))
             {
               event.keyCode=0;
               return;
             }           
           }  
        }          
      
      if ((Len(Controle.value)==0) && (InStr("A9#",Left(Controle.mask,1))==0)) 
        {
         Controle.value = Left(Controle.mask,1);
        }              
       
      while(wl_sair==true)
        {        
         if (Len(Controle.value)>=Len(Controle.mask))            
           {            
            wl_sair = false;
            break;
           }                                                                          
         
         switch (wl_mask.charAt(Len(Controle.value)))
          {           
           case "9":           
              if ((Valor>=48) && (Valor<=57))
                 {                  
                  Controle.value += String.fromCharCode(Valor);                  
                  break;
                 } 
              else
                 {
                  wl_sair = false;                                               
                  break;
                 } 
              
            case "#":
              if (Valor==0)
                {
                  wl_sair = false;
                  break;
                }  
              else
                {                                    
                  Controle.value += String.fromCharCode(Valor);   
                  break;
                }                
              
            case "A","a":  
              if (InStr("QWERTYUIOPLKJHGFDSAZXCVBNM",String.fromCharCode(Valor))==0)
                {
                  wl_sair = false;                          
                  break;
                }
              else   
                {                
                  Controle.value += String.fromCharCode(Valor);                                                          
                  break;
                }
            
            default:                                  
                {                                 
                  Controle.value += wl_mask.charAt(Len(Controle.value));           
                  break;
                }
              
         }          
         Valor=0;
       }           
 }      
 //------------------------------------------------------------------------------------------
//Fim FF_KeyPress


//Começo FF_CPF
//----------------------------------------------------------------------------------------- 
function FF_CPF(obj)
{

 if (obj.value!="") 
  {

    if ((obj.value=="000.000.000-00") || (obj.value=="111.111.111-11") || (obj.value=="222.222.222-22") || (obj.value=="333.333.333-33") || (obj.value=="444.444.444-44") || (obj.value=="555.555.555-55") || (obj.value=="666.666.666-66") || (obj.value=="777.777.777-77") || (obj.value=="888.888.888-88") || (obj.value=="999.999.999-99")) {
        alert("Numero do CPF invalido");
        obj.value="";
        obj.focus();
        return (false);
    }

    var checkOK = "0123456789.-";
    var checkStr = obj.value;
    var allValid = true;

    // Verifica a existencia de caracteres invalidos
   for (i = 0; i < checkStr.length; i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
           break;
       if (j == checkOK.length)
        {
          allValid = false;
          break;
        }
     }

   if (!allValid)
     {
        alert("O CPF possui caracteres invalidos\n\nFormato: 999.999.999-99");
        obj.value="";
        obj.focus();
        return (false);
      }

   // Elimina todos os caracteres nao numericos  
    var cad="";
    for (i=0;i<checkStr.length;i++) {
      if ((checkStr.charAt(i)!=".") && (checkStr.charAt(i)!="-") && (checkStr.charAt(i)!="/"))
         cad += checkStr.charAt(i);
     }

   // Inicio do teste com CPF
    if (cad.length!=11)
      {
         alert("O numero do CPF precisa ter 11 digitos");         
         obj.value="";
         obj.focus();
         return (false);
       }
       
    //Valida CPF
    if (FF_Valida_CPF(cad)==0)
      {
         alert("Numero do CPF invalido");
         obj.value="";
         obj.focus();
         return (false);
       }        
    
    return (true);
    
  }
}

function FF_CPF2(obj)
{
	if ((obj.value!="") && (obj.value!="000.000.000-00"))
	{
		FF_CPF(obj);
	}
}
//----------------------------------------------------------------------------------------- 
function FF_Valida_CPF(cad){
 s = cad;
 if (isNaN(s)) {
  return 0;
 }
 var i;
 var c = s.substr(0,9);
 var dv = s.substr(9,2);
 var d1 = 0;
 for (i = 0; i < 9; i++) {
  d1 += c.charAt(i)*(10-i);
 }
 if (d1 == 0){
  return 0;
 }         
    d1 = 11 - (d1 % 11);
    if (d1 > 9) d1 = 0;         
 if (dv.charAt(0) != d1) {
  return 0;         
 }
 d1 *= 2;
 for (i = 0; i < 9; i++) {
  d1 += c.charAt(i)*(11-i);
 }
 d1 = 11 - (d1 % 11);
 if (d1 > 9) d1 = 0;
 if (dv.charAt(1) != d1) {
     return 0;
    }
    return 1;
}
//----------------------------------------------------------------------------------------- 
//Fim FF_CPF


//Começo FF_CGC
//----------------------------------------------------------------------------------------- 
function FF_CGC(obj)
{

if (obj.value!="") 
{
  var checkOK = "0123456789.-/";
  var checkStr = obj.value;
  var allValid = true;

  // Verifica a existencia de caracteres invalidos
  for (i = 0; i < checkStr.length; i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  
  if (!allValid)
  {
    alert("O CNPJ possui caracteres invalidos\n\nFormato: 99.999.999/9999-99");
    obj.value="";
    obj.focus();
    return (false);
  }

  // Elimina todos os caracteres nao numericos
  
  var cad="";
  for (i=0;i<checkStr.length;i++) {
    if ((checkStr.charAt(i)!=".") && (checkStr.charAt(i)!="-") && (checkStr.charAt(i)!="/"))
      cad += checkStr.charAt(i);
  }

// Inicio do teste com CGC

    if (cad.length!=14)
    {
      alert("O numero do CNPJ precisa ter 14 digitos");
      obj.value="";
      obj.focus();
      return (false);
    }
    
// Testa digito verificador
   if (FF_Valida_CGC(cad)==0) 
      {
      alert("Numero do CNPJ invalido");      
      obj.value="";
      obj.focus();
      return (false);
      }   
    
 }
return(true);
}

function FF_CGC2(obj)
{
	if ((obj.value!="") && (obj.value!="00.000.000/0000-00"))
	{
		FF_CGC(obj);
	}
}
//----------------------------------------------------------------------------------------- 
function FF_Valida_CGC(cad){
 s = cad;
 if (isNaN(s)) {
  return 0;
 }
 var i;
 var c = s.substr(0,12);
 var dv = s.substr(12,2);
 var d1 = 0;
 for (i = 0; i <12; i++){
  d1 += c.charAt(11-i)*(2+(i % 8));
 }
 if (d1 == 0) 
  return 0;
 d1 = 11 - (d1 % 11);
 if (d1 > 9) d1 = 0;
 if (dv.charAt(0) != d1){
  return 0;
 }
 d1 *= 2;
 for (i = 0; i < 12; i++){
  d1 += c.charAt(11-i)*(2+((i+1) % 8));
 }
 d1 = 11 - (d1 % 11);
 if (d1 > 9) 
  d1 = 0;
 if (dv.charAt(1) != d1){
  return 0;
 }
  return 1;
}
//----------------------------------------------------------------------------------------- 
//Fim FF_CGC






//Começo Status
<!-- Begin
scrollit(10);
function scrollit(seed) {
var m1  = "                                             ";
var m2  = "                                             ";
var m3  = "                                             ";
var m4  = "                                             ";
var msg=m1+m4+m2+m4+m3+m4;
var out = "                                             ";
var c   = 1;
if (seed > 10) {
seed--;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 10 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,10);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit(10)",75);
      }
   }
}
// End -->
//Fim Status



function tirarespacos(obj) {

  while (obj.value.indexOf('  ') != -1) {
    obj.value = obj.value.substring(0,obj.value.indexOf('  ')) + obj.value.substring(obj.value.indexOf('  ')+1,obj.value.length);
  }

  if (obj.value.indexOf(' ') == 0) {
    obj.value = obj.value.substring(1,obj.value.length);
  }

  if (obj.value.charAt(obj.value.length-1) == ' ') {
    obj.value = obj.value.substring(0,obj.value.length-1);
  }

  return(true);
}

function sonumeros(obj,cad) {
  var chvalidos = cad;
  var i=0;
  var valid=true;

  while ((i<obj.value.length) && (valid)) {
    valid=false;
    for(j=0;j<chvalidos.length;j++) {
      if (obj.value.charAt(i) == chvalidos.charAt(j)) {valid=true;}
    }
    i++;
  }
  if (!valid) {
    alert('Digite somente numeros');
    obj.value="";
    obj.focus();
    return(false);
  }
  return(true);
}

// Verifica o telefonte digitado

function verfone(obj) 
{
  var chkstr=obj.value;
  var caracter;

  if (chkstr.length = 0) {
     return(true);
  }


  if (sonumeros(obj,"0123456789()") == false) {
     return(false);
  }

  caracter =chkstr.charAt(0);
 
  if (caracter == "") {
    return(true);
  }

  if (caracter == 0) {
     alert("O telefone não deve iniciar com zero!");
     obj.focus();
     return(false);
  }

  if (chkstr.length < 10) {
     alert("Quantidade de numeros menor que o minimo exigido (10 caracteres: ddd + numero)");
     obj.focus();
     return(false);
  }

  return(true);
}

function veremail(obj)
{
if (obj.value!="") {

  while (obj.value.indexOf(' ') != -1) {
    obj.value = obj.value.substring(0,obj.value.indexOf(' ')) + obj.value.substring(obj.value.indexOf(' ')+1,obj.value.length);
  }

  var checkOK = "\@."; // Caracteres Obrigatorios
  obj.value = obj.value.toLowerCase(); // Converte para Lower Case
  var checkStr = obj.value;
  var achar = true;
  var erro = false;
  i=0;

  // Verifica a presenca dos caracteres obrigatorios

  while ((i<checkOK.length)&&(achar)) {
    ch = checkOK.charAt(i);
    t=0;
    achar=false;
    while ((!achar)&&(t<checkStr.length)) {
      if (ch==checkStr.charAt(t))
        achar=true;
      t++;
    }
    i++;
  }

  // Se OK entao prossegue com os testes

  if (achar) {
    cta=0;
    ctpp=0;
    for (i=0;i<checkStr.length;i++)        // Verifica a quantidade de '\@'
      if (checkStr.charAt(i)=='\@') {
        cta++;

        // Verifica se existe algum '.' antes ou depois do '\@'

        if ((checkStr.charAt(i+1)=='.') || 
            (checkStr.charAt(i-1)=='.'))
              cta++;
      } 

    // Verifica a quantidade de '.'


    // Verifica se ha algum '.' junto a outro

    for (i=0;i<checkStr.length;i++)
      if (checkStr.charAt(i)=='.')
        if (checkStr.charAt(i+1)=='.') ctpp++;

    if ((cta>1)||(ctpp!=0)) erro=true;   // Seta esta variavel se houve algum erro ate agora

    // Verifica se ha '.' ou '\@' no inicio ou no fim do E-mail
   
    if ((checkStr.charAt(0)=='\@') ||
        (checkStr.charAt(0)=='.') ||
        (checkStr.charAt(checkStr.length-1)=='\@') ||
        (checkStr.charAt(checkStr.length-1)=='.'))
          erro = true;    // Seta esta variavel se houve algum erro ate agora

    // Certifica que o fim do E-mail possui 2 ou 3 caracteres

    if ((checkStr.charAt(checkStr.length-4)!='.') &&
        (checkStr.charAt(checkStr.length-3)!='.'))
          erro = true;    // Seta esta variavel se houve algum erro ate agora
  }

  if ((erro)||(!achar))
  {
    alert("Digite o e-mail no formato user\@dominio");
    obj.focus();
    obj.value="";
    return (false);
  }

  var checkOK = "abcdefghijklmnopqrstuvwxyz0123456789\@%_-."; // Caracteres Possiveis
  var allValid = true;

  // Verifica existencia de caracteres invalidos

  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;

    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("O e-mail possui caracteres invalidos");
    obj.focus();
    obj.value="";
    return (false);
  }
  else
    return(obj.value);   // Retorna o E-mail ja' em Lower Case
}
}


// Verifica formato da Data



function verdata(obj)
{

if (sonumeros(obj,"0123456789/") == false) {
	return(false);
}

if (obj.value != '') {

  while (obj.value.indexOf(' ') != -1) {
    obj.value = obj.value.substring(0,obj.value.indexOf(' ')) + obj.value.substring(obj.value.indexOf(' ')+1,obj.value.length);
  }

  ch='/';
  validform=true;
  valid=true;
  chkstr=obj.value;
  ct=0;
  dia=''; mes=''; ano='';

  if (((chkstr.charAt(1)!=ch)&&(chkstr.charAt(2)!=ch))||
     ((chkstr.charAt(3)!=ch)&&(chkstr.charAt(4)!=ch)&&(chkstr.charAt(5)!=ch))||
      (chkstr.charAt(chkstr.length-1)==ch))
        validform=false;
  for (i=0;i<chkstr.length;i++)
    if (chkstr.charAt(i)==ch) ct++;
  if (ct>2) validform=false;
  i=0;
  if (validform)
  {
    while (chkstr.charAt(i)!=ch)
    {
      dia=dia+chkstr.charAt(i);
      i++;
    }
    i++; 
    while (chkstr.charAt(i)!=ch)
    {
      mes=mes+chkstr.charAt(i);
      i++;
    }
    i++; 
    while (i<chkstr.length)
    {
      ano=ano+chkstr.charAt(i);
      i++;
    }

    if ((ano.length != 2)&&(ano.length != 4)) {valid=false;}

    if (ano < 100) {
      if ((ano >=0)&&(ano<=49))
        ano = eval(ano)+2000;
      else
        ano = eval(ano)+1900;
    }
 
    if (!(((ano%4)||!(ano%100))&&(ano%400)))
    {
      if ((dia>29)&&(mes==2)) valid=false;
    }
    else
    {
      if ((dia>28)&&(mes==2)) valid=false;
    }

    if (valid)
    if (((dia>31)&&(mes==1))||
        ((dia>31)&&(mes==3))||
        ((dia>30)&&(mes==4))||
        ((dia>31)&&(mes==5))||
        ((dia>30)&&(mes==6))||
        ((dia>31)&&(mes==7))||
        ((dia>31)&&(mes==8))||
        ((dia>30)&&(mes==9))||
        ((dia>31)&&(mes==10))||
        ((dia>30)&&(mes==11))||
        ((dia>31)&&(mes==12))||       
         (dia<1)||(dia>31)||
         (mes<1)||(mes>12)||
         (ano<0)
       )
      valid=false;
  }
  else
  {
    alert("Digite a data no formato dd/mm/aaaa");
    obj.focus();
    obj.value="";
    return (false);
  }
  if (!valid)
  {
    alert("Data invalida");
    obj.focus();
    obj.value="";
    return (false);
  }

  if (dia.length == 1) {dia = "0" + dia;}
  if (mes.length == 1) {mes = "0" + mes;}

  return (obj.value=dia+'/'+mes+'/'+ano);
}
}




function verdatapq(obj)
{

if (sonumeros(obj,'0123456789/') == false) {
	return(false);
}

if (obj.value != '') {

  while (obj.value.indexOf(' ') != -1) {
    obj.value = obj.value.substring(0,obj.value.indexOf(' ')) + obj.value.substring(obj.value.indexOf(' ')+1,obj.value.length);
  }

  ch='/';
  validform=true;
  valid=true;
  chkstr=obj.value;
  ct=0;
  dia=''; mes=''; ano='';


  if ((chkstr.charAt(1)!=ch)&&(chkstr.charAt(2)!=ch)||
      (chkstr.charAt(chkstr.length-1)==ch))
        validform=false;
  for (i=0;i<chkstr.length;i++)
    if (chkstr.charAt(i)==ch) ct++;
  if (ct>1) validform=false;
  i=0;
  if (validform)
  {
    while (chkstr.charAt(i)!=ch)
    {
      mes=mes+chkstr.charAt(i);
      i++;
    }
    i++; 
    while (i<chkstr.length)
    {
      ano=ano+chkstr.charAt(i);
      i++;
    }

    if ((ano.length != 2)&&(ano.length != 4)) {valid=false;}

    if (ano < 100) {
      if ((ano >=0)&&(ano<=49))
        ano = eval(ano)+2000;
      else
        ano = eval(ano)+1900;
    }
 
    if ((mes < 1) || (mes > 12))
    {
      valid=false;
    }
  }

  else
  {
    alert("Digite a data no formato mm/aaaa");
    obj.value="";
    obj.focus();
    return (false);
  }

  if (!valid)
  {
    alert("Data invalida");
    obj.value="";
    obj.focus();
    return (false);
  }
  
  if (mes.length == 1) {mes = "0" + mes;}

  return (obj.value=mes+'/'+ano);
}
}


function vercep(obj,muda)
{
if (obj.value!="") {

  while (obj.value.indexOf(' ') != -1) {
    obj.value = obj.value.substring(0,obj.value.indexOf(' ')) + obj.value.substring(obj.value.indexOf(' ')+1,obj.value.length);
  }

  var checkOK = "0123456789-. "; // Caracteres Possiveis
  var checkStr = obj.value;
  var allValid = true;

  // Verifica a existencia de caracteres invalidos

  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("O CEP possui caracteres invalidos\\n\\nFormato: 60000-000");
    obj.focus();
    obj.value="";
    return (false);
  }

  // Elimina todos os caracteres nao numericos

  var cad="";
  for (i=0;i<checkStr.length;i++) {
    if ((checkStr.charAt(i)!="-") && (checkStr.charAt(i)!="."))
      cad += checkStr.charAt(i);
  }

  // Verifica o tamanho do CEP. Caso esteja OK Reformata o CEP

  if (cad.length<8) {
    alert('O CEP precisa ter 8 digitos');
    obj.focus();
    obj.value="";
    return(false);
  }
  else { 
    obj.value=cad.charAt(0)+cad.charAt(1)+cad.charAt(2)+cad.charAt(3)+cad.charAt(4)+"-"+
                     cad.charAt(5)+cad.charAt(6)+cad.charAt(7);
  }
  return(obj.value);
}
}

function formatamoney(obj) {
  var checkOK = "0123456789"; // Caracteres Possiveis    
  var i=0;
  var j=0;
  var stringfinal="";

  if (!sonumeros(obj,'0123456789,')) {
    return(false);
  }

  if (obj.value.indexOf(',') != -1) {obj.value = obj.value.substring(0,obj.value.indexOf(','));}

  if (obj.value != "") {
     for(i=0;i<obj.value.length;i++)
       for(j=0;j<checkOK.length;j++)
         if (obj.value.charAt(i)==checkOK.charAt(j)) {stringfinal += obj.value.charAt(i);}
     obj.value=stringfinal;
  }
  return(true);
}



function autotab(obj,obj2) {
	var tam 
	tam = obj.value.length;
	if (tam>=obj.maxLength) {
		obj2.focus();
	}
}


function FormataNumero(src, mask) {
	var i = src.value.length;
	var saida = mask.substring(i,i+1);
	var ascii = event.keyCode;
	if (saida == "A") {
		if ((ascii >=97) && (ascii <= 122)) { event.keyCode -= 32; }
		else if ((ascii >=224) && (ascii <= 251)) { event.keyCode -= 32; }
		else if ((ascii+32 >=97) && (ascii+32 <= 122)) { event.keyCode = ascii; }
		else { event.keyCode = 0; }
	} else if (saida == "0") {
		if ((ascii >= 48) && (ascii <= 57)) { return }
		else { event.keyCode = 0 }
	} else if (saida == "#") {
		return;
	} else {
		src.value += saida;
		i += 1
		saida = mask.substring(i,i+1);
		if (saida == "A") {
		if ((ascii >=97) && (ascii <= 122)) { event.keyCode -= 32; }
		else if ((ascii+32 >=97) && (ascii+32 <= 122)) { event.keyCode = event.keyCode; }
		else { event.keyCode = 0; }
		} else if (saida == "0") {
			if ((ascii >= 48) && (ascii <= 57)) { return }
			else { event.keyCode = 0 }
		} else { return; }
	}
}

function ValidaSomenteNumero(objEvent) {
	var Code;

	if (navigator.appName == 'Microsoft Internet Explorer') {
 		Code = objEvent.keyCode;
	} else if (navigator.appName == 'Netscape') {
 		Code = objEvent.which;
	}

	if ((Code > 47) && (Code < 58)) {
		return true;
	}
	else {
		if ((Code == 0) || (Code == 8) || (Code == 13)) {
			return true;
		}
		else {
			alert('Digite apenas numeros');
			return false;
		}
	}
}