function onlyNumbers(e, input)
{
	if(window.event)
	{
		if ((e.keyCode < 48)||(e.keyCode > 57))
		{
			if(e.keyCode!=8)
				return false;
		}

	} else {
	 	if (e.which)
	 	{
			if ((e.which < 48)||(e.which > 57))
			{
				if(e.which!=8)
					return false;
			}

	 	}
	}
}

function mudaBorda(id, obj)
{
	if(id == 0)
	{
		cor = '#c0c0c0';
		borda = 1;
	}
	else
	{
		cor = '#ae0000';
		borda = 1;
	}
	

	document.getElementById(obj).style.border =  borda + 'px solid ' + cor;
}

function mudaBordaVerde(id, obj)
{
	if(id == 0)
	{
		cor = '#186d16';
		borda = 1;
	}
	else
	{
		cor = '#ae0000';
		borda = 1;
	}
	

	document.getElementById(obj).style.border =  borda + 'px solid ' + cor;
}

function verificaExtensao(arquivo)
{
	   extensoes_permitidas = new Array(".gif", ".jpg");

	   if (!arquivo)
	   {
	       return true;
	   }
	   else
	   {
	      extensao = (arquivo.substring(arquivo.lastIndexOf("."))).toLowerCase();

	      permitida = false;

	      for (var i = 0; i < extensoes_permitidas.length; i++)
	      {
	         if (extensoes_permitidas[i] == extensao)
	         {
	         	permitida = true;
	        	break;
	         }
	      }

	      if (!permitida)
	      {
	         return false;
	      }
	   }

	   return true;
}

function excluir(link, id)
{
	if(confirm("Deseja realmente excluir este registro?"))
	{
		self.location.href = link + id;
	}
}
