function trim(str) {
   return str.replace(/^\s*|\s*$/g,"");
}

function selTR(valor, idTR, corOriginal) {
	//by Lucas
	// indica a linha da tabela selecionada p/ exclusao
	
	
	// campo  o checkbox
	// ID  o ID da TR
	
	if (valor.checked) document.getElementById(idTR).bgColor = "#CCCCCC";
	else document.getElementById(idTR).bgColor = corOriginal;
}

function ativo(src) {
if (!src.contains(event.fromElement))
	{
		src.bgColor = '#E6E7DF';
		src.style.color = '#0A326F';
		src.style.cursor = "hand";
	}
}
function inativo(src) {
if (!src.contains(event.toElement))
	{
		src.bgColor = '#E6E7DF';
		src.style.color = '#4C5C6C';
		src.style.cursor = "default";
	}
}

function abrirJanela(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function janelaSecundaria (URL){ 
   window.open(URL,"janela1","width=772,height=600,scrollbars=YES") 
} 

function campoNumerico(evt,campo) {
	evt = (evt) ? evt : window.event
		var digito = campo.value
		if (isNaN (digito)){
		var mainString = campo.value
    	var param1 = 0
		var param2 = -1
		campo.value = mainString.slice(param1, param2)
		alert ("Este campo s aceita nmeros.")
		campo.focus()
	}
}

function escreveData() 
{ 
  day = new Date() 
  num_dia = day.getDate() 
  dia = day.getDay() 
  mes = day.getMonth() 
  ano = day.getYear() 

  diaSemana = new Array("Domingo","Segunda","Ter&ccedil;a","Quarta","Quinta","Sexta","S&aacute;bado") 
  nomeMes = new Array("janeiro","fevereiro","mar&ccedil;o","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro") 
  dataext = diaSemana[dia] + ", " + num_dia + " de " + nomeMes[mes] + " de " + ano 

  return dataext; 
} 

function validarExclusao(URL, textoconfirm)
{
	if(confirm(textoconfirm))
	{
		document.location.href = URL;
	}
	else
	{
    	return false;
	}
}

function mouseOver(img, ref)
{document.images[img].src = ref;}

function mouseOut(img, ref)
{document.images[img].src = ref;}




