/*-------------------------------------------------------------------------------------------------
	REDIRECT IFRAME
-------------------------------------------------------------------------------------------------*/

function redirectIframe(frame,pagina)
{
	this[frame].location = pagina;
}

/*-------------------------------------------------------------------------------------------------
	MUDA PÁGINA
-------------------------------------------------------------------------------------------------*/

function mudaPagina(url)
{
	location.href = url;
}

/*-------------------------------------------------------------------------------------------------
	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 DE UMA STRING
---------------------------------------------------------------------------------------------------*/

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;
} 

/*-------------------------------------------------------------------------------------------------
	MANIPULA DID
-------------------------------------------------------------------------------------------------*/

function statusDiv(d)
{
	if (document.getElementById(d).style.display == "none")
	{
		document.getElementById(d).style.display = "block";
	}
	else
	{
		document.getElementById(d).style.display = "none";
	}
}

