// Versão 18/03/2008
function ValidaNumero(Controle,SairFoco) {
  var ValorDigitado = 0;
  var ValorMinimo = parseFloat((Controle.getAttribute("ValorMinimo").replace(/[.]/gi,'')).replace(/[,]/gi,'.'));
  var ValorMaximo = parseFloat((Controle.getAttribute("ValorMaximo").replace(/[.]/gi,'')).replace(/[,]/gi,'.'));
  var Retorno = true;
  TabPressionado = false;
  Controle.title = (Trim(Controle.getAttribute("DescricaoCampo"))=='' ? Controle.id : Trim(Controle.getAttribute("DescricaoCampo"))) + '. ';
  Controle.style.background = Controle.getAttribute("CorBackGroundInicial");
  if ((Controle.disabled) || (isParentDIVDesabilitado(Controle))) return Retorno;
  ValorDigitado = parseFloat('0'+(Controle.value.replace(/[.]/gi,'')).replace(/[,]/gi,'.'));
  if ((ValorDigitado < ValorMinimo) || (ValorDigitado > ValorMaximo)) {
    if (!SairFoco) {SetaFoco(Controle);}
	if (Trim(Controle.value) == '') 
	  Controle.title = Controle.title + 'Valor deve ser digitado. Valor M\u00EDnimo: ' + Controle.getAttribute("ValorMinimo") + ' Valor M\u00E1ximo: ' + Controle.getAttribute("ValorMaximo");
	else
	  Controle.title = Controle.title + 'Valor informado fora da faixa permitida. Valor M\u00EDnimo: ' + Controle.getAttribute("ValorMinimo") + ' Valor M\u00E1ximo: ' + Controle.getAttribute("ValorMaximo");
    AdicionaErroTela(Controle.title);
    Controle.style.background = Controle.getAttribute("CorBackGroundErro");
    Retorno = false;
  }
  //return (SairFoco) ? SairFoco : Retorno;
  return Retorno;
}

