function isNUMB(c)
 {
 if((cx=c.indexOf("."))!=-1)
  {
  c = c.substring(0,cx)+"."+c.substring(cx+1);
  }
 if((parseFloat(c) / c != 1))
  {
  if(parseFloat(c) * c == 0)
   {
   return(1);
   }
  else
   {
   return(0);
   }
  }
 else
  {
  return(1);
  }
 }

function LIMP(c)
 {
 while((cx=c.indexOf("-"))!=-1)
  {
  c = c.substring(0,cx)+c.substring(cx+1);
  }
 while((cx=c.indexOf("/"))!=-1)
  {
  c = c.substring(0,cx)+c.substring(cx+1);
  }
 while((cx=c.indexOf("."))!=-1)
  {
  c = c.substring(0,cx)+c.substring(cx+1);
  }
 while((cx=c.indexOf("."))!=-1)
  {
  c = c.substring(0,cx)+c.substring(cx+1);
  }
 while((cx=c.indexOf("("))!=-1)
  {
  c = c.substring(0,cx)+c.substring(cx+1);
  }
 while((cx=c.indexOf(")"))!=-1)
  {
  c = c.substring(0,cx)+c.substring(cx+1);
  }
 while((cx=c.indexOf(" "))!=-1)
  {
  c = c.substring(0,cx)+c.substring(cx+1);
  }
 return(c);
 }
 
//verifica valor numerico valido
function integerFormatnum(fld, e) {
var sep = 0;
var key = '';
var i = j = 0;
var len = len2 = 0;
var strCheck = '0123456789';
var whichCode = (window.Event) ? e.which : e.keyCode;
if (whichCode == 13) return true;  // Enter
key = String.fromCharCode(whichCode);  // Get key value from key code
if (strCheck.indexOf(key) == -1)
	return false;  // Not a valid key
else
	return true;
}
//função para liberar apenas numero no campo
function isNum( caractere )
{
	var strValidos = "0123456789."
	if ( strValidos.indexOf( caractere ) == -1 )
		return false;
	
	return true; 
}
function validaTecla(campo, event) 
{
	var BACKSPACE= 8;
	var key;
	var tecla; 
	CheckTAB=true; 
	if(navigator.appName.indexOf("Netscape")!= -1)
		tecla= event.which;
	else
		tecla= event.keyCode;
	key = String.fromCharCode( tecla);
 
	//alert( 'key: ' + tecla + ' -> campo: ' + campo.value); 
	
	if ( tecla == 13 )
		return false;
 
	if ( tecla == BACKSPACE )
		return true;
	
	return ( isNum(key));
}
//
function integerFormat(fld, e) {
var sep = 0;
var key = '';
var i = j = 0;
var len = len2 = 0;
var strCheck = '0123456789.';
var whichCode = (window.Event) ? e.which : e.keyCode;
if (whichCode == 13) return true;  // Enter
key = String.fromCharCode(whichCode);  // Get key value from key code
if (strCheck.indexOf(key) == -1)
	return false;  // Not a valid key
else
	return true;
}

function isNum2( caractere )
{
	var strValidos = "0123456789"
	if ( strValidos.indexOf( caractere ) == -1 )
		return false;
	
	return true; 
}
function validaTecla2(campo, event) 
{
	var BACKSPACE= 8;
	var key;
	var tecla; 
	CheckTAB=true; 
	if(navigator.appName.indexOf("Netscape")!= -1)
		tecla= event.which;
	else
		tecla= event.keyCode;
	key = String.fromCharCode( tecla);
 
	//alert( 'key: ' + tecla + ' -> campo: ' + campo.value); 
	
	if ( tecla == 13 )
		return false;
 
	if ( tecla == BACKSPACE )
		return true;
	
	return ( isNum2(key));
}



