Commit 41679f3b50d5ebc7c3590ad89f48d0d2d3356d63
1 parent
50c2fc30
Exists in
master
and in
7 other branches
--no commit message
Showing
3 changed files
with
1306 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,63 @@ | @@ -0,0 +1,63 @@ | ||
1 | +//+$trad(1,i3GEOF.graficointerativo.dicionario)+ | ||
2 | +i3GEOF.graficointerativo.dicionario = { | ||
3 | +1: [{ | ||
4 | +pt:"", | ||
5 | +en:"", | ||
6 | +es:"", | ||
7 | +it:"" | ||
8 | +}], | ||
9 | +2: [{ | ||
10 | +pt:"", | ||
11 | +en:"", | ||
12 | +es:"", | ||
13 | +it:"" | ||
14 | +}], | ||
15 | +3: [{ | ||
16 | +pt:"", | ||
17 | +en:"", | ||
18 | +es:"", | ||
19 | +it:"" | ||
20 | +}], | ||
21 | +4: [{ | ||
22 | +pt:"", | ||
23 | +en:"", | ||
24 | +es:"", | ||
25 | +it:"" | ||
26 | +}], | ||
27 | +5: [{ | ||
28 | +pt:"", | ||
29 | +en:"", | ||
30 | +es:"", | ||
31 | +it:"" | ||
32 | +}], | ||
33 | +6: [{ | ||
34 | +pt:"", | ||
35 | +en:"", | ||
36 | +es:"", | ||
37 | +it:"" | ||
38 | +}], | ||
39 | +7: [{ | ||
40 | +pt:"", | ||
41 | +en:"", | ||
42 | +es:"", | ||
43 | +it:"" | ||
44 | +}], | ||
45 | +8: [{ | ||
46 | +pt:"", | ||
47 | +en:"", | ||
48 | +es:"", | ||
49 | +it:"" | ||
50 | +}], | ||
51 | +9: [{ | ||
52 | +pt:"", | ||
53 | +en:"", | ||
54 | +es:"", | ||
55 | +it:"" | ||
56 | +}], | ||
57 | +10: [{ | ||
58 | +pt:"", | ||
59 | +en:"", | ||
60 | +es:"", | ||
61 | +it:"" | ||
62 | +}] | ||
63 | +}; | ||
0 | \ No newline at end of file | 64 | \ No newline at end of file |
@@ -0,0 +1,34 @@ | @@ -0,0 +1,34 @@ | ||
1 | +<?php | ||
2 | +include_once(dirname(__FILE__)."/../inicia.php"); | ||
3 | +// | ||
4 | +//faz a busca da função que deve ser executada | ||
5 | +// | ||
6 | +$retorno = ""; //string que será retornada ao browser via JSON | ||
7 | +switch (strtoupper($funcao)) | ||
8 | +{ | ||
9 | +/* | ||
10 | +Valor: GRAFICOSELECAO | ||
11 | + | ||
12 | +Pega os dados necessários para a geração dos gráficos da ferramenta seleção | ||
13 | + | ||
14 | +<iniciaDadosGrafico> | ||
15 | +*/ | ||
16 | + case "GRAFICOSELECAO": | ||
17 | + include(dirname(__FILE__)."/../../classesphp/graficos.php"); | ||
18 | + if(!isset($exclui)) | ||
19 | + {$exclui = "";} | ||
20 | + if(!isset($tipo)) | ||
21 | + {$tipo = "nenhum";} | ||
22 | + if(!isset($ordenax)) | ||
23 | + {$ordenax = "nao";} | ||
24 | + $retorno = iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,false,$ext,true,$ordenax); | ||
25 | + break; | ||
26 | +} | ||
27 | +if (!connection_aborted()){ | ||
28 | + if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | ||
29 | + restauraCon($map_file,$postgis_mapa); | ||
30 | + cpjson($retorno); | ||
31 | +} | ||
32 | +else | ||
33 | +{exit();} | ||
34 | +?> | ||
0 | \ No newline at end of file | 35 | \ No newline at end of file |
@@ -0,0 +1,1209 @@ | @@ -0,0 +1,1209 @@ | ||
1 | + | ||
2 | +/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */ | ||
3 | +/* | ||
4 | +Title: Gráfico interativo | ||
5 | + | ||
6 | +Representação gráfica de dados. O gráfico é construído tendo como base os atributos de um tema e é modificado | ||
7 | +conforme o usuário navega pelo mapa. A renderização do gráfico é feito pelo navegador por meio do aplicativo openflashchart. | ||
8 | +Os dados que serão utilizados no gráfico são baseados em um elemento TABLE. Esse elemento pode ser montado com base na tabela | ||
9 | +de atributos e editada pelo usuário. Os dados podem também ser inseridos como parâmetros na inicialização da ferramenta, | ||
10 | +permitindo que o gráfico seja utilizado por outras ferramentas. | ||
11 | + | ||
12 | +Veja: | ||
13 | + | ||
14 | +<i3GEO.analise.dialogo.graficointerativo1> | ||
15 | + | ||
16 | +Arquivo: | ||
17 | + | ||
18 | +i3geo/ferramentas/graficointerativo1/index.js.php | ||
19 | + | ||
20 | +Licenca: | ||
21 | + | ||
22 | +GPL2 | ||
23 | + | ||
24 | +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
25 | + | ||
26 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
27 | +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
28 | + | ||
29 | +Este programa é software livre; você pode redistribuí-lo | ||
30 | +e/ou modificá-lo sob os termos da Licença Pública Geral | ||
31 | +GNU conforme publicada pela Free Software Foundation; | ||
32 | + | ||
33 | +Este programa é distribuído na expectativa de que seja útil, | ||
34 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
35 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
36 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
37 | +Você deve ter recebido uma cópia da Licença Pública Geral do | ||
38 | +GNU junto com este programa; se não, escreva para a | ||
39 | +Free Software Foundation, Inc., no endereço | ||
40 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
41 | +*/ | ||
42 | +if(typeof(i3GEOF) === 'undefined'){ | ||
43 | + var i3GEOF = {}; | ||
44 | +} | ||
45 | +/* | ||
46 | +Classe: i3GEOF.graficointerativo1 | ||
47 | + | ||
48 | +*/ | ||
49 | +i3GEOF.graficointerativo1 = { | ||
50 | + /* | ||
51 | + Variavel: aguarde | ||
52 | + | ||
53 | + Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. | ||
54 | + */ | ||
55 | + aguarde: "", | ||
56 | + /* | ||
57 | + Propriedade: dados | ||
58 | + | ||
59 | + Dados que serao utilizados. Pode ser passado como parametro. | ||
60 | + | ||
61 | + Default: | ||
62 | + {false} | ||
63 | + */ | ||
64 | + dados:false, | ||
65 | + /* | ||
66 | + Propriedade: titulo | ||
67 | + | ||
68 | + Título do gráfico. Se for vazio, será obtido do nome do tema selecionado | ||
69 | + */ | ||
70 | + titulo: "", | ||
71 | + /* | ||
72 | + Propriedade: tipo | ||
73 | + | ||
74 | + Tipo de gráfico escolhido pelo usuário. | ||
75 | + */ | ||
76 | + tipo: "", | ||
77 | + /* | ||
78 | + Propriedade: acumula | ||
79 | + | ||
80 | + Acumula os valores ao gerar o gráfico | ||
81 | + | ||
82 | + Type: | ||
83 | + {boolean} | ||
84 | + | ||
85 | + Default: | ||
86 | + {false} | ||
87 | + */ | ||
88 | + acumula: false, | ||
89 | + /* | ||
90 | + Propriedade: relativa | ||
91 | + | ||
92 | + Utiliza valores relativos ao criar o gráfico | ||
93 | + | ||
94 | + Type: | ||
95 | + {boolean} | ||
96 | + | ||
97 | + Default: | ||
98 | + {false} | ||
99 | + */ | ||
100 | + relativa: false, | ||
101 | + /* | ||
102 | + Propriedade: dadospuros | ||
103 | + | ||
104 | + Não faz nenhum tipo de processamento nos dados antes de gerar o gráfico | ||
105 | + | ||
106 | + Type: | ||
107 | + {boolean} | ||
108 | + | ||
109 | + Default: | ||
110 | + {false} | ||
111 | + */ | ||
112 | + dadospuros: false, | ||
113 | + /* | ||
114 | + Propriedade: navegacao | ||
115 | + | ||
116 | + Ativa ou não a navegação dinâmica do mapa | ||
117 | + | ||
118 | + Type: | ||
119 | + {boolean} | ||
120 | + | ||
121 | + Default: | ||
122 | + {false} | ||
123 | + */ | ||
124 | + navegacao:false, | ||
125 | + | ||
126 | + /* | ||
127 | + Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário | ||
128 | + */ | ||
129 | + criaJanelaFlutuante: function(dados){ | ||
130 | + if(dados){ | ||
131 | + i3GEOF.graficointerativo1.dados = dados; | ||
132 | + } | ||
133 | + i3GEOF.graficointerativo1.iniciaDicionario(); | ||
134 | + }, | ||
135 | + /* | ||
136 | + Function: iniciaDicionario | ||
137 | + | ||
138 | + Carrega o dicionário e chama a função que inicia a ferramenta | ||
139 | + | ||
140 | + O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script | ||
141 | + */ | ||
142 | + iniciaDicionario: function(dados){ | ||
143 | + if(dados){ | ||
144 | + i3GEOF.graficointerativo1.dados = dados; | ||
145 | + } | ||
146 | + if(typeof(i3GEOF.graficointerativo1.dicionario) === 'undefined'){ | ||
147 | + i3GEO.util.scriptTag( | ||
148 | + i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/dicionario.js", | ||
149 | + "i3GEOF.graficointerativo1.iniciaJanelaFlutuante()", | ||
150 | + "i3GEOF.graficointerativo1.dicionario_script" | ||
151 | + ); | ||
152 | + } | ||
153 | + else{ | ||
154 | + i3GEOF.graficointerativo1.iniciaJanelaFlutuante(dados); | ||
155 | + } | ||
156 | + }, | ||
157 | + /* | ||
158 | + Function: inicia | ||
159 | + | ||
160 | + Inicia a ferramenta. É chamado por criaJanelaFlutuante | ||
161 | + | ||
162 | + Parametros: | ||
163 | + | ||
164 | + iddiv {String} - id do div que receberá o conteudo HTML da ferramenta | ||
165 | + | ||
166 | + dados {JSON} - dados para o gráfico (opcional) exemplo ["n;x","'Argentina';33796870","'Paraguay';4773464","'Brazil';151525400","'Chile';13772710"] | ||
167 | + */ | ||
168 | + inicia: function(iddiv){ | ||
169 | + //try{ | ||
170 | + $i(iddiv).innerHTML += i3GEOF.graficointerativo1.html(); | ||
171 | + $i("i3GEOgraficointerativo1Acumula").checked = i3GEOF.graficointerativo1.acumula; | ||
172 | + $i("i3GEOgraficointerativo1Relativa").checked = i3GEOF.graficointerativo1.relativa; | ||
173 | + $i("i3GEOgraficointerativo1DadosPuros").checked = i3GEOF.graficointerativo1.dadospuros; | ||
174 | + if(i3GEOF.graficointerativo1.navegacao === true) | ||
175 | + {i3GEOF.graficointerativo1.ativaNavegacao(true);} | ||
176 | + //eventos das guias | ||
177 | + $i("i3GEOgraficointerativo1guia1").onclick = function(){ | ||
178 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1","i3GEOgraficointerativo1guia"); | ||
179 | + $i("i3GEOgraficointerativo1Grafico").style.display = "none"; | ||
180 | + }; | ||
181 | + $i("i3GEOgraficointerativo1guia2").onclick = function(){ | ||
182 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia2","i3GEOgraficointerativo1guia"); | ||
183 | + i3GEOF.graficointerativo1.configuraDados(); | ||
184 | + $i("i3GEOgraficointerativo1Grafico").style.display = "none"; | ||
185 | + }; | ||
186 | + $i("i3GEOgraficointerativo1guia3").onclick = function(){ | ||
187 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia3","i3GEOgraficointerativo1guia"); | ||
188 | + $i("i3GEOgraficointerativo1Grafico").style.display = "none"; | ||
189 | + }; | ||
190 | + $i("i3GEOgraficointerativo1guia4").onclick = function(){ | ||
191 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia4","i3GEOgraficointerativo1guia"); | ||
192 | + function outputStatus(e) { | ||
193 | + //alert("oi"); | ||
194 | + } | ||
195 | + swfobject.embedSWF( | ||
196 | + i3GEO.configura.locaplic+"/pacotes/openflashchart/open-flash-chart.swf", | ||
197 | + "i3GEOgraficointerativo1Grafico", | ||
198 | + "95%", | ||
199 | + "88%", | ||
200 | + "9.0.0", | ||
201 | + "expressInstall.swf", | ||
202 | + { | ||
203 | + "get-data":"i3GEOF.graficointerativo1.tabela2dados", | ||
204 | + "loading":"Criando grafico..." | ||
205 | + }, | ||
206 | + false, | ||
207 | + false, | ||
208 | + outputStatus | ||
209 | + ); | ||
210 | + var t = $i("i3GEOgraficointerativo1Grafico"); | ||
211 | + t.style.display = "block"; | ||
212 | + t.style.position = "relative"; | ||
213 | + t.style.top = "-5px"; | ||
214 | + t.visibility = "visible"; | ||
215 | + }; | ||
216 | + $i("i3GEOgraficointerativo1guia5").onclick = function(){ | ||
217 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia5","i3GEOgraficointerativo1guia"); | ||
218 | + $i("i3GEOgraficointerativo1Grafico").style.display = "none"; | ||
219 | + $i("i3GEOgraficointerativo1guia5obj").innerHTML = "<textarea rows='20' cols='52' >"+(i3GEOF.graficointerativo1.tabela2csv()).join("\n")+"</textarea>"; | ||
220 | + }; | ||
221 | + | ||
222 | + i3GEOF.graficointerativo1.ativaFoco(); | ||
223 | + i3GEOF.graficointerativo1.comboTemas(); | ||
224 | + new YAHOO.widget.Button( | ||
225 | + "i3GEOgraficointerativo1botao1", | ||
226 | + {onclick:{fn: i3GEOF.graficointerativo1.obterDados}} | ||
227 | + ); | ||
228 | + if(i3GEOF.graficointerativo1.dados && i3GEOF.graficointerativo1.dados != "undefined"){ | ||
229 | + //i3GEOF.graficointerativo1.tipo = "pizza2d"; | ||
230 | + //var retorno = {"attributes":{"id":""},"data":{"dados":["n;x","'4';3839572","'8';81710320","'7';24631314","'2';10967753","'1';24496400","'3';18752482","'5';13574480","'6';216507515"]}}; | ||
231 | + i3GEOF.graficointerativo1.montaTabelaDados(i3GEOF.graficointerativo1.dados); | ||
232 | + $i("i3GEOgraficointerativo1guia4").onclick.call(); | ||
233 | + } | ||
234 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1","i3GEOgraficointerativo1guia"); | ||
235 | + //} | ||
236 | + //catch(erro){i3GEO.janela.tempoMsg(erro);} | ||
237 | + }, | ||
238 | + /* | ||
239 | + Function: html | ||
240 | + | ||
241 | + Gera o código html para apresentação das opções da ferramenta | ||
242 | + | ||
243 | + Retorno: | ||
244 | + | ||
245 | + String com o código html | ||
246 | + */ | ||
247 | + html:function(){ | ||
248 | + var locaplic = i3GEO.configura.locaplic, | ||
249 | + ins = '' + | ||
250 | + '<div id=i3GEOgraficointerativo1guiasYUI class="yui-navset" style="top:0px;cursor:pointer;left:0px;">' + | ||
251 | + ' <ul class="yui-nav" style="border-width:0pt 0pt 0px;border-color:rgb(240,240,240);border-bottom-color:white;">' + | ||
252 | + ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia3" style="text-align:center;left:0px;" ><img class="ticPropriedades2" style="height:14px" title="'+$trad("p13")+'" src="'+i3GEO.configura.locaplic+'/imagens/visual/default/branco.gif"></div></em></a></li>' + | ||
253 | + ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia1" style="text-align:center;left:0px;" >Tipo</div></em></a></li>' + | ||
254 | + ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia2" style="text-align:center;left:0px;" >Dados</div></em></a></li>' + | ||
255 | + ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia4" style="text-align:center;left:0px;" >Gráfico</div></em></a></li>' + | ||
256 | + ' <li><a href="#ancora"><em><div id="i3GEOgraficointerativo1guia5" style="text-align:center;left:0px;" >CSV</div></em></a></li>' + | ||
257 | + ' </ul>' + | ||
258 | + '</div><br>' + | ||
259 | + '<div class=guiaobj id="i3GEOgraficointerativo1guia1obj" style="left:1px;display:none;">' + | ||
260 | + ' <p class=paragrafo >Escolha o tipo de gráfico: </p>' + | ||
261 | + ' <table class=lista6 >' + | ||
262 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-pie-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="pizza2d" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>pizza 2d</td></tr>' + | ||
263 | + ' <tr><td> </td></tr>' + | ||
264 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-area-stacked-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="area" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>área 2d</td></tr>' + | ||
265 | + ' <tr><td> </td></tr>' + | ||
266 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-scatter-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="scatter" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>distribuição de pontos</td></tr>' + | ||
267 | + ' <tr><td> </td></tr>' + | ||
268 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-line-stacked-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="line" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>linha</td></tr>' + | ||
269 | + ' <tr><td> </td></tr>' + | ||
270 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-polar-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="radar" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>radar</td></tr>' + | ||
271 | + ' <tr><td> </td></tr>' + | ||
272 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-bar-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="bar_filled" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>barras simples</td></tr>' + | ||
273 | + ' <tr><td> </td></tr>' + | ||
274 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-bar-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="bar_glass" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>barras 2 cores</td></tr>' + | ||
275 | + ' <tr><td> </td></tr>' + | ||
276 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-bar-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="bar_3d" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>barras 3d</td></tr>' + | ||
277 | + ' <tr><td> </td></tr>' + | ||
278 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-bar-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="bar_sketch" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>barras rascunho</td></tr>' + | ||
279 | + ' <tr><td> </td></tr>' + | ||
280 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-bar-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="bar_cylinder" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>barras cilindro</td></tr>' + | ||
281 | + ' <tr><td> </td></tr>' + | ||
282 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-bar-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="bar_cylinder_outline" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>barras cilindro com contorno</td></tr>' + | ||
283 | + ' <tr><td> </td></tr>' + | ||
284 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-bar-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="bar_round_glass" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>barras cúpula</td></tr>' + | ||
285 | + ' <tr><td> </td></tr>' + | ||
286 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-bar-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="bar_round" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>barras pílula</td></tr>' + | ||
287 | + ' <tr><td> </td></tr>' + | ||
288 | + ' <tr><td><img style=cursor:text; src="'+locaplic+'/imagens/oxygen/22x22/Actions-office-chart-bar-icon.png" /></td><td><input type=radio onclick="i3GEOF.graficointerativo1.ativaTipo(this)" value="hbar" name="tipoGrafico" style="border:0px solid white;cursor:pointer" > </td><td>barras horizontais</td></tr>' + | ||
289 | + ' </table>' + | ||
290 | + '</div> ' + | ||
291 | + '<div class=guiaobj id="i3GEOgraficointerativo1guia2obj" style="left:1px;display:none;top:-5px">' + | ||
292 | + ' <p class=paragrafo >Escolha os dados que comporão o gráfico: </p>' + | ||
293 | + ' <p class=paragrafo >Tema:</p>' + | ||
294 | + ' <div class=paragrafo id=i3GEOgraficointerativo1ComboTemas ></div>' + | ||
295 | + ' <div class=paragrafo id=i3GEOgraficointerativo1ComboXlinha >' + | ||
296 | + ' <p class=paragrafo >Item com as classes ou eixo X:</p>' + | ||
297 | + ' <div class=paragrafo id=i3GEOgraficointerativo1ComboX ></div>' + | ||
298 | + ' </div>'+ | ||
299 | + ' <div id=i3GEOgraficointerativo1ComboYlinha style=display:block >'+ | ||
300 | + ' <p class=paragrafo >Item com os valores ou eixo Y: </p>'+ | ||
301 | + ' <div class=paragrafo id=i3GEOgraficointerativo1ComboY ></div>' + | ||
302 | + ' </div>' + | ||
303 | + ' <p class=paragrafo >Excluir o seguinte valor: ' + | ||
304 | + $inputText("","","i3GEOgraficointerativo1excluir","",3,"") + | ||
305 | + ' <p class=paragrafo ><input type=checkbox style="cursor:pointer;top:3px;position:relative;" id=i3GEOgraficointerativo1CoresA /> gera cores aleatórias</p>' + | ||
306 | + ' <p class=paragrafo ><input id=i3GEOgraficointerativo1botao1 type="buttom" value="Obter dados" /></p>'+ | ||
307 | + ' <div id=i3GEOgraficointerativo1Dados ></div>'+ | ||
308 | + ' <div class=paragrafo id=i3GEOgraficointerativo1AjudaPizza >Se vc escolher para X e Y o mesmo item, será considerada a frequência das ocorrências para compor cada parte da pizza. Caso contrário, será feita a soma dos valores existentes em Y para cada ocorrência existente em X.</div>' + | ||
309 | + '</div>' + | ||
310 | + '<div class=guiaobj id="i3GEOgraficointerativo1guia3obj" style="left:1px;display:none;top:-5px">' + | ||
311 | + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1AdLinhas checked /> Adiciona as linhas em gráficos de barras</p>' + | ||
312 | + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1Acumula /> Utiliza valores acumulados</p>' + | ||
313 | + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1Relativa /> Utiliza valores relativos (%)</p>' + | ||
314 | + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1OrdenaX checked /> Ordena o eixo X</p>' + | ||
315 | + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox id=i3GEOgraficointerativo1DadosPuros /> Não processa os valores ao obter os dados (mantém os dados como estão na tabela de atributos) - essa opção é útil nos gráficos de distribuição de pontos</p>' + | ||
316 | + ' <p class=paragrafo ><input style=cursor:pointer type=checkbox onclick="i3GEOF.graficointerativo1.ativaNavegacao(this.checked)" /> Atualiza o gráfico ao navegar pelo mapa</p>' + | ||
317 | + ' <p class=paragrafo ><select onchange="i3GEOF.graficointerativo1.obterDados()" id="i3GEOgraficointerativo1TipoAgregacao" ><option value="soma">Soma</option><option value="media">Média</option></select> Tipo de agregação dos valores do eixo Y</p>' + | ||
318 | + '</div>'+ | ||
319 | + '<div class=guiaobj id="i3GEOgraficointerativo1guia4obj" style="left:1px;display:none;top:-10px">' + | ||
320 | + ' <a href="#" onclick="i3GEOF.graficointerativo1.novaJanela()" >abrir em uma janela separada</a>' + | ||
321 | + '</div>' + | ||
322 | + '<div class=guiaobj id="i3GEOgraficointerativo1guia5obj" style="font-size:10px;left:10px;display:none;top:-0px">' + | ||
323 | + '</div>' + | ||
324 | + '<div id="i3GEOgraficointerativo1Grafico" style="position:relative;top:-5px;display:none"></div>'; | ||
325 | + return ins; | ||
326 | + }, | ||
327 | + /* | ||
328 | + Function: iniciaJanelaFlutuante | ||
329 | + | ||
330 | + Cria a janela flutuante para controle da ferramenta. | ||
331 | + | ||
332 | + Parametro | ||
333 | + | ||
334 | + dados {JSON} - dados para o gráfico | ||
335 | + */ | ||
336 | + iniciaJanelaFlutuante: function(dados){ | ||
337 | + if(dados){ | ||
338 | + i3GEOF.graficointerativo1.dados = dados; | ||
339 | + } | ||
340 | + var minimiza,cabecalho,janela,divid,temp,titulo; | ||
341 | + //cria a janela flutuante | ||
342 | + cabecalho = function(){ | ||
343 | + i3GEOF.graficointerativo1.ativaFoco(); | ||
344 | + }; | ||
345 | + minimiza = function(){ | ||
346 | + i3GEO.janela.minimiza("i3GEOF.graficointerativo1"); | ||
347 | + }; | ||
348 | + titulo = " "+$trad("t37b")+" <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=3&idajuda=84' > </a>"; | ||
349 | + janela = i3GEO.janela.cria( | ||
350 | + "380px", | ||
351 | + "310px", | ||
352 | + "", | ||
353 | + "", | ||
354 | + "", | ||
355 | + titulo, | ||
356 | + "i3GEOF.graficointerativo1", | ||
357 | + false, | ||
358 | + "hd", | ||
359 | + cabecalho, | ||
360 | + minimiza | ||
361 | + ); | ||
362 | + divid = janela[2].id; | ||
363 | + i3GEOF.graficointerativo1.aguarde = $i("i3GEOF.graficointerativo1_imagemCabecalho").style; | ||
364 | + $i("i3GEOF.graficointerativo1_corpo").style.backgroundColor = "white"; | ||
365 | + $i("i3GEOF.graficointerativo1_corpo").style.overflow = "auto"; | ||
366 | + i3GEOF.graficointerativo1.inicia(divid); | ||
367 | + if(i3GEO.Interface){ | ||
368 | + temp = function(){ | ||
369 | + if(i3GEO.Interface.ATUAL !== "googlemaps" && i3GEO.Interface.ATUAL !== "googleearth"){ | ||
370 | + i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.graficointerativo1.obterDados()"); | ||
371 | + } | ||
372 | + if(i3GEO.Interface.ATUAL == "googlemaps"){ | ||
373 | + google.maps.event.removeListener(graficointerativo1Dragend); | ||
374 | + google.maps.event.removeListener(graficointerativo1Zoomend); | ||
375 | + } | ||
376 | + if(i3GEO.Interface.ATUAL === "googleearth"){ | ||
377 | + google.earth.removeEventListener(graficointerativo1Dragend); | ||
378 | + } | ||
379 | + if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.graficointerativo1.comboTemas()") > 0) | ||
380 | + {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove("i3GEOF.graficointerativo1.comboTemas()");} | ||
381 | + }; | ||
382 | + YAHOO.util.Event.addListener(janela[0].close, "click", temp); | ||
383 | + if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.graficointerativo1.comboTemas()") < 0) | ||
384 | + {i3GEO.eventos.ATUALIZAARVORECAMADAS.push("i3GEOF.graficointerativo1.comboTemas()");} | ||
385 | + } | ||
386 | + }, | ||
387 | + /* | ||
388 | + Function: ativaFoco | ||
389 | + | ||
390 | + Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado | ||
391 | + */ | ||
392 | + ativaFoco: function(){ | ||
393 | + if(i3GEO.Interface){ | ||
394 | + i3GEO.barraDeBotoes.ativaIcone("graficointerativo1"); | ||
395 | + } | ||
396 | + var i = $i("i3GEOF.graficointerativo1_c").style; | ||
397 | + i3GEO.janela.ULTIMOZINDEX++; | ||
398 | + i.zIndex = i3GEO.janela.ULTIMOZINDEX; | ||
399 | + }, | ||
400 | + novaJanela: function(){ | ||
401 | + var janela = "", | ||
402 | + divid, | ||
403 | + g = $i("i3GEOgraficointerativo1Grafico"), | ||
404 | + v = g.cloneNode(true), | ||
405 | + cabecalho = function(){}, | ||
406 | + id = YAHOO.util.Dom.generateId(), | ||
407 | + minimiza = function(){ | ||
408 | + i3GEO.janela.minimiza(id); | ||
409 | + }, | ||
410 | + titulo = " "+i3GEOF.graficointerativo1.titulo; | ||
411 | + janela = i3GEO.janela.cria( | ||
412 | + "380px", | ||
413 | + "280px", | ||
414 | + "", | ||
415 | + "", | ||
416 | + "", | ||
417 | + titulo, | ||
418 | + id, | ||
419 | + false, | ||
420 | + "hd", | ||
421 | + cabecalho, | ||
422 | + minimiza | ||
423 | + ); | ||
424 | + divid = janela[2].id; | ||
425 | + $i(divid).style.marginTop = "0px"; | ||
426 | + v = g.cloneNode(true); | ||
427 | + v.id = id+"ngrafico"; | ||
428 | + v.style.marginTop = "0px"; | ||
429 | + $i(divid).appendChild(v); | ||
430 | + }, | ||
431 | + /* | ||
432 | + Function: comboTemas | ||
433 | + | ||
434 | + Monta o combo para escolha do tema que será utilizado no gráfico | ||
435 | + */ | ||
436 | + comboTemas: function(){ | ||
437 | + if(!i3GEO.Interface){return;} | ||
438 | + i3GEO.util.comboTemas( | ||
439 | + "i3GEOgraficointerativo1ComboTemasId", | ||
440 | + function(retorno){ | ||
441 | + $i("i3GEOgraficointerativo1ComboTemas").innerHTML = retorno.dados; | ||
442 | + $i("i3GEOgraficointerativo1ComboTemas").style.display = "block"; | ||
443 | + if ($i("i3GEOgraficointerativo1ComboTemasId")){ | ||
444 | + $i("i3GEOgraficointerativo1ComboTemasId").onchange = function(){ | ||
445 | + i3GEO.mapa.ativaTema($i("i3GEOgraficointerativo1ComboTemasId").value); | ||
446 | + i3GEOF.graficointerativo1.comboItensSel(); | ||
447 | + }; | ||
448 | + } | ||
449 | + if(i3GEO.temaAtivo !== ""){ | ||
450 | + $i("i3GEOgraficointerativo1ComboTemasId").value = i3GEO.temaAtivo; | ||
451 | + $i("i3GEOgraficointerativo1ComboTemasId").onchange.call(); | ||
452 | + } | ||
453 | + }, | ||
454 | + "i3GEOgraficointerativo1ComboTemas", | ||
455 | + "", | ||
456 | + false, | ||
457 | + "ligados", | ||
458 | + "font-size:12px;width:350px" | ||
459 | + ); | ||
460 | + }, | ||
461 | + /* | ||
462 | + Function: ativaTipo | ||
463 | + | ||
464 | + Define a variável com o tipo de gráfico e mostra a guia 2 | ||
465 | + */ | ||
466 | + ativaTipo: function(obj){ | ||
467 | + i3GEOF.graficointerativo1.tipo = obj.value; | ||
468 | + if($i("i3GEOgraficointerativo1Grafico").innerHTML === "" || $i("i3GEOgraficointerativo1tabeladados").innerHTML == "") | ||
469 | + {$i("i3GEOgraficointerativo1guia2").onclick.call();} | ||
470 | + else | ||
471 | + {$i("i3GEOgraficointerativo1guia4").onclick.call();} | ||
472 | + }, | ||
473 | + /* | ||
474 | + Function: configuraDados | ||
475 | + | ||
476 | + Configura o formulário para obtenção dos dados para cada tipo de gráfico | ||
477 | + */ | ||
478 | + configuraDados: function(){ | ||
479 | + var ativa = function(comboxlinha,comboylinha,ajudapizza){ | ||
480 | + try{ | ||
481 | + $i("i3GEOgraficointerativo1ComboXlinha").style.display = comboxlinha; | ||
482 | + $i("i3GEOgraficointerativo1ComboYlinha").style.display = comboylinha; | ||
483 | + $i("i3GEOgraficointerativo1AjudaPizza").style.display = ajudapizza; | ||
484 | + }catch(e){} | ||
485 | + }; | ||
486 | + if (i3GEOF.graficointerativo1.tipo === ""){ | ||
487 | + i3GEO.janela.tempoMsg("Escolha um tipo de grafico"); | ||
488 | + i3GEO.guias.mostraGuiaFerramenta("i3GEOgraficointerativo1guia1","i3GEOgraficointerativo1guia"); | ||
489 | + return; | ||
490 | + } | ||
491 | + if(i3GEOF.graficointerativo1.tipo === "pizza2d"){ | ||
492 | + ativa.call("block","block","block"); | ||
493 | + } | ||
494 | + }, | ||
495 | + /* | ||
496 | + Function: comboItensSel | ||
497 | + | ||
498 | + Cria um combo para selecionar os itens do tema escolhido | ||
499 | + | ||
500 | + Veja: | ||
501 | + | ||
502 | + <i3GEO.util.comboItens> | ||
503 | + */ | ||
504 | + comboItensSel: function(){ | ||
505 | + var tema = $i("i3GEOgraficointerativo1ComboTemasId").value; | ||
506 | + i3GEO.util.comboItens( | ||
507 | + "i3GEOgraficointerativo1ComboXid", | ||
508 | + tema, | ||
509 | + function(retorno){ | ||
510 | + if(retorno.tipo === "erro"){ | ||
511 | + $i("i3GEOgraficointerativo1ComboX").innerHTML = "<br><br><span style='color:red'>erro ao ler os itens do tema de origem</span><br><br>"; | ||
512 | + $i("i3GEOgraficointerativo1ComboY").innerHTML = "<br><br><span style='color:red'>erro ao ler os itens do tema de origem</span><br><br>"; | ||
513 | + } | ||
514 | + else{ | ||
515 | + $i("i3GEOgraficointerativo1ComboY").innerHTML = retorno.dados + " <input title='Digite o título' class=digitar type=text size=20 id=i3GEOgraficointerativo1ComboYidTitulo value='' />"; | ||
516 | + $i("i3GEOgraficointerativo1ComboXid").id = "i3GEOgraficointerativo1ComboYid"; | ||
517 | + $i("i3GEOgraficointerativo1ComboX").innerHTML = retorno.dados + " <input title='Digite o título' class=digitar type=text size=20 id=i3GEOgraficointerativo1ComboXidTitulo value='' />"; | ||
518 | + $i("i3GEOgraficointerativo1ComboXid").style.width = "160px"; | ||
519 | + $i("i3GEOgraficointerativo1ComboYid").style.width = "160px"; | ||
520 | + $i("i3GEOgraficointerativo1ComboXid").onchange = function(){ | ||
521 | + var combo = $i("i3GEOgraficointerativo1ComboXid"); | ||
522 | + $i("i3GEOgraficointerativo1ComboXidTitulo").value = combo.options[combo.selectedIndex].label; | ||
523 | + }; | ||
524 | + $i("i3GEOgraficointerativo1ComboYid").onchange = function(){ | ||
525 | + var combo = $i("i3GEOgraficointerativo1ComboYid"); | ||
526 | + $i("i3GEOgraficointerativo1ComboYidTitulo").value = combo.options[combo.selectedIndex].label; | ||
527 | + }; | ||
528 | + } | ||
529 | + }, | ||
530 | + "i3GEOgraficointerativo1ComboX", | ||
531 | + "" | ||
532 | + ); | ||
533 | + }, | ||
534 | + /* | ||
535 | + Function: obterDados | ||
536 | + | ||
537 | + Obtém os dados que serão utilizados no gráfico | ||
538 | + | ||
539 | + Veja: | ||
540 | + | ||
541 | + <GRAFICOSELECAO> | ||
542 | + */ | ||
543 | + obterDados: function(){ | ||
544 | + if(!i3GEO.Interface){ | ||
545 | + return; | ||
546 | + } | ||
547 | + if(i3GEOF.graficointerativo1.aguarde.visibility === "visible") | ||
548 | + {return;} | ||
549 | + var tema = $i("i3GEOgraficointerativo1ComboTemasId").value, | ||
550 | + x = $i("i3GEOgraficointerativo1ComboXid").value, | ||
551 | + y = $i("i3GEOgraficointerativo1ComboYid").value, | ||
552 | + excluir = $i("i3GEOgraficointerativo1excluir").value, | ||
553 | + p = i3GEO.configura.locaplic+"/ferramentas/graficointerativo1/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=graficoSelecao&tema="+tema+"&itemclasses="+x+"&itemvalores="+y+"&exclui="+excluir+"&ext="+i3GEO.parametros.mapexten, | ||
554 | + cp = new cpaint(), | ||
555 | + tipo = $i("i3GEOgraficointerativo1TipoAgregacao").value, | ||
556 | + ordenax = "sim", | ||
557 | + monta; | ||
558 | + | ||
559 | + if($i("i3GEOgraficointerativo1DadosPuros").checked) | ||
560 | + {tipo = "nenhum";} | ||
561 | + else{ | ||
562 | + if(x === y) | ||
563 | + {tipo = "conta";} | ||
564 | + } | ||
565 | + if(!$i("i3GEOgraficointerativo1OrdenaX").checked) | ||
566 | + {ordenax = "nao";} | ||
567 | + | ||
568 | + if(tema === "") | ||
569 | + {i3GEO.janela.tempoMsg("Escolha um tema");return;} | ||
570 | + if(x === "") | ||
571 | + {i3GEO.janela.tempoMsg("Escolha um item para X");return;} | ||
572 | + if(y === "") | ||
573 | + {i3GEO.janela.tempoMsg("Escolha um item para Y");return;} | ||
574 | + monta = function(retorno){ | ||
575 | + i3GEOF.graficointerativo1.aguarde.visibility = "hidden"; | ||
576 | + i3GEOF.graficointerativo1.montaTabelaDados(retorno); | ||
577 | + $i("i3GEOgraficointerativo1guia4").onclick.call(); | ||
578 | + i3GEO.janela.tempoMsg("Os dados utilizados referem-se apenas à região atual mostrada no mapa"); | ||
579 | + }; | ||
580 | + i3GEOF.graficointerativo1.aguarde.visibility = "visible"; | ||
581 | + cp.set_response_type("JSON"); | ||
582 | + cp.call(p+"&tipo="+tipo+"&ordenax="+ordenax,"graficoSelecao",monta); | ||
583 | + }, | ||
584 | + /* | ||
585 | + Function: montaTabelaDados | ||
586 | + | ||
587 | + Monta a tabela com os dados que serão utilizados no gráfico | ||
588 | + | ||
589 | + Parametro: | ||
590 | + | ||
591 | + retorno {JSON} - dados no formato JSON | ||
592 | + */ | ||
593 | + montaTabelaDados: function(retorno){ | ||
594 | + var dados, | ||
595 | + n, | ||
596 | + v, | ||
597 | + ins = [], | ||
598 | + i, | ||
599 | + id, | ||
600 | + cor = "#C11515"; | ||
601 | + if(!retorno.dados && retorno.data != undefined) | ||
602 | + {dados = retorno.data.dados;} | ||
603 | + else | ||
604 | + {dados = retorno;} | ||
605 | + n = dados.length; | ||
606 | + ins.push("<p class=paragrafo >Tabela de dados para o gráfico. Os valores podem ser editados</p><table class=lista4 id=i3GEOgraficointerativo1tabeladados ><tr><td></td>"); | ||
607 | + ins.push("<td style=background-color:yellow > <img style=cursor:pointer onclick='i3GEOF.graficointerativo1.ordenaColuna(this,1)' src='"+i3GEO.configura.locaplic+"/imagens/ordena1.gif' title='ordena' /> nome</td>"); | ||
608 | + ins.push("<td style=background-color:yellow > <img style=cursor:pointer onclick='i3GEOF.graficointerativo1.ordenaColuna(this,2)' src='"+i3GEO.configura.locaplic+"/imagens/ordena1.gif' title='ordena' /> valor</td>"); | ||
609 | + ins.push("<td style=background-color:yellow >cor</td><td></td></tr>"); | ||
610 | + for (i=1;i<n; i++){ | ||
611 | + v = dados[i].split(";"); | ||
612 | + v[0] = v[0].replace("'",""); | ||
613 | + v[0] = v[0].replace("'",""); | ||
614 | + //ins += v[0]+" "+v[1]; | ||
615 | + id = "i3GEOgraficointerativo1Dados"+i; //layer+indice da classe | ||
616 | + ins.push("<tr><td>"); | ||
617 | + ins.push("<img style='cursor:pointer' title='clique para excluir' onclick='i3GEOF.graficointerativo1.excluilinha(this)' src='"+i3GEO.configura.locaplic+"/imagens/x.gif' title='excluir' /></td>"); | ||
618 | + ins.push("</td><td>"); | ||
619 | + ins.push($inputText("","",id+"_nome","digite o novo nome",20,v[0],"nome")); | ||
620 | + ins.push("</td><td>"); | ||
621 | + ins.push($inputText("","",id+"_valor","digite o novo valor",12,v[1],"valor")); | ||
622 | + ins.push("</td><td>"); | ||
623 | + if($i("i3GEOgraficointerativo1CoresA").checked){ | ||
624 | + cor = i3GEO.util.rgb2hex(i3GEO.util.randomRGB()); | ||
625 | + } | ||
626 | + //verifica se no objeto com os dados existe um terceiro valor com as cores | ||
627 | + if(v[2]){ | ||
628 | + cor = i3GEO.util.rgb2hex(v[2]); | ||
629 | + } | ||
630 | + ins.push($inputText("","",id+"_cor","",12,cor,"cor")); | ||
631 | + ins.push("</td><td>"); | ||
632 | + ins.push("<img alt='aquarela.gif' style=cursor:pointer src='"+i3GEO.configura.locaplic+"/imagens/aquarela.gif' onclick='i3GEOF.graficointerativo1.corj(\""+id+"_cor\")' />"); | ||
633 | + ins.push("</td></tr>"); | ||
634 | + } | ||
635 | + ins.push("</table><br>"); | ||
636 | + $i("i3GEOgraficointerativo1Dados").innerHTML = ins.join(""); | ||
637 | + }, | ||
638 | + /* | ||
639 | + Function: tabela2csv | ||
640 | + | ||
641 | + Obtém os dados da tabela em CSV | ||
642 | + */ | ||
643 | + tabela2csv: function(){ | ||
644 | + var inputs = $i("i3GEOgraficointerativo1Dados").getElementsByTagName("input"), | ||
645 | + ninputs = inputs.length, | ||
646 | + i, | ||
647 | + legendaX = "", | ||
648 | + legendaY = "", | ||
649 | + csv = []; | ||
650 | + if($i("i3GEOgraficointerativo1ComboXid")) | ||
651 | + {legendaX = $i("i3GEOgraficointerativo1ComboXid").value;} | ||
652 | + if($i("i3GEOgraficointerativo1ComboYid")) | ||
653 | + {legendaY = $i("i3GEOgraficointerativo1ComboYid").value;} | ||
654 | + csv.push(legendaX+";"+legendaY); | ||
655 | + for(i=0;i<ninputs;i = i + 3){ | ||
656 | + csv.push(inputs[i].value+";"+inputs[i+1].value * 1); | ||
657 | + } | ||
658 | + return csv; | ||
659 | + }, | ||
660 | + /* | ||
661 | + Function: tabela2dados | ||
662 | + | ||
663 | + Obtém os dados da tabela para compor o gráfico | ||
664 | + */ | ||
665 | + tabela2dados: function(){ | ||
666 | + var temp = 0, | ||
667 | + ultimo = 0, | ||
668 | + inputs = $i("i3GEOgraficointerativo1Dados").getElementsByTagName("input"), | ||
669 | + ninputs = inputs.length, | ||
670 | + n, | ||
671 | + i, | ||
672 | + parametros = [], | ||
673 | + valores = [], | ||
674 | + valoresS = [], | ||
675 | + acumulado = [], | ||
676 | + acum, | ||
677 | + nomes = [], | ||
678 | + cores = [], | ||
679 | + indice = "", | ||
680 | + titulo = "", | ||
681 | + par = [], | ||
682 | + parcor = [], | ||
683 | + soma = 0, | ||
684 | + total = 0, | ||
685 | + menor = inputs[1].value * 1, | ||
686 | + maior = 0, | ||
687 | + menorNome = inputs[0].value * 1, | ||
688 | + maiorNome = 0, | ||
689 | + alpha = 0.8, | ||
690 | + stroke = 2, | ||
691 | + gradient = true, | ||
692 | + tituloSize = "15px", | ||
693 | + tituloCor = "#000000", | ||
694 | + tituloAlinhamento = "center", | ||
695 | + corunica = "#C11515", | ||
696 | + outlinecolor = "#577261", | ||
697 | + corGrid = "#D7E4A3", | ||
698 | + divisoesY = 10, | ||
699 | + rotacaoX = 270, | ||
700 | + legendaX = "", | ||
701 | + legendaY = "", | ||
702 | + fill = "#C4B86A", | ||
703 | + pointSize = 4; | ||
704 | + if($i("i3GEOgraficointerativo1ComboTemasId")){ | ||
705 | + indice = $i("i3GEOgraficointerativo1ComboTemasId").options.selectedIndex; | ||
706 | + titulo = $i("i3GEOgraficointerativo1ComboTemasId").options[indice].text; | ||
707 | + } | ||
708 | + if(i3GEOF.graficointerativo1.titulo != "") | ||
709 | + {titulo = i3GEOF.graficointerativo1.titulo;} | ||
710 | + if($i("i3GEOgraficointerativo1ComboXid")) | ||
711 | + {legendaX = $i("i3GEOgraficointerativo1ComboXidTitulo").value;} | ||
712 | + if($i("i3GEOgraficointerativo1ComboYid")) | ||
713 | + {legendaY = $i("i3GEOgraficointerativo1ComboYidTitulo").value;} | ||
714 | + for(i=0;i<ninputs;i = i + 3){ | ||
715 | + temp = inputs[i+1].value * 1; | ||
716 | + total += temp; | ||
717 | + } | ||
718 | + for(i=0;i<ninputs;i = i + 3){ | ||
719 | + nomes.push(inputs[i].value+" "); | ||
720 | + cores.push(inputs[i+2].value); | ||
721 | + temp = inputs[i+1].value * 1; | ||
722 | + valores.push(temp); | ||
723 | + valoresS.push(temp+" "); | ||
724 | + acum = ultimo + temp; | ||
725 | + acumulado.push(acum); | ||
726 | + ultimo = ultimo + temp; | ||
727 | + soma += temp; | ||
728 | + if(temp > maior) | ||
729 | + {maior = temp;} | ||
730 | + if(temp < menor) | ||
731 | + {menor = temp;} | ||
732 | + temp = inputs[i].value * 1; | ||
733 | + if(temp > maiorNome) | ||
734 | + {maiorNome = temp;} | ||
735 | + if(temp < menorNome) | ||
736 | + {menorNome = temp;} | ||
737 | + par.push({"value":inputs[i+1].value * 1,"label":inputs[i].value+" "}); | ||
738 | + | ||
739 | + temp = inputs[i+1].value * 1; | ||
740 | + if($i("i3GEOgraficointerativo1Acumula").checked) | ||
741 | + {temp = acum;} | ||
742 | + if($i("i3GEOgraficointerativo1Relativa").checked) | ||
743 | + {temp = (temp * 100) / total;} | ||
744 | + parcor.push({"colour":inputs[i+2].value,"value":temp,"label":inputs[i].value+" "}); | ||
745 | + } | ||
746 | + if($i("i3GEOgraficointerativo1Acumula").checked){ | ||
747 | + valores = acumulado; | ||
748 | + maior = soma; | ||
749 | + } | ||
750 | + if(legendaX == legendaY){ | ||
751 | + menor = 0; | ||
752 | + legendaX += " (casos)"; | ||
753 | + legendaY += " (n. de casos)"; | ||
754 | + } | ||
755 | + if($i("i3GEOgraficointerativo1Relativa").checked){ | ||
756 | + n = valores.length; | ||
757 | + for(i=0;i<n;i++){ | ||
758 | + valores[i] = (valores[i] * 100) / soma; | ||
759 | + } | ||
760 | + maior = 100; | ||
761 | + menor = 0; | ||
762 | + } | ||
763 | + if(i3GEOF.graficointerativo1.tipo === "pizza2d"){ | ||
764 | + parametros = { | ||
765 | + "elements":[{ | ||
766 | + "type": "pie", | ||
767 | + "start-angle": 180, | ||
768 | + "colours": cores, | ||
769 | + "alpha": alpha, | ||
770 | + "stroke": stroke, | ||
771 | + "animate": 1, | ||
772 | + "values" : par, | ||
773 | + "tip": "#val# de #total#<br>#percent# de 100%", | ||
774 | + "gradient-fill": gradient | ||
775 | + }], | ||
776 | + "title":{ | ||
777 | + "text": titulo, | ||
778 | + "style": "{font-size: "+tituloSize+"; color:"+tituloCor+"; text-align: "+tituloAlinhamento+";}" | ||
779 | + }, | ||
780 | + "num_decimals": 2, | ||
781 | + "is_fixed_num_decimals_forced": true, | ||
782 | + "is_decimal_separator_comma": true, | ||
783 | + "is_thousand_separator_disabled": true, | ||
784 | + "x_axis": null | ||
785 | + }; | ||
786 | + } | ||
787 | + if(i3GEOF.graficointerativo1.tipo === "line" || i3GEOF.graficointerativo1.tipo === "scatter" || i3GEOF.graficointerativo1.tipo === "hbar" || i3GEOF.graficointerativo1.tipo === "area" || i3GEOF.graficointerativo1.tipo === "bar_round" || i3GEOF.graficointerativo1.tipo === "bar_round_glass" || i3GEOF.graficointerativo1.tipo === "bar_filled" || i3GEOF.graficointerativo1.tipo === "bar_glass" || i3GEOF.graficointerativo1.tipo === "bar_3d" || i3GEOF.graficointerativo1.tipo === "bar_sketch" || i3GEOF.graficointerativo1.tipo === "bar_cylinder" || i3GEOF.graficointerativo1.tipo === "bar_cylinder_outline"){ | ||
788 | + temp = valores; | ||
789 | + if(i3GEOF.graficointerativo1.tipo === "line" || i3GEOF.graficointerativo1.tipo === "scatter" || i3GEOF.graficointerativo1.tipo === "area") | ||
790 | + {temp = parcor;} | ||
791 | + parametros = { | ||
792 | + "elements":[ | ||
793 | + { | ||
794 | + "type": i3GEOF.graficointerativo1.tipo, | ||
795 | + "start-angle": 180, | ||
796 | + "colour": corunica, | ||
797 | + "outlinecolor": outlinecolor, | ||
798 | + "alpha": alpha, | ||
799 | + "stroke": stroke, | ||
800 | + "animate": 1, | ||
801 | + "values" : temp, | ||
802 | + "tip": "#val#", | ||
803 | + "gradient-fill": gradient, | ||
804 | + "fill": fill, | ||
805 | + "fill-alpha": alpha, | ||
806 | + "dot-style": { "type": "solid-dot", "colour": "#9C0E57", "dot-size": pointSize } | ||
807 | + } | ||
808 | + ], | ||
809 | + "x_axis": { | ||
810 | + "colour": "#A2ACBA", | ||
811 | + "grid-colour": corGrid, | ||
812 | + "offset": true, | ||
813 | + "steps": 1, | ||
814 | + "labels": { | ||
815 | + "steps": 1, | ||
816 | + "rotate": rotacaoX, | ||
817 | + "colour": "#000000", | ||
818 | + "labels": nomes | ||
819 | + } | ||
820 | + }, | ||
821 | + "y_axis": { | ||
822 | + "min": menor, | ||
823 | + "max": maior, | ||
824 | + "steps": parseInt((parseInt(maior - menor,10) / divisoesY),10) | ||
825 | + }, | ||
826 | + "x_legend": { | ||
827 | + "text": legendaX, | ||
828 | + "style": "{font-size: 12px; color: #778877}" | ||
829 | + }, | ||
830 | + "y_legend": { | ||
831 | + "text": legendaY, | ||
832 | + "style": "{font-size: 12px; color: #778877}" | ||
833 | + }, | ||
834 | + "title":{ | ||
835 | + "text": titulo, | ||
836 | + "style": "{font-size: "+tituloSize+"; color:"+tituloCor+"; text-align: "+tituloAlinhamento+";}" | ||
837 | + } | ||
838 | + }; | ||
839 | + if($i("i3GEOgraficointerativo1AdLinhas").checked){ | ||
840 | + parametros.elements.push({ | ||
841 | + "type": "line", | ||
842 | + "colour": "#FFFFFF", | ||
843 | + "start-angle": 180, | ||
844 | + "alpha": 0, | ||
845 | + "stroke": 0, | ||
846 | + "width": 0, | ||
847 | + "animate": 1, | ||
848 | + "values" : parcor, | ||
849 | + "dot-style": { "type": "solid-dot", "colour": "#9C0E57", "dot-size": pointSize } | ||
850 | + }); | ||
851 | + } | ||
852 | + if(i3GEOF.graficointerativo1.tipo === "hbar"){ | ||
853 | + n = valores.length; | ||
854 | + temp = []; | ||
855 | + for(i=0;i<n;i++){ | ||
856 | + temp.push({"left":0,right:valores[i]}); | ||
857 | + } | ||
858 | + parametros.elements[0].values = temp; | ||
859 | + | ||
860 | + parametros.x_axis = { | ||
861 | + "min": 0, | ||
862 | + "max": maior, | ||
863 | + "steps": parseInt((maior / divisoesY),10) | ||
864 | + }; | ||
865 | + parametros.y_axis = { | ||
866 | + "offset": 1, | ||
867 | + "labels": nomes | ||
868 | + }; | ||
869 | + parametros.x_legend.text = legendaY; | ||
870 | + parametros.y_legend.text = legendaX; | ||
871 | + } | ||
872 | + if(i3GEOF.graficointerativo1.tipo === "scatter"){ | ||
873 | + n = valores.length; | ||
874 | + temp = []; | ||
875 | + for(i=0;i<n;i++){ | ||
876 | + temp.push({"x":nomes[i],"y":valores[i]}); | ||
877 | + } | ||
878 | + parametros.elements[0].values = temp; | ||
879 | + parametros.x_axis = { | ||
880 | + "min": menor, | ||
881 | + "max": maior, | ||
882 | + "steps": parseInt(((maior - menor) / divisoesY),10) | ||
883 | + }; | ||
884 | + parametros.x_axis = { | ||
885 | + "min": menorNome, | ||
886 | + "max": maiorNome, | ||
887 | + "steps": parseInt(((maiorNome - menorNome) / divisoesY),10) | ||
888 | + }; | ||
889 | + parametros.elements[0].tip = "#x# - #y#"; | ||
890 | + } | ||
891 | + } | ||
892 | + if(i3GEOF.graficointerativo1.tipo === "radar"){ | ||
893 | + parametros = { | ||
894 | + "elements": [{ | ||
895 | + "type": "area", | ||
896 | + "width": 1, | ||
897 | + "dot-style": { "type": "anchor", "colour": "#9C0E57", "dot-size": pointSize }, | ||
898 | + "colour": "#45909F", | ||
899 | + "fill": "#45909F", | ||
900 | + "fill-alpha": 0.4, | ||
901 | + "loop": true, | ||
902 | + "values": parcor | ||
903 | + }], | ||
904 | + "radar_axis": { | ||
905 | + "max": maior, | ||
906 | + "steps": parseInt(((maior - menor) / divisoesY),10), | ||
907 | + "colour": "#EFD1EF", | ||
908 | + "grid-colour": "#EFD1EF", | ||
909 | + "spoke-labels": { | ||
910 | + "labels": nomes, | ||
911 | + "colour": "#9F819F" | ||
912 | + } | ||
913 | + }, | ||
914 | + "title":{ | ||
915 | + "text": titulo, | ||
916 | + "style": "{font-size: "+tituloSize+"; color:"+tituloCor+"; text-align: "+tituloAlinhamento+";}" | ||
917 | + }, | ||
918 | + "bg_colour": "#DFFFEC" | ||
919 | + }; | ||
920 | + } | ||
921 | + return( JSON1.stringify(parametros)); | ||
922 | + }, | ||
923 | + /* | ||
924 | + Function: excluilinha | ||
925 | + | ||
926 | + Exclui uma linha da tabela de dados | ||
927 | + */ | ||
928 | + excluilinha: function(celula){ | ||
929 | + var p = celula.parentNode.parentNode; | ||
930 | + do{ | ||
931 | + p.removeChild(p.childNodes[0]); | ||
932 | + } while (p.childNodes.length > 0); | ||
933 | + p.parentNode.removeChild(p); | ||
934 | + }, | ||
935 | + /* | ||
936 | + Function: corj | ||
937 | + | ||
938 | + Abre a janela para o usuário selecionar uma cor interativamente | ||
939 | + */ | ||
940 | + corj: function(obj) | ||
941 | + {i3GEO.util.abreCor("",obj,"hex");}, | ||
942 | + /* | ||
943 | + Function: ordenaColuna | ||
944 | + | ||
945 | + Ordena uma coluna da tabela | ||
946 | + */ | ||
947 | + ordenaColuna: function(coluna,cid){ | ||
948 | + try{ | ||
949 | + var tabela = $i("i3GEOgraficointerativo1Dados").getElementsByTagName("table")[0], | ||
950 | + trs = tabela.getElementsByTagName("tr"), | ||
951 | + ntrs = trs.length, | ||
952 | + psort = [], | ||
953 | + t, | ||
954 | + psortfim, | ||
955 | + npsortfim, | ||
956 | + ins, | ||
957 | + p, | ||
958 | + e, | ||
959 | + temp, | ||
960 | + chaves = [], | ||
961 | + numero = false; | ||
962 | + | ||
963 | + function sortNumber(a,b) | ||
964 | + {return a - b;} | ||
965 | + for (t=1;t<ntrs;t++) | ||
966 | + { | ||
967 | + temp = trs[t].childNodes[cid]; | ||
968 | + if (temp){ | ||
969 | + psort.push(temp.childNodes[0].value); | ||
970 | + chaves[temp.childNodes[0].value] = t; | ||
971 | + if(temp.childNodes[0].value *1) | ||
972 | + {numero = true;} | ||
973 | + } | ||
974 | + } | ||
975 | + //recosntroi a tabela | ||
976 | + if(numero) | ||
977 | + {psortfim = psort.sort(sortNumber);} | ||
978 | + else | ||
979 | + {psortfim = psort.sort();} | ||
980 | + ins = "<tr>" + trs[0].innerHTML + "</tr>"; | ||
981 | + npsortfim = psortfim.length; | ||
982 | + for (p=0;p<npsortfim;p++) | ||
983 | + { | ||
984 | + e = chaves[psortfim[p]]; | ||
985 | + //e = psortfim[p].split("+")[1] * 1; | ||
986 | + if (trs[e] !== undefined) | ||
987 | + {ins += "<tr>" + trs[e].innerHTML + "</tr>";} | ||
988 | + } | ||
989 | + tabela.innerHTML = ins; | ||
990 | + } | ||
991 | + catch(e){} | ||
992 | + }, | ||
993 | + /* | ||
994 | + Function: ativaNavegacao | ||
995 | + | ||
996 | + Ativa ou desativa a atualização automática ao navegar no mapa | ||
997 | + */ | ||
998 | + ativaNavegacao: function(obj){ | ||
999 | + if(!i3GEO.Interface){ | ||
1000 | + return; | ||
1001 | + } | ||
1002 | + if(obj === true){ | ||
1003 | + if(i3GEO.Interface.ATUAL !== "googlemaps" && i3GEO.Interface.ATUAL !== "googleearth"){ | ||
1004 | + i3GEO.eventos.NAVEGAMAPA.push("i3GEOF.graficointerativo1.obterDados()"); | ||
1005 | + } | ||
1006 | + if(i3GEO.Interface.ATUAL === "googlemaps"){ | ||
1007 | + graficointerativo1Dragend = GEvent.addListener(i3GeoMap, "dragend", function() {i3GEOF.graficointerativo1.obterDados();}); | ||
1008 | + graficointerativo1Zoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {i3GEOF.graficointerativo1.obterDados();}); | ||
1009 | + } | ||
1010 | + if(i3GEO.Interface.ATUAL === "googleearth"){ | ||
1011 | + graficointerativo1Dragend = google.earth.addEventListener(i3GeoMap.getView(), "viewchangeend", function() {i3GEOF.graficointerativo1.obterDados();}); | ||
1012 | + } | ||
1013 | + } | ||
1014 | + else{ | ||
1015 | + if(i3GEO.Interface.ATUAL !== "googlemaps" && i3GEO.Interface.ATUAL !== "googleearth"){ | ||
1016 | + i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.graficointerativo1.obterDados()"); | ||
1017 | + } | ||
1018 | + if(i3GEO.Interface.ATUAL === "googlemaps"){ | ||
1019 | + GEvent.removeListener(graficointerativo1Dragend); | ||
1020 | + GEvent.removeListener(graficointerativo1Zoomend); | ||
1021 | + } | ||
1022 | + if(i3GEO.Interface.ATUAL === "googleearth"){ | ||
1023 | + google.earth.removeEventListener(graficointerativo1Dragend); | ||
1024 | + } | ||
1025 | + } | ||
1026 | + } | ||
1027 | +}; | ||
1028 | +//pacotes/openflashchart/json2.js | ||
1029 | +if (!this.JSON1) { | ||
1030 | + JSON1 = function () { | ||
1031 | + | ||
1032 | + function f(n) { // Format integers to have at least two digits. | ||
1033 | + return n < 10 ? '0' + n : n; | ||
1034 | + } | ||
1035 | + Date.prototype.toJSON = function () { | ||
1036 | + return this.getUTCFullYear() + '-' + | ||
1037 | + f(this.getUTCMonth() + 1) + '-' + | ||
1038 | + f(this.getUTCDate()) + 'T' + | ||
1039 | + f(this.getUTCHours()) + ':' + | ||
1040 | + f(this.getUTCMinutes()) + ':' + | ||
1041 | + f(this.getUTCSeconds()) + 'Z'; | ||
1042 | + }; | ||
1043 | + var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g, | ||
1044 | + gap, | ||
1045 | + indent, | ||
1046 | + meta = { // table of character substitutions | ||
1047 | + '\b': '\\b', | ||
1048 | + '\t': '\\t', | ||
1049 | + '\n': '\\n', | ||
1050 | + '\f': '\\f', | ||
1051 | + '\r': '\\r', | ||
1052 | + '"' : '\\"', | ||
1053 | + '\\': '\\\\' | ||
1054 | + }, | ||
1055 | + rep; | ||
1056 | + function quote(string) { | ||
1057 | + return escapeable.test(string) ? | ||
1058 | + '"' + string.replace(escapeable, function (a) { | ||
1059 | + var c = meta[a]; | ||
1060 | + if (typeof c === 'string') { | ||
1061 | + return c; | ||
1062 | + } | ||
1063 | + c = a.charCodeAt(); | ||
1064 | + return '\\u00' + Math.floor(c / 16).toString(16) + | ||
1065 | + (c % 16).toString(16); | ||
1066 | + }) + '"' : | ||
1067 | + '"' + string + '"'; | ||
1068 | + } | ||
1069 | + function str(key, holder) { | ||
1070 | + var i, // The loop counter. | ||
1071 | + k, // The member key. | ||
1072 | + v, // The member value. | ||
1073 | + length, | ||
1074 | + mind = gap, | ||
1075 | + partial, | ||
1076 | + value = holder[key]; | ||
1077 | + if (value && typeof value === 'object' && | ||
1078 | + typeof value.toJSON === 'function') { | ||
1079 | + value = value.toJSON(key); | ||
1080 | + } | ||
1081 | + if (typeof rep === 'function') { | ||
1082 | + value = rep.call(holder, key, value); | ||
1083 | + } | ||
1084 | + switch (typeof value) { | ||
1085 | + case 'string': | ||
1086 | + return quote(value); | ||
1087 | + | ||
1088 | + case 'number': | ||
1089 | + return isFinite(value) ? String(value) : 'null'; | ||
1090 | + | ||
1091 | + case 'boolean': | ||
1092 | + case 'null': | ||
1093 | + return String(value); | ||
1094 | + case 'object': | ||
1095 | + if (!value) { | ||
1096 | + return 'null'; | ||
1097 | + } | ||
1098 | + gap += indent; | ||
1099 | + partial = []; | ||
1100 | + if (typeof value.length === 'number' && | ||
1101 | + !(value.propertyIsEnumerable('length'))) { | ||
1102 | + length = value.length; | ||
1103 | + for (i = 0; i < length; i += 1) { | ||
1104 | + partial[i] = str(i, value) || 'null'; | ||
1105 | + } | ||
1106 | + v = partial.length === 0 ? '[]' : | ||
1107 | + gap ? '[\n' + gap + partial.join(',\n' + gap) + | ||
1108 | + '\n' + mind + ']' : | ||
1109 | + '[' + partial.join(',') + ']'; | ||
1110 | + gap = mind; | ||
1111 | + return v; | ||
1112 | + } | ||
1113 | + if (typeof rep === 'object') { | ||
1114 | + length = rep.length; | ||
1115 | + for (i = 0; i < length; i += 1) { | ||
1116 | + k = rep[i]; | ||
1117 | + if (typeof k === 'string') { | ||
1118 | + v = str(k, value, rep); | ||
1119 | + if (v) { | ||
1120 | + partial.push(quote(k) + (gap ? ': ' : ':') + v); | ||
1121 | + } | ||
1122 | + } | ||
1123 | + } | ||
1124 | + } else { | ||
1125 | + for (k in value) { | ||
1126 | + v = str(k, value, rep); | ||
1127 | + if (v) { | ||
1128 | + partial.push(quote(k) + (gap ? ': ' : ':') + v); | ||
1129 | + } | ||
1130 | + } | ||
1131 | + } | ||
1132 | + v = partial.length === 0 ? '{}' : | ||
1133 | + gap ? '{\n' + gap + partial.join(',\n' + gap) + | ||
1134 | + '\n' + mind + '}' : | ||
1135 | + '{' + partial.join(',') + '}'; | ||
1136 | + gap = mind; | ||
1137 | + return v; | ||
1138 | + } | ||
1139 | + } | ||
1140 | + return { | ||
1141 | + stringify: function (value, replacer, space) { | ||
1142 | + var i; | ||
1143 | + gap = ''; | ||
1144 | + indent = ''; | ||
1145 | + if (space) { | ||
1146 | + if (typeof space === 'number') { | ||
1147 | + for (i = 0; i < space; i += 1) { | ||
1148 | + indent += ' '; | ||
1149 | + } | ||
1150 | + } else if (typeof space === 'string') { | ||
1151 | + indent = space; | ||
1152 | + } | ||
1153 | + } | ||
1154 | + if (!replacer) { | ||
1155 | + rep = function (key, value) { | ||
1156 | + if (!Object.hasOwnProperty.call(this, key)) { | ||
1157 | + return undefined; | ||
1158 | + } | ||
1159 | + return value; | ||
1160 | + }; | ||
1161 | + } else if (typeof replacer === 'function' || | ||
1162 | + (typeof replacer === 'object' && | ||
1163 | + typeof replacer.length === 'number')) { | ||
1164 | + rep = replacer; | ||
1165 | + } else { | ||
1166 | + throw new Error('JSON.stringify'); | ||
1167 | + } | ||
1168 | + return str('', {'': value}); | ||
1169 | + }, | ||
1170 | + parse: function (text, reviver) { | ||
1171 | + var j; | ||
1172 | + | ||
1173 | + function walk(holder, key) { | ||
1174 | + var k, v, value = holder[key]; | ||
1175 | + if (value && typeof value === 'object') { | ||
1176 | + for (k in value) { | ||
1177 | + if (Object.hasOwnProperty.call(value, k)) { | ||
1178 | + v = walk(value, k); | ||
1179 | + if (v !== undefined) { | ||
1180 | + value[k] = v; | ||
1181 | + } else { | ||
1182 | + delete value[k]; | ||
1183 | + } | ||
1184 | + } | ||
1185 | + } | ||
1186 | + } | ||
1187 | + return reviver.call(holder, key, value); | ||
1188 | + } | ||
1189 | + if (/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/bfnrtu]/g, '@'). | ||
1190 | +replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). | ||
1191 | +replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { | ||
1192 | + j = eval('(' + text + ')'); | ||
1193 | + return typeof reviver === 'function' ? | ||
1194 | + walk({'': j}, '') : j; | ||
1195 | + } | ||
1196 | + throw new SyntaxError('JSON.parse'); | ||
1197 | + }, | ||
1198 | + quote: quote | ||
1199 | + }; | ||
1200 | + }(); | ||
1201 | +} | ||
1202 | + | ||
1203 | + | ||
1204 | + | ||
1205 | + | ||
1206 | +/* SWFObject v2.2 <http://code.google.com/p/swfobject/> | ||
1207 | + is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> | ||
1208 | +*/ | ||
1209 | +swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}(); |