guias.js
44.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
/**
* Title: Guias
*
* Cria e controla os blocos de opções ativados por meio de guias
* ou botões
*
* As guias alternam conteúdos para exibição conforme as escolhas feitas pelo usuário
*
* Namespace:
*
* i3GEO.guias
*
* Veja:
*
* <http://localhost/i3geo/classesjs/classe_guias.js>
*/
/**
* Licença
*
* GPL2
*
* i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
*
* Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com
*
* Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo sob os termos da Licença
* Pública Geral GNU conforme publicada pela Free Software Foundation;
*
* Este programa é distribuído na expectativa de que seja útil, porém, SEM NENHUMA GARANTIA; nem mesmo a
* garantia implícita de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença
* Pública Geral do GNU para mais detalhes. Você deve ter recebido uma cópia da Licença Pública Geral do
* GNU junto com este programa; se não, escreva para a Free Software Foundation, Inc., no endereço 59 Temple Street, Suite
* 330, Boston, MA 02111-1307 USA.
*/
if (typeof (i3GEO) === 'undefined') {
var i3GEO = {};
}
i3GEO.guias =
{
/**
* Variavel: ATUAL
*
* Guia que está ativa ou que será ativada ao iniciar o mapa
*
* O nome da guia é a definida na variável i3GEO.guias.CONFIGURA
*
* Tipo:
*
* {string}
*
* Default:
*
* temas
*/
ATUAL : "temas",
/**
* Propriedade: ALTURACORPOGUIAS
*
* Altura em pixels que será aplicado em cada guia
*
* Por default, a altura é calculada automaticamente, mas em alguns casos, pode ser necessário especificar o valor
* para permitir um melhor ajuste do layout do mapa
*
* Mantenha como 0 para que o cálculo seja automático
*
* Tipo:
*
* {numeric}
*
* Default:
*
* 0
*/
ALTURACORPOGUIAS : 0,
/**
* Propriedade: CONFIGURA
*
* Define os parâmetros de cada guia que será mostrada no mapa, como título, conteúdo, etc.
*
* Você pode modificar o nome de uma guia como no exemplo
*
* i3GEO.guias.CONFIGURA.legenda.titulo = "nome diferente";
*
* Por padrão são definidas as guias legenda, temas, adiciona e mapas (links)
*
* Exemplo:
*
* (start code)
*
* i3GEO.guias.CONFIGURA.legenda = { icone : "imagens/gisicons/show-legend.png", titulo : "Legenda", id : "guia4", idconteudo :
* "guia4obj", click : function() { i3GEO.guias.mostra("legenda"); i3GEO.mapa.legendaHTML.cria("guia4obj"); } };
*
* (end)
*
* Tipo:
*
* {objeto}
*/
CONFIGURA : {
"temas" : {
icone : "imagens/layer.png",
titulo : $trad("g4a"),
id : "guia1",
idconteudo : "guia1obj",
click : ""
},
"adiciona" : {
icone : "imagens/catalogo.png",
titulo : $trad("g1a"),
id : "guia2",
idconteudo : "guia2obj",
click : function() {
var ondeArvore;
i3GEO.guias.mostra("adiciona");
ondeArvore = "arvoreAdicionaTema";
if (!$i("arvoreAdicionaTema")) {
ondeArvore = "guia2obj";
}
// para efeitos de compatibilidade
if (document.getElementById("outrasOpcoesAdiciona")) {
i3GEO.arvoreDeTemas.OPCOESADICIONAIS.idonde = "outrasOpcoesAdiciona";
i3GEO.arvoreDeTemas.OPCOESADICIONAIS.incluiArvore = false;
}
i3GEO.arvoreDeTemas.cria(i3GEO.configura.sid, i3GEO.configura.locaplic, ondeArvore);
}
},
"legenda" : {
icone : "imagens/legenda.png",
titulo : $trad("g3"),
id : "guia4",
idconteudo : "guia4obj",
click : function() {
i3GEO.guias.mostra("legenda");
i3GEO.util.defineValor(i3GEO.mapa.legendaHTML.ID, "innerHTML", "");
i3GEO.mapa.legendaHTML.cria("guia4obj");
}
},
"mapas" : {
icone : "imagens/gisicons/show-links.png",
titulo : "Links",
id : "guia5",
idconteudo : "guia5obj",
mostraLink : function(id, url) {
$i("i3geoMapasLink_" + id).innerHTML = "<a href='" + url + "' target=_blank >" + $trad("abreMapa") + "</a>";
},
click : function(onde) {
if (!onde) {
onde = i3GEO.guias.CONFIGURA.mapas.idconteudo;
}
// TODO retirar os estilos do codigo e incluir em arquivo css
var pegaMapas =
function(retorno) {
var ins, mapa, ig1lt, ig1, nome, lkd, link, temp, combo, urlinterface;
ins = "<br><div id='banners' style='overflow:auto;text-align:center'>";
if (i3GEO.configura.verificaCookieLogin === true) {
ins +=
"<a class='linkMapasEditor' href='" + i3GEO.configura.locaplic
+ "/admin/html/mapas.html' target=_blank >"
+ $trad("x89")
+ "</a><br>";
}
ins += "<br>";
mapa = retorno.data.mapas;
ig1lt = mapa.length;
ig1 = 0;
urlinterface = window.location.origin + window.location.pathname;
if (ig1lt > 0) {
do {
temp = mapa[ig1];
nome = temp.NOME;
if (temp.PUBLICADO) {
if (temp.PUBLICADO.toLowerCase() === "nao") {
nome = "<s>" + nome + "</s>";
}
}
lkd = temp.LINK;
link = i3GEO.configura.locaplic + "/ms_criamapa.php?temasa=" + temp.TEMAS + "&layers=" + temp.LIGADOS;
if (temp.EXTENSAO !== "") {
link += "&mapext=" + temp.EXTENSAO;
}
if (temp.OUTROS !== "") {
link += "&" + temp.OUTROS;
}
if (lkd !== "") {
link = lkd;
}
ins +=
"<div style='cursor:pointer; height: 120px;float: left;width:45%;background-color:white;padding:5px;margin:5px;border: 1px solid #F0F0F0;border-radius: 5px;box-shadow: 1px 1px 1px 1px #D3D3D3;' >";
if (temp.IMAGEM && temp.IMAGEM != "") {
ins +=
"<div style='float:left;margin:2px' ><a href='" + link
+ "' style=text-align:center;text-decoration:none; >"
+ "<img src='"
+ temp.IMAGEM
+ "'></a></div>";
}
// verifica se o mapfile esta salvo no banco
// diretamente
nome += " (" + temp.ID_MAPA + ")";
if (temp.CONTEMMAPFILE == "nao") {
ins +=
"<div class=paragrafo style='text-align:left;'>" + "<a href='"
+ link
+ "' style=text-align:left;text-decoration:none; >"
+ nome
+ "</a></div>";
} else {
// combo de opcoes para abrir os mapas
// salvos
// como mapfiles
// esses links tambem sao colocados em
// admin/php/xml.php geraRSSmapas
combo =
"<select style='width:170px;' onchange='i3GEO.guias.CONFIGURA.mapas.mostraLink(" + ig1
+ ",this.value)'>"
+ "<option value=''>"
+ $trad("x103")
+ ":</option>"
+ "<option value='"
+ link
+ "'>Como foi salvo</option>"
+ "<option value='"
+ link
+ "&interface="
+ urlinterface
+ "'>Com a interface atual</option>"
+ "<option value='"
+ i3GEO.configura.locaplic
+ "/mashups/openlayers.php?numzoomlevels=18&restauramapa="
+ temp.ID_MAPA
+ "&fundo=e_wsm'>Openlayers com todos os botoes</option>"
+ "<option value='"
+ i3GEO.configura.locaplic
+ "/mashups/openlayers.php?numzoomlevels=18&restauramapa="
+ temp.ID_MAPA
+ "&fundo=est_wms'>Sem o fundo</option>"
+ "<option value='"
+ i3GEO.configura.locaplic
+ "/mashups/openlayers.php?numzoomlevels=18&restauramapa="
+ temp.ID_MAPA
+ "&fundo=e_wsm&botoes=legenda pan zoombox zoomtot zoomin zoomout distancia area identifica'>Com botoes principais</option>"
+ "<option value='"
+ i3GEO.configura.locaplic
+ "/mashups/osm.php?numzoomlevels=18&restauramapa="
+ temp.ID_MAPA
+ "&fundo=e_wsm&botoes=legenda pan zoombox zoomtot zoomin zoomout distancia area identifica'>Com botoes principais e OSM</option>"
+ "<option value='"
+ i3GEO.configura.locaplic
+ "/mashups/openlayers.php?numzoomlevels=18&restauramapa="
+ temp.ID_MAPA
+ "&botoes=legenda pan zoombox zoomtot zoomin zoomout'>Botoes de navegacao</option>"
+ "</select>";
ins +=
"<div style='float:left;margin:2px'>" + "<img src='"
+ i3GEO.configura.locaplic
+ "/ferramentas/salvamapa/geraminiatura.php?w=100&h=67&restauramapa="
+ temp.ID_MAPA
+ "'></div><div class=paragrafo style='text-align:left;'><a href='"
+ link
+ "' style=text-align:center;text-decoration:none; >"
+ nome
+ "</a></div>"
+ combo
+ "<br><div style='cursor:pointer;' id='i3geoMapasLink_"
+ ig1
+ "' ></div>";
}
ins += "</div>";
ig1++;
} while (ig1 < ig1lt);
}
$i(onde).innerHTML = ins + "</div>";
};
if ($i(i3GEO.guias.CONFIGURA.mapas.idconteudo)) {
$i(i3GEO.guias.CONFIGURA.mapas.idconteudo).innerHTML = "Aguarde...";
}
i3GEO.guias.mostra("mapas");
i3GEO.php.pegaMapas(pegaMapas);
i3GEO.navega.removeCookieExtensao();
}
},
"dobraPagina" : {
icone : "imagens/googlemaps.png",
titulo : $trad("trocaInterface"),
id : "guia6",
idconteudo : "",
inicializa : function(){
if (i3GEO.Interface.ATUAL === "googlemaps") {
i3GEO.guias.CONFIGURA.dobraPagina.icone = "imagens/openlayers.png";
}
else{
i3GEO.guias.CONFIGURA.dobraPagina.icone = "imagens/googlemaps.png";
}
},
click : function() {
i3GEO.Interface.atual2gm.insereIcone = false;
i3GEO.Interface.atual2ol.insereIcone = false;
if (i3GEO.Interface.ATUAL === "googlemaps") {
if (typeof i3GeoMap.getStreetView != "undefined"){
if(i3GeoMap.getStreetView().getVisible() === true) {
i3GeoMap.getStreetView().setVisible(false);
}
}
i3GEO.Interface.atual2ol.inicia();
i3GEO.guias.CONFIGURA.dobraPagina.icone = "imagens/googlemaps.png";
}
if (i3GEO.Interface.ATUAL === "openlayers") {
i3GEO.Interface.atual2gm.inicia();
i3GEO.guias.CONFIGURA.dobraPagina.icone = "imagens/openlayers.png";
}
$i("guia6").src = i3GEO.configura.locaplic + "/" + i3GEO.guias.CONFIGURA.dobraPagina.icone;
}
}
},
/**
* Propriedade: ORDEM
*
* Ordem de inclusão das guias no mapa. Essa opção é mais útil no caso do tipo sanfona, pois
* nesse caso, a primeira guia é sempre a que fica ativa. Se esse parametro for uma string vazia, a ordem utilizada
* será a ordem existente em i3GEO.guias.CONFIGURA.
*
* Ao ser definida, apenas as guias indicadas no array serão incluídas
*
* Exemplo:
*
* i3GEO.guias.ORDEM = ["temas","adiciona","legenda"];
*
* Tipo:
*
* {array}
*/
ORDEM : "",
/**
* Propriedade: TIPO
*
* Tipo de guia
*
* Quando TIPO = "movel", a inicialização da guia é feita em i3GEO.inicia Isso é ne cessário pq a
* guia móvel só pode ser criada após o posicionamento do corpo do mapa
*
* Tipo:
*
* {string}
*
* Default:
*
* guia
*
* Values:
*
* guia|sanfona|tablet|movel
*/
TIPO : "guia",
/**
* Propriedade: idguias
*
* ID do elemento DOM, criado pelo YUI, onde serão inseridas as guias
*
* Tipo:
*
* {String}
*
* Default:
*
* guiasYUI
*/
IDGUIAS : "guiasYUI",
/**
* Function: cria
*
* Cria as guias com base na variável i3GEO.guias.CONFIGURA
*
* As guias podem ser definidas no HTML do mapa, sem necessariamente estarem na variável configura.<b> As guias, nesse caso,
* devem ter como ID "guia'n'", por exemplo id="guia6". Para cada uma dessas guias deve haver um DIV com o conteúdo. Esse DIV
* deve ter como ID "guia'n'obj", por exemplo id="guia6obj". No caso de ser utilizado a guia móvel, com i3GEO.guias.TIPO =
* "movel" , "guia'n" não é necessário, uma vez que são utilizados os ícones definidos em
* i3GEO.guias.CONFIGURA
*
* Parametro:
*
* {String} - id do elemento que conterá as guias
*/
cria : function(onde) {
//
// obtém outras guias que podem existir no mapa
//
var nguiasreal = 0, guiaconteudo, id, guia, g, re, ng, tituloguia, i, ins, altura, temp, CONFIGURA = i3GEO.guias.CONFIGURA, guias =
i3GEO.util.listaChaves(CONFIGURA), nguias = guias.length;
//roda a funcao de inicializacao se existir
for (ng = 0; ng < 20; ng++) {
if(i3GEO.guias.CONFIGURA[guias[ng]] && i3GEO.guias.CONFIGURA[guias[ng]].inicializa){
i3GEO.guias.CONFIGURA[guias[ng]].inicializa.call();
}
}
//
// no caso de TIPO === "movel", as guias não são
// construídas de imediato, apenas é criado um objeto
// com os parâmetros necessários para a
// criação das guias
//
if (i3GEO.guias.TIPO === "movel") {
i3GEO.guias.IDGUIAS = "i3GEOguiaMovelConteudo";
for (ng = 0; ng < 20; ng++) {
// icones sem conteudo devem ter um div com id com prefixo "iconeGuia_"
if (i3GEO.guias.CONFIGURA[guias[ng]] && ($i(i3GEO.guias.CONFIGURA[guias[ng]].idconteudo) || $i("iconeGuia_" + guias[ng]))) {
i3GEO.guias.guiaMovel.config.guias.ids.push(i3GEO.guias.CONFIGURA[guias[ng]].id);
i3GEO.guias.guiaMovel.config.guias.idsconteudos.push(i3GEO.guias.CONFIGURA[guias[ng]].idconteudo);
if (i3GEO.guias.CONFIGURA[guias[ng]].icone !== undefined) {
i3GEO.guias.guiaMovel.config.guias.icones.push(i3GEO.guias.CONFIGURA[guias[ng]].icone);
} else {
i3GEO.guias.guiaMovel.config.guias.icones.push("imagens/gisicons/open1.png");
}
i3GEO.guias.guiaMovel.config.guias.titulos.push(i3GEO.guias.CONFIGURA[guias[ng]].titulo);
i3GEO.guias.guiaMovel.config.guias.chaves.push(guias[ng]);
}
}
return;
}
try {
for (g = 0; g < 12; g++) {
tituloguia = "";
if ($i("guia" + g)) {
tituloguia = $i("guia" + g).innerHTML;
re = new RegExp(" ", "g");
tituloguia = tituloguia.replace(re, '');
for (ng = 0; ng < nguias; ng++) {
if (CONFIGURA[guias[ng]].id === "guia" + g) {
tituloguia = "";
}
}
if (tituloguia !== "") {
i3GEO.guias.CONFIGURA["guia" + g] = [];
i3GEO.guias.CONFIGURA["guia" + g].titulo = tituloguia;
i3GEO.guias.CONFIGURA["guia" + g].id = "guia" + g;
i3GEO.guias.CONFIGURA["guia" + g].idconteudo = "guia" + g + "obj";
if ($i('guia' + g).onclick) {
i3GEO.guias.CONFIGURA["guia" + g].click = $i("guia" + g).onclick;
}
}
}
}
if (i3GEO.guias.ORDEM === "") {
guias = i3GEO.util.listaChaves(CONFIGURA);
} else {
guias = i3GEO.guias.ORDEM;
}
nguias = guias.length;
//
// verifica o div que contém as guias caso não
// tenha
// sido passado como parametro
//
if (arguments.length === 0) {
for (ng = 0; ng < nguias; ng++) {
if (i3GEO.guias.CONFIGURA[guias[ng]]) {
i = $i(i3GEO.guias.CONFIGURA[guias[ng]].id);
if (i) {
onde = i.parentNode;
}
}
}
} else {
onde = $i(onde);
}
if (!onde) {
return;
}
onde.id = i3GEO.guias.IDGUIAS;
onde.className = "yui-navset";
//
// constroi as TAGs para as guias
//
if (i3GEO.guias.TIPO === "guia" || i3GEO.guias.TIPO === "tablet") {
ins =
'<ul class="yui-nav" style="border-width:0pt 0pt 0px;border-color:rgb(240,240,240);border-bottom-color:white;text-align:center;">';
for (ng = 0; ng < nguias; ng++) {
if ($i(i3GEO.guias.CONFIGURA[guias[ng]].id)) {
if ($i(i3GEO.guias.CONFIGURA[guias[ng]].idconteudo)) {
ins +=
'<li><a alt="" title=""><em><div id="' + i3GEO.guias.CONFIGURA[guias[ng]].id
+ '" >'
+ i3GEO.guias.CONFIGURA[guias[ng]].titulo
+ '</div></em></a></li>';
}
}
}
// adiciona uma guia que permite esconder todas as outras
// guias
// se for do tipo tablet
ins += "</ul>";
onde.innerHTML = ins;
}
if (i3GEO.guias.TIPO === "sanfona") {
ins = '<dl id=sanfona' + onde.id + ' class="accordion" >';
// verifica a quantidade certa de guias
if (i3GEO.guias.ORDEM === "") {
for (ng = 0; ng < nguias; ng++) {
if ($i(i3GEO.guias.CONFIGURA[guias[ng]].id)) {
nguiasreal++;
}
}
} else {
nguiasreal = i3GEO.guias.ORDEM.length;
}
if (navn) {
altura = i3GEO.parametros.h - (nguiasreal * 25) - 1;
} else {
altura = i3GEO.parametros.h - (nguiasreal * 23) + 1;
}
for (ng = 0; ng < nguias; ng++) {
if ($i(i3GEO.guias.CONFIGURA[guias[ng]].id)) {
id = i3GEO.guias.CONFIGURA[guias[ng]].idconteudo;
temp = $i(id);
if (temp) {
guiaconteudo = temp.innerHTML;
temp.innerHTML = "";
temp.style.display = "none";
temp.id = "";
ins +=
'<dt style=height:17px id="' + i3GEO.guias.CONFIGURA[guias[ng]].id
+ '" >'
+ '<table class=accordiontable ><tr><td width="98%" >'
+ i3GEO.guias.CONFIGURA[guias[ng]].titulo
+ '</td><td width="2%" ><img id="" src="'
+ i3GEO.configura.locaplic
+ '/imagens/branco.gif" style="width:10px;" /></td></tr></table>'
+ '<dd clas=close >'
+ '<div class=bd >'
+ '<div id="'
+ id
+ '" >'
+ guiaconteudo
+ '</div></div></dd>';
}
}
}
ins += "</dl>";
onde.innerHTML = ins;
onde.style.height = altura + "px";
YAHOO.lutsr.accordion.init(true, 5, false, "sanfona" + onde.id, altura);
i3GEO.guias.ALTURACORPOGUIAS = altura;
}
for (g = 0; g < nguias; g++) {
guia = i3GEO.guias.CONFIGURA[guias[g]];
id = guia.id;
guiaconteudo = $i(id);
if (guiaconteudo) {
if (guia.click === "" || guia.click === undefined) {
eval('$i("' + id + '").onclick = function(event){i3GEO.guias.mostra("' + guias[g] + '");}');
// atrib = document.createAttribute("nomeGuia");
// atrib.value = guias[g];
// $i(id).setAttributeNode(atrib);
// $i(id).onclick = function(event){
// i3GEO.guias.mostra(this.attributes["nomeGuia"].value);
// };
} else {
guiaconteudo.onclick = guia.click;
}
YAHOO.util.Event.addListener($i(id), "click", YAHOO.util.Event.preventDefault);
YAHOO.util.Event.addListener($i(id), "click", YAHOO.util.Event.stopPropagation);
YAHOO.util.Event.addFocusListener($i(id), YAHOO.util.Event.preventDefault);
guiaconteudo.onmouseover = function() {
};
guiaconteudo.onmouseout = function() {
};
temp = $i(guia.idconteudo);
if (temp) {
temp.style.overflow = "auto";
if (i3GEO.guias.TIPO === "guia") {
if (i3GEO.guias.ALTURACORPOGUIAS === 0) {
temp.style.height = i3GEO.parametros.h + "px";
} else {
temp.style.height = i3GEO.guias.ALTURACORPOGUIAS + "px";
}
} else {
temp.style.height = onde.style.height;
}
}
}
}
} catch (e) {
}
if (i3GEO.guias.TIPO !== "tablet") {
i3GEO.guias.mostra(i3GEO.guias.ATUAL);
i3GEO.guias.ativa(i3GEO.guias.ATUAL);
} else {
i3GEO.guias.escondeGuias();
}
},
/**
* Ajusta a altura das guias conforme a altura da imagem do mapa
*/
ajustaAltura : function() {
var guia, guias, nguias, temp, temps, n, i, g, altura = 0;
if (i3GEO.guias.ALTURACORPOGUIAS != 0) {
altura = i3GEO.guias.ALTURACORPOGUIAS;
}
guias = i3GEO.util.listaChaves(i3GEO.guias.CONFIGURA);
nguias = guias.length;
for (g = 0; g < nguias; g++) {
guia = $i(this.CONFIGURA[guias[g]].idconteudo);
if (guia) {
guia.style.overflow = "auto";
if (this.TIPO === "guia") {
if (altura === 0) {
guia.style.height = i3GEO.parametros.h + "px";
} else {
guia.style.height = altura + "px";
}
}
if (this.TIPO === "sanfona") {
guia.style.height = altura + "px";
temp = $i("guiasYUI");
if (temp) {
temp.style.height = altura + "px";
temps = temp.getElementsByTagName("dd");
n = temps.length;
for (i = 0; i < n; i++) {
if (temps[i].style.visibility == "visible") {
temps[i].style.height = altura + "px";
}
}
}
YAHOO.lutsr.accordion.properties.altura = altura;
}
}
}
},
/**
* Esconde todas as guias
*/
escondeGuias : function() {
var guias, nguias, g, temp, attributes, anim;
guias = i3GEO.util.listaChaves(i3GEO.guias.CONFIGURA);
nguias = guias.length;
for (g = 0; g < nguias; g++) {
temp = $i(this.CONFIGURA[guias[g]].idconteudo);
if (temp) {
if (i3GEO.guias.TIPO === "tablet" && temp.style.display === "block") {
temp.style.overflow = "hidden";
attributes = {
height : {
to : 0
},
id : this.CONFIGURA[guias[g]].idconteudo
};
anim = new YAHOO.util.Anim(temp, attributes, 1, YAHOO.util.Easing.easeNone);
anim.onComplete.subscribe(function() {
var temp = $i(anim.attributes.id);
temp.style.overflow = "auto";
temp.style.display = "none";
if (i3GEO.barraDeBotoes.BARRAS[0]) {
i3GEO.barraDeBotoes.BARRAS[0].show();
}
});
anim.animate();
} else {
temp.style.display = "none";
}
}
if ($i(this.CONFIGURA[guias[g]].id) && i3GEO.guias.TIPO !== "movel") {
$i(this.CONFIGURA[guias[g]].id).parentNode.parentNode.style.background = "transparent";
}
}
},
/**
* Mostra no mapa uma determinada guia
*
* Parametro:
*
* {String} - nome da guia
*/
mostra : function(guia) {
// fecha o streetview
if (i3GEO.Interface.ATUAL === "googlemaps") {
if(typeof i3GeoMap.getStreetView != "undefined"){
i3GeoMap.getStreetView().setVisible(false);
}
}
var guias, nguias, g, temp, attributes, anim;
guias = i3GEO.util.listaChaves(i3GEO.guias.CONFIGURA);
nguias = guias.length;
//
// se a guia clicada já estiver aberta na interface com
// TABLET
//
if (!$i(i3GEO.guias.CONFIGURA[guia].id)) {
return;
}
if (!$i(i3GEO.guias.CONFIGURA[guia].idconteudo)) {
return;
}
if ($i(i3GEO.guias.CONFIGURA[guia].idconteudo).style.display === "block" && i3GEO.guias.TIPO === "tablet") {
i3GEO.guias.escondeGuias();
return;
}
if (i3GEO.guias.TIPO !== "movel") {
for (g = 0; g < nguias; g++) {
if ($i(i3GEO.guias.CONFIGURA[guias[g]].idconteudo)) {
$i(i3GEO.guias.CONFIGURA[guias[g]].idconteudo).style.display = "none";
}
if ($i(i3GEO.guias.CONFIGURA[guias[g]].id)) {
$i(i3GEO.guias.CONFIGURA[guias[g]].id).parentNode.parentNode.style.background = "transparent";
}
}
}
//
// verifica se o nome da guia passado como parametro está
// correto
// ou é o id da guia
//
if (i3GEO.guias.CONFIGURA.toString().search(guia) < 0) {
for (g = 0; g < nguias; g++) {
if (i3GEO.guias.CONFIGURA[guias[g]].id === guia) {
guia = guias[g];
}
}
}
if (i3GEO.guias.CONFIGURA[guia]) {
temp = $i(i3GEO.guias.CONFIGURA[guia].idconteudo);
if (temp) {
if (i3GEO.guias.TIPO === "tablet") {
if (i3GEO.barraDeBotoes.BARRAS[0]) {
i3GEO.barraDeBotoes.BARRAS[0].hide();
}
temp.style.left = (i3GEO.parametros.w / 2) - 150 + "px";
temp.style.height = 0;// i3GEO.parametros.h - 10 +
// "px";
temp.style.display = "block";
temp.style.zIndex = 9000;
temp.style.overflow = "hidden";
attributes = {
height : {
to : i3GEO.parametros.h - 10
}
};
anim = new YAHOO.util.Anim(temp, attributes, 1, YAHOO.util.Easing.easeNone);
anim.onComplete.subscribe(function() {
temp.style.overflow = "auto";
temp.style.display = "block";
});
if (DetectaMobile("DetectAndroid") === true) {
temp.style.height = "";
temp.style.overflow = "auto";
} else {
anim.animate();
}
} else {
temp.style.display = "block";
}
if (i3GEO.guias.TIPO !== "movel") {
$i(i3GEO.guias.CONFIGURA[guia].id).parentNode.parentNode.style.backgroundColor = "white";
}
i3GEO.guias.ATUAL = guia;
}
}
},
/**
* Function: ativa
*
* Ativa uma determinada guia
*
* Parametro:
*
* {String} - guia que será ativada
*/
ativa : function(guia) {
try {
i3GEO.guias.ATUAL = guia;
if (i3GEO.guias.CONFIGURA[i3GEO.guias.ATUAL].click !== "") {
i3GEO.guias.CONFIGURA[i3GEO.guias.ATUAL].click.call();
}
} catch (e) {
}
},
/**
* Libera as guias do local atual, colocando-as em uma janela flutuante sobre o mapa.
*/
libera : function() {
if (!$i("conteudojanelaguias")) {
var i, w, pos, a, l, temp;
$i(i3GEO.Interface.IDCORPO).style.left = "0px";
if ($i(this.IDGUIAS)) {
$i(this.IDGUIAS).style.display = "none";
}
i = $i("contemFerramentas");
// if(i)
// {i.style.display = "none";}
w = parseInt($i("contemFerramentas").style.width, 10);
$i("contemFerramentas").style.width = "0px";
// visual foi depreciado na 4.7
// i = $i("visual");
// if (i)
// {i.style.width="0px";i.innerHTML="";}
pos = "px";
a = i3GEO.parametros.h;
l = i3GEO.parametros.w + w;
i3GEO.parametros.h = a;
i3GEO.parametros.w = l;
// if (navm)
// {pos = "";}
i = $i(i3GEO.Interface.IDCORPO);
if (i) {
i.style.width = l + pos;
i.style.height = a + pos;
}
i = $i(i3GEO.Interface.IDMAPA);
if (i) {
i.style.width = l + pos;
i.style.height = a + pos;
i.style.clip = 'rect(' + 0 + " " + (l * 1 + 2) + " " + (a * 1 + 2) + " " + 0 + ')';
}
i = $i("mst");
if (i) {
i.style.width = l + 1 + pos;
}
i3GEO.mapa.ajustaPosicao();
temp =
function(retorno) {
// carrega janela
var novoel, temp, i, g, guias, nguias, janela;
novoel = document.createElement("div");
novoel.id = "janelaguias";
novoel.style.display = "block";
novoel.innerHTML =
'<div class="hd">Guias <div onclick ="i3GEO.janela.minimiza(\'conteudojanelaguias\')" id="janelaguias_minimizaCabecalho" class="container-minimiza" ></div></div><div class="bd" id="conteudojanelaguias_corpo" style=padding:0px ></div>';
temp = $i("i3geo") ? $i("i3geo").appendChild(novoel) : document.body.appendChild(novoel);
janela = new YAHOO.widget.Panel("janelaguias", {
width : "270px",
fixedcenter : true,
constraintoviewport : false,
underlay : "none",
close : false,
visible : true,
draggable : true,
modal : false,
iframe : true
});
YAHOO.i3GEO.janela.manager.register(janela);
janela.render();
janela.show();
janela.cfg.setProperty("y", 0);
i = $i(i3GEO.guias.IDGUIAS);
$i("conteudojanelaguias_corpo").appendChild(i);
i.style.borderLeft = "1px solid black";
i.style.borderRight = "1px solid black";
guias = i3GEO.util.listaChaves(i3GEO.guias.CONFIGURA);
nguias = guias.length;
for (g = 0; g < nguias; g++) {
if ($i(i3GEO.guias.CONFIGURA[guias[g]].idconteudo)) {
$i("conteudojanelaguias_corpo").appendChild($i(i3GEO.guias.CONFIGURA[guias[g]].idconteudo));
temp = $i(i3GEO.guias.CONFIGURA[guias[g]].idconteudo).style;
temp.background = "white";
temp.border = "1px solid black";
temp.borderTop = "0px solid black";
temp.width = "270px";
temp.left = "-1px";
temp.height = i3GEO.parametros.h - 90 + "px";
}
}
i3GEO.atualiza("");
i.style.display = "block";
i.style.left = "-1px";
i.style.width = "270px";
};
i3GEO.php.mudatamanho(temp, a, l);
} else {
janela = YAHOO.i3GEO.janela.manager.find(id);
janela.show();
janela.bringToTop();
}
},
/**
* Mostra uma determinada guia em uma janela do tipo ferramenta.
*
* As guias são construídas pelo construtor da ferramenta
*
* Parametros:
*
* {String} - O elemento html cujo id for igual a guia+"obj" terá seu estilo (display) definido como block, tornando-o
* visível
*
* {String} - Todos os elementos html que tiverem como id o namespace, seguindo por um número e "obj", terão seu
* estilo alterado para none, tornando-se invisíveis
*
*/
mostraGuiaFerramenta : function(guia, namespace) {
var g, Dom = YAHOO.util.Dom;
if (!namespace) {
namespace = "guia";
}
for (g = 0; g < 12; g++) {
Dom.setStyle(namespace + g + "obj", "display", "none");
}
Dom.setStyle(guia + "obj", "display", "block");
},
/**
* Function: ajustaGuiaFerramenta
*
* Ajusta as guias de uma janela para que sempre fiquem no topo da janela, aplicando o overflow ao conteúdo das guias
*
* Deve ser utilizado pelas ferramentas após a janela ter seu conteúdo renderizado.
*
* Veja como exemplo a ferramenta tabela
*
* Paremeters:
*
* {string} - id da janela
*
* {string} - namespace da janela utilizado para definir os elementos DIV onde o conteúdo é renderizado
*
*/
ajustaGuiaFerramenta : function(idjanela, namespace) {
var c = $i(idjanela + "_corpo"), h, g, temp;
c.style.overflow = "unset";
c.style.overflow = "none";
h = c.style.height;
h = parseInt(h, 10) - 40 + "px";
for (g = 0; g < 12; g++) {
temp = $i(namespace + "guia" + g + "obj");
if (temp) {
temp.style.height = h;
temp.style.width = "100%";
temp.style.overflow = "auto";
}
}
},
/**
* Section: guiaMovel
*
* Controla as guias do tipo "movel", que apresenta uma janela retrátil onde as opções são mostradas
*/
guiaMovel : {
/**
* Propriedade: ABERTA
*
* Indica se a guia inicializará aberta
*
* Type:
*
* {boolean}
*
* Default:
*
* false
*/
ABERTA : false,
/**
* Propriedade: config
*
* Define os valores de posicionamento dos elementos que compõem a guia
*
* Default:
*
* (start code) i3GEO.guias.guiaMovel.config = { larguraPuxador : 50, alturaPuxador : 319, alturaGuiaMovel : 0, larguraGuiaMovel :
* 320, topGuiaMovel : 0, guias : { icones : [], ids : [], idsconteudos : [], titulos : [], chaves : [] }, posicao : [ "c", "r" ] };
* (end)
*/
config : {
larguraPuxador : 50,
alturaPuxador : 280,
alturaGuiaMovel : 0,
larguraGuiaMovel : 320,
topGuiaMovel : 0,
guias : {
icones : [],
ids : [],
idsconteudos : [],
titulos : [],
chaves : []
},
posicao : [
"c", "r"
]
},
/**
* Valor de posicionamento a esquerda, calculado na inicialização
*/
left : 0,
/**
* Function: inicia
*
* Inicializa a guia móvel
*/
inicia : function() {
var posMapa = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA)), centroY = posMapa[1] + (i3GEO.parametros.h / 2), config =
i3GEO.guias.guiaMovel.config, temp;
if (i3GEO.guias.ALTURACORPOGUIAS === 0 && config.alturaGuiaMovel === 0) {
i3GEO.guias.guiaMovel.config.alturaGuiaMovel = i3GEO.parametros.h;
} else {
i3GEO.guias.guiaMovel.config.alturaGuiaMovel = i3GEO.guias.ALTURACORPOGUIAS;
}
config = i3GEO.guias.guiaMovel.config;
temp = $i("i3GEOguiaMovel").style;
if (config.posicao[1] === "r") {
temp.left = (posMapa[0] + i3GEO.parametros.w - config.larguraPuxador) + "px";
i3GEO.guias.guiaMovel.left = parseInt(temp.left, 10) + "px";
}
if (config.posicao[1] === "l") {
temp.left = posMapa[0] + "px";
i3GEO.guias.guiaMovel.left = parseInt(temp.left, 10) + "px";
}
if (config.topGuiaMovel === 0) {
temp.top = (centroY - ((config.alturaGuiaMovel - 42) / 2)) + "px";
} else {
temp.top = config.topGuiaMovel + "px";
}
temp.width = config.larguraPuxador + "px";
temp.height = config.alturaPuxador + "px";
// aberta temp.width = config.larguraPuxador +
// config.larguraGuiaMovel + "px";
temp = $i("i3GEOguiaMovelMolde").style;
temp.top = "0px";
if (config.posicao[1] === "r") {
temp.left = config.larguraPuxador + "px";
}
if (config.posicao[1] === "l") {
temp.left = "1px";
}
temp.height = config.alturaGuiaMovel + "px";
temp.backgroundColor = "white";
if ($i("i3GEOguiaMovelPuxador")) {
temp = $i("i3GEOguiaMovelPuxador").style;
temp.top = ((config.alturaGuiaMovel - config.alturaPuxador) / 2) + "px";
temp.left = "0px";
temp.width = config.larguraPuxador + "px";
temp.height = config.alturaPuxador + "px";
}
temp = $i("i3GEOguiaMovelIcones");
if (temp) {
temp = temp.style;
temp.left = "1px";
temp.top = "1px";
temp.width = (config.larguraGuiaMovel - 1) + "px";
temp.height = "35px";
if (navm) {
temp.height = "37px";
}
temp.zIndex = 5;
temp.paddingTop = "2px";
YAHOO.util.Dom.setStyle("i3GEOguiaMovelIcones", "opacity", 0.60);
}
temp = $i("i3GEOguiaMovelConteudo").style;
temp.left = "1px";
if (temp.top == "") {
temp.top = "38px";
}
temp.height = (config.alturaGuiaMovel - 39) + "px";
if (navm) {
temp.width = (config.larguraGuiaMovel - 1) + "px";
} else {
temp.width = (config.larguraGuiaMovel - 5) + "px";
}
temp.paddingLeft = "4px";
YAHOO.util.Dom.setStyle("i3GEOguiaMovelConteudo", "opacity", 0.70);
YAHOO.util.Dom.setStyle("i3GEOguiaMovelMolde", "opacity", 0.10);
$i("i3GEOguiaMovelMolde").onmouseover = function() {
if ($i("i3GEOguiaMovelConteudo").style.display === "block") {
YAHOO.util.Dom.setStyle("i3GEOguiaMovelMolde", "opacity", 0.9);
}
if ($i("i3GEOguiaMovelIcones") && $i("i3GEOguiaMovelIcones").innerHTML === "") {
i3GEO.guias.guiaMovel.mostraIcones();
}
};
$i("i3GEOguiaMovelMolde").onmouseout = function() {
YAHOO.util.Dom.setStyle("i3GEOguiaMovelMolde", "opacity", 0.90);
if ($i("i3GEOguiaMovelIcones") && $i("i3GEOguiaMovelIcones").innerHTML === "") {
i3GEO.guias.guiaMovel.mostraIcones();
}
};
if (i3GEO.guias.guiaMovel.ABERTA === true) {
i3GEO.guias.guiaMovel.ativa(i3GEO.guias.ATUAL);
}
i3GEO.guias.guiaMovel.mostraIcones();
temp = $i("i3GEOguiaMovel");
temp.style.visibility = "visible";
// evita sobreposicao com elementos que tenham onclick
temp.style.height = parseInt(temp.style.height) - 20 + "px";
i3GEO.util.aparece("i3GEOguiaMovel", 300, 100);
},
/**
* Mostra os ícones que acionam cada guia
*/
mostraIcones : function() {
if ($i("i3GEOguiaMovelIcones") && $i("i3GEOguiaMovelIcones").innerHTML != "") {
return;
}
var n = i3GEO.guias.guiaMovel.config.guias.icones.length, i, temp = i3GEO.guias.guiaMovel.config.guias, ins = "", ico;
if (i3GEO.guias.ORDEM !== "") {
temp.chaves = i3GEO.guias.ORDEM;
}
for (i = 0; i < n; i++) {
if (temp.chaves[i]) {
ico =
"<button title='" + temp.titulos[i]
+ "' onmouseout='javascript:this.className = \"iconeGuiaMovel iconeGuiaMovelMouseOut\"' onmouseover='javascript:this.className = \"iconeGuiaMovel iconeGuiaMovelMouseOver\"' onclick='i3GEO.guias.guiaMovel.ativa(\""
+ temp.chaves[i]
+ "\")' class=iconeGuiaMovel ><img id='"
+ temp.ids[i]
+ "' src='"
+ i3GEO.configura.locaplic
+ "/"
+ temp.icones[i]
+ "' style='cursor:pointer;' /></button>";
// verifica se existe um id na interface
// se existir, o icone e inserido nesse id
if (!$i("iconeGuia_" + temp.chaves[i])) {
ins += ico;
} else {
$i("iconeGuia_" + temp.chaves[i]).innerHTML = ico;
}
}
}
if ($i("i3GEOguiaMovelIcones")) {
$i("i3GEOguiaMovelIcones").innerHTML = ins;
}
ins = "1.2px";
if (navn && chro === false) {
ins = "0px";
}
for (i = 0; i < n; i++) {
ico = $i(temp.ids[i]);
if (ico) {
YAHOO.util.Dom.setStyle(ico, "padding", ins);
}
}
i3GEO.guias.guiaMovel.desativaIcones();
if (i3GEO.guias.ATUAL != "") {
ico = $i(i3GEO.guias.CONFIGURA[i3GEO.guias.ATUAL].id);
if (ico) {
YAHOO.util.Dom.setStyle(ico, "opacity", 0.9);
ico.parentNode.style.boxShadow = "none";
}
}
},
/**
* Altera a cor do fundo dos ícones, voltando ao original
*/
desativaIcones : function(o) {
var ims, n, i, temp;
if (!o) {
o = 0.9;
}
ims = $i("i3GEOguiaMovelIcones");
if (ims) {
ims = ims.getElementsByTagName("button");
n = ims.length;
for (i = 0; i < n; i++) {
YAHOO.util.Dom.setStyle(ims[i], "opacity", o);
ims[i].style.boxShadow = "none";
}
}
// verifica se existem icones fora do container
n = i3GEO.guias.guiaMovel.config.guias.icones.length;
temp = i3GEO.guias.guiaMovel.config.guias;
for (i = 0; i < n; i++) {
if ($i("iconeGuia_" + temp.chaves[i])) {
ims = $i("iconeGuia_" + temp.chaves[i]).getElementsByTagName("button");
if (ims.length > 0) {
ims[0].style.backgroundColor = "white";
ims[0].style.boxShadow = "none";
ims[0].style.margin = "0px";
ims[0].style.border = "1px solid gray";
if (i3GEO.guias.guiaMovel.config.posicao[1] === "l") {
ims[0].style.borderLeft = "2px solid white";
} else {
ims[0].style.borderRight = "2px solid white";
}
YAHOO.util.Dom.setStyle(ims[0], "opacity", o);
ims[0].blur();
}
}
}
},
/**
* Ativa o conteúdo de determinada guia
*
* Parametro:
*
* chave {string} - código da guia, definido em i3GEO.guias.CONFIGURA
*/
ativa : function(chave) {
if (chave === "") {
i3GEO.guias.guiaMovel.desativaIcones();
return;
}
// nao tem conteudo para mostrar
if (!$i(i3GEO.guias.CONFIGURA[chave].idconteudo)) {
i3GEO.guias.CONFIGURA[chave].click.call();
return;
}
i3GEO.guias.escondeGuias();
i3GEO.guias.guiaMovel.desativaIcones(0.5);
if (i3GEO.guias.ATUAL === chave && $i("i3GEOguiaMovelMolde").style.display === "block") {
i3GEO.guias.ATUAL = "";
i3GEO.guias.guiaMovel.desativaIcones(0.9);
i3GEO.guias.guiaMovel.abreFecha("fecha");
} else {
i3GEO.guias.ATUAL = chave;
i3GEO.guias.guiaMovel.abreFecha("abre");
if (i3GEO.guias.CONFIGURA[chave].click) {
i3GEO.guias.CONFIGURA[chave].click.call();
}
i3GEO.guias.mostra(chave);
var ico = $i(i3GEO.guias.CONFIGURA[chave].id);
if (ico) {
ico.parentNode.blur();
YAHOO.util.Dom.setStyle(ico.parentNode, "opacity", 0.9);
ico.parentNode.style.boxShadow = "none";
// verifica se esta fora do lugar normal e muda a borda
if ($i("iconeGuia_" + chave)) {
if (i3GEO.guias.guiaMovel.config.posicao[1] === "l") {
ico.parentNode.style.borderLeft = "2px solid white";
} else {
ico.parentNode.style.borderRight = "2px solid white";
}
}
}
}
},
/**
* Reposiciona a guia móvel quando o mapa muda de tamanho
*/
reposiciona : function() {
var temp = $i("i3GEOguiaMovel").style.top;
i3GEO.guias.guiaMovel.config.alturaGuiaMovel = 0;
i3GEO.guias.ALTURACORPOGUIAS = 0;
if ($i("i3GEOguiaMovelIcones")) {
$i("i3GEOguiaMovelIcones").style.display = "none";
}
$i("i3GEOguiaMovelConteudo").style.display = "none";
$i("i3GEOguiaMovelMolde").style.display = "none";
i3GEO.guias.escondeGuias();
i3GEO.guias.guiaMovel.inicia();
$i("i3GEOguiaMovel").style.top = temp;
},
/**
* Function: abreFecha
*
* Abre ou fecha a guia móvel
*/
abreFecha : function(forca) {
var molde = $i("i3GEOguiaMovelMolde"), guia = $i("i3GEOguiaMovel"), attributes, anim, anim1, anim2, temp;
// para efeitos de compatibilidade caso seja chamado com
// i3GEO.guias.guiaMovel.abreFecha()
if (!forca) {
if (molde.style.display === "block") {
forca = "fecha";
} else {
temp = i3GEO.guias.ATUAL;
i3GEO.guias.ATUAL = "";
i3GEO.guias.guiaMovel.ativa(temp);
return;
}
}
if (forca === "fecha") {// esconde
if ($i("i3GEOguiaMovelIcones")) {
$i("i3GEOguiaMovelIcones").style.display = "none";
}
$i("i3GEOguiaMovelConteudo").style.display = "none";
attributes = {
left : {
to : parseInt(i3GEO.guias.guiaMovel.left, 10)
},
id : "i3GEOguiaMovel"
};
anim = new YAHOO.util.Anim(guia, attributes, 1, YAHOO.util.Easing.easeNone);
attributes = {
width : {
to : 0
},
id : "i3GEOguiaMovelMolde"
};
anim1 = new YAHOO.util.Anim(molde, attributes, 1, YAHOO.util.Easing.easeNone);
anim.duration = 0.5;
anim1.duration = 0.5;
anim1.onComplete.subscribe(function() {
molde.style.display = "none";
});
if (i3GEO.guias.guiaMovel.config.posicao[1] === "l" && $i("i3GEOguiaMovelIconesPuxador")) {
attributes = {
left : {
to : 0
}
};
anim2 = new YAHOO.util.Anim("i3GEOguiaMovelIconesPuxador", attributes, 1, YAHOO.util.Easing.easeNone);
anim2.duration = 0.5;
anim2.animate();
}
anim.animate();
anim1.animate();
} else if (molde.style.display != "block") {
molde.style.display = "block";
if (i3GEO.guias.guiaMovel.config.posicao[1] === "l") {
attributes = {
rigth : {
to : (parseInt(guia.style.left, 10) - i3GEO.guias.guiaMovel.config.larguraGuiaMovel) * -1
},
id : "i3GEOguiaMovel"
};
} else {
attributes = {
left : {
to : parseInt(guia.style.left, 10) - i3GEO.guias.guiaMovel.config.larguraGuiaMovel
},
id : "i3GEOguiaMovel"
};
}
anim = new YAHOO.util.Anim(guia, attributes, 1, YAHOO.util.Easing.easeNone);
attributes = {
width : {
to : i3GEO.guias.guiaMovel.config.larguraGuiaMovel
},
id : "i3GEOguiaMovelMolde"
};
anim1 = new YAHOO.util.Anim(molde, attributes, 1, YAHOO.util.Easing.easeNone);
anim.duration = 0.5;
anim1.duration = 0.5;
anim1.onComplete.subscribe(function() {
if ($i("i3GEOguiaMovelIcones")) {
$i("i3GEOguiaMovelIcones").style.display = "block";
}
$i("i3GEOguiaMovelConteudo").style.display = "block";
// i3GEO.guias.guiaMovel.mostraIcones();
YAHOO.util.Dom.setStyle("i3GEOguiaMovelMolde", "opacity", 0.9);
});
if (i3GEO.guias.guiaMovel.config.posicao[1] === "l" && $i("i3GEOguiaMovelIconesPuxador")) {
attributes = {
left : {
to : i3GEO.guias.guiaMovel.config.larguraGuiaMovel
}
};
anim2 = new YAHOO.util.Anim("i3GEOguiaMovelIconesPuxador", attributes, 1, YAHOO.util.Easing.easeNone);
anim2.duration = 0.5;
anim2.animate();
}
anim.animate();
anim1.animate();
}
}
}
};