/******************************************************************
	MUDA PÁGINA DA JANELA DE BAIXO
******************************************************************/

function janelaTras(url)
{
	window.opener.location = url;
}


/******************************************************************
	MUDA PÁGINA
******************************************************************/

function mudaPagina(url)
{
	location.href = url;
}


/******************************************************************
	MUDA IMAGEM
******************************************************************/

function trocaImagem(id,img)
{
	document.getElementById(id).src = img;
}



/******************************************************************
	POPUP CENTRALIZADO
******************************************************************/

function abrePopup(pagina,largura,altura,rolagem)
{
	var posX;
	var posY;
	posX = (window.screen.width - largura) / 2;
	posY = (window.screen.height - altura) / 2;
	window.open(pagina,"_blank","width="+largura+",height="+altura+",top="+posY+",left="+posX+",scrollbars="+rolagem+",toolbar=no,location=no,directories=no,menubar=no,resizable=no,menubar=no");
}


/******************************************************************
	POPUP POSIÇÃO PADRÃO
******************************************************************/

function abrePopupMenor(pagina,largura,altura,rolagem)
{
	window.open(pagina,"_blank","width="+largura+",height="+altura+",top=80,left=80,scrollbars="+rolagem+",toolbar=no,location=no,directories=no,menubar=no");
}


/******************************************************************
	REMOVE ACENTOS
******************************************************************/

function removeAcentos(texto) 
{
	str = texto.toUpperCase();
	str = str.replace(new RegExp('[ÁÀÂÃ]','gi'), 'A');
	str = str.replace(new RegExp('[ÉÈÊ]','gi'), 'E');
	str = str.replace(new RegExp('[ÍÌÎ]','gi'), 'I');
	str = str.replace(new RegExp('[ÓÒÔÕ]','gi'), 'O');
	str = str.replace(new RegExp('[ÚÙÛÜ]','gi'), 'U');
	str = str.replace(new RegExp('[Ç]','gi'), 'C');
	str = str.replace(new RegExp('[Ñ]','gi'), 'N');
	
	return str;
} 


/******************************************************************
	CONTROLADOR PARA ABAS
******************************************************************/

function controlaAbas()
{
	var btLidas = document.getElementById("btMaisLidas");
	var btBusca = document.getElementById("btMaisBuscados");
	var ctLidas = document.getElementById("contLidas");
	var ctBusca = document.getElementById("contTags");
	
	if (ctLidas.style.display == "none")
	{
		ctLidas.style.display = "block";
		ctBusca.style.display = "none";
		btLidas.style.borderBottom = "0px";
		btBusca.style.borderBottom = "1px solid #878787";
	}
	else
	{
		ctLidas.style.display = "none";
		ctBusca.style.display = "block";
		btLidas.style.borderBottom = "1px solid #878787";
		btBusca.style.borderBottom = "0px";
	}
}

/******************************************************************
	CONTROLADOR PARA DIV
******************************************************************/

function controlaDiv(div)
{
	dv = document.getElementById(div);
	
	if (dv.style.display == "none")
	{
		dv.style.display = "block";
	}
	else
	{
		dv.style.display = "none";
	}
}

