function verifica_numero(campo)
{
	// Aceita somente números
	Key = window.event.keyCode;
	if ((Key < 48 || Key > 57) && Key != 13)
	{
		window.event.keyCode = "";
	}
			
}

function verifica_numero_decimal(campo)
{
	// Aceita somente números
	Key = window.event.keyCode;
	if ((Key < 48 || Key > 57) && Key != 13)
	{
		// Permitindo "." e ","
		if (Key == 44 || Key == 46)
		{
			window.event.keyCode = window.event.keyCode;
		}
		else
		{
			window.event.keyCode = "";
		}
	}		
}

function mascara_hora(hora, campo)
{
	// Formata a hora HH:MM
	if(window.event.keyCode != 8)
	{
		var myhora = '';
		myhora = myhora + hora;
		if (hora.length == 2)
		{
			myhora = myhora + ':';
			campo.value = myhora;
		}
	}
}
		
function verifica_hora(hora, campo)
{
	// Consiste hora
	if (hora.length != 5)
	{
		if (hora.length != 0)
		{
			alert("Hora incompleta... redigite!");
			campo.focus();
		}
	}
	else
	{
		hrs = (hora.substring(0,2));
		min = (hora.substring(3,5));
			
		if ((hrs < 00 ) || (hrs > 23) || ( min < 00) ||( min > 59))
		{
			alert("Hora inexistente... redigite!");
			campo.focus();
		}
	}
}

function verifica_acentuacao(campo)
{
	// Não aceita acentuações
	Key = window.event.keyCode;
	if (((Key < 65 || Key > 90) && (Key < 97 || Key > 122)) && Key != 13)
	{
		if (Key == 32)
		{
			window.event.keyCode = window.event.keyCode;
		}
		else
		{
			window.event.keyCode = "";
		}
	}			
}
