// JavaScript
//Scripts produzidos por Tiago Fachini - Favor não retirar estes créditos
//Scripts produzidos em 10/2006 - Joinville/sc

//Pop up específico centralizado
function janela(nome,width,height,pagina) {
	largura = screen.width;
	altura = screen.height;
	if(width == "") {
		width = 500;
	} 
	if(height == "") {
		height = 500;
	}
	posX = (largura - width) / 2;
	posY = (altura - height) / 2;
	if(pagina == "") {
		window.open("ampliar.php?f="+nome+"&l="+width+"&a="+height,"janela", "status=no, width="+width+", height="+height+", left="+posX+",top="+posY+"");
	} else {
		window.open(pagina,"janela", "status=no, width="+width+", height="+height+", left="+posX+",top="+posY+"");
	}
}

//Função para fechar janelas
function fechar() {
	window.close();
}

//Função para fazer o navegador voltar N páginas
function voltar(numero) {
	history.go(numero);	
}

//Função para auto-ajustar popup
var i=0;
function resize() {
  if (navigator.appName == 'Netscape') i=40;
  if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+120-i);
  self.focus();
}

function mostraItem() {
	visivel = document.getElementById("aviso").style.display;
		
	if(visivel=="none"){
		document.getElementById("aviso").style.display = "";
	} else {
		document.getElementById("aviso").style.display = "none";
	}
}
