/*!
  \file menujs.js
  \brief Integra a biblioteca de funções de apoio à execução da camada cliente,
		responsável por concentrar as chamadas por novas janelas do navegador para
		prover acesso à maioria das ferramentas que são compostas por interfaces específicas.
  
     Author: André Carvalho
     Data : 16/04/2007

     Alteração:
     Data :

     Comentários: André Carvalho
     Data: 11/10/2007
*/
/*! Referência para a janela do google. */
var googleWindow = null; 
/*!
	\brief Define largura e altura para a nova janela com relação à resolução de tela do cliente e
	o ponto de deslocamento para manter a janela no centro da tela, abrindo a janela e
	requisitando o recurso definido pelo parâmetro pagina.
	\param String pagina, endereço de requisição.
	\return void.
	\public
*/
function operacaomenu(pagina) {
	var largura;
	var altura;
    if(pagina=="frmConsultaPreDefinida.php") {
    	 largura = screen.width * 0.7;
		 altura = screen.height * 0.55;
		 pleft = (screen.width - largura) / 2;
		 ptop = (screen.height - altura) / 2;
		 window.open(pagina,"ConsultaPre",",scrollbars=yes,resizable=yes,width="+largura+",height="+altura+",left="+pleft+"px,top="+ptop+"px");
		 return;
    }
    else if(pagina=="../../help/apresentacao.html") {
    	 largura = screen.width * 0.8;
		 altura = screen.height * 0.55;
		 pleft = (screen.width - largura) / 2;
		 ptop = (screen.height - altura) / 2;
		 window.open(pagina,"help",",scrollbars=yes,resizable=yes,width="+largura+",height="+altura+",left="+pleft+"px,top="+ptop+"px");
		 return;
    }
    else if(pagina=="'frmTiposRptPdf.php") {
    	 largura = screen.width * 0.9;
		 altura = screen.height * 0.85;
		 pleft = (screen.width - largura) / 2;
		 ptop = (screen.height - altura) / 2;
		 window.open(pagina,"RPT_PDF","resizable=yes,width="+largura+",height="+altura+",left="+pleft+"px,top="+ptop+"px");
		 return;
    }
    else if(pagina=="frmRelatorioPDF.php") {
    	 largura = screen.width * 0.63;
		 altura = screen.height * 0.55;
		 pleft = (screen.width - largura) / 2;
		 ptop = (screen.height - altura) / 2;
		 window.open(pagina,"Relatorios_PDF","resizable=yes,width="+largura+",height="+altura+",left="+pleft+"px,top="+ptop+"px");
		 return;
    }
    else if(pagina=="frmExportarLayers.php") {
    	 largura = screen.width * 0.3;
		 altura = screen.height * 0.47;
		 pleft = (screen.width - largura) / 2;
		 ptop = (screen.height - altura) / 2;
		 window.open(pagina,"exportLayers","scrollbars=yes,resizable=yes,width="+largura+",height="+altura+",left="+pleft+"px,top="+ptop+"px");
		 return;
    }
    else if(pagina=="frmConsultasAcesso.php") {
    	 largura = screen.width * 0.7;
		 altura = screen.height * 0.55;
		 pleft = (screen.width - largura) / 2;
		 ptop = (screen.height - altura) / 2;
		 window.open(pagina,"linkConsultas","scrollbars=yes,resizable=yes,width="+largura+",height="+altura+",left="+pleft+"px,top="+ptop+"px");
		 return;
    }
    else if(pagina=="frmNivelAgrupamento.php") {
    	 largura = screen.width * 0.9;
		 altura = screen.height * 0.85;
		 pleft = (screen.width - largura) / 2;
		 ptop = (screen.height - altura) / 2;
		 window.open(pagina,"ConsultaAvancada","scrollbars=yes,resizable=yes,width="+largura+",height="+altura+",left="+pleft+"px,top="+ptop+"px");
		 return;
    }
    else if(pagina=="frmSimples.php") {
    	 largura = 780;//screen.width * 0.605;
		 altura = 580;//screen.height * 0.7;
		 pleft = (screen.width - largura) / 2;
		 ptop = (screen.height - altura) / 2;
		 window.open(pagina,"Consultas","scrollbars=yes,resizable=yes,width="+largura+",height="+altura+",left="+pleft+"px,top="+ptop+"px");
		 return;
    }
    else if(pagina=="frmMunicipioPerfil.php") {//em uso
    	 largura = screen.width * 0.97;
		 altura = screen.height * 0.97;
		 pleft = (screen.width - largura) / 2;
		 ptop = (screen.height - altura) / 2;
		 window.open(pagina,"Consultas","scrollbars=yes,resizable=yes,width="+largura+",height="+altura+",left="+pleft+"px,top="+ptop+"px");
		 return;
    }
    else if(pagina=="frmGoogleMapApi.php") {
		largura = screen.width * 0.9;
		altura = screen.height * 0.85;
		// centraliza a nova janela.
		pleft = (screen.width - largura) / 2;
		ptop = (screen.height - altura) / 2;
		googleWindow = window.open(pagina,"Google","directories=no,statusbar=no,location=no,scrollbars=no,resizable=yes,width="+largura+",height="+altura+",left="+pleft+"px,top="+ptop+"px");
		return;
    }else {// caso geral
		largura = 600;
		altura = 400;
	}
	window.open(pagina,"Window","location=no,resizable=yes,width="+largura+",scrollbars=yes,height="+altura+",left=5,top=5");
}
