Commit 8741ce436129bacd6bab8cf3c8ec9872e5bf53b2
1 parent
405c596f
Exists in
master
and in
7 other branches
V 6 - remoção da biblioteca Richdraw dos códigos JS
Showing
13 changed files
with
344 additions
and
1038 deletions
Show diff stats
classesjs/classe_analise.js
| ... | ... | @@ -316,17 +316,6 @@ i3GEO.analise = { |
| 316 | 316 | fechaJanela: function(){ |
| 317 | 317 | var janela; |
| 318 | 318 | i3GEO.eventos.cliquePerm.ativa(); |
| 319 | - //@TODO remover | |
| 320 | - if(i3GEO.Interface.ATUAL === "googleearth"){ | |
| 321 | - i3GEO.Interface.ATUAL !== "googleearth" ? i3GEO.desenho.richdraw.fecha() : i3GEO.Interface.googleearth.removePlacemark("divGeometriasTemp"); | |
| 322 | - i3GEO.util.removeChild("pontosins"); | |
| 323 | - if($i("divGeometriasTemp")) | |
| 324 | - {i3GEO.desenho.richdraw.fecha();} | |
| 325 | - i3GEO.eventos.MOUSECLIQUE.remove("i3GEO.analise.medeDistancia.clique()"); | |
| 326 | - i3GEO.eventos.MOUSEMOVE.remove("i3GEO.analise.medeDistancia.movimento()"); | |
| 327 | - i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.analise.medeDistancia.fechaJanela()"); | |
| 328 | - i3GEO.barraDeBotoes.ativaBotoes(); | |
| 329 | - } | |
| 330 | 319 | janela = YAHOO.i3GEO.janela.manager.find("mostradistancia"); |
| 331 | 320 | if(janela){ |
| 332 | 321 | YAHOO.i3GEO.janela.manager.remove(janela); |
| ... | ... | @@ -558,7 +547,7 @@ i3GEO.analise = { |
| 558 | 547 | i3GeoMap.setOptions({disableDoubleClickZoom:true}); |
| 559 | 548 | i3GeoMap.setOptions({draggableCursor:'crosshair'}); |
| 560 | 549 | var evtdblclick = null,evtclick = null,evtmousemove = null, |
| 561 | - pontos = { | |
| 550 | + pontos = { | |
| 562 | 551 | xpt: [], |
| 563 | 552 | ypt: [], |
| 564 | 553 | dist: [], |
| ... | ... | @@ -566,26 +555,26 @@ i3GEO.analise = { |
| 566 | 555 | mvcMarkers: new google.maps.MVCArray(), |
| 567 | 556 | line: null, |
| 568 | 557 | polygon: null |
| 569 | - }, | |
| 570 | - termina = function(){ | |
| 571 | - google.maps.event.removeListener(evtdblclick); | |
| 572 | - google.maps.event.removeListener(evtclick); | |
| 573 | - google.maps.event.removeListener(evtmousemove); | |
| 574 | - pontos.line.setOptions({clickable: true}); | |
| 575 | - google.maps.event.addListener(pontos.line, 'click', function(shape) { | |
| 576 | - if(shape.setEditable){ | |
| 577 | - shape.setEditable(!shape.editable); | |
| 578 | - } | |
| 579 | - }); | |
| 580 | - if(pontos){ | |
| 581 | - i3GEO.desenho.googlemaps.shapes.push(pontos.mvcLine); | |
| 582 | - i3GEO.desenho.googlemaps.shapes.push(pontos.line); | |
| 583 | - pontos = null; | |
| 558 | + }, | |
| 559 | + termina = function(){ | |
| 560 | + google.maps.event.removeListener(evtdblclick); | |
| 561 | + google.maps.event.removeListener(evtclick); | |
| 562 | + google.maps.event.removeListener(evtmousemove); | |
| 563 | + pontos.line.setOptions({clickable: true}); | |
| 564 | + google.maps.event.addListener(pontos.line, 'click', function(shape) { | |
| 565 | + if(shape.setEditable){ | |
| 566 | + shape.setEditable(!shape.editable); | |
| 584 | 567 | } |
| 585 | - }; | |
| 568 | + }); | |
| 569 | + if(pontos){ | |
| 570 | + i3GEO.desenho.googlemaps.shapes.push(pontos.mvcLine); | |
| 571 | + i3GEO.desenho.googlemaps.shapes.push(pontos.line); | |
| 572 | + pontos = null; | |
| 573 | + } | |
| 574 | + }; | |
| 586 | 575 | evtclick = google.maps.event.addListener(i3GeoMap, "click", function(evt) { |
| 587 | 576 | var x1,x2,y1,y2,trecho=0,total,n, |
| 588 | - estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao]; | |
| 577 | + estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao]; | |
| 589 | 578 | // When the map is clicked, pass the LatLng obect to the measureAdd function |
| 590 | 579 | pontos.mvcLine.push(evt.latLng); |
| 591 | 580 | pontos.xpt.push(evt.latLng.lng()); |
| ... | ... | @@ -604,36 +593,36 @@ i3GEO.analise = { |
| 604 | 593 | i3GEO.analise.medeDistancia.googlemaps.mostraTotal(trecho,total); |
| 605 | 594 | if($i("pararraios") && $i("pararraios").checked === true ){ |
| 606 | 595 | i3GEO.desenho.googlemaps.shapes.push( |
| 607 | - new google.maps.Circle({ | |
| 608 | - map: i3GeoMap, | |
| 609 | - fillOpacity: 0, | |
| 610 | - clickable: false, | |
| 611 | - strokeColor: estilo.circcolor, | |
| 612 | - strokeOpacity: 1, | |
| 613 | - strokeWeight: estilo.linewidth, | |
| 614 | - center: new google.maps.LatLng(y1,x1), | |
| 615 | - radius: trecho*1000, | |
| 616 | - origem: "medeDistanciaExcluir" | |
| 617 | - }) | |
| 596 | + new google.maps.Circle({ | |
| 597 | + map: i3GeoMap, | |
| 598 | + fillOpacity: 0, | |
| 599 | + clickable: false, | |
| 600 | + strokeColor: estilo.circcolor, | |
| 601 | + strokeOpacity: 1, | |
| 602 | + strokeWeight: estilo.linewidth, | |
| 603 | + center: new google.maps.LatLng(y1,x1), | |
| 604 | + radius: trecho*1000, | |
| 605 | + origem: "medeDistanciaExcluir" | |
| 606 | + }) | |
| 618 | 607 | ); |
| 619 | 608 | } |
| 620 | 609 | } |
| 621 | 610 | //desenha uma marca no ponto |
| 622 | 611 | if($i("parartextos") && $i("parartextos").checked === true ){ |
| 623 | 612 | i3GEO.desenho.googlemaps.shapes.push( |
| 624 | - new google.maps.Marker({ | |
| 625 | - map: i3GeoMap, | |
| 626 | - fillOpacity: 0, | |
| 627 | - clickable: false, | |
| 628 | - position:evt.latLng, | |
| 629 | - icon: { | |
| 630 | - path: google.maps.SymbolPath.CIRCLE, | |
| 631 | - scale: 2.5, | |
| 632 | - strokeColor: "#ffffff", | |
| 633 | - title: trecho.toFixed(0)+" km" | |
| 634 | - }, | |
| 635 | - origem: "medeDistanciaExcluir" | |
| 636 | - }) | |
| 613 | + new google.maps.Marker({ | |
| 614 | + map: i3GeoMap, | |
| 615 | + fillOpacity: 0, | |
| 616 | + clickable: false, | |
| 617 | + position:evt.latLng, | |
| 618 | + icon: { | |
| 619 | + path: google.maps.SymbolPath.CIRCLE, | |
| 620 | + scale: 2.5, | |
| 621 | + strokeColor: "#ffffff", | |
| 622 | + title: trecho.toFixed(0)+" km" | |
| 623 | + }, | |
| 624 | + origem: "medeDistanciaExcluir" | |
| 625 | + }) | |
| 637 | 626 | ); |
| 638 | 627 | } |
| 639 | 628 | //mais um ponto para criar uma linha movel |
| ... | ... | @@ -645,8 +634,8 @@ i3GEO.analise = { |
| 645 | 634 | return; |
| 646 | 635 | } |
| 647 | 636 | var x1,y1,x2,y2,direcao,parcial, |
| 648 | - estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao], | |
| 649 | - n = pontos.xpt.length; | |
| 637 | + estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao], | |
| 638 | + n = pontos.xpt.length; | |
| 650 | 639 | |
| 651 | 640 | // If there is more than one vertex on the line |
| 652 | 641 | if (pontos.mvcLine.getLength() > 0) { |
| ... | ... | @@ -762,124 +751,6 @@ i3GEO.analise = { |
| 762 | 751 | |
| 763 | 752 | } |
| 764 | 753 | }, |
| 765 | - | |
| 766 | - | |
| 767 | - | |
| 768 | - | |
| 769 | - ////////////////////////////////////// | |
| 770 | - /* | |
| 771 | - Adiciona uma marca na tela e realiza o calculo de distancia dos pontos inseridos | |
| 772 | - */ | |
| 773 | - clique: function(){ | |
| 774 | - var n,d,decimal,dd, | |
| 775 | - pontosdistobj = i3GEO.analise.pontosdistobj; | |
| 776 | - if (g_tipoacao === "mede"){ | |
| 777 | - n = pontosdistobj.xpt.length; | |
| 778 | - pontosdistobj.xpt[n] = objposicaocursor.ddx; | |
| 779 | - pontosdistobj.ypt[n] = objposicaocursor.ddy; | |
| 780 | - pontosdistobj.xtela[n] = objposicaocursor.telax; | |
| 781 | - pontosdistobj.ytela[n] = objposicaocursor.telay; | |
| 782 | - pontosdistobj.ximg[n] = objposicaocursor.imgx; | |
| 783 | - pontosdistobj.yimg[n] = objposicaocursor.imgy; | |
| 784 | - pontosdistobj.dist[n] = 0; | |
| 785 | - //cria a linha que sera utilizada para seguir a posicao do mouse e o ultimo ponto | |
| 786 | - if(i3GEO.util.in_array(i3GEO.Interface.ATUAL,["openlayers","googlemaps"])){ | |
| 787 | - try{ | |
| 788 | - pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, (pontosdistobj.ximg[n]-1),(pontosdistobj.yimg[n]-1),(pontosdistobj.ximg[n]-1),(pontosdistobj.yimg[n]-1)); | |
| 789 | - } | |
| 790 | - catch(e){ | |
| 791 | - if(typeof(console) !== 'undefined'){console.error("i3GEO.desenho.richdraw "+e);} | |
| 792 | - } | |
| 793 | - } | |
| 794 | - if (n > 0){ | |
| 795 | - d = i3GEO.calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy); | |
| 796 | - decimal = 0; | |
| 797 | - d = d + ""; | |
| 798 | - d = d.split("."); | |
| 799 | - decimal = d[1].substr(0,5); | |
| 800 | - d = d[0]+"."+decimal; | |
| 801 | - d = d * 1; | |
| 802 | - pontosdistobj.dist[n] = d + pontosdistobj.dist[n-1]; | |
| 803 | - if(navm) | |
| 804 | - {i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, (pontosdistobj.ximg[n-1]),pontosdistobj.yimg[n-1],(pontosdistobj.ximg[n]),pontosdistobj.yimg[n]);} | |
| 805 | - if($i("pararraios") && $i("pararraios").checked === true ){ | |
| 806 | - if(i3GEO.util.in_array(i3GEO.Interface.ATUAL,["openlayers","googlemaps"])){ | |
| 807 | - i3GEO.desenho.aplica("insereCirculo","",n); | |
| 808 | - } | |
| 809 | - if(i3GEO.Interface.ATUAL === "googleearth"){ | |
| 810 | - dd = Math.sqrt(((Math.pow((pontosdistobj.xpt[n] - pontosdistobj.xpt[n-1]),2)) + (Math.pow((pontosdistobj.ypt[n] - pontosdistobj.ypt[n-1]),2)) )); | |
| 811 | - i3GEO.Interface.googleearth.insereCirculo(pontosdistobj.xpt[n],pontosdistobj.ypt[n],dd,"","divGeometriasTemp"); | |
| 812 | - } | |
| 813 | - } | |
| 814 | - if($i("parartextos") && $i("parartextos").checked === true ){ | |
| 815 | - if(i3GEO.util.in_array(i3GEO.Interface.ATUAL,["openlayers","googlemaps"])){ | |
| 816 | - i3GEO.desenho.aplica("insereTexto","",n+1,d+" km"); | |
| 817 | - } | |
| 818 | - if(i3GEO.Interface.ATUAL === "googleearth") | |
| 819 | - {i3GEO.Interface.googleearth.insereMarca(d+" km",objposicaocursor.ddx,objposicaocursor.ddy,"","divGeometriasTemp");} | |
| 820 | - } | |
| 821 | - //cria a linha ligando os dois ultimos pontos | |
| 822 | - if(i3GEO.Interface.ATUAL === "googleearth"){ | |
| 823 | - i3GEO.Interface.googleearth.insereLinha(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],pontosdistobj.xpt[n],pontosdistobj.ypt[n],"","divGeometriasTemp"); | |
| 824 | - } | |
| 825 | - } | |
| 826 | - if(i3GEO.util.in_array(i3GEO.Interface.ATUAL,["openlayers","googlemaps"])){ | |
| 827 | - i3GEO.util.insereMarca.cria(objposicaocursor.imgx,objposicaocursor.imgy,i3GEO.analise.medeDistancia.paraCalculo,"divGeometriasTemp","",i3GEO.configura.locaplic+"/imagens/estasel.png",6,6); | |
| 828 | - i3GEO.desenho.insereCirculo(objposicaocursor.imgx,objposicaocursor.imgy,3,"white"); | |
| 829 | - } | |
| 830 | - } | |
| 831 | - }, | |
| 832 | - /* | |
| 833 | - Para o calculo de distancias e ativa o botao "pan" | |
| 834 | - */ | |
| 835 | - paraCalculo: function(){ | |
| 836 | - var botaoPan = $i("pan"); | |
| 837 | - g_tipoacao = ""; | |
| 838 | - botaoPan ? botaoPan.onclick.call() : i3GEO.barraDeBotoes.ativaBotoes(); | |
| 839 | - }, | |
| 840 | - /* | |
| 841 | - Realiza os calculos e desenho da linha conforme o usuario movimenta o mouse | |
| 842 | - */ | |
| 843 | - movimento: function(){ | |
| 844 | - var n,d,r,decimal,da,mostra,texto, | |
| 845 | - pontosdistobj = i3GEO.analise.pontosdistobj, | |
| 846 | - calculo = i3GEO.calculo; | |
| 847 | - if (g_tipoacao === "mede"){ | |
| 848 | - YAHOO.util.Dom.setStyle("mostradistancia","display","block"); | |
| 849 | - n = pontosdistobj.xpt.length; | |
| 850 | - try{ | |
| 851 | - //console.info(objposicaocursor.ddx); | |
| 852 | - if (n > 0){ | |
| 853 | - d = calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy); | |
| 854 | - r = calculo.direcao(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy); | |
| 855 | - r = calculo.dd2dms(r,r); | |
| 856 | - r = r[0]; | |
| 857 | - | |
| 858 | - d = d + ""; | |
| 859 | - d = d.split("."); | |
| 860 | - decimal = d[1].substr(0,5); | |
| 861 | - d = d[0]+"."+decimal; | |
| 862 | - d = d * 1; | |
| 863 | - da = d + pontosdistobj.dist[n-1]; | |
| 864 | - da = da + ""; | |
| 865 | - da = da.split("."); | |
| 866 | - decimal = da[1].substr(0,5); | |
| 867 | - da = da[0]+"."+decimal; | |
| 868 | - da = da * 1; | |
| 869 | - | |
| 870 | - mostra = $i("mostradistancia_calculo"); | |
| 871 | - if (mostra){ | |
| 872 | - texto = " Dist acum.= "+da+" km <br>atual= "+d+" km <br> "+$trad("x23")+" (DMS)= "+r; | |
| 873 | - texto += "<br>"+$trad("x25")+": "+calculo.metododistancia; | |
| 874 | - mostra.innerHTML = texto; | |
| 875 | - } | |
| 876 | - if(i3GEO.Interface.ATUAL !== "googleearth" && navn) | |
| 877 | - {i3GEO.desenho.aplica("resizeLinha",pontosdistobj.linhas[n-1],n);} | |
| 878 | - } | |
| 879 | - } | |
| 880 | - catch(e){} | |
| 881 | - } | |
| 882 | - } | |
| 883 | 754 | }, |
| 884 | 755 | /* |
| 885 | 756 | i3GEO.analise.medeArea |
| ... | ... | @@ -907,19 +778,6 @@ i3GEO.analise = { |
| 907 | 778 | inicia: function(){ |
| 908 | 779 | if(typeof(console) !== 'undefined'){console.info("i3GEO.analise.medeDistancia.inicia()");} |
| 909 | 780 | i3GEO.eventos.cliquePerm.desativa(); |
| 910 | - //@TODO remover apos concluir a refatoracao do codigo | |
| 911 | - i3GEO.analise.pontosdistobj = { | |
| 912 | - xpt: [], | |
| 913 | - ypt: [], | |
| 914 | - dist: [], | |
| 915 | - distV: [], | |
| 916 | - xtela: [], | |
| 917 | - ytela: [], | |
| 918 | - ximg: [], | |
| 919 | - yimg: [], | |
| 920 | - linhas: [], | |
| 921 | - linhastemp: [] | |
| 922 | - }; | |
| 923 | 781 | i3GEO.analise.medeArea.criaJanela(); |
| 924 | 782 | i3GEO.analise.medeArea[i3GEO.Interface["ATUAL"]].inicia(); |
| 925 | 783 | }, |
| ... | ... | @@ -960,15 +818,6 @@ i3GEO.analise = { |
| 960 | 818 | fechaJanela: function(){ |
| 961 | 819 | var janela; |
| 962 | 820 | i3GEO.eventos.cliquePerm.ativa(); |
| 963 | - //@TODO remover | |
| 964 | - if(i3GEO.Interface.ATUAL == "googleearth"){ | |
| 965 | - i3GEO.desenho.richdraw.fecha(); | |
| 966 | - i3GEO.util.removeChild("pontosArea",document.body); | |
| 967 | - i3GEO.eventos.MOUSECLIQUE.remove("i3GEO.analise.medeArea.clique()"); | |
| 968 | - i3GEO.eventos.MOUSEMOVE.remove("i3GEO.analise.medeArea.movimento()"); | |
| 969 | - i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.analise.medeArea.fechaJanela()"); | |
| 970 | - i3GEO.barraDeBotoes.ativaBotoes(); | |
| 971 | - } | |
| 972 | 821 | janela = YAHOO.i3GEO.janela.manager.find("mostraarea"); |
| 973 | 822 | if(janela){ |
| 974 | 823 | YAHOO.i3GEO.janela.manager.remove(janela); |
| ... | ... | @@ -1223,8 +1072,10 @@ i3GEO.analise = { |
| 1223 | 1072 | i3GEO.desenho[i3GEO.Interface["ATUAL"]].inicia(); |
| 1224 | 1073 | i3GeoMap.setOptions({disableDoubleClickZoom:true}); |
| 1225 | 1074 | i3GeoMap.setOptions({draggableCursor:'crosshair'}); |
| 1226 | - var evtdblclick = null,evtclick = null,evtmousemove = null, | |
| 1227 | - pontos = { | |
| 1075 | + var evtdblclick = null, | |
| 1076 | + evtclick = null, | |
| 1077 | + evtmousemove = null, | |
| 1078 | + pontos = { | |
| 1228 | 1079 | xpt: [], |
| 1229 | 1080 | ypt: [], |
| 1230 | 1081 | dist: [], |
| ... | ... | @@ -1232,23 +1083,23 @@ i3GEO.analise = { |
| 1232 | 1083 | mvcMarkers: new google.maps.MVCArray(), |
| 1233 | 1084 | line: null, |
| 1234 | 1085 | polygon: null |
| 1235 | - }, | |
| 1236 | - termina = function(){ | |
| 1237 | - google.maps.event.removeListener(evtdblclick); | |
| 1238 | - google.maps.event.removeListener(evtclick); | |
| 1239 | - google.maps.event.removeListener(evtmousemove); | |
| 1240 | - pontos.line.setOptions({clickable: true}); | |
| 1241 | - google.maps.event.addListener(pontos.line, 'click', function(shape) { | |
| 1242 | - if(shape.setEditable){ | |
| 1243 | - shape.setEditable(!shape.editable); | |
| 1244 | - } | |
| 1245 | - }); | |
| 1246 | - if(pontos){ | |
| 1247 | - i3GEO.desenho.googlemaps.shapes.push(pontos.mvcLine); | |
| 1248 | - i3GEO.desenho.googlemaps.shapes.push(pontos.line); | |
| 1249 | - pontos = null; | |
| 1086 | + }, | |
| 1087 | + termina = function(){ | |
| 1088 | + google.maps.event.removeListener(evtdblclick); | |
| 1089 | + google.maps.event.removeListener(evtclick); | |
| 1090 | + google.maps.event.removeListener(evtmousemove); | |
| 1091 | + pontos.line.setOptions({clickable: true}); | |
| 1092 | + google.maps.event.addListener(pontos.line, 'click', function(shape) { | |
| 1093 | + if(shape.setEditable){ | |
| 1094 | + shape.setEditable(!shape.editable); | |
| 1250 | 1095 | } |
| 1251 | - }; | |
| 1096 | + }); | |
| 1097 | + if(pontos){ | |
| 1098 | + i3GEO.desenho.googlemaps.shapes.push(pontos.mvcLine); | |
| 1099 | + i3GEO.desenho.googlemaps.shapes.push(pontos.line); | |
| 1100 | + pontos = null; | |
| 1101 | + } | |
| 1102 | + }; | |
| 1252 | 1103 | evtclick = google.maps.event.addListener(i3GeoMap, "click", function(evt) { |
| 1253 | 1104 | var area=0,per; |
| 1254 | 1105 | // When the map is clicked, pass the LatLng obect to the measureAdd function |
| ... | ... | @@ -1263,18 +1114,18 @@ i3GEO.analise = { |
| 1263 | 1114 | } |
| 1264 | 1115 | //desenha uma marca no ponto |
| 1265 | 1116 | i3GEO.desenho.googlemaps.shapes.push( |
| 1266 | - new google.maps.Marker({ | |
| 1267 | - map: i3GeoMap, | |
| 1268 | - fillOpacity: 0, | |
| 1269 | - clickable: false, | |
| 1270 | - position:evt.latLng, | |
| 1271 | - icon: { | |
| 1272 | - path: google.maps.SymbolPath.CIRCLE, | |
| 1273 | - scale: 2.5, | |
| 1274 | - strokeColor: "#ffffff" | |
| 1275 | - }, | |
| 1276 | - origem: "medeAreaExcluir" | |
| 1277 | - }) | |
| 1117 | + new google.maps.Marker({ | |
| 1118 | + map: i3GeoMap, | |
| 1119 | + fillOpacity: 0, | |
| 1120 | + clickable: false, | |
| 1121 | + position:evt.latLng, | |
| 1122 | + icon: { | |
| 1123 | + path: google.maps.SymbolPath.CIRCLE, | |
| 1124 | + scale: 2.5, | |
| 1125 | + strokeColor: "#ffffff" | |
| 1126 | + }, | |
| 1127 | + origem: "medeAreaExcluir" | |
| 1128 | + }) | |
| 1278 | 1129 | ); |
| 1279 | 1130 | //mais um ponto para criar uma linha movel |
| 1280 | 1131 | pontos.mvcLine.push(evt.latLng); |
| ... | ... | @@ -1285,8 +1136,8 @@ i3GEO.analise = { |
| 1285 | 1136 | return; |
| 1286 | 1137 | } |
| 1287 | 1138 | var x1,y1,x2,y2,direcao,per,area, |
| 1288 | - estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao], | |
| 1289 | - n = pontos.xpt.length; | |
| 1139 | + estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao], | |
| 1140 | + n = pontos.xpt.length; | |
| 1290 | 1141 | |
| 1291 | 1142 | // If there is more than one vertex on the line |
| 1292 | 1143 | if (pontos.mvcLine.getLength() > 0) { |
| ... | ... | @@ -1317,6 +1168,10 @@ i3GEO.analise = { |
| 1317 | 1168 | } |
| 1318 | 1169 | }); |
| 1319 | 1170 | evtdblclick = google.maps.event.addListener(i3GeoMap, "dblclick", function(evt) { |
| 1171 | + pontos.mvcLine.push(new google.maps.LatLng(pontos.ypt[0],pontos.xpt[0])); | |
| 1172 | + var per = google.maps.geometry.spherical.computeLength(pontos.mvcLine), | |
| 1173 | + area = google.maps.geometry.spherical.computeArea(pontos.mvcLine); | |
| 1174 | + i3GEO.analise.medeArea.googlemaps.mostraTotal(per,area); | |
| 1320 | 1175 | termina.call(); |
| 1321 | 1176 | }); |
| 1322 | 1177 | }, |
| ... | ... | @@ -1384,119 +1239,6 @@ i3GEO.analise = { |
| 1384 | 1239 | } |
| 1385 | 1240 | }, |
| 1386 | 1241 | googleearth: { |
| 1387 | - inicia: function(){ | |
| 1388 | - var x,y,ll1,ll2,d, | |
| 1389 | - calculo = i3GEO.calculo, | |
| 1390 | - montacontainer = function(){ | |
| 1391 | - var desenho = i3GEO.desenho; | |
| 1392 | - $i("mostraarea_calculo").innerHTML = "Clique no mapa para desenhar o poligono. Clique duas vezes para concluir"; | |
| 1393 | - i3GEO.barraDeBotoes.ativaIcone("area"); | |
| 1394 | - g_tipoacao = "area"; | |
| 1395 | - desenho.criaContainerRichdraw(); | |
| 1396 | - desenho.richdraw.lineColor = "green"; | |
| 1397 | - desenho.richdraw.lineWidth = "2px"; | |
| 1398 | - }; | |
| 1399 | - i3GEO.analise.medeArea.criaJanela(); | |
| 1400 | - if (g_tipoacao !== "area"){ | |
| 1401 | - $i("mostraarea_calculo").innerHTML = ""; | |
| 1402 | - if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEO.analise.medeArea.clique()") < 0) | |
| 1403 | - {i3GEO.eventos.MOUSECLIQUE.push("i3GEO.analise.medeArea.clique()");} | |
| 1404 | - if(i3GEO.eventos.MOUSEMOVE.toString().search("i3GEO.analise.medeArea.movimento()") < 0) | |
| 1405 | - {i3GEO.eventos.MOUSEMOVE.push("i3GEO.analise.medeArea.movimento()");} | |
| 1406 | - if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.analise.medeArea.fechaJanela()") < 0) | |
| 1407 | - {i3GEO.eventos.NAVEGAMAPA.push("i3GEO.analise.medeArea.fechaJanela()");} | |
| 1408 | - // | |
| 1409 | - //a API do Openlayers e GoogleMaps tem uma funcao propria de obtencao da resolucao de cada pixel | |
| 1410 | - //essa funcao e embutida em i3GEO.calculo.tela2dd | |
| 1411 | - // | |
| 1412 | - if(i3GEO.util.in_array(i3GEO.Interface.ATUAL,["openlayers","googlemaps"])){ | |
| 1413 | - x = parseInt(i3GEO.parametros.w / 2,10); | |
| 1414 | - y = parseInt(i3GEO.parametros.h / 2,10); | |
| 1415 | - ll1 = calculo.tela2dd(x,y,"",""); | |
| 1416 | - ll2 = calculo.tela2dd(x + 1,y,"",""); | |
| 1417 | - d = calculo.distancia(ll1[0],ll1[1],ll2[0],ll2[1]); | |
| 1418 | - d = d * 1000; | |
| 1419 | - g_areapixel = d * d; | |
| 1420 | - g_areapixel < 0 ? i3GEO.janela.tempoMsg("Nao e possivel calcular a area. Entre em contato com o administrador do sistema.") : montacontainer(); | |
| 1421 | - } | |
| 1422 | - } | |
| 1423 | - else{i3GEO.desenho.richdraw.fecha();} | |
| 1424 | - }, | |
| 1425 | - fechaJanela: function(){ | |
| 1426 | - } | |
| 1427 | - }, | |
| 1428 | - | |
| 1429 | - | |
| 1430 | - | |
| 1431 | - //////////////////////////////////////////// | |
| 1432 | - /* | |
| 1433 | - Adiciona uma marca na tela e realiza o calculo de distancia dos pontos inseridos | |
| 1434 | - */ | |
| 1435 | - clique: function(){ | |
| 1436 | - var n,m; | |
| 1437 | - pontosdistobj = i3GEO.analise.pontosdistobj; | |
| 1438 | - if (g_tipoacao === "area"){ | |
| 1439 | - n = pontosdistobj.xpt.length; | |
| 1440 | - pontosdistobj.xpt[n] = objposicaocursor.ddx; | |
| 1441 | - pontosdistobj.ypt[n] = objposicaocursor.ddy; | |
| 1442 | - pontosdistobj.xtela[n] = objposicaocursor.telax; | |
| 1443 | - pontosdistobj.ytela[n] = objposicaocursor.telay; | |
| 1444 | - pontosdistobj.ximg[n] = objposicaocursor.imgx; | |
| 1445 | - pontosdistobj.yimg[n] = objposicaocursor.imgy; | |
| 1446 | - pontosdistobj.dist[n] = 0; | |
| 1447 | - //inclui a linha para ligar com o ponto inicial | |
| 1448 | - if (n === 0){ | |
| 1449 | - try { | |
| 1450 | - pontosdistobj.linhastemp = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1,pontosdistobj.ximg[0]-1,pontosdistobj.yimg[0]-1); | |
| 1451 | - } | |
| 1452 | - catch(e){ | |
| 1453 | - if(typeof(console) !== 'undefined'){console.error(e);} | |
| 1454 | - } | |
| 1455 | - } | |
| 1456 | - else{ | |
| 1457 | - if(navm) | |
| 1458 | - {i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, (pontosdistobj.ximg[n-1]),pontosdistobj.yimg[n-1],(pontosdistobj.ximg[n]),pontosdistobj.yimg[n]);} | |
| 1459 | - //parece qe tem um problema de versao do ie aqui | |
| 1460 | - //if(navm) | |
| 1461 | - //{i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, (pontosdistobj.ximg[n-1])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n-1],(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n]);} | |
| 1462 | - } | |
| 1463 | - try{ | |
| 1464 | - pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1,pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1); | |
| 1465 | - } | |
| 1466 | - catch(men){ | |
| 1467 | - if(typeof(console) !== 'undefined'){console.error(men);} | |
| 1468 | - } | |
| 1469 | - m = i3GEO.calculo.area(pontosdistobj.xtela,pontosdistobj.ytela,g_areapixel); | |
| 1470 | - i3GEO.util.defineValor("mostraarea_calculo","innerHTML","<br>m2</b>= "+m.toFixed(2)+"<br><b>km2</b>= "+(m/1000000).toFixed(2)+"<br><b>ha</b>= "+(m/10000).toFixed(2)); | |
| 1471 | - if(i3GEO.util.in_array(i3GEO.Interface.ATUAL,["openlayers","googlemaps"])){ | |
| 1472 | - i3GEO.util.insereMarca.cria(objposicaocursor.imgx,objposicaocursor.imgy,i3GEO.analise.medeArea.paraCalculo,"divGeometriasTemp","",i3GEO.configura.locaplic+"/imagens/estasel.png",6,6); | |
| 1473 | - i3GEO.desenho.insereCirculo(objposicaocursor.imgx,objposicaocursor.imgy,3,"white"); | |
| 1474 | - } | |
| 1475 | - if(i3GEO.Interface.ATUAL === "googleearth") | |
| 1476 | - {i3GEO.util.insereMarca.cria(objposicaocursor.ddx,objposicaocursor.ddy,i3GEO.analise.medeArea.paraCalculo,"divGeometriasTemp","");} | |
| 1477 | - } | |
| 1478 | - }, | |
| 1479 | - /* | |
| 1480 | - Para o calculo de area e ativa o botao "pan" | |
| 1481 | - */ | |
| 1482 | - paraCalculo: function(){ | |
| 1483 | - var botaoPan = $i("pan"); | |
| 1484 | - g_tipoacao = ""; | |
| 1485 | - botaoPan ? botaoPan.onclick.call() : i3GEO.barraDeBotoes.ativaBotoes(); | |
| 1486 | - }, | |
| 1487 | - /* | |
| 1488 | - Realiza o desenho do poligono conforme o usuario movimenta o mouse | |
| 1489 | - */ | |
| 1490 | - movimento: function(){ | |
| 1491 | - var n, | |
| 1492 | - pontosdistobj = i3GEO.analise.pontosdistobj; | |
| 1493 | - if (g_tipoacao === "area"){ | |
| 1494 | - n = pontosdistobj.xpt.length; | |
| 1495 | - if (n > 0){ | |
| 1496 | - i3GEO.desenho.aplica("resizePoligono",pontosdistobj.linhastemp,1); | |
| 1497 | - i3GEO.desenho.aplica("resizeLinha",pontosdistobj.linhas[n-1],n); | |
| 1498 | - } | |
| 1499 | - } | |
| 1500 | 1242 | } |
| 1501 | 1243 | } |
| 1502 | 1244 | }; | ... | ... |
classesjs/classe_eventos.js
| ... | ... | @@ -219,7 +219,10 @@ i3GEO.eventos = { |
| 219 | 219 | i3GEO.eventos.executaEventos(this.MOUSEUP); |
| 220 | 220 | } |
| 221 | 221 | else{ |
| 222 | - if(exy.target && (exy.target.style.zIndex == "" || exy.target.style.zIndex == 1)){ | |
| 222 | + if(i3GEO.Interface.ATUAL === "googlemaps" && exy.target && !exy.target.src){ | |
| 223 | + i3GEO.eventos.executaEventos(this.MOUSEUP); | |
| 224 | + } | |
| 225 | + if(i3GEO.Interface.ATUAL === "openlayers" && exy.target && (exy.target.style.zIndex == "" || exy.target.style.zIndex == 1)){ | |
| 223 | 226 | var parente = exy.target.parentNode; |
| 224 | 227 | if(parente && (parente.className === "olLayerDiv olLayerGrid" || (parente.childNodes && parente.childNodes[0].attributes[0].nodeValue === "olTileImage"))){ |
| 225 | 228 | i3GEO.eventos.executaEventos(this.MOUSEUP); |
| ... | ... | @@ -365,8 +368,6 @@ i3GEO.eventos = { |
| 365 | 368 | //se a interface for googleearth, googlemaps ou openlayers, os eventos são controlados |
| 366 | 369 | //pelas respectivas apis |
| 367 | 370 | //caso contrário, o i3geo irá controlar os cálculos |
| 368 | - //Entretanto, nas ferramentas que usam o richdraw (distância e área) o posicionamento | |
| 369 | - //deve ser controlado pelo i3geo | |
| 370 | 371 | // |
| 371 | 372 | var teladd,teladms, |
| 372 | 373 | container = "", | ... | ... |
classesjs/classe_i3geo.js
| ... | ... | @@ -230,7 +230,7 @@ var i3GEO = { |
| 230 | 230 | Essa variável é um contador utilizado para indicar quantos processos estão ativos e que |
| 231 | 231 | irão executar o redesenho do mapa. O mapa só é atualizado quando o contador for menor que 1. |
| 232 | 232 | Esse contador é utilizado no método i3GEO.atualiza |
| 233 | - O contador é necessário para evitar chamadas desnecessárias a função de redesenho do mapa. | |
| 233 | + O contador é necessário para evitar chamadas desnecessárias a� função de redesenho do mapa. | |
| 234 | 234 | |
| 235 | 235 | Tipo: |
| 236 | 236 | {string} |
| ... | ... | @@ -376,7 +376,7 @@ var i3GEO = { |
| 376 | 376 | {i3GEO.arvoreDeTemas.OPCOESADICIONAIS.navegacaoDir = true;} |
| 377 | 377 | // |
| 378 | 378 | //calcula (opcional) o tamanho correto da tabela onde fica o mapa |
| 379 | - //se não for feito esse cálculo, o mapa fica ajustado a esquerda | |
| 379 | + //se não for feito esse cálculo, o mapa fica ajustado a� esquerda | |
| 380 | 380 | // |
| 381 | 381 | temp = 0; |
| 382 | 382 | if ($i("contemFerramentas")){temp = temp + parseInt($i("contemFerramentas").style.width,10);} |
| ... | ... | @@ -576,8 +576,6 @@ var i3GEO = { |
| 576 | 576 | if(arguments.length === 0){return;} |
| 577 | 577 | i3GEO.mapa.verifica(retorno); |
| 578 | 578 | tempo = ""; |
| 579 | - if(i3GEO.desenho.richdraw) | |
| 580 | - {i3GEO.desenho.richdraw.clearWorkspace();} | |
| 581 | 579 | mapscale = i3GEO.parametros.mapscale; |
| 582 | 580 | i3GEO.atualizaParametros(retorno.data.variaveis); |
| 583 | 581 | ... | ... |
classesjs/classe_janela.js
| ... | ... | @@ -445,7 +445,7 @@ i3GEO.janela = { |
| 445 | 445 | }, |
| 446 | 446 | /* |
| 447 | 447 | Aplica a opção definida em ANTESFECHA e elimina alguns objetos que são comumente adicionados por algumas operações do i3geo |
| 448 | - como richdraw, box, pin | |
| 448 | + como box, pin | |
| 449 | 449 | |
| 450 | 450 | Parametros: |
| 451 | 451 | ... | ... |
classesjs/classe_php.js
| ... | ... | @@ -719,7 +719,7 @@ i3GEO.php = { |
| 719 | 719 | selecaobox: function(funcao,tema,tipo,box){ |
| 720 | 720 | i3GEO.php.verifica(); |
| 721 | 721 | var p = i3GEO.configura.locaplic+"/ferramentas/selecao/exec.php", |
| 722 | - par = "funcao=selecaobox&ext="+i3GEO.util.extOSM2Geo(box)+"&g_sid="+i3GEO.configura.sid+"&tipo="+tipo+"&tema="+tema+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); | |
| 722 | + par = "funcao=selecaobox&box="+i3GEO.util.extOSM2Geo(box)+"&g_sid="+i3GEO.configura.sid+"&tipo="+tipo+"&tema="+tema+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); | |
| 723 | 723 | cpJSON.call(p,"selecaobox",funcao,par); |
| 724 | 724 | }, |
| 725 | 725 | /* | ... | ... |
classesjs/classe_selecao.js
| ... | ... | @@ -1,339 +0,0 @@ |
| 1 | -/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */ | |
| 2 | - | |
| 3 | -/* | |
| 4 | -Esta classe foi depreciada e podera ser removida. Veja i3geo/ferramentas/selecao/index.js | |
| 5 | - | |
| 6 | -*/ | |
| 7 | -if(typeof(i3GEO) === 'undefined'){ | |
| 8 | - var i3GEO = {}; | |
| 9 | -} | |
| 10 | -i3GEO.selecao = { | |
| 11 | - porxy: function(tema,tipo,tolerancia){ | |
| 12 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.selecao.porxy()");} | |
| 13 | - var retorna = function(retorno) | |
| 14 | - {i3GEO.atualiza(retorno);}; | |
| 15 | - i3GEO.php.selecaopt(retorna,tema,objposicaocursor.ddx+" "+objposicaocursor.ddy,tipo,tolerancia); | |
| 16 | - }, | |
| 17 | - porbox: function(tema,tipo,box){ | |
| 18 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.navega.selecao.porbox()");} | |
| 19 | - var retorna = function(retorno) | |
| 20 | - {i3GEO.atualiza(retorno);}; | |
| 21 | - i3GEO.php.selecaobox(retorna,tema,tipo,box); | |
| 22 | - }, | |
| 23 | - janelaOpcoes: function(){ | |
| 24 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.selecao.janelaOpcoes()");} | |
| 25 | - var janela,temp; | |
| 26 | - g_tipoacao = "selecao"; | |
| 27 | - i3GEO.mapa.ativaTema(""); | |
| 28 | - janela = i3GEO.janela.cria("430px","320px",i3GEO.configura.locaplic+'/ferramentas/selecao/index.htm',"","",$trad("x51")+" <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=48a' > </a>"); | |
| 29 | - if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEO.selecao.clique()") < 0) | |
| 30 | - {i3GEO.eventos.MOUSECLIQUE.push("i3GEO.selecao.clique()");} | |
| 31 | - if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.selecao.atualizaGrafico()") < 0) | |
| 32 | - {i3GEO.eventos.NAVEGAMAPA.push("i3GEO.selecao.atualizaGrafico()");} | |
| 33 | - | |
| 34 | - temp = function(){ | |
| 35 | - i3GEO.eventos.MOUSECLIQUE.remove("i3GEO.selecao.clique()"); | |
| 36 | - i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.selecao.atualizaGrafico()"); | |
| 37 | - try{ | |
| 38 | - i3GEO.desenho.richdraw.fecha(); | |
| 39 | - } | |
| 40 | - catch(e){ | |
| 41 | - if(typeof(console) !== 'undefined'){console.error("i3GEO.selecao.janelaOpcoes "+e);} | |
| 42 | - } | |
| 43 | - if($i("pontosins")){document.body.removeChild($i("pontosins"));} | |
| 44 | - i3GEO.barraDeBotoes.ativaBotoes(); | |
| 45 | - }; | |
| 46 | - YAHOO.util.Event.addListener(janela[0].close, "click", temp); | |
| 47 | - }, | |
| 48 | - atualizaGrafico: function(){ | |
| 49 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.selecao.atualizaGrafico()");} | |
| 50 | - if(g_tipoacao === "selecao"){ | |
| 51 | - var doc = (navm) ? document.frames("wdocai").document : $i("wdocai").contentDocument; | |
| 52 | - if(doc.getElementById("guia5obj")){ | |
| 53 | - if(doc.getElementById("guia5obj").style.display==="block"){ | |
| 54 | - if(window.parent.frames.wdocai.atualizaGrafico) | |
| 55 | - {window.parent.frames.wdocai.atualizaGrafico();} | |
| 56 | - } | |
| 57 | - } | |
| 58 | - } | |
| 59 | - }, | |
| 60 | - clique: function(){ | |
| 61 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.selecao.clique()");} | |
| 62 | - if (g_tipoacao === "selecao"){ | |
| 63 | - var doc,tipo,tolerancia; | |
| 64 | - doc = (navm) ? document.frames("wdocai").document : $i("wdocai").contentDocument; | |
| 65 | - tipo = "adiciona"; | |
| 66 | - //pega o tipo de operacao da janela de selecao | |
| 67 | - if(doc.getElementById("tipoOperacao")) | |
| 68 | - {tipo = doc.getElementById("tipoOperacao").value;} | |
| 69 | - if (i3GEO.temaAtivo === "") | |
| 70 | - {i3GEO.janela.tempoMsg("Nenhum tema ativo");return;} | |
| 71 | - tolerancia = doc.getElementById("toleranciapt").value; | |
| 72 | - //se tipo for limpa ou inverte, a operacao nao e executada no clique no mapa | |
| 73 | - if ((tipo !== "limpa") && (tipo !== "inverte")) | |
| 74 | - {i3GEO.selecao.porxy(i3GEO.temaAtivo,tipo,tolerancia);} | |
| 75 | - } | |
| 76 | - }, | |
| 77 | - box: { | |
| 78 | - inicia: function(){ | |
| 79 | - if(g_tipoacao !== 'selecaobox') | |
| 80 | - {return;} | |
| 81 | - i3GEO.selecao.box.criaBox(); | |
| 82 | - adicionaxyBox = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); | |
| 83 | - var i = $i("i3geoboxSel").style; | |
| 84 | - i.width=0 + "px"; | |
| 85 | - i.height=0 + "px"; | |
| 86 | - i.visibility="visible"; | |
| 87 | - i.display="block"; | |
| 88 | - i.left = objposicaocursor.imgx + adicionaxyBox[0] + "px"; | |
| 89 | - i.top = objposicaocursor.imgy + adicionaxyBox[1] + "px"; | |
| 90 | - | |
| 91 | - boxxini = objposicaocursor.imgx + adicionaxyBox[0]; | |
| 92 | - boxyini = objposicaocursor.imgy + adicionaxyBox[1]; | |
| 93 | - //tamanhox = 0; | |
| 94 | - //tamanhoy = 0; | |
| 95 | - if(i3GEO.eventos.MOUSEMOVE.toString().search("i3GEO.selecao.box.desloca()") < 0) | |
| 96 | - {i3GEO.eventos.MOUSEMOVE.push("i3GEO.selecao.box.desloca()");} | |
| 97 | - if(i3GEO.eventos.MOUSEUP.toString().search("i3GEO.selecao.box.termina()") < 0) | |
| 98 | - {i3GEO.eventos.MOUSEUP.push("i3GEO.selecao.box.termina()");} | |
| 99 | - }, | |
| 100 | - /* | |
| 101 | - criaBox | |
| 102 | - | |
| 103 | - Cria o DIV que sera utilizado para desenhar o box no mapa | |
| 104 | - */ | |
| 105 | - criaBox: function(){ | |
| 106 | - try{i3GEO.desenho.richdraw.fecha();}catch(e){ | |
| 107 | - if(typeof(console) !== 'undefined'){console.error("i3GEO.selecao.criaBox "+e);} | |
| 108 | - } | |
| 109 | - i3GEO.desenho.criaContainerRichdraw(); | |
| 110 | - i3GEO.desenho.richdraw.lineColor = "red"; | |
| 111 | - i3GEO.desenho.richdraw.lineWidth = "2px"; | |
| 112 | - var novoel,temp; | |
| 113 | - if(!$i("i3geoboxSel")){ | |
| 114 | - novoel = document.createElement("div"); | |
| 115 | - novoel.style.width = "0px"; | |
| 116 | - novoel.style.height = "0px"; | |
| 117 | - novoel.id = "i3geoboxSel"; | |
| 118 | - novoel.style.display = "none"; | |
| 119 | - novoel.style.fontSize = "0px"; | |
| 120 | - if(navn) | |
| 121 | - {novoel.style.opacity = 0.25;} | |
| 122 | - novoel.style.backgroundColor = "yellow"; | |
| 123 | - novoel.style.position="absolute"; | |
| 124 | - novoel.style.border = "2px solid #ff0000"; | |
| 125 | - if (navm) | |
| 126 | - {novoel.style.filter = "alpha(opacity=25)";} | |
| 127 | - novoel.onmousemove = function(){ | |
| 128 | - var b,wb,hb; | |
| 129 | - b = $i("i3geoboxSel").style; | |
| 130 | - wb = parseInt(b.width,10); | |
| 131 | - hb = parseInt(b.height,10); | |
| 132 | - if (navm){ | |
| 133 | - if(wb > 2) | |
| 134 | - {b.width = wb - 2 + "px";} | |
| 135 | - if(hb > 2) | |
| 136 | - {b.height = hb - 2 + "px";} | |
| 137 | - } | |
| 138 | - else{ | |
| 139 | - b.width = wb - 2 + "px"; | |
| 140 | - b.height = hb - 2 + "px"; | |
| 141 | - } | |
| 142 | - }; | |
| 143 | - novoel.onmouseup = function() | |
| 144 | - {i3GEO.selecao.box.termina();}; | |
| 145 | - document.body.appendChild(novoel); | |
| 146 | - } | |
| 147 | - i3GEO.util.mudaCursor(i3GEO.configura.cursores,"zoom","i3geoboxSel",i3GEO.configura.locaplic); | |
| 148 | - if($i("img")){ | |
| 149 | - $i("img").title = ""; | |
| 150 | - temp = "zoom"; | |
| 151 | - if(i3GEO.Interface.ATIVAMENUCONTEXTO) | |
| 152 | - {temp = "zoom_contexto";} | |
| 153 | - i3GEO.util.mudaCursor(i3GEO.configura.cursores,temp,"img",i3GEO.configura.locaplic); | |
| 154 | - } | |
| 155 | - }, | |
| 156 | - /* | |
| 157 | - desloca | |
| 158 | - | |
| 159 | - Desloca o box conforme o mouse e movimentado | |
| 160 | - */ | |
| 161 | - desloca: function(){ | |
| 162 | - if(g_tipoacao !== 'selecaobox') | |
| 163 | - {return;} | |
| 164 | - var bxs,ppx,py; | |
| 165 | - bxs = $i("i3geoboxSel").style; | |
| 166 | - if(bxs.display !== "block") | |
| 167 | - {return;} | |
| 168 | - ppx = objposicaocursor.imgx + adicionaxyBox[0]; | |
| 169 | - py = objposicaocursor.imgy + adicionaxyBox[1]; | |
| 170 | - if (navm){ | |
| 171 | - if ((ppx > boxxini) && ((ppx - boxxini - 2) > 0)) | |
| 172 | - {bxs.width = ppx - boxxini - 2 + "px";} | |
| 173 | - if ((py > boxyini) && ((py - boxyini - 2) > 0)) | |
| 174 | - {bxs.height = py - boxyini - 2 + "px";} | |
| 175 | - if (ppx < boxxini) | |
| 176 | - {bxs.left = ppx;bxs.width = boxxini - ppx + 2 + "px";} | |
| 177 | - if (py < boxyini) | |
| 178 | - {bxs.top = py;bxs.height = boxyini - py + 2 + "px";} | |
| 179 | - } | |
| 180 | - else{ | |
| 181 | - if (ppx > boxxini) | |
| 182 | - {bxs.width = ppx - boxxini + "px";} | |
| 183 | - if (py > boxyini) | |
| 184 | - {bxs.height = py - boxyini + "px";} | |
| 185 | - if (ppx < boxxini) | |
| 186 | - {bxs.left = ppx + "px";bxs.width = boxxini - ppx + "px";} | |
| 187 | - if (py < boxyini) | |
| 188 | - {bxs.top = py + "px";bxs.height = boxyini - py + "px";} | |
| 189 | - } | |
| 190 | - }, | |
| 191 | - /* | |
| 192 | - termina | |
| 193 | - | |
| 194 | - Para o desenho do box, captura seu tamanho e faz o zoom no mapa | |
| 195 | - */ | |
| 196 | - termina: function(){ | |
| 197 | - if(g_tipoacao !== 'selecaobox') | |
| 198 | - {return;} | |
| 199 | - var valor,v,x1,y1,x2,y2, | |
| 200 | - limpa = function(){}, | |
| 201 | - doc,tipo; | |
| 202 | - try{ | |
| 203 | - valor = i3GEO.calculo.rect2ext("i3geoboxSel",i3GEO.parametros.mapexten,i3GEO.parametros.pixelsize); | |
| 204 | - v = valor[0]; | |
| 205 | - x1 = valor[1]; | |
| 206 | - y1 = valor[2]; | |
| 207 | - x2 = valor[3]; | |
| 208 | - y2 = valor[4]; | |
| 209 | - limpa = function(){ | |
| 210 | - var bxs = $i("i3geoboxSel").style; | |
| 211 | - bxs.display="none"; | |
| 212 | - bxs.visibility="hidden"; | |
| 213 | - bxs.width = 0 + "px"; | |
| 214 | - bxs.height = 0 + "px"; | |
| 215 | - }; | |
| 216 | - if((x1 === x2) || (y1 === y2)) | |
| 217 | - {limpa.call();return;} | |
| 218 | - // se o retangulo for negativo pula essa parte para nao gerar erro | |
| 219 | - i3GEO.parametros.mapexten=v; | |
| 220 | - limpa.call(); | |
| 221 | - i3GEO.eventos.MOUSEMOVE.remove("i3GEO.selecao.box.desloca()"); | |
| 222 | - i3GEO.eventos.MOUSEUP.remove("i3GEO.selecao.box.termina()"); | |
| 223 | - | |
| 224 | - doc = (navm) ? document.frames("wdocai").document : $i("wdocai").contentDocument; | |
| 225 | - tipo = "adiciona"; | |
| 226 | - //pega o tipo de operacao da janela de selecao | |
| 227 | - if (doc.getElementById("tipoOperacao")) | |
| 228 | - {tipo = doc.getElementById("tipoOperacao").value;} | |
| 229 | - | |
| 230 | - if ((tipo !== "limpa") && (tipo !== "inverte")) | |
| 231 | - {i3GEO.selecao.porbox(i3GEO.temaAtivo,tipo,v);} | |
| 232 | - } | |
| 233 | - catch(e){ | |
| 234 | - if(typeof(console) !== 'undefined'){console.error(e);} | |
| 235 | - limpa.call(); | |
| 236 | - return; | |
| 237 | - } | |
| 238 | - } | |
| 239 | - }, | |
| 240 | - /* | |
| 241 | - i3GEO.selecao.poligono | |
| 242 | - | |
| 243 | - Realiza a selecao desenhando um poligono no mapa | |
| 244 | - */ | |
| 245 | - poligono:{ | |
| 246 | - /* | |
| 247 | - inicia | |
| 248 | - | |
| 249 | - Inicia o desenho do poligono | |
| 250 | - */ | |
| 251 | - inicia: function(){ | |
| 252 | - try | |
| 253 | - {i3GEO.desenho.richdraw.fecha();} | |
| 254 | - catch(e){ | |
| 255 | - if(typeof(console) !== 'undefined'){console.error(e);} | |
| 256 | - } | |
| 257 | - i3GEO.util.insereMarca.limpa(); | |
| 258 | - g_tipoacao = "selecaopoli"; | |
| 259 | - i3GEO.janela.tempoMsg($trad("x20")); | |
| 260 | - i3GEO.desenho.criaContainerRichdraw(); | |
| 261 | - i3GEO.desenho.richdraw.lineColor = "red"; | |
| 262 | - i3GEO.desenho.richdraw.lineWidth = "2px"; | |
| 263 | - i3GEO.eventos.MOUSECLIQUE.remove("i3GEO.selecao.clique()"); | |
| 264 | - if(i3GEO.eventos.MOUSEMOVE.toString().search("i3GEO.selecao.poligono.move()") < 0) | |
| 265 | - {i3GEO.eventos.MOUSEMOVE.push("i3GEO.selecao.poligono.move()");} | |
| 266 | - if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEO.selecao.poligono.clique()") < 0) | |
| 267 | - {i3GEO.eventos.MOUSECLIQUE.push("i3GEO.selecao.poligono.clique()");} | |
| 268 | - }, | |
| 269 | - /* | |
| 270 | - move | |
| 271 | - | |
| 272 | - Modifica o poligono conforme o usuario cria vertices | |
| 273 | - */ | |
| 274 | - move: function(){ | |
| 275 | - if (g_tipoacao === "selecaopoli"){ | |
| 276 | - var n = pontosdistobj.xpt.length; | |
| 277 | - if (n > 0){ | |
| 278 | - i3GEO.desenho.aplica("resizePoligono",pontosdistobj.linhas[n-1],n); | |
| 279 | - } | |
| 280 | - } | |
| 281 | - }, | |
| 282 | - /* | |
| 283 | - clique | |
| 284 | - | |
| 285 | - Inclui um novo vertice no poligono | |
| 286 | - */ | |
| 287 | - clique: function(){ | |
| 288 | - if (g_tipoacao !== "selecaopoli"){return;} | |
| 289 | - var n,d; | |
| 290 | - n = pontosdistobj.xpt.length; | |
| 291 | - pontosdistobj.xpt[n] = objposicaocursor.ddx; | |
| 292 | - pontosdistobj.ypt[n] = objposicaocursor.ddy; | |
| 293 | - pontosdistobj.xtela[n] = objposicaocursor.telax; | |
| 294 | - pontosdistobj.ytela[n] = objposicaocursor.telay; | |
| 295 | - pontosdistobj.ximg[n] = objposicaocursor.imgx; | |
| 296 | - pontosdistobj.yimg[n] = objposicaocursor.imgy; | |
| 297 | - pontosdistobj.dist[n] = 0; | |
| 298 | - try{ | |
| 299 | - if (navn) | |
| 300 | - {pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, (pontosdistobj.ximg[n]-1),(pontosdistobj.yimg[n]-1),(pontosdistobj.ximg[n]-1),(pontosdistobj.yimg[n]-1));} | |
| 301 | - else | |
| 302 | - {pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, (pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n],(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n]);} | |
| 303 | - } | |
| 304 | - catch(e){ | |
| 305 | - if(typeof(console) !== 'undefined'){console.error(e);} | |
| 306 | - } | |
| 307 | - if (n > 0){ | |
| 308 | - d = parseInt(i3GEO.calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy),10); | |
| 309 | - pontosdistobj.dist[n] = d + pontosdistobj.dist[n-1]; | |
| 310 | - } | |
| 311 | - i3GEO.util.insereMarca.cria(objposicaocursor.imgx,objposicaocursor.imgy,i3GEO.selecao.poligono.termina,"divGeometriasTemp"); | |
| 312 | - }, | |
| 313 | - /* | |
| 314 | - termina | |
| 315 | - | |
| 316 | - Termina o desenho do poligono e executa a operacao de selecao | |
| 317 | - */ | |
| 318 | - termina: function(){ | |
| 319 | - var doc,pontos,xs,ys,retorna,p,cp; | |
| 320 | - doc = (navm) ? document.frames("wdocai").document : $i("wdocai").contentDocument; | |
| 321 | - pontos = pontosdistobj; | |
| 322 | - i3GEO.desenho.richdraw.fecha(); | |
| 323 | - i3GEO.mapa.ativaTema(doc.getElementById("comboTemas").value); | |
| 324 | - xs = pontos.xpt.toString(","); | |
| 325 | - ys = pontos.ypt.toString(","); | |
| 326 | - retorna = function(){ | |
| 327 | - i3GEO.janela.fechaAguarde("i3GEO.atualiza",$trad("o1")); | |
| 328 | - i3GEO.atualiza(""); | |
| 329 | - }; | |
| 330 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=selecaoPoli"; | |
| 331 | - cp = new cpaint(); | |
| 332 | - //cp.set_debug(2) | |
| 333 | - cp.set_transfer_mode('POST'); | |
| 334 | - cp.set_response_type("JSON"); | |
| 335 | - cp.call(p,"selecaoPoli",retorna,xs,ys,doc.getElementById("comboTemas").value,doc.getElementById("tipoOperacao").value); | |
| 336 | - } | |
| 337 | - } | |
| 338 | -}; | |
| 339 | -//YAHOO.log("carregou classe selecao", "Classes i3geo"); | |
| 340 | 0 | \ No newline at end of file |
classesjs/classe_util.js
| ... | ... | @@ -2961,6 +2961,19 @@ i3GEO.util = { |
| 2961 | 2961 | return ext; |
| 2962 | 2962 | }, |
| 2963 | 2963 | /* |
| 2964 | + Function: projOSM2Geo | |
| 2965 | + | |
| 2966 | + Projeta um objeto OpenLayers de OSM para GEO | |
| 2967 | + */ | |
| 2968 | + projOSM2Geo: function(obj){ | |
| 2969 | + if(i3GEO.Interface.openlayers.googleLike === true){ | |
| 2970 | + projWGS84 = new OpenLayers.Projection("EPSG:4326"); | |
| 2971 | + proj900913 = new OpenLayers.Projection("EPSG:900913"); | |
| 2972 | + obj = obj.transform(proj900913,projWGS84); | |
| 2973 | + } | |
| 2974 | + return obj; | |
| 2975 | + }, | |
| 2976 | + /* | |
| 2964 | 2977 | Function: navegadorDir |
| 2965 | 2978 | |
| 2966 | 2979 | Abre o navegador de arquivos localizados no servidor | ... | ... |
classesjs/compactajs.php
| ... | ... | @@ -32,7 +32,6 @@ i3geo/classesjs/compactajs.php |
| 32 | 32 | |
| 33 | 33 | */ |
| 34 | 34 | // |
| 35 | -//compacta os arquivos do richdraw | |
| 36 | 35 | // |
| 37 | 36 | $locaplic = dirname(__FILE__)."/.."; |
| 38 | 37 | include_once(dirname(__FILE__)."/../admin/php/admin.php"); |
| ... | ... | @@ -70,20 +69,6 @@ if (!file_exists("../mashups/teste.txt")){ |
| 70 | 69 | echo "<br><span style='color:red'>Não foi possivel escrever em mashups";exit; |
| 71 | 70 | } |
| 72 | 71 | echo "<pre>"; |
| 73 | -packer("../pacotes/richdraw/richdraw.js","../pacotes/richdraw/richdraw_compacto.js","Normal"); | |
| 74 | -packer("../pacotes/richdraw/svgrenderer.js","../pacotes/richdraw/svgrenderer_compacto.js","Normal"); | |
| 75 | -packer("../pacotes/richdraw/vmlrenderer.js","../pacotes/richdraw/vmlrenderer_compacto.js","Normal"); | |
| 76 | -$s = inicia("../pacotes/richdraw/prototype.js"); | |
| 77 | -$abre = fopen("../pacotes/richdraw/prototype_compacto.js", "wt"); | |
| 78 | -$escreve = fwrite ($abre,$s); | |
| 79 | -$fecha = fclose ($abre); | |
| 80 | -$jsfiles = array( | |
| 81 | -"../pacotes/richdraw/richdraw_compacto.js", | |
| 82 | -"../pacotes/richdraw/svgrenderer_compacto.js", | |
| 83 | -"../pacotes/richdraw/vmlrenderer_compacto.js" | |
| 84 | -); | |
| 85 | -$buffer = ""; | |
| 86 | -salvatudojs($jsfiles,$buffer,"../pacotes/richdraw/richdraw_tudo_compacto.js","js"); | |
| 87 | 72 | // |
| 88 | 73 | //compacta os arquivos do i3geo |
| 89 | 74 | //gera um arquivo compactado para cada um |
| ... | ... | @@ -185,7 +170,6 @@ $jsfiles = array( |
| 185 | 170 | "compactados/classe_eventos_compacto.js", |
| 186 | 171 | "compactados/classe_arvoredetemas_compacto.js", |
| 187 | 172 | "compactados/classe_barradebotoes_compacto.js", |
| 188 | -"../pacotes/richdraw/richdraw_tudo_compacto.js", | |
| 189 | 173 | "compactados/classe_coordenadas_compacto.js", |
| 190 | 174 | "compactados/classe_gadgets_compacto.js", |
| 191 | 175 | "compactados/classe_social_compacto.js", | ... | ... |
classesjs/i3geonaocompacto.js
ferramentas/selecao/exec.php
| ... | ... | @@ -107,7 +107,7 @@ Seleciona elementos utilizando um ret&acirc;ngulo. |
| 107 | 107 | foreach($temas as $tema) |
| 108 | 108 | { |
| 109 | 109 | $m = new Selecao($map_file,$tema,$ext); |
| 110 | - $ok[] = $m->selecaoBOX($tipo,$ext); | |
| 110 | + $ok[] = $m->selecaoBOX($tipo,$box); | |
| 111 | 111 | } |
| 112 | 112 | $_SESSION["contadorsalva"]++; |
| 113 | 113 | redesenhaMapa(); | ... | ... |
ferramentas/selecao/index.js
| ... | ... | @@ -162,7 +162,7 @@ i3GEOF.selecao = { |
| 162 | 162 | '</div><br>' + |
| 163 | 163 | '<div class=guiaobj id="i3GEOselecaoguia1obj" style="left:1px;display:none;top:-5px">' + |
| 164 | 164 | ' <p class=paragrafo ><button title="Clique no mapa para selecionar" value="i3GEOselecaopt" onclick="i3GEOF.selecao.tiposel(this)"><img id=i3GEOselecaopt src="'+i3GEO.configura.locaplic+'/imagens/gisicons/select-one.png" /></button>'; |
| 165 | - if(i3GEO.Interface.ATUAL != "googlemaps" && i3GEO.Interface.ATUAL != "googleearth") | |
| 165 | + if(i3GEO.Interface.ATUAL != "googleearth") | |
| 166 | 166 | {ins += ' <button title="'+$trad(5,i3GEOF.selecao.dicionario)+'" onclick="i3GEOF.selecao.tiposel(this)" value="i3GEOselecaopoli"><img id=i3GEOselecaopoli src="'+i3GEO.configura.locaplic+'/imagens/gisicons/select-polygon.png" /></button>';} |
| 167 | 167 | ins += ' <button title="'+$trad(6,i3GEOF.selecao.dicionario)+'" onclick="i3GEOF.selecao.tiposel(this)" value="i3GEOselecaoext" ><img id=i3GEOselecaoext src="'+i3GEO.configura.locaplic+'/imagens/gisicons/map.png" /></button>'; |
| 168 | 168 | if(i3GEO.Interface.ATUAL != "googlemaps" && i3GEO.Interface.ATUAL != "googleearth" && !navm) |
| ... | ... | @@ -250,20 +250,13 @@ i3GEOF.selecao = { |
| 250 | 250 | |
| 251 | 251 | if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.selecao.criaCombosTemas()") < 0) |
| 252 | 252 | {i3GEO.eventos.ATUALIZAARVORECAMADAS.push("i3GEOF.selecao.criaCombosTemas()");} |
| 253 | - if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEOF.selecao.clique()") < 0) | |
| 254 | - {i3GEO.eventos.MOUSECLIQUE.push("i3GEOF.selecao.clique()");} | |
| 255 | 253 | i3GEO.eventos.cliquePerm.desativa(); |
| 254 | + | |
| 256 | 255 | temp = function(){ |
| 257 | 256 | i3GEO.eventos.cliquePerm.ativa(); |
| 258 | 257 | if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEOF.selecao.criaCombosTemas()") > 0) |
| 259 | 258 | {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove("i3GEOF.selecao.criaCombosTemas()");} |
| 260 | 259 | i3GEO.barraDeBotoes.ativaPadrao(); |
| 261 | - i3GEO.eventos.MOUSECLIQUE.remove("i3GEOF.selecao.clique()"); | |
| 262 | - try{ | |
| 263 | - i3GEO.desenho.richdraw.fecha(); | |
| 264 | - } | |
| 265 | - catch(e){} | |
| 266 | - if($i("pontosins")){document.body.removeChild($i("pontosins"));} | |
| 267 | 260 | }; |
| 268 | 261 | YAHOO.util.Event.addListener(janela[0].close, "click", temp); |
| 269 | 262 | i3GEO.util.mudaCursor(i3GEO.configura.cursores,"crosshair",i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic); |
| ... | ... | @@ -278,16 +271,13 @@ i3GEOF.selecao = { |
| 278 | 271 | i3GEO.util.mudaCursor(i3GEO.configura.cursores,"crosshair",i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic); |
| 279 | 272 | i3GEO.barraDeBotoes.ativaIcone("selecao"); |
| 280 | 273 | i3GEOF.selecao.pegaTemasSel(); |
| 281 | - g_tipoacao='selecao'; | |
| 282 | - g_operacao=''; | |
| 283 | 274 | i3GEOF.selecao.mudaicone(); |
| 284 | 275 | var i = $i("i3GEOF.selecao_c").style; |
| 285 | 276 | i3GEO.janela.ULTIMOZINDEX++; |
| 286 | 277 | i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; |
| 287 | - if(i3GEO.Interface.ATUAL == "googlemaps") | |
| 288 | - {i3GEO.Interface.googlemaps.recalcPar();} | |
| 289 | - if(i3GEO.Interface.ATUAL == "googleearth") | |
| 290 | - {i3GEO.Interface.googleearth.recalcPar();} | |
| 278 | + if(i3GEO.Interface.ATUAL != "openlayers"){ | |
| 279 | + i3GEO.Interface[i3GEO.Interface.ATUAL].recalcPar(); | |
| 280 | + } | |
| 291 | 281 | }, |
| 292 | 282 | /* |
| 293 | 283 | Function: criaCombosTemas |
| ... | ... | @@ -331,8 +321,6 @@ i3GEOF.selecao = { |
| 331 | 321 | {$i("i3GEOselecaobox").parentNode.style.backgroundColor = "#F5F5F5";} |
| 332 | 322 | if($i("i3GEOselecaopoli")) |
| 333 | 323 | {$i("i3GEOselecaopoli").parentNode.style.backgroundColor = "#F5F5F5";} |
| 334 | - try{i3GEO.desenho.richdraw.fecha();} | |
| 335 | - catch(e){} | |
| 336 | 324 | }, |
| 337 | 325 | /* |
| 338 | 326 | Function: pegaTemasSel |
| ... | ... | @@ -372,8 +360,9 @@ i3GEOF.selecao = { |
| 372 | 360 | tipo {String} - tipo de operação inverte|limpa |
| 373 | 361 | */ |
| 374 | 362 | operacao: function(tipo){ |
| 375 | - if(i3GEOF.selecao.aguarde.visibility === "visible") | |
| 376 | - {return;} | |
| 363 | + if(i3GEOF.selecao.aguarde.visibility === "visible"){ | |
| 364 | + return; | |
| 365 | + } | |
| 377 | 366 | try{ |
| 378 | 367 | if($i("i3GEOselecaotemasLigados").value === "") |
| 379 | 368 | {i3GEO.janela.tempoMsg("Escolha um tema");return;} |
| ... | ... | @@ -383,8 +372,6 @@ i3GEOF.selecao = { |
| 383 | 372 | fim = function(retorno){ |
| 384 | 373 | var nsel; |
| 385 | 374 | i3GEOF.selecao.aguarde.visibility = "hidden"; |
| 386 | - if(i3GEO.Interface.ATUAL === "padrao") | |
| 387 | - {i3GEO.atualiza(retorno);} | |
| 388 | 375 | i3GEO.Interface.atualizaTema(retorno,tema); |
| 389 | 376 | //verifica qts elementos selecionados |
| 390 | 377 | nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas); |
| ... | ... | @@ -404,18 +391,15 @@ i3GEOF.selecao = { |
| 404 | 391 | obj {objeto dom) - objeto que foi clicado para disparar a operação. O valor identifica o tipo de operação |
| 405 | 392 | */ |
| 406 | 393 | tiposel: function(obj){ |
| 407 | - if(i3GEOF.selecao.aguarde.visibility === "visible") | |
| 408 | - {return;} | |
| 394 | + if(i3GEOF.selecao.aguarde.visibility === "visible"){ | |
| 395 | + return; | |
| 396 | + } | |
| 409 | 397 | try{ |
| 410 | 398 | if($i("i3GEOselecaotemasLigados").value === "") |
| 411 | 399 | {i3GEO.janela.tempoMsg("Escolha um tema");return;} |
| 412 | - //window.parent.i3GEO.eventos.MOUSEDOWN.remove("i3GEO.selecao.box.inicia()") | |
| 413 | - //$i("parapoli").style.display = "none"; | |
| 414 | 400 | var fim = function(retorno){ |
| 415 | 401 | var nsel; |
| 416 | 402 | i3GEOF.selecao.aguarde.visibility = "hidden"; |
| 417 | - if(i3GEO.Interface.ATUAL === "padrao") | |
| 418 | - {i3GEO.atualiza(retorno);} | |
| 419 | 403 | i3GEO.Interface.atualizaTema(retorno,tema); |
| 420 | 404 | nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas); |
| 421 | 405 | $i("i3GEOselecaoNsel").innerHTML = $trad(28,i3GEOF.selecao.dicionario)+": "+(nsel.nsel); |
| ... | ... | @@ -428,23 +412,20 @@ i3GEOF.selecao = { |
| 428 | 412 | if (obj.value == "i3GEOselecaobox"){ |
| 429 | 413 | i3GEOF.selecao.mudaicone(); |
| 430 | 414 | obj.style.backgroundColor = "#cedff2"; |
| 431 | - g_tipoacao = "selecaobox"; | |
| 432 | - i3GEOF.selecao.box.criaBox(); | |
| 433 | - if(i3GEO.eventos.MOUSEDOWN.toString().search("i3GEOF.selecao.box.inicia()") < 0) | |
| 434 | - {i3GEO.eventos.MOUSEDOWN.push("i3GEOF.selecao.box.inicia()");} | |
| 415 | + i3GEO.desenho[i3GEO.Interface["ATUAL"]].inicia(); | |
| 416 | + i3GEOF.selecao.box[i3GEO.Interface["ATUAL"]].inicia(); | |
| 435 | 417 | } |
| 436 | 418 | if (obj.value == "i3GEOselecaopt"){ |
| 437 | 419 | i3GEOF.selecao.mudaicone(); |
| 438 | 420 | obj.style.backgroundColor = "#cedff2"; |
| 439 | - g_tipoacao = "selecao"; | |
| 440 | - if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEOF.selecao.clique()") < 0) | |
| 441 | - {i3GEO.eventos.MOUSECLIQUE.push("i3GEOF.selecao.clique()");} | |
| 421 | + i3GEO.desenho[i3GEO.Interface["ATUAL"]].inicia(); | |
| 422 | + i3GEOF.selecao.clique[i3GEO.Interface["ATUAL"]].inicia(); | |
| 442 | 423 | } |
| 443 | 424 | if (obj.value == "i3GEOselecaopoli"){ |
| 444 | 425 | i3GEOF.selecao.mudaicone(); |
| 445 | 426 | obj.style.backgroundColor = "#cedff2"; |
| 446 | - g_tipoacao = "selecaopoli"; | |
| 447 | - i3GEOF.selecao.poligono.inicia(); | |
| 427 | + i3GEO.desenho[i3GEO.Interface["ATUAL"]].inicia(); | |
| 428 | + i3GEOF.selecao.poligono[i3GEO.Interface["ATUAL"]].inicia(); | |
| 448 | 429 | } |
| 449 | 430 | } |
| 450 | 431 | catch(e){i3GEO.janela.tempoMsg("Erro: "+e);i3GEOF.selecao.aguarde.visibility = "hidden";} |
| ... | ... | @@ -455,332 +436,261 @@ i3GEOF.selecao = { |
| 455 | 436 | Controla o desenho do box para a seleção e executa a operação de seleção |
| 456 | 437 | */ |
| 457 | 438 | box:{ |
| 458 | - /* | |
| 459 | - Function: inicia | |
| 460 | - | |
| 461 | - Marca o início do desenho do box, capturando a posição do mouse | |
| 462 | - */ | |
| 463 | - inicia: function(){ | |
| 464 | - if($i("i3GEOselecaotemasLigados").value === "") | |
| 465 | - {i3GEO.janela.tempoMsg($trad(1,i3GEOF.selecao.dicionario));return;} | |
| 466 | - if(g_tipoacao !== 'selecaobox') | |
| 467 | - {return;} | |
| 468 | - | |
| 469 | - i3GEO.Interface.openlayers.OLpan.deactivate(); | |
| 470 | - i3geoOL.removeControl(i3GEO.Interface.openlayers.OLpan); | |
| 471 | - i3GEOF.selecao.box.criaBox(); | |
| 472 | - adicionaxyBox = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); | |
| 473 | - var i = $i("i3geoboxSel").style; | |
| 474 | - i.width="10px"; | |
| 475 | - i.height="10px"; | |
| 476 | - i.visibility="visible"; | |
| 477 | - i.display="block"; | |
| 478 | - i.left = objposicaocursor.imgx + adicionaxyBox[0] - 5 + "px"; | |
| 479 | - i.top = objposicaocursor.imgy + adicionaxyBox[1] - 5 + "px"; | |
| 480 | - boxxini = objposicaocursor.imgx + adicionaxyBox[0]; | |
| 481 | - boxyini = objposicaocursor.imgy + adicionaxyBox[1]; | |
| 482 | - if(i3GEO.eventos.MOUSEMOVE.toString().search("i3GEOF.selecao.box.desloca()") < 0) | |
| 483 | - {i3GEO.eventos.MOUSEMOVE.push("i3GEOF.selecao.box.desloca()");} | |
| 484 | - if(i3GEO.eventos.MOUSEUP.toString().search("i3GEOF.selecao.box.termina()") < 0) | |
| 485 | - {i3GEO.eventos.MOUSEUP.push("i3GEOF.selecao.box.termina()");} | |
| 486 | - }, | |
| 487 | - /* | |
| 488 | - Function: criaBox | |
| 489 | - | |
| 490 | - Cria o DIV que será utilizado para desenhar o box no mapa | |
| 491 | - */ | |
| 492 | - criaBox: function(){ | |
| 493 | - try{i3GEO.desenho.richdraw.fecha();} | |
| 494 | - catch(e){ | |
| 495 | - if(typeof(console) !== 'undefined'){console.error(e);} | |
| 496 | - } | |
| 497 | - i3GEO.desenho.criaContainerRichdraw(); | |
| 498 | - i3GEO.desenho.richdraw.lineColor = "red"; | |
| 499 | - i3GEO.desenho.richdraw.lineWidth = "2px"; | |
| 500 | - var novoel; | |
| 501 | - if(!$i("i3geoboxSel")){ | |
| 502 | - novoel = document.createElement("div"); | |
| 503 | - novoel.style.width = "10px"; | |
| 504 | - novoel.style.height = "10px"; | |
| 505 | - novoel.id = "i3geoboxSel"; | |
| 506 | - novoel.style.display = "block"; | |
| 507 | - novoel.style.fontSize = "0px"; | |
| 508 | - YAHOO.util.Dom.setStyle(novoel,"opacity",0.25); | |
| 509 | - novoel.style.backgroundColor = "#cedff2"; | |
| 510 | - novoel.style.position="absolute"; | |
| 511 | - novoel.style.border = "2px solid #ff0000"; | |
| 512 | - novoel.onmousemove = function(){ | |
| 513 | - var b,wb,hb; | |
| 514 | - b = $i("i3geoboxSel").style; | |
| 515 | - wb = parseInt(b.width,10); | |
| 516 | - hb = parseInt(b.height,10); | |
| 517 | - if(wb > 2) | |
| 518 | - {b.width = wb - 2 + "px";} | |
| 519 | - if(hb > 2) | |
| 520 | - {b.height = hb - 2 + "px";} | |
| 521 | - }; | |
| 522 | - novoel.onmouseup = function() | |
| 523 | - {i3GEOF.selecao.box.termina();}; | |
| 524 | - document.body.appendChild(novoel); | |
| 525 | - } | |
| 526 | - if($i("img")){ | |
| 527 | - $i("img").title = ""; | |
| 528 | - temp = "zoom"; | |
| 529 | - if(i3GEO.Interface.ATIVAMENUCONTEXTO) | |
| 530 | - {temp = "zoom_contexto";} | |
| 439 | + openlayers: { | |
| 440 | + inicia: function(){ | |
| 441 | + i3GEO.eventos.cliquePerm.desativa(); | |
| 442 | + i3GEOF.selecao.box.openlayers.removeControle(); | |
| 443 | + var box = new OpenLayers.Control.DrawFeature( | |
| 444 | + i3GEO.desenho.layergrafico, | |
| 445 | + OpenLayers.Handler.Box, | |
| 446 | + { | |
| 447 | + autoActivate: true, | |
| 448 | + id: "i3GEOFselecaoBox", | |
| 449 | + type: OpenLayers.Control.TYPE_TOOL, | |
| 450 | + callbacks:{ | |
| 451 | + done: function(feature){ | |
| 452 | + i3GEOF.selecao.box.openlayers.removeControle(); | |
| 453 | + var xminymin = i3geoOL.getLonLatFromPixel({ | |
| 454 | + x: feature.left, | |
| 455 | + y: feature.bottom | |
| 456 | + }), | |
| 457 | + xmaxymax = i3geoOL.getLonLatFromPixel({ | |
| 458 | + x: feature.right, | |
| 459 | + y: feature.top | |
| 460 | + }); | |
| 461 | + i3GEOF.selecao.box.termina( | |
| 462 | + i3GEO.temaAtivo, | |
| 463 | + $i("i3GEOselecaotipoOperacao").value, | |
| 464 | + xminymin.lon+" "+xminymin.lat+" "+xmaxymax.lon+" "+xmaxymax.lat | |
| 465 | + ); | |
| 466 | + } | |
| 467 | + } | |
| 468 | + }); | |
| 469 | + i3geoOL.addControl(box); | |
| 470 | + }, | |
| 471 | + removeControle: function(){ | |
| 472 | + var controle = i3geoOL.getControlsBy("id","i3GEOFselecaoBox"); | |
| 473 | + if(controle.length > 0){ | |
| 474 | + controle[0].deactivate(); | |
| 475 | + i3geoOL.removeControl(controle[0]); | |
| 476 | + } | |
| 531 | 477 | } |
| 532 | 478 | }, |
| 533 | - /* | |
| 534 | - Function: desloca | |
| 535 | - | |
| 536 | - Desloca o box conforme o mouse é movimentado | |
| 537 | - */ | |
| 538 | - desloca: function(){ | |
| 539 | - if(g_tipoacao !== 'selecaobox') | |
| 540 | - {return;} | |
| 541 | - var bxs,ppx,py; | |
| 542 | - bxs = $i("i3geoboxSel").style; | |
| 543 | - if(bxs.display !== "block") | |
| 544 | - {return;} | |
| 545 | - ppx = objposicaocursor.imgx + adicionaxyBox[0]; | |
| 546 | - py = objposicaocursor.imgy + adicionaxyBox[1]; | |
| 547 | - | |
| 548 | - if ((ppx > boxxini) && ((ppx - boxxini - 2) > 0)) | |
| 549 | - {bxs.width = ppx - boxxini - 2 + "px";} | |
| 550 | - if ((py > boxyini) && ((py - boxyini - 2) > 0)) | |
| 551 | - {bxs.height = py - boxyini - 2 + "px";} | |
| 552 | - if (ppx < boxxini) | |
| 553 | - {bxs.left = ppx;bxs.width = boxxini - ppx + 2 + "px";} | |
| 554 | - if (py < boxyini) | |
| 555 | - {bxs.top = py;bxs.height = boxyini - py + 2 + "px";} | |
| 556 | - }, | |
| 557 | - /* | |
| 558 | - Function: termina | |
| 559 | - | |
| 560 | - Para o desenho do box, captura seu tamanho e faz o zoom no mapa | |
| 561 | - */ | |
| 562 | - termina: function(){ | |
| 563 | - var valor,v,x1,y1,x2,y2,limpa,tipo; | |
| 564 | - limpa = function(){ | |
| 565 | - var bxs = $i("i3geoboxSel").style; | |
| 566 | - bxs.display="none"; | |
| 567 | - bxs.visibility="hidden"; | |
| 568 | - bxs.width = "0px"; | |
| 569 | - bxs.height = "0px"; | |
| 479 | + termina: function(tema,tipo,box){ | |
| 480 | + var retorna = function(retorno){ | |
| 481 | + i3GEO.janela.fechaAguarde("i3GEO.atualiza"); | |
| 482 | + var nsel; | |
| 483 | + i3GEO.Interface.atualizaTema(retorno,tema); | |
| 484 | + nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas); | |
| 485 | + $i("i3GEOselecaoNsel").innerHTML = $trad(28,i3GEOF.selecao.dicionario)+": "+(nsel.nsel); | |
| 570 | 486 | }; |
| 571 | - try{ | |
| 572 | - valor = i3GEO.calculo.rect2ext("i3geoboxSel",i3GEO.parametros.mapexten,i3GEO.parametros.pixelsize); | |
| 573 | - v = valor[0]; | |
| 574 | - x1 = valor[1]; | |
| 575 | - y1 = valor[2]; | |
| 576 | - x2 = valor[3]; | |
| 577 | - y2 = valor[4]; | |
| 578 | - if((x1 === x2) || (y1 === y2)) | |
| 579 | - {limpa.call();return;} | |
| 580 | - // se o retangulo for negativo pula essa parte para n� gerar erro | |
| 581 | - i3GEO.parametros.mapexten=v; | |
| 582 | - limpa.call(); | |
| 583 | - i3GEO.eventos.MOUSEMOVE.remove("i3GEOF.selecao.box.desloca()"); | |
| 584 | - i3GEO.eventos.MOUSEUP.remove("i3GEOF.selecao.box.termina()"); | |
| 585 | - tipo = "adiciona"; | |
| 586 | - //pega o tipo de operacao da janela de selecao | |
| 587 | - tipo = $i("i3GEOselecaotipoOperacao").value; | |
| 588 | - i3GEOF.selecao.porbox(i3GEO.temaAtivo,tipo,v); | |
| 589 | - } | |
| 590 | - catch(e){ | |
| 591 | - if(typeof(console) !== 'undefined'){console.error(e);} | |
| 592 | - limpa.call(); | |
| 593 | - return; | |
| 594 | - } | |
| 487 | + i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); | |
| 488 | + i3GEO.php.selecaobox(retorna,tema,tipo,box); | |
| 595 | 489 | } |
| 596 | 490 | }, |
| 597 | 491 | /* |
| 598 | - Function: porbox | |
| 599 | - | |
| 600 | - Seleciona elementos de um tema com base em um retângulo | |
| 601 | - | |
| 602 | - Parametros: | |
| 603 | - | |
| 604 | - tema {String} - código do tema | |
| 605 | - | |
| 606 | - tipo {String} - tipo de operação adiciona|retira | |
| 607 | - | |
| 608 | - box {String} - xmin ymin xmax ymax | |
| 609 | - */ | |
| 610 | - porbox: function(tema,tipo,box){ | |
| 611 | - if(typeof(console) !== 'undefined') | |
| 612 | - {console.info("i3GEO.navega.selecao.porbox()");} | |
| 613 | - var retorna = function(retorno){ | |
| 614 | - i3GEO.janela.fechaAguarde("i3GEO.atualiza"); | |
| 615 | - var nsel; | |
| 616 | - i3GEO.Interface.atualizaTema(retorno,tema); | |
| 617 | - nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas); | |
| 618 | - $i("i3GEOselecaoNsel").innerHTML = $trad(28,i3GEOF.selecao.dicionario)+": "+(nsel.nsel); | |
| 619 | - }; | |
| 620 | - i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); | |
| 621 | - i3GEO.php.selecaobox(retorna,tema,tipo,box); | |
| 622 | - }, | |
| 623 | - /* | |
| 624 | 492 | Function: clique |
| 625 | 493 | |
| 626 | 494 | Seleciona elementos clicando no mapa |
| 627 | 495 | */ |
| 628 | - clique: function(){ | |
| 629 | - if($i("i3GEOselecaotemasLigados").value === "") | |
| 630 | - {i3GEO.janela.tempoMsg("Escolha um tema");return;} | |
| 631 | - if(typeof(console) !== 'undefined') | |
| 632 | - {console.info("i3GEO.selecao.clique()");} | |
| 633 | - if (g_tipoacao === "selecao"){ | |
| 634 | - var tipo,tolerancia; | |
| 635 | - tipo = $i("i3GEOselecaotipoOperacao").value; | |
| 636 | - tolerancia = $i("i3GEOselecaotoleranciapt").value; | |
| 637 | - i3GEOF.selecao.porxy(i3GEO.temaAtivo,tipo,tolerancia); | |
| 496 | + clique: { | |
| 497 | + openlayers: { | |
| 498 | + inicia: function(){ | |
| 499 | + i3GEO.eventos.cliquePerm.desativa(); | |
| 500 | + i3GEOF.selecao.clique.openlayers.removeControle(); | |
| 501 | + var ponto = new OpenLayers.Control.DrawFeature( | |
| 502 | + i3GEO.desenho.layergrafico, | |
| 503 | + OpenLayers.Handler.Point, | |
| 504 | + { | |
| 505 | + autoActivate: true, | |
| 506 | + id: "i3GEOFselecaoPonto", | |
| 507 | + type: OpenLayers.Control.TYPE_TOOL, | |
| 508 | + callbacks:{ | |
| 509 | + done: function(feature){ | |
| 510 | + i3GEOF.selecao.clique.openlayers.removeControle(); | |
| 511 | + feature = i3GEO.util.projOSM2Geo(feature); | |
| 512 | + i3GEOF.selecao.clique.termina( | |
| 513 | + i3GEO.temaAtivo, | |
| 514 | + $i("i3GEOselecaotipoOperacao").value, | |
| 515 | + $i("i3GEOselecaotoleranciapt").value, | |
| 516 | + feature.x, | |
| 517 | + feature.y | |
| 518 | + ); | |
| 519 | + } | |
| 520 | + } | |
| 521 | + }); | |
| 522 | + i3geoOL.addControl(ponto); | |
| 523 | + }, | |
| 524 | + removeControle: function(){ | |
| 525 | + var controle = i3geoOL.getControlsBy("id","i3GEOFselecaoPonto"); | |
| 526 | + if(controle.length > 0){ | |
| 527 | + controle[0].deactivate(); | |
| 528 | + i3geoOL.removeControl(controle[0]); | |
| 529 | + } | |
| 530 | + } | |
| 531 | + }, | |
| 532 | + googlemaps: { | |
| 533 | + inicia: function(){ | |
| 534 | + var evtclick = null; | |
| 535 | + i3GEO.eventos.cliquePerm.desativa(); | |
| 536 | + evtclick = google.maps.event.addListener(i3GeoMap, "click", function(evt) { | |
| 537 | + i3GEOF.selecao.clique.termina( | |
| 538 | + i3GEO.temaAtivo, | |
| 539 | + $i("i3GEOselecaotipoOperacao").value, | |
| 540 | + $i("i3GEOselecaotoleranciapt").value, | |
| 541 | + evt.latLng.lng(), | |
| 542 | + evt.latLng.lat() | |
| 543 | + ); | |
| 544 | + google.maps.event.removeListener(evtclick); | |
| 545 | + }); | |
| 546 | + } | |
| 547 | + }, | |
| 548 | + termina: function(tema,tipo,tolerancia,x,y){ | |
| 549 | + if(typeof(console) !== 'undefined'){console.info("i3GEO.selecao.porxy()");} | |
| 550 | + var retorna = function(retorno){ | |
| 551 | + var nsel; | |
| 552 | + i3GEO.Interface.atualizaTema(retorno,tema); | |
| 553 | + nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas); | |
| 554 | + $i("i3GEOselecaoNsel").innerHTML = $trad(28,i3GEOF.selecao.dicionario)+": "+(nsel.nsel); | |
| 555 | + }; | |
| 556 | + i3GEO.php.selecaopt(retorna,tema,x+" "+y,tipo,tolerancia); | |
| 638 | 557 | } |
| 639 | 558 | }, |
| 640 | 559 | /* |
| 641 | - Function: porxy | |
| 642 | - | |
| 643 | - Executa a seleção de elementos de um tema com base em um par de coordenadas xy | |
| 644 | - | |
| 645 | - Parametros: | |
| 646 | - | |
| 647 | - tema {String} - código do tema | |
| 648 | - | |
| 649 | - tipo {String} - tipo de operação adiciona|retira | |
| 650 | - | |
| 651 | - tolerancia {Integer} - tolerância de busca | |
| 652 | - */ | |
| 653 | - porxy: function(tema,tipo,tolerancia){ | |
| 654 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.selecao.porxy()");} | |
| 655 | - var retorna = function(retorno){ | |
| 656 | - var nsel; | |
| 657 | - if(i3GEO.Interface.ATUAL === "padrao") | |
| 658 | - {i3GEO.atualiza(retorno);} | |
| 659 | - i3GEO.Interface.atualizaTema(retorno,tema); | |
| 660 | - nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas); | |
| 661 | - $i("i3GEOselecaoNsel").innerHTML = $trad(28,i3GEOF.selecao.dicionario)+": "+(nsel.nsel); | |
| 662 | - }; | |
| 663 | - //i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); | |
| 664 | - i3GEO.php.selecaopt(retorna,tema,objposicaocursor.ddx+" "+objposicaocursor.ddy,tipo,tolerancia); | |
| 665 | - }, | |
| 666 | - /* | |
| 667 | 560 | Classe: i3GEOF.selecao.poligono |
| 668 | 561 | |
| 669 | 562 | Realiza a seleção desenhando um polígono no mapa |
| 670 | 563 | */ |
| 671 | 564 | poligono:{ |
| 672 | - /* | |
| 673 | - Function: inicia | |
| 674 | - | |
| 675 | - Inicia o desenho do polígono | |
| 676 | - */ | |
| 677 | - inicia: function(){ | |
| 678 | - try | |
| 679 | - {i3GEO.desenho.richdraw.fecha();} | |
| 680 | - catch(e) | |
| 681 | - {if(typeof(console) !== 'undefined'){console.error(e);}} | |
| 682 | - pontosdistobj = []; | |
| 683 | - i3GEO.util.insereMarca.limpa(); | |
| 684 | - g_tipoacao = "selecaopoli"; | |
| 685 | - i3GEO.janela.tempoMsg($trad(29,i3GEOF.selecao.dicionario)); | |
| 686 | - i3GEO.eventos.MOUSECLIQUE.remove("i3GEOF.selecao.clique()"); | |
| 687 | - if(i3GEO.eventos.MOUSEMOVE.toString().search("i3GEOF.selecao.poligono.move()") < 0) | |
| 688 | - {i3GEO.eventos.MOUSEMOVE.push("i3GEOF.selecao.poligono.move()");} | |
| 689 | - if(i3GEO.eventos.MOUSECLIQUE.toString().search("i3GEOF.selecao.poligono.clique()") < 0) | |
| 690 | - {i3GEO.eventos.MOUSECLIQUE.push("i3GEOF.selecao.poligono.clique()");} | |
| 691 | - i3GEO.desenho.criaContainerRichdraw(); | |
| 692 | - i3GEO.desenho.richdraw.lineColor = "red"; | |
| 693 | - i3GEO.desenho.richdraw.lineWidth = "2px"; | |
| 694 | - }, | |
| 695 | - /* | |
| 696 | - Function: move | |
| 697 | - | |
| 698 | - Modifica o polígono conforme o usuário cria vértices | |
| 699 | - */ | |
| 700 | - move: function(){ | |
| 701 | - if (g_tipoacao === "selecaopoli"){ | |
| 702 | - var n = pontosdistobj.xpt.length; | |
| 703 | - if (n > 0){ | |
| 704 | - i3GEO.desenho.aplica("resizePoligono",pontosdistobj.linhastemp,1); | |
| 705 | - i3GEO.desenho.aplica("resizeLinha",pontosdistobj.linhas[n-1],n); | |
| 565 | + openlayers: { | |
| 566 | + inicia: function(){ | |
| 567 | + var poligono; | |
| 568 | + i3GEO.eventos.cliquePerm.desativa(); | |
| 569 | + i3GEOF.selecao.poligono.openlayers.removeControle(); | |
| 570 | + poligono = new OpenLayers.Control.DrawFeature( | |
| 571 | + i3GEO.desenho.layergrafico, | |
| 572 | + OpenLayers.Handler.Polygon, | |
| 573 | + { | |
| 574 | + autoActivate: true, | |
| 575 | + id: "i3GEOFselecaoPoli", | |
| 576 | + type: OpenLayers.Control.TYPE_TOOL, | |
| 577 | + callbacks:{ | |
| 578 | + done: function(feature){ | |
| 579 | + i3GEOF.selecao.poligono.openlayers.removeControle(); | |
| 580 | + feature = i3GEO.util.projOSM2Geo(feature); | |
| 581 | + //pega as coordenadas | |
| 582 | + var i, | |
| 583 | + x = [], | |
| 584 | + y = [], | |
| 585 | + vertices = feature.components[0].components, | |
| 586 | + n = vertices.length; | |
| 587 | + for(i=0;i<n;i++){ | |
| 588 | + x.push(vertices[i].x); | |
| 589 | + y.push(vertices[i].y); | |
| 590 | + } | |
| 591 | + i3GEOF.selecao.poligono.termina({ | |
| 592 | + xpt: x, | |
| 593 | + ypt: y | |
| 594 | + }); | |
| 595 | + } | |
| 596 | + } | |
| 597 | + }); | |
| 598 | + i3geoOL.addControl(poligono); | |
| 599 | + }, | |
| 600 | + removeControle: function(){ | |
| 601 | + var controle = i3geoOL.getControlsBy("id","i3GEOFselecaoPoli"); | |
| 602 | + if(controle.length > 0){ | |
| 603 | + controle[0].deactivate(); | |
| 604 | + i3geoOL.removeControl(controle[0]); | |
| 706 | 605 | } |
| 707 | 606 | } |
| 708 | 607 | }, |
| 709 | - /* | |
| 710 | - Function: clique | |
| 711 | - | |
| 712 | - Inclui um novo vértice no polígono | |
| 713 | - */ | |
| 714 | - clique: function(){ | |
| 715 | - if (g_tipoacao !== "selecaopoli"){return;} | |
| 716 | - var n; | |
| 717 | - n = pontosdistobj.xpt.length; | |
| 718 | - pontosdistobj.xpt[n] = objposicaocursor.ddx; | |
| 719 | - pontosdistobj.ypt[n] = objposicaocursor.ddy; | |
| 720 | - pontosdistobj.xtela[n] = objposicaocursor.telax; | |
| 721 | - pontosdistobj.ytela[n] = objposicaocursor.telay; | |
| 722 | - pontosdistobj.ximg[n] = objposicaocursor.imgx; | |
| 723 | - pontosdistobj.yimg[n] = objposicaocursor.imgy; | |
| 724 | - pontosdistobj.dist[n] = 0; | |
| 725 | - //inclui a linha para ligar com o ponto inicial | |
| 726 | - if (n === 0){ | |
| 727 | - try { | |
| 728 | - pontosdistobj.linhastemp = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1,pontosdistobj.ximg[0]-1,pontosdistobj.yimg[0]-1); | |
| 729 | - } | |
| 730 | - catch(e){ | |
| 731 | - if(typeof(console) !== 'undefined'){console.error(e);} | |
| 732 | - } | |
| 733 | - } | |
| 734 | - try{ | |
| 735 | - pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1,pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1); | |
| 736 | - } | |
| 737 | - catch(e){ | |
| 738 | - if(typeof(console) !== 'undefined'){console.error(e);} | |
| 739 | - } | |
| 740 | - /* | |
| 741 | - if (n === 0){ | |
| 742 | - try { | |
| 743 | - if (navn) | |
| 744 | - {pontosdistobj.linhastemp = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1,pontosdistobj.ximg[0]-1,pontosdistobj.yimg[0]-1);} | |
| 745 | - } | |
| 746 | - catch(e){ | |
| 747 | - if(typeof(console) !== 'undefined'){console.error(e);} | |
| 748 | - } | |
| 749 | - } | |
| 750 | - else{ | |
| 751 | - if(navm) | |
| 752 | - {pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, (pontosdistobj.ximg[n-1])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n-1],(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n]);} | |
| 753 | - } | |
| 754 | - try{ | |
| 755 | - if (navn) | |
| 756 | - {pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1,pontosdistobj.ximg[n]-1,pontosdistobj.yimg[n]-1);} | |
| 757 | - } | |
| 758 | - catch(e){ | |
| 759 | - if(typeof(console) !== 'undefined'){console.error(e);} | |
| 608 | + googlemaps: { | |
| 609 | + inicia: function(){ | |
| 610 | + i3GEO.desenho[i3GEO.Interface["ATUAL"]].inicia(); | |
| 611 | + i3GeoMap.setOptions({disableDoubleClickZoom:true}); | |
| 612 | + i3GeoMap.setOptions({draggableCursor:'crosshair'}); | |
| 613 | + var evtdblclick = null, | |
| 614 | + evtclick = null, | |
| 615 | + evtmousemove = null, | |
| 616 | + pontos = { | |
| 617 | + mvcLine: new google.maps.MVCArray(), | |
| 618 | + line: null, | |
| 619 | + polygon: null, | |
| 620 | + x: [], | |
| 621 | + y: [] | |
| 622 | + }, | |
| 623 | + termina = function(){ | |
| 624 | + google.maps.event.removeListener(evtdblclick); | |
| 625 | + google.maps.event.removeListener(evtclick); | |
| 626 | + google.maps.event.removeListener(evtmousemove); | |
| 627 | + var f = i3GEO.desenho.googlemaps.getFeaturesByAttribute("origem","i3GEOFselecao"); | |
| 628 | + i3GEOF.selecao.poligono.termina({ | |
| 629 | + xpt: pontos.x, | |
| 630 | + ypt: pontos.y | |
| 631 | + }); | |
| 632 | + if(f && f.length > 0){ | |
| 633 | + i3GEO.desenho.googlemaps.destroyFeatures(f); | |
| 634 | + } | |
| 635 | + }; | |
| 636 | + evtclick = google.maps.event.addListener(i3GeoMap, "click", function(evt) { | |
| 637 | + pontos.mvcLine.push(evt.latLng); | |
| 638 | + pontos.x.push(evt.latLng.lng()); | |
| 639 | + pontos.y.push(evt.latLng.lat()); | |
| 640 | + i3GEO.desenho.googlemaps.shapes.push( | |
| 641 | + new google.maps.Marker({ | |
| 642 | + map: i3GeoMap, | |
| 643 | + fillOpacity: 0, | |
| 644 | + clickable: false, | |
| 645 | + position:evt.latLng, | |
| 646 | + icon: { | |
| 647 | + path: google.maps.SymbolPath.CIRCLE, | |
| 648 | + scale: 2.5, | |
| 649 | + strokeColor: "#ffffff" | |
| 650 | + }, | |
| 651 | + origem: "i3GEOFselecao" | |
| 652 | + }) | |
| 653 | + ); | |
| 654 | + //mais um ponto para criar uma linha movel | |
| 655 | + pontos.mvcLine.push(evt.latLng); | |
| 656 | + }); | |
| 657 | + evtmousemove = google.maps.event.addListener(i3GeoMap, "mousemove", function(evt) { | |
| 658 | + if (pontos.mvcLine.getLength() > 0) { | |
| 659 | + if (!pontos.line) { | |
| 660 | + // Create the line (google.maps.Polyline) | |
| 661 | + pontos.line = new google.maps.Polygon({ | |
| 662 | + map: i3GeoMap, | |
| 663 | + clickable: false, | |
| 664 | + strokeColor: "#000000", | |
| 665 | + strokeOpacity: 1, | |
| 666 | + strokeWeight: 2, | |
| 667 | + path: pontos.mvcLine, | |
| 668 | + origem: "i3GEOFselecao" | |
| 669 | + }); | |
| 670 | + i3GEO.desenho.googlemaps.shapes.push(pontos.line); | |
| 671 | + } | |
| 672 | + pontos.mvcLine.pop(); | |
| 673 | + pontos.mvcLine.push(evt.latLng); | |
| 674 | + } | |
| 675 | + }); | |
| 676 | + evtdblclick = google.maps.event.addListener(i3GeoMap, "dblclick", function(evt) { | |
| 677 | + termina.call(); | |
| 678 | + }); | |
| 760 | 679 | } |
| 761 | - */ | |
| 762 | - if(i3GEO.Interface.ATUAL === "padrao" || i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps") | |
| 763 | - {i3GEO.util.insereMarca.cria(objposicaocursor.imgx,objposicaocursor.imgy,i3GEOF.selecao.poligono.termina,"divGeometriasTemp");} | |
| 764 | - if(i3GEO.Interface.ATUAL === "googleearth") | |
| 765 | - {i3GEO.util.insereMarca.cria(objposicaocursor.ddx,objposicaocursor.ddy,i3GEOF.selecao.poligono.termina,"divGeometriasTemp","");} | |
| 766 | 680 | }, |
| 767 | 681 | /* |
| 768 | 682 | Function: termina |
| 769 | 683 | |
| 770 | 684 | Termina o desenho do polígono e executa a operação de seleção |
| 771 | 685 | */ |
| 772 | - termina: function(){ | |
| 773 | - var pontos,xs,ys,retorna,p,cp,tema=i3GEO.temaAtivo; | |
| 774 | - pontos = pontosdistobj; | |
| 775 | - i3GEO.desenho.richdraw.fecha(); | |
| 686 | + termina: function(pontos){ | |
| 687 | + var xs,ys,retorna,p,cp,tema=i3GEO.temaAtivo; | |
| 776 | 688 | n = pontos.xpt.length; |
| 777 | 689 | xs = pontos.xpt.toString(","); |
| 778 | 690 | ys = pontos.ypt.toString(","); |
| 779 | 691 | retorna = function(retorno){ |
| 780 | 692 | var nsel; |
| 781 | 693 | i3GEO.janela.fechaAguarde("i3GEO.atualiza",$trad("o1")); |
| 782 | - if(i3GEO.Interface.ATUAL === "padrao") | |
| 783 | - {i3GEO.atualiza(retorno);} | |
| 784 | 694 | i3GEO.Interface.atualizaTema(retorno,tema); |
| 785 | 695 | nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas); |
| 786 | 696 | $i("i3GEOselecaoNsel").innerHTML = $trad(28,i3GEOF.selecao.dicionario)+": "+(nsel.nsel); |
| ... | ... | @@ -968,7 +878,6 @@ i3GEOF.selecao = { |
| 968 | 878 | i3GEOF.selecao.aguarde.visibility = "hidden"; |
| 969 | 879 | return; |
| 970 | 880 | } |
| 971 | - g_operacao = "selecao"; | |
| 972 | 881 | temp = function(retorno){ |
| 973 | 882 | var nsel; |
| 974 | 883 | if(i3GEO.Interface.ATUAL === "padrao") |
| ... | ... | @@ -1009,7 +918,6 @@ i3GEOF.selecao = { |
| 1009 | 918 | nsel = i3GEO.arvoreDeCamadas.pegaTema(tema,retorno.data.temas); |
| 1010 | 919 | $i("i3GEOselecaoNsel").innerHTML = $trad(28,i3GEOF.selecao.dicionario)+": "+(nsel.nsel); |
| 1011 | 920 | }; |
| 1012 | - g_operacao = "selecao"; | |
| 1013 | 921 | i3GEO.php.selecaotema(temp,$i("i3GEOselecaoTemaoverlay").value,i3GEO.temaAtivo,$i("i3GEOselecaotipoOperacao").value); |
| 1014 | 922 | } |
| 1015 | 923 | catch(e){ | ... | ... |
mashups/openlayers_compacto.js
| ... | ... | @@ -42,7 +42,7 @@ setTimeout(function(){a.removeClass(v,"yui-force-redraw");},0);},toString:functi |
| 42 | 42 | j=this.footer;if(p&&j){j.removeChild(p);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}this.changeContentEvent.fire();},getButtons:function(){return this._aButtons||null;},focusFirst:function(k,i,n){var j=this.firstFormElement,m=false;if(i&&i[1]){b.stopEvent(i[1]);if(i[0]===9&&this.firstElement){j=this.firstElement;}}if(j){try{j.focus();m=true;}catch(l){}}else{if(this.defaultHtmlButton){m=this.focusDefaultButton();}else{m=this.focusFirstButton();}}return m;},focusLast:function(k,i,n){var o=this.cfg.getProperty("buttons"),j=this.lastFormElement,m=false;if(i&&i[1]){b.stopEvent(i[1]);if(i[0]===9&&this.lastElement){j=this.lastElement;}}if(o&&f.isArray(o)){m=this.focusLastButton();}else{if(j){try{j.focus();m=true;}catch(l){}}}return m;},_getButton:function(j){var i=YAHOO.widget.Button;if(i&&j&&j.nodeName&&j.id){j=i.getButton(j.id)||j;}return j;},focusDefaultButton:function(){var i=this._getButton(this.defaultHtmlButton),k=false;if(i){try{i.focus();k=true;}catch(j){}}return k;},blurButtons:function(){var o=this.cfg.getProperty("buttons"),l,n,k,j;if(o&&f.isArray(o)){l=o.length;if(l>0){j=(l-1);do{n=o[j];if(n){k=this._getButton(n.htmlButton);if(k){try{k.blur();}catch(m){}}}}while(j--);}}},focusFirstButton:function(){var m=this.cfg.getProperty("buttons"),k,i,l=false;if(m&&f.isArray(m)){k=m[0];if(k){i=this._getButton(k.htmlButton);if(i){try{i.focus();l=true;}catch(j){}}}}return l;},focusLastButton:function(){var n=this.cfg.getProperty("buttons"),j,l,i,m=false;if(n&&f.isArray(n)){j=n.length;if(j>0){l=n[(j-1)];if(l){i=this._getButton(l.htmlButton);if(i){try{i.focus();m=true;}catch(k){}}}}}return m;},configPostMethod:function(j,i,k){this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){if(this.beforeSubmitEvent.fire()){this.doSubmit();this.submitEvent.fire();if(this.cfg.getProperty("hideaftersubmit")){this.hide();}return true;}else{return false;}}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var A=this.form,k,t,w,m,u,r,q,j,x,l,y,B,p,C,o,z,v;function s(n){var i=n.tagName.toUpperCase();return((i=="INPUT"||i=="TEXTAREA"||i=="SELECT")&&n.name==m);}if(A){k=A.elements;t=k.length;w={};for(z=0;z<t;z++){m=k[z].name;u=e.getElementsBy(s,"*",A);r=u.length;if(r>0){if(r==1){u=u[0];q=u.type;j=u.tagName.toUpperCase();switch(j){case"INPUT":if(q=="checkbox"){w[m]=u.checked;}else{if(q!="radio"){w[m]=u.value;}}break;case"TEXTAREA":w[m]=u.value;break;case"SELECT":x=u.options;l=x.length;y=[];for(v=0;v<l;v++){B=x[v];if(B.selected){o=B.attributes.value;y[y.length]=(o&&o.specified)?B.value:B.text;}}w[m]=y;break;}}else{q=u[0].type;switch(q){case"radio":for(v=0;v<r;v++){p=u[v];if(p.checked){w[m]=p.value;break;}}break;case"checkbox":y=[];for(v=0;v<r;v++){C=u[v];if(C.checked){y[y.length]=C.value;}}w[m]=y;break;}}}}}return w;},destroy:function(i){d.call(this);this._aButtons=null;var j=this.element.getElementsByTagName("form"),k;if(j.length>0){k=j[0];if(k){b.purgeElement(k);if(k.parentNode){k.parentNode.removeChild(k);}this.form=null;}}a.superclass.destroy.call(this,i);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(e,d){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,e,d);};var c=YAHOO.util.Dom,b=YAHOO.widget.SimpleDialog,a={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};b.ICON_BLOCK="blckicon";b.ICON_ALARM="alrticon";b.ICON_HELP="hlpicon";b.ICON_INFO="infoicon";b.ICON_WARN="warnicon";b.ICON_TIP="tipicon";b.ICON_CSS_CLASSNAME="yui-icon";b.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(b,YAHOO.widget.Dialog,{initDefaultConfig:function(){b.superclass.initDefaultConfig.call(this);this.cfg.addProperty(a.ICON.key,{handler:this.configIcon,value:a.ICON.value,suppressEvent:a.ICON.suppressEvent});this.cfg.addProperty(a.TEXT.key,{handler:this.configText,value:a.TEXT.value,suppressEvent:a.TEXT.suppressEvent,supercedes:a.TEXT.supercedes});},init:function(e,d){b.superclass.init.call(this,e);this.beforeInitEvent.fire(b);c.addClass(this.element,b.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(d){this.cfg.applyConfig(d,true);}this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(b);},registerForm:function(){b.superclass.registerForm.call(this);var e=this.form.ownerDocument,d=e.createElement("input");d.type="hidden";d.name=this.id;d.value="";this.form.appendChild(d);},configIcon:function(k,j,h){var d=j[0],e=this.body,f=b.ICON_CSS_CLASSNAME,l,i,g;if(d&&d!="none"){l=c.getElementsByClassName(f,"*",e);if(l.length===1){i=l[0];g=i.parentNode;if(g){g.removeChild(i);i=null;}}if(d.indexOf(".")==-1){i=document.createElement("span");i.className=(f+" "+d);i.innerHTML=" ";}else{i=document.createElement("img");i.src=(this.imageRoot+d);i.className=f;}if(i){e.insertBefore(i,e.firstChild);}}},configText:function(e,d,f){var g=d[0];if(g){this.setBody(g);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(e,h,g,d,f){if(!f){f=YAHOO.util.Anim;}this.overlay=e;this.attrIn=h;this.attrOut=g;this.targetElement=d||e.element;this.animClass=f;};var b=YAHOO.util.Dom,c=YAHOO.util.CustomEvent,a=YAHOO.widget.ContainerEffect;a.FADE=function(d,f){var g=YAHOO.util.Easing,i={attributes:{opacity:{from:0,to:1}},duration:f,method:g.easeIn},e={attributes:{opacity:{to:0}},duration:f,method:g.easeOut},h=new a(d,i,e,d.element);h.handleUnderlayStart=function(){var k=this.overlay.underlay;if(k&&YAHOO.env.ua.ie){var j=(k.filters&&k.filters.length>0);if(j){b.addClass(d.element,"yui-effect-fade");}}};h.handleUnderlayComplete=function(){var j=this.overlay.underlay;if(j&&YAHOO.env.ua.ie){b.removeClass(d.element,"yui-effect-fade");}};h.handleStartAnimateIn=function(k,j,l){l.overlay._fadingIn=true;b.addClass(l.overlay.element,"hide-select");if(!l.overlay.underlay){l.overlay.cfg.refireEvent("underlay"); |
| 43 | 43 | }l.handleUnderlayStart();l.overlay._setDomVisibility(true);b.setStyle(l.overlay.element,"opacity",0);};h.handleCompleteAnimateIn=function(k,j,l){l.overlay._fadingIn=false;b.removeClass(l.overlay.element,"hide-select");if(l.overlay.element.style.filter){l.overlay.element.style.filter=null;}l.handleUnderlayComplete();l.overlay.cfg.refireEvent("iframe");l.animateInCompleteEvent.fire();};h.handleStartAnimateOut=function(k,j,l){l.overlay._fadingOut=true;b.addClass(l.overlay.element,"hide-select");l.handleUnderlayStart();};h.handleCompleteAnimateOut=function(k,j,l){l.overlay._fadingOut=false;b.removeClass(l.overlay.element,"hide-select");if(l.overlay.element.style.filter){l.overlay.element.style.filter=null;}l.overlay._setDomVisibility(false);b.setStyle(l.overlay.element,"opacity",1);l.handleUnderlayComplete();l.overlay.cfg.refireEvent("iframe");l.animateOutCompleteEvent.fire();};h.init();return h;};a.SLIDE=function(f,d){var i=YAHOO.util.Easing,l=f.cfg.getProperty("x")||b.getX(f.element),k=f.cfg.getProperty("y")||b.getY(f.element),m=b.getClientWidth(),h=f.element.offsetWidth,j={attributes:{points:{to:[l,k]}},duration:d,method:i.easeIn},e={attributes:{points:{to:[(m+25),k]}},duration:d,method:i.easeOut},g=new a(f,j,e,f.element,YAHOO.util.Motion);g.handleStartAnimateIn=function(o,n,p){p.overlay.element.style.left=((-25)-h)+"px";p.overlay.element.style.top=k+"px";};g.handleTweenAnimateIn=function(q,p,r){var s=b.getXY(r.overlay.element),o=s[0],n=s[1];if(b.getStyle(r.overlay.element,"visibility")=="hidden"&&o<l){r.overlay._setDomVisibility(true);}r.overlay.cfg.setProperty("xy",[o,n],true);r.overlay.cfg.refireEvent("iframe");};g.handleCompleteAnimateIn=function(o,n,p){p.overlay.cfg.setProperty("xy",[l,k],true);p.startX=l;p.startY=k;p.overlay.cfg.refireEvent("iframe");p.animateInCompleteEvent.fire();};g.handleStartAnimateOut=function(o,n,r){var p=b.getViewportWidth(),s=b.getXY(r.overlay.element),q=s[1];r.animOut.attributes.points.to=[(p+25),q];};g.handleTweenAnimateOut=function(p,o,q){var s=b.getXY(q.overlay.element),n=s[0],r=s[1];q.overlay.cfg.setProperty("xy",[n,r],true);q.overlay.cfg.refireEvent("iframe");};g.handleCompleteAnimateOut=function(o,n,p){p.overlay._setDomVisibility(false);p.overlay.cfg.setProperty("xy",[l,k]);p.animateOutCompleteEvent.fire();};g.init();return g;};a.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=c.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=c.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=c.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=c.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this._stopAnims(this.lastFrameOnStop);this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this._stopAnims(this.lastFrameOnStop);this.beforeAnimateOutEvent.fire();this.animOut.animate();},lastFrameOnStop:true,_stopAnims:function(d){if(this.animOut&&this.animOut.isAnimated()){this.animOut.stop(d);}if(this.animIn&&this.animIn.isAnimated()){this.animIn.stop(d);}},handleStartAnimateIn:function(e,d,f){},handleTweenAnimateIn:function(e,d,f){},handleCompleteAnimateIn:function(e,d,f){},handleStartAnimateOut:function(e,d,f){},handleTweenAnimateOut:function(e,d,f){},handleCompleteAnimateOut:function(e,d,f){},toString:function(){var d="ContainerEffect";if(this.overlay){d+=" ["+this.overlay.toString()+"]";}return d;}};YAHOO.lang.augmentProto(a,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.9.0",build:"2800"}); |
| 44 | 44 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.calculo={metododistancia:"vicenty",dms2dd:function(cd,cm,cs){try{var sinal,spm,mpg,dd;sinal='positivo';if(cd<0){cd=cd*-1;sinal='negativo'}spm=cs/3600;mpg=cm/60;dd=(cd*1)+(mpg*1)+(spm*1);if(sinal==='negativo'){dd=dd*-1}return(dd)}catch(e){return(0)}},dd2tela:function(vx,vy,docmapa,ext,cellsize){try{var pos,xyn,dc,imgext,c,xy;if(i3GEO.Interface.ATUAL==="googlemaps"&&docmapa.id!=="mapaReferencia"){pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));xyn=i3GeoMapOverlay.getProjection().fromLatLngToContainerPixel(new google.maps.LatLng(vy,vx));xy=[];return[(xyn.x)+pos[0],(xyn.y)+pos[1]]}if(i3GEO.Interface.ATUAL==="openlayers"&&docmapa.id!=="mapaReferencia"){pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));xy=i3geoOL.getViewPortPxFromLonLat(new OpenLayers.LonLat(vx,vy));return[(xy.x)+pos[0],(xy.y)+pos[1]]}if(arguments.length===3){ext=i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);cellsize=i3GEO.parametros.pixelsize}if(arguments.length===4){cellsize=i3GEO.parametros.pixelsize}if(!docmapa){docmapa=window.document}dc=docmapa;pos=i3GEO.util.pegaPosicaoObjeto(dc);imgext=ext.split(" ");vx=(vx*1)-(imgext[0]*1);vy=(vy*-1)+(imgext[3]*1);c=cellsize*1;return[(vx/c)+pos[0],(vy/c)+pos[1]]}catch(e){return([])}},dd2dms:function(x,y){var restod=0,sx="00.00",sy="00.00",mx,mm,restos,my,s,dx,dy;dx=parseInt(x,10);if(dx>0){restod=x-dx}if(dx<0){restod=(x*-1)-(dx*-1)}if(restod!==0){mm=restod*60;mx=parseInt(restod*60,10);restos=mm-mx;if(restos!==0){s=restos*60;s=(s+"_").substring(0,5);sx=s}}else{mx="00";sx="00.00"}dy=parseInt(y,10);if(dy>0){restod=y-dy}if(dy<0){restod=(y*-1)-(dy*-1)}if(restod!==0){mm=restod*60;my=parseInt(restod*60,10);restos=mm-my;if(restos!==0){s=restos*60;s=(s+"_").substring(0,5);sy=s}}else{my="00";sy="00.00"}return[dx+" "+mx+" "+sx,dy+" "+my+" "+sy]},tela2dd:function(xfign,yfign,g_celula,imgext,idorigem){try{var amext,longdd,latdd,point;if(i3GEO.Interface.ATUAL==="googlemaps"&&arguments.length===4){amext=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(xfign,yfign));return[amext.lng(),amext.lat()]}if(i3GEO.Interface.openlayers.googleLike===true){amext=i3geoOL.getLonLatFromPixel(new OpenLayers.Pixel(xfign,yfign));point=new OpenLayers.LonLat(amext.lon,amext.lat);amext=point.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection("EPSG:4326"));return[amext.lon,amext.lat]}if(i3GEO.Interface.ATUAL==="openlayers"&&arguments.length===4){amext=i3geoOL.getLonLatFromPixel(new OpenLayers.Pixel(xfign,yfign));return[amext.lon,amext.lat]}if(navm){xfign=xfign-2.2;yfign=yfign-2.7}else{xfign=xfign-0.12;yfign=yfign-1.05}amext=imgext.split(" ");longdd=(amext[0]*1)+(g_celula*xfign);latdd=(amext[3]*1)-(g_celula*yfign);return[longdd,latdd]}catch(e){return(0)}},area:function(x,y,pixel){var n=x.length,$polygon_area,$i;try{if(n>2){x.push(x[0]);y.push(y[0]);$polygon_area=0;for($i=0;$i<n;$i+=1){$polygon_area+=((x[$i]*y[$i+1])-(y[$i]*x[$i+1]))}$polygon_area=Math.abs($polygon_area)/2}else{$polygon_area=0}return $polygon_area*pixel}catch(e){return(0)}},distancia:function(lon1,lat1,lon2,lat2){if(i3GEO.calculo.metododistancia==="haversine"){return i3GEO.calculo.distHaversine(lon1,lat1,lon2,lat2)}if(i3GEO.calculo.metododistancia==="vicenty"){return i3GEO.calculo.distVincenty(lon1,lat1,lon2,lat2)}},distHaversine:function(lon1,lat1,lon2,lat2){var dLat,dLon,a,c,d;dLat=((lat2-lat1))*Math.PI/180;dLon=((lon2-lon1))*Math.PI/180;a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(lat1*Math.PI/180)*Math.cos(lat2*Math.PI/180)*Math.sin(dLon/2)*Math.sin(dLon/2);c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));d=6378.137*c;return d},distVincenty:function(lon1,lat1,lon2,lat2){var rad=function(x){return x*Math.PI/180},ct={a:6378137,b:6356752.3142,f:1/298.257223563},p1={lat:lat1,lon:lon1},p2={lat:lat2,lon:lon2},a=ct.a,b=ct.b,f=ct.f,L=rad(p2.lon-p1.lon),U1=Math.atan((1-f)*Math.tan(rad(p1.lat))),U2=Math.atan((1-f)*Math.tan(rad(p2.lat))),sinU1=Math.sin(U1),cosU1=Math.cos(U1),sinU2=Math.sin(U2),cosU2=Math.cos(U2),lambda=L,lambdaP=2*Math.PI,iterLimit=20,sinLambda,cosLambda,sinSigma=0,cosSigma=0,sigma=0,alpha,cosSqAlpha=0,cos2SigmaM=0,C,uSq,A,B,s,d,deltaSigma;while(Math.abs(lambda-lambdaP)>1e-12&&--iterLimit>0){sinLambda=Math.sin(lambda);cosLambda=Math.cos(lambda);sinSigma=Math.sqrt((cosU2*sinLambda)*(cosU2*sinLambda)+(cosU1*sinU2-sinU1*cosU2*cosLambda)*(cosU1*sinU2-sinU1*cosU2*cosLambda));if(sinSigma===0){return 0}cosSigma=sinU1*sinU2+cosU1*cosU2*cosLambda;sigma=Math.atan2(sinSigma,cosSigma);alpha=Math.asin(cosU1*cosU2*sinLambda/sinSigma);cosSqAlpha=Math.cos(alpha)*Math.cos(alpha);cos2SigmaM=cosSigma-2*sinU1*sinU2/cosSqAlpha;C=f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha));lambdaP=lambda;lambda=L+(1-C)*f*Math.sin(alpha)*(sigma+C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)))}if(iterLimit===0){return NaN}uSq=cosSqAlpha*(a*a-b*b)/(b*b);A=1+uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));B=uSq/1024*(256+uSq*(-128+uSq*(74-47*uSq)));deltaSigma=B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)-B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM)));s=b*A*(sigma-deltaSigma);d=s.toFixed(3)/1000;return d},direcao:function(lon1,lat1,lon2,lat2){var dLon,y,x,r;lat1=lat1*(Math.PI/180);lat2=lat2*(Math.PI/180);dLon=(lon2-lon1)*(Math.PI/180);y=Math.sin(dLon)*Math.cos(lat2);x=Math.cos(lat1)*Math.sin(lat2)-Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon);r=Math.atan2(y,x);r=r*180/Math.PI;r=r+360;return r%360},destinoDD:function(lon,lat,d,direcao){var R,lat1,lon1,brng,lat2,lon2;R=6371;lat1=lat*(Math.PI/180);lon1=lon*(Math.PI/180);brng=direcao*(Math.PI/180);lat2=Math.asin(Math.sin(lat1)*Math.cos(d/R)+Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng));lon2=lon1+Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1),Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2));lon2=(lon2+Math.PI)%(2*Math.PI)-Math.PI;if(isNaN(lat2)||isNaN(lon2)){return null}return[(lon2*180/Math.PI),(lat2*180/Math.PI)]},rect2ext:function(idrect,mapext,pixel){var bx,bxs,xfig,yfig,nx,ny,pos,amext,dy,x1,y1,x2,y2,pix=parseInt(document.getElementById(idrect).style.left,10),piy=parseInt(document.getElementById(idrect).style.top,10);if($i(idrect)){bx=$i(idrect);bxs=bx.style}else{i3GEO.janela.tempoMsg("Box nao encontrado");return}pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));xfig=pix+(parseInt(bxs.width,10))-pos[0];yfig=piy+(parseInt(bxs.height,10))-pos[1];amext=mapext.split(" ");dy=((amext[1]*1)-(amext[3]*1))/-1;if(dy<0){dy=dy*-1}nx=pixel*xfig;ny=pixel*yfig;x1=(amext[0]*1)+nx;y1=(amext[3]*1)-ny;xfig=pix-pos[0];yfig=piy-pos[1];if(dy<0){dy=dy*-1}nx=pixel*xfig;ny=pixel*yfig;x2=(amext[0]*1)+nx;y2=(amext[3]*1)-ny;return[x2+" "+y2+" "+x1+" "+y1,x1,y1,x2,y2]},ext2rect:function(idrect,mapext,boxext,pixel,documento){var rectbox,xyMin,xyMax,w,h,tl,pos,t,l,d,box;rectbox=boxext.split(" ");xyMin=i3GEO.calculo.dd2tela(rectbox[0],rectbox[1],documento,boxext,pixel);xyMax=i3GEO.calculo.dd2tela(rectbox[2],rectbox[3],documento,boxext,pixel);w=xyMax[0]-xyMin[0];h=xyMin[1]-xyMax[1];tl=i3GEO.calculo.dd2tela(rectbox[0],rectbox[3],documento,mapext,pixel);pos=i3GEO.util.pegaPosicaoObjeto(documento);t=tl[1]-pos[1];l=tl[0]-pos[0];d="block";if($i(idrect)){box=$i(idrect);box.style.width=w+"px";box.style.height=h+"px";box.style.top=t+"px";box.style.left=l+"px";box.style.display=d}return[w,h,xyMax[1],xyMin[0]]}}; |
| 45 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}navm=false;navn=false;chro=navigator.userAgent.toLowerCase().indexOf('chrome')>-1;opera=navigator.userAgent.toLowerCase().indexOf('opera')>-1;if(navigator.appName.substring(0,1)==='N'){navn=true}if(navigator.appName.substring(0,1)==='M'){navm=true}if(opera===true){navn=true}g_operacao="";g_tipoacao="zoomli";$i=function(id){return document.getElementById(id)};Array.prototype.remove=function(s){try{var n=this.length,i;for(i=0;i<n;i++){if(this[i]==s){this.splice(i,1)}}}catch(e){}};i3GEO.util={PINS:[],BOXES:[],escapeURL:function(sUrl){var re;sUrl=escape(sUrl);re=new RegExp("%3F","g");sUrl=sUrl.replace(re,'?');re=new RegExp("%3D","g");sUrl=sUrl.replace(re,'=');re=new RegExp("%26","g");sUrl=sUrl.replace(re,'&');return sUrl},insereCookie:function(nome,valor,expira){if(!expira){expira=10}var exdate=new Date();exdate.setDate(exdate.getDate()+expira);document.cookie=nome+"="+valor+"; expires="+exdate.toUTCString()+";path=/"},pegaCookie:function(nome){var cookies,i,fim;cookies=document.cookie;i=cookies.indexOf(nome);if(i===-1){return null}fim=cookies.indexOf(";",i);if(fim===-1){fim=cookies.length}return(unescape(cookies.substring(i,fim))).split("=")[1]},listaChaves:function(obj){var keys,key="";keys=[];for(key in obj){if(obj[key]){keys.push(key)}}return keys},listaTodasChaves:function(obj){var keys,key="";keys=[];for(key in obj){keys.push(key)}return keys},criaBotaoAplicar:function(nomeFuncao,titulo,classe,obj){try{if(typeof(tempoBotaoAplicar)!=='undefined'){clearTimeout(tempoBotaoAplicar)}}catch(e){}var executar=new Function(nomeFuncao+"().call;clearTimeout(tempoBotaoAplicar);"),novoel,xy;tempoBotaoAplicar=setTimeout(executar,(i3GEO.configura.tempoAplicar));if(arguments.length===1){titulo="Aplicar"}if(arguments.length===1||arguments.length===2){classe="i3geoBotaoAplicar"}if(!document.getElementById("i3geo_aplicar")){novoel=document.createElement("input");novoel.id='i3geo_aplicar';novoel.type='button';novoel.value=titulo;novoel.style.cursor="pointer";novoel.style.fontSize="10px";novoel.style.zIndex=15000;novoel.style.position="absolute";novoel.style.display="none";novoel.onmouseover=function(){this.style.display="block"};novoel.onmouseout=function(){this.style.display="none"};novoel.className=classe;document.body.appendChild(novoel)}else{novoel=document.getElementById("i3geo_aplicar")}novoel.onclick=function(){clearTimeout(i3GEO.parametros.tempo);i3GEO.parametros.tempo="";this.style.display='none';eval(nomeFuncao+"\(\)")};if(arguments.length===4){novoel.style.display="block";xy=YAHOO.util.Dom.getXY(obj);YAHOO.util.Dom.setXY(novoel,xy)}return(novoel)},arvore:function(titulo,onde,obj){var arvore,root,tempNode,d,criaNo;if(!$i(onde)){return}arvore=new YAHOO.widget.TreeView(onde);root=arvore.getRoot();try{tempNode=new YAHOO.widget.TextNode('',root,false);tempNode.isLeaf=false;tempNode.enableHighlight=true}catch(e){}titulo="<table><tr><td><b>"+titulo+"</b></td><td></td></tr></table>";d={html:titulo};tempNode=new YAHOO.widget.HTMLNode(d,root,true,true);tempNode.enableHighlight=true;criaNo=function(obj,noDestino){var trad,i,j,linha,conteudo,temaNode,c=obj.propriedades.length;for(i=0,j=c;i<j;i++){linha=obj.propriedades[i];if(linha.url!==""){trad=$trad(linha.text);if(!trad){trad=linha.text}conteudo="<a href='#' onclick='"+linha.url+"'>"+trad+"</a>"}else{conteudo=linha.text}d={html:conteudo};temaNode=new YAHOO.widget.HTMLNode(d,noDestino,false,true);temaNode.enableHighlight=false;if(obj.propriedades[i].propriedades){criaNo(obj.propriedades[i],temaNode)}}};criaNo(obj,tempNode);arvore.collapseAll();arvore.draw();return arvore},removeAcentos:function(palavra){var re;re=/á|à|ã|â/gi;palavra=palavra.replace(re,"a");re=/é|ê/gi;palavra=palavra.replace(re,"e");re=/í/gi;palavra=palavra.replace(re,"i");re=/ó|õ|ô/gi;palavra=palavra.replace(re,"o");re=/ç/gi;palavra=palavra.replace(re,"c");re=/ú/gi;palavra=palavra.replace(re,"u");return(palavra)},protocolo:function(){var u=window.location.href;u=u.split(":");return(u[0])},pegaPosicaoObjeto:function(obj){if(obj){if(!obj.style){return[0,0]}var curleft=0,curtop=0;if(obj){if(obj.offsetParent){do{curleft+=obj.offsetLeft-obj.scrollLeft;curtop+=obj.offsetTop-obj.scrollTop;obj=obj.offsetParent}while(obj)}}return[curleft+document.body.scrollLeft,curtop+document.body.scrollTop]}else{return[0,0]}},pegaElementoPai:function(e){var targ=document;if(!e){e=window.event}if(e.target){targ=e.target}else{if(e.srcElement){targ=e.srcElement}}if(targ.nodeType===3){targ=targ.parentNode}if(targ.parentNode){tparent=targ.parentNode;return(tparent)}else{return targ}},mudaCursor:function(cursores,tipo,idobjeto,locaplic){var os=[],o,i,c="",n,cursor="",ext=".ff";try{if(navm){ext=".ie"}os.push(document.getElementById(idobjeto));if(i3GEO.Interface.ATUAL==="openlayers"){os=YAHOO.util.Dom.getElementsByClassName('olTileImage','img')}if(i3GEO.Interface.ATUAL==="googlemaps"){os=document.getElementById(idobjeto).firstChild;os=os.getElementsByTagName("div")}n=os.length;if(tipo==="default"||tipo==="pointer"||tipo==="crosshair"||tipo==="help"||tipo==="move"||tipo==="text"){cursor=tipo}else{c=eval("cursores."+tipo+ext)}if(c==="default"||c==="pointer"||c==="crosshair"||c==="help"||c==="move"||c==="text"){cursor=c}if(cursor===""){cursor="URL(\""+locaplic+eval("cursores."+tipo+ext)+"\"),auto"}for(i=0;i<n;i++){o=os[i];if(o){o.style.cursor=cursor}}}catch(e){}},criaBox:function(id){if(arguments.length===0){id="boxg"}if(!$i(id)){var novoel=document.createElement("div");novoel.id=id;novoel.style.zIndex=1;novoel.innerHTML='<font face="Arial" size=0></font>';document.body.appendChild(novoel);novoel.onmouseover=function(){novoel.style.display='none'};novoel.onmouseout=function(){novoel.style.display='block'};i3GEO.util.BOXES.push(id)}else{$i(id).style.display="block"}},escondeBox:function(){var l,i;l=i3GEO.util.BOXES.length;for(i=0;i<l;i++){if($i(i3GEO.util.BOXES[i])){$i(i3GEO.util.BOXES[i]).style.display="none"}}},criaPin:function(id,imagem,w,h,mouseover){if(arguments.length<1||id===""){id="boxpin"}if(arguments.length<2||imagem===""){imagem=i3GEO.configura.locaplic+'/imagens/marker.png'}if(arguments.length<3||w===""){w=21}if(arguments.length<4||h===""){h=25}if(!$i(id)){var novoel=document.createElement("img");novoel.style.zIndex=10000;novoel.style.position="absolute";novoel.style.width=parseInt(w,10)+"px";novoel.style.height=parseInt(h,10)+"px";novoel.style.top="0px";novoel.style.left="0px";novoel.src=imagem;novoel.id=id;if(id==="boxpin"){novoel.onmouseover=function(){$i("boxpin").style.display="none"}}else if(mouseover){novoel.onmouseover=mouseover}document.body.appendChild(novoel);i3GEO.util.PINS.push(id)}$i(id).style.display="block"},posicionaImagemNoMapa:function(id,x,y){var i,mx,my;if(x&&x!=""){objposicaocursor.telax=x}if(y&&y!=""){objposicaocursor.telay=y}i=$i(id);mx=parseInt(i.style.width,10)/2;my=parseInt(i.style.height,10)/2;i.style.top=objposicaocursor.telay-my+"px";i.style.left=objposicaocursor.telax-mx+"px";return[objposicaocursor.telay-my,objposicaocursor.telax-mx]},escondePin:function(){var l,i;l=i3GEO.util.PINS.length;for(i=0;i<l;i++){if($i(i3GEO.util.PINS[i])){$i(i3GEO.util.PINS[i]).style.display="none"}}},$im:function(g){return i3GEO.configura.locaplic+"/imagens/visual/default/"+g},$inputText:function(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch){if(arguments.length===6){nome=""}if(idPai!==""){if(larguraIdPai!==""){$i(idPai).style.width=larguraIdPai+"px"}$i(idPai).style.padding="3";$i(idPai).style.textAlign="center"}if(!onch){onch=""}return"<span class=digitar onmouseover='javascript:this.className=\"digitarOver\";' onmouseout='javascript:this.className=\"digitar\";' ><input onchange=\""+onch+"\" tabindex='0' onclick='javascript:this.select();' id='"+idInput+"' title='"+titulo+"' type='text' size='"+digitos+"' class='digitar' value='"+valor+"' name='"+nome+"' /></span>"},$inputTextMudaCor:function(obj){var n=obj.value.split(" ");obj.style.color="rgb("+n[0]+","+n[1]+","+n[2]+")"},$top:function(id,valor){if(document.getElementById(id).style){if(document.getElementById(id).style.pixelTop){document.getElementById(id).style.pixelTop=valor}else{document.getElementById(id).style.top=valor+"px"}}},$left:function(id,valor){if(document.getElementById(id).style){if(document.getElementById(id).style.pixelLeft){document.getElementById(id).style.pixelLeft=valor}else{document.getElementById(id).style.left=valor+"px"}}},insereMarca:{CONTAINER:[],cria:function(xi,yi,funcaoOnclick,container,texto,srci,w,h){if(!w){w=5}if(!h){h=5}if(!srci||srci===""){srci=i3GEO.configura.locaplic+"/imagens/dot2.gif"}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.insereMarca(texto,xi,yi,container);return}try{var novoel,i,novoimg,temp;if(i3GEO.util.insereMarca.CONTAINER.toString().search(container)<0){i3GEO.util.insereMarca.CONTAINER.push(container)}if(!$i(container)){novoel=document.createElement("div");novoel.id=container;i=novoel.style;i.position="absolute";if($i(i3GEO.Interface.IDCORPO)){i.top=parseInt($i(i3GEO.Interface.IDCORPO).style.top,10)+"px";i.left=parseInt($i(i3GEO.Interface.IDCORPO).style.left,10)+"px"}else{i.top=parseInt($i(i3GEO.Interface.IDMAPA).style.top,10)+"px";i.left=parseInt($i(i3GEO.Interface.IDMAPA).style.left,10)+"px"}document.body.appendChild(novoel)}container=$i(container);novoel=document.createElement("div");i=novoel.style;i.position="absolute";i.zIndex=2000;i.top=(yi-(h/2))+"px";i.left=(xi-(w/2))+"px";i.width=w+"px";i.height=h+"px";novoimg=document.createElement("img");if(funcaoOnclick!==""){novoimg.onclick=funcaoOnclick}else{novoimg.onclick=function(){i3GEO.util.insereMarca.limpa()}}novoimg.src=srci;temp=novoimg.style;temp.width=w+"px";temp.height=h+"px";temp.zIndex=2000;novoel.appendChild(novoimg);container.appendChild(novoel);if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.util.insereMarca.limpa()")<0){i3GEO.eventos.NAVEGAMAPA.push("i3GEO.util.insereMarca.limpa()")}}catch(e){i3GEO.janela.tempoMsg("Ocorreu um erro. inseremarca"+e)}},limpa:function(){try{var n,i;n=i3GEO.util.insereMarca.CONTAINER.length;for(i=0;i<n;i++){if($i(i3GEO.util.insereMarca.CONTAINER[i])){$i(i3GEO.util.insereMarca.CONTAINER[i]).innerHTML=""}}i3GEO.util.insereMarca.CONTAINER=[];i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.util.insereMarca.limpa()")}catch(e){}}},adicionaSHP:function(path){var temp=path.split(".");if((temp[1]==="SHP")||(temp[1]==="shp")){i3GEO.php.adicionaTemaSHP(i3GEO.atualiza,path)}else{i3GEO.php.adicionaTemaIMG(i3GEO.atualiza,path)}},abreCor:function(janelaid,elemento,tipo){if(!i3GEO.configura){i3GEO.configura={locaplic:"../"}}if(arguments.length===2){tipo="rgb"}var janela,ins,novoel,wdocaiframe,wsrc=i3GEO.configura.locaplic+"/ferramentas/colorpicker/index.htm?doc="+janelaid+"&elemento="+elemento+"&tipo="+tipo,texto="Cor",id="i3geo_janelaCor",classe="hd";if($i(id)){YAHOO.i3GEO.janela.manager.find(id).show();return}ins='<div id="'+id+'_cabecalho" class="hd">';ins+="<span><img id='i3geo_janelaCor_imagemCabecalho' style='visibility:hidden;' src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde.gif\' /></span>";ins+=texto;ins+='</div><div id="i3geo_janelaCor_corpo" class="bd" style="padding:5px">';if(wsrc!==""){ins+='<iframe name="'+id+'i" id="i3geo_janelaCori" valign="top" style="height:230px,border:0px white solid"></iframe>'}ins+='</div>';novoel=document.createElement("div");novoel.id="i3geo_janelaCor";novoel.style.display="block";novoel.innerHTML=ins;if($i("i3geo")){$i("i3geo").appendChild(novoel)}else{document.body.appendChild(novoel)}wdocaiframe=$i("i3geo_janelaCori");if(wdocaiframe){wdocaiframe.style.display="block";wdocaiframe.src=wsrc;wdocaiframe.style.height="230px";wdocaiframe.style.width="325px";wdocaiframe.style.border="0px solid white"}janela=new YAHOO.widget.Panel(id,{height:"290px",modal:false,width:"350px",fixedcenter:true,constraintoviewport:false,visible:true,iframe:false});YAHOO.i3GEO.janela.manager.register(janela);janela.render();$i(id+'_cabecalho').className=classe},ajaxhttp:function(){var objhttp1;try{objhttp1=new XMLHttpRequest()}catch(ee){try{objhttp1=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{objhttp1=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){objhttp1=false}}}return(objhttp1)},ajaxexecASXml:function(programa,funcao){var h,ohttp;if(programa.search("http")===0){h=window.location.host;if(programa.search(h)<0){alert("OOps! Nao e possivel chamar um XML de outro host.\nContacte o administrador do sistema.\nConfigure corretamente o ms_configura.php");return}}ohttp=i3GEO.util.ajaxhttp();ohttp.open("GET",programa,true);ohttp.onreadystatechange=function(){var retorno,parser,dom;if(ohttp.readyState===4){retorno=ohttp.responseText;if(retorno!==undefined){if(document.implementation.createDocument){parser=new DOMParser();dom=parser.parseFromString(retorno,"text/xml")}else{dom=new ActiveXObject("Microsoft.XMLDOM");dom.async="false";dom.load(programa)}}else{return"erro"}if(funcao!=="volta"){eval(funcao+'(dom)')}else{return dom}}};ohttp.send(null)},aparece:function(id,tempo,intervalo){var n,obj,opacidade,fadei=0,tempoFadei=null;n=parseInt(tempo/intervalo,10);obj=$i(id);if(n===1){obj.style.display="block";if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}}tempo=n*intervalo;intervalo=(intervalo*100)/tempo;opacidade=0;if(navm){obj.style.filter='alpha(opacity=0)'}else{obj.style.opacity=0}obj.style.display="block";fadei=function(){opacidade+=intervalo;if(navm){obj.style.filter='alpha(opacity='+opacidade+')'}else{obj.style.opacity=opacidade/100}if(opacidade<100){tempoFadei=setTimeout(fadei,tempo)}else{if(tempoFadei){clearTimeout(tempoFadei)}if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}}};tempoFadei=setTimeout(fadei,tempo)},desaparece:function(id,tempo,intervalo,removeobj){var n,obj,opacidade,fade=0,p,tempoFade=null;n=parseInt(tempo/intervalo,10);obj=$i(id);if(n===1){obj.style.display="none";if(removeobj){p=obj.parentNode;if(p){p.removeChild(obj)}}return}tempo=n*intervalo;intervalo=(intervalo*100)/tempo;opacidade=100;if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}obj.style.display="block";fade=function(){opacidade-=intervalo;if(navm){obj.style.filter='alpha(opacity='+opacidade+')'}else{obj.style.opacity=opacidade/100}if(opacidade>0){tempoFade=setTimeout(fade,tempo)}else{if(tempoFade){clearTimeout(tempoFade)}obj.style.display="none";if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}if(removeobj){p=obj.parentNode;if(p){p.removeChild(obj)}}}};tempoFade=setTimeout(fade,tempo)},wkt2ext:function(wkt,tipo){var re,x,y,w,xMin,xMax,yMin,yMax,temp;tipo=tipo.toLowerCase();ext=false;if(tipo==="polygon"){try{re=new RegExp("POLYGON","g");wkt=wkt.replace(re,"");wkt=wkt.split("(")[2].split(")")[0];wkt=wkt.split(",");x=[];y=[];for(w=0;w<wkt.length;w++){temp=wkt[w].split(" ");x.push(temp[0]);y.push(temp[1])}x.sort(i3GEO.util.sortNumber);xMin=x[0];xMax=x[(x.length)-1];y.sort(i3GEO.util.sortNumber);yMin=y[0];yMax=y[(y.length)-1];return xMin+" "+yMin+" "+xMax+" "+yMax}catch(e){}}if(tipo==="point"){try{re=new RegExp("POINT","g");wkt=wkt.replace(re,"");wkt=wkt.split("(")[1].split(")")[0];wkt=wkt.split(" ");return(wkt[0]*1-0.01)+" "+(wkt[1]*1-0.01)+" "+(wkt[0]*1+0.01)+" "+(wkt[1]*1+0.01)}catch(e){}}return ext},sortNumber:function(a,b){return a-b},getScrollerWidth:function(){var scr=null,inn=null,wNoScroll=0,wScroll=0;scr=document.createElement('div');scr.style.position='absolute';scr.style.top='-1000px';scr.style.left='-1000px';scr.style.width='100px';scr.style.height='50px';scr.style.overflow='hidden';inn=document.createElement('div');inn.style.width='100%';inn.style.height='200px';scr.appendChild(inn);document.body.appendChild(scr);wNoScroll=inn.offsetWidth;scr.style.overflow='auto';wScroll=inn.offsetWidth;document.body.removeChild(document.body.lastChild);return(wNoScroll-wScroll)},getScrollHeight:function(){var mx=Math.max,d=document;return mx(mx(d.body.scrollHeight,d.documentElement.scrollHeight),mx(d.body.offsetHeight,d.documentElement.offsetHeight),mx(d.body.clientHeight,d.documentElement.clientHeight))},scriptTag:function(js,ini,id,aguarde){if(!aguarde){aguarde=false}var head,script,tipojanela=i3GEO.janela.ESTILOAGUARDE;if(!$i(id)||id===""){if(i3GEO.janela&&aguarde===true){i3GEO.janela.ESTILOAGUARDE="reduzida";i3GEO.janela.abreAguarde(id+"aguarde","Carregando JS")}head=document.getElementsByTagName('head')[0];script=document.createElement('script');script.type='text/javascript';if(ini!==""){if(navm){script.onreadystatechange=function(){if(this.readyState==='loaded'||this.readyState==='complete'){if(i3GEO.janela){i3GEO.janela.fechaAguarde(id+"aguarde")}if(YAHOO.lang.isFunction(ini)){ini.call()}else{eval(ini)}}}}else{script.onload=function(){if(i3GEO.janela){i3GEO.janela.fechaAguarde(id+"aguarde")}if(YAHOO.lang.isFunction(ini)){ini.call()}else{eval(ini)}}}i3GEO.janela.ESTILOAGUARDE=tipojanela}script.src=js;if(id!==""){script.id=id}head.appendChild(script)}else{if(ini!==""){if(YAHOO.lang.isFunction(ini)){ini.call()}else{eval(ini)}}}},removeScriptTag:function(id){try{old=$i("loadscriptI3GEO");if(old!==null){old.parentNode.removeChild(old);old=null;eval(id+" = null;")}old=$i(id);if(old!==null){old.parentNode.removeChild(old)}}catch(erro){}},verificaScriptTag:function(texto){var s=document.getElementsByTagName("script"),n=s.length,i,t;try{for(i=0;i<n;i++){t=s[i].id;t=t.split(".");if(t[2]&&t[2]=="dicionario_script"){return false}if(t[0]===texto){return true}}return false}catch(e){return false}},mensagemAjuda:function(onde,texto){var ins="<table style='width:100%;padding:2;vertical-align:top;background-color:#ffffff;' ><tr><th style='background-color: #cedff2; font-family:Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; border: 1px solid #B1CDEB; text-align: left; padding-left: 7px;padding-right: 11px;'>";ins+='<div style="float:right"><img src="'+i3GEO.configura.locaplic+'/imagens/question.gif" /></div>';ins+='<div style="text-align:left;">';if(texto===""){texto=$i(onde).innerHTML}ins+=texto;ins+='</div></th></tr></table>';if(onde!==""){$i(onde).innerHTML=ins}else{return(ins)}},randomRGB:function(){var v=Math.random(),r=parseInt(255*v,10),g;v=Math.random();g=parseInt(255*v,10);v=Math.random();b=parseInt(255*v,10);return(r+","+g+","+b)},rgb2hex:function(str){var re=new RegExp(" ","g"),rgb=str.replace(re,',');return YAHOO.util.Dom.Color.toHex("rgb("+rgb+")")},comboTemas:function(id,funcao,onde,nome,multiplo,tipoCombo,estilo,yui){if(onde&&onde!==""){i3GEO.util.defineValor(onde,"innerHTML","<span style=color:red;font-size:10px; >buscando temas...</span>")}if(!nome){nome=""}if(!multiplo){multiplo=false}if(!estilo||estilo==""){estilo="font-size: 12px;width: 95%;"}if(!yui){yui=false}var monta,temp,temp1,temp2;monta=function(retorno){var i,comboTemas='',n,nome="";if(yui===true){comboTemas='<input type="button" name='+id+'_button id="'+id+'" value="'+$trad("x33")+' ">';id=id+"select";nome=id}if(retorno!==undefined){if(retorno.data){retorno=retorno.data}n=retorno.length;if(n>0){if(multiplo){comboTemas+="<select style='"+estilo+"' id='"+id+"' size='4' multiple='multiple' name='"+nome+"'>"}else{comboTemas+="<select style='"+estilo+"' id='"+id+"' name='"+nome+"'>"}if(yui===false){comboTemas+="<option value=''>----</option>"}for(i=0;i<n;i++){if(retorno[i].nome){nome=retorno[i].nome;tema=retorno[i].tema}else{nome=retorno[i].tema;tema=retorno[i].name}if(retorno[i].escondido!=="sim"){comboTemas+="<option value="+tema+" >"+nome+"</option>"}}comboTemas+="</select>";temp={dados:comboTemas,tipo:"dados"}}else{if(tipoCombo==="poligonosSelecionados"||tipoCombo==="selecionados"||tipoCombo==="pontosSelecionados"){temp={dados:'<div class=alerta >Nenhum tema encontrado. <span style=cursor:pointer;color:blue onclick="i3GEO.mapa.dialogo.selecao()" > Selecionar...</span></div>',tipo:"mensagem"}}else{temp={dados:'<div class=alerta >Nenhum tema encontrado. </div>',tipo:"mensagem"}}}}else{temp={dados:"<p style=color:red >Ocorreu um erro<br>",tipo:"erro"}}eval("funcao(temp);")};if(tipoCombo==="ligados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemas(monta,"ligados",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="ligadosComTabela"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS);temp1=i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"menor",temp);temp2=i3GEO.arvoreDeCamadas.filtraCamadas("type",8,"igual",temp);monta(temp1.concat(temp2))}else{i3GEO.php.listaTemas(monta,"ligados",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="locais"){i3GEO.php.listaTemasEditaveis(monta,i3GEO.configura.locaplic,i3GEO.configura.sid)}if(tipoCombo==="editavel"){temp=i3GEO.arvoreDeCamadas.filtraCamadas("editavel","SIM","igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(temp)}if(tipoCombo==="selecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemasComSel(monta,i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="raster"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listatemasTipo(monta,"raster",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="pontosSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="pontos"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="poligonos"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="poligonosSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="naolinearSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",1,"diferente",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="linhaDoTempo"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("linhadotempo","sim","igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo===""){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type","","diferente",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}},checkCombo:function(id,nomes,valores,estilo,funcaoclick,ids,idschecked){var temp,i,combo="",n=valores.length;if(n>0){combo="<div style='"+estilo+"'><table class=lista3 id="+id+" >";for(i=0;i<n;i++){temp="";if(idschecked&&idschecked[i]){temp="checked"}if(!ids){combo+="<tr><td><input "+temp+" onclick="+funcaoclick+" size=2 style='top:1px;cursor:pointer' type=checkbox value='"+valores[i]+"' /></td><td>"+nomes[i]+"</td>"}else{combo+="<tr><td><input "+temp+" id="+ids[i]+" onclick="+funcaoclick+" size=2 style='top:1px;cursor:pointer' type=checkbox value='"+valores[i]+"' /></td><td>"+nomes[i]+"</td>"}}combo+="</table></div>"}return combo},valoresCheckCombo:function(id){var el=$i(id),res=[],n,i;if(el){el=el.getElementsByTagName("input");n=el.length;for(i=0;i<n;i++){if(el[i].checked===true){res.push(el[i].value)}}}return res},checkTemas:function(id,funcao,onde,nome,tipoLista,prefixo,size){if(arguments.length>2){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando temas...</span>"}if(arguments.length===3){nome=""}var monta,temp,temp1,n,i;monta=function(retorno){try{var i,comboTemas,n,nome;if(retorno!==undefined){if(retorno.data){retorno=retorno.data}n=retorno.length;if(n>0){comboTemas="<table class=lista3 >";for(i=0;i<n;i++){if(retorno[i].nome){nome=retorno[i].nome;tema=retorno[i].tema}else{nome=retorno[i].tema;tema=retorno[i].name}comboTemas+="<tr><td><input size=2 style='cursor:pointer' type=checkbox name='"+tema+"' /></td>";comboTemas+="<td> <input style='text-align:left;width:"+size+" cursor:text;' onclick='javascript:this.select();' id='"+prefixo+tema+"' type=text value='"+nome+"' /></td></tr>"}comboTemas+="</table>";temp={dados:comboTemas,tipo:"dados"}}else{temp={dados:'<div class=alerta >Nenhum tema encontrado.</div>',tipo:"mensagem"}}}else{temp={dados:"<p style=color:red >Ocorreu um erro<br>",tipo:"erro"}}eval("funcao(temp);")}catch(e){}};if(tipoLista==="ligados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemas(monta,"ligados",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoLista==="selecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemasComSel(monta,i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoLista==="raster"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listatemasTipo(monta,"raster",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoLista==="polraster"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"igual",i3GEO.arvoreDeCamadas.CAMADAS);temp1=i3GEO.arvoreDeCamadas.filtraCamadas("type",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS);n=temp1.length;for(i=0;i<n;i++){temp.push(temp1[i])}monta(temp)}else{alert($trad("x13"))}}if(tipoLista==="pontosSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{alert($trad("x13"))}}if(tipoLista==="pontos"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{alert($trad("x13"))}}},comboItens:function(id,tema,funcao,onde,nome,alias){if(!alias){alias="sim"}if(arguments.length>3){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando itens...</span>"}if(arguments.length!==5){nome=""}var monta=function(retorno){var ins,temp,i,nm;if(retorno.data!==undefined){ins=[];ins.push("<select id='"+id+"' name='"+nome+"'>");ins.push("<option value='' >---</option>");temp=retorno.data.valores.length;for(i=0;i<temp;i++){if(retorno.data.valores[i].tema===tema){if(alias=="sim"){nm=retorno.data.valores[i].alias;if(nm===""){nm=retorno.data.valores[i].item}}else{nm=retorno.data.valores[i].item}ins.push("<option value='"+retorno.data.valores[i].item+"' >"+nm+"</option>")}}ins.push("</select>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"}}eval("funcao(temp)")};i3GEO.php.listaItensTema(monta,tema)},comboValoresItem:function(id,tema,itemTema,funcao,onde){if(arguments.length===5){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando valores...</span>"}var monta=function(retorno){var ins=[],i,pares,j;if(retorno.data!==undefined){ins.push("<select id="+id+" >");ins.push("<option value='' >---</option>");for(i=0;i<retorno.data[1].registros.length;i++){pares=retorno.data[1].registros[i].valores;for(j=0;j<pares.length;j++){ins.push("<option value='"+pares[j].valor+"' >"+pares[j].valor+"</option>")}}ins.push("</select>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >Ocorreu um erro</erro>',tipo:"erro"}}eval("funcao(temp)")};i3GEO.php.listaValoresItensTema(monta,tema,itemTema)},comboFontes:function(id,onde){$i(onde).innerHTML="<span style=color:red >buscando fontes...</span>";var monta=function(retorno){var ins="",temp,i,dados;if(retorno.data!==undefined){ins+="<select id='"+id+"'>";ins+="<option value='bitmap' >bitmap</option>";dados=retorno.data.split(",");temp=dados.length;for(i=0;i<temp;i++){ins+="<option value='"+dados[i]+"' >"+dados[i]+"</option>"}ins+="</select>"}$i(onde).innerHTML=ins};i3GEO.php.listaFontesTexto(monta)},comboSimNao:function(id,selecionado){var combo="<select name="+id+" id="+id+" >";combo+="<option value='' >---</option>";if(selecionado.toLowerCase()==="sim"){combo+="<option value=TRUE selected >"+$trad("x14")+"</option>"}else{combo+="<option value=TRUE >"+$trad("x14")+"</option>"}if(selecionado==="nao"){combo+="<option value=FALSE selected >"+$trad("x15")+"</option>"}else{combo+="<option value=FALSE >"+$trad("x15")+"</option>"}combo+="</select>";return(combo)},checkItensEditaveis:function(tema,funcao,onde,size,prefixo,ordenacao){if(!ordenacao||ordenacao==""){ordenacao=="nao"}if(onde!==""){$i(onde).innerHTML="<span style=color:red;font-size:10px; >"+$trad("x65")+"</span>"}var monta=function(retorno){var ins=[],i,temp,n;if(retorno.data!==undefined){if(ordenacao==="sim"){ins.push("<table class=lista3 ><tr><td></td><td>"+$trad("x64")+"</td><td>Ordem</td>")}else{ins.push("<table class=lista3 ><tr><td></td><td>"+$trad("x64")+"</td><td></td>")}n=retorno.data.valores.length;for(i=0;i<n;i++){ins.push("<tr><td><input size=2 style='cursor:pointer' name='"+retorno.data.valores[i].tema+"' type=checkbox id='"+prefixo+retorno.data.valores[i].item+"' /></td>");ins.push("<td><input style='text-align:left;cursor:text;width:"+size+"' onclick='javascript:this.select();' id='"+prefixo+retorno.data.valores[i].item+retorno.data.valores[i].tema+"' type=text value='"+retorno.data.valores[i].item+"' /></td>");if(ordenacao==="sim"){ins.push("<td><input style='text-align:left; cursor:text;' id='ordem_"+prefixo+retorno.data.valores[i].item+retorno.data.valores[i].tema+"' type=text size='3' value='"+i+"' /></td>")}else{ins.push("<td></td>")}ins.push("</tr>")}ins.push("</table>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >'+$trad("x66")+'</div>',tipo:"erro"}}funcao.call(this,temp)};i3GEO.php.listaItensTema(monta,tema)},radioEpsg:function(funcao,onde,prefixo){if(arguments.length===2){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando...</span>"}var monta=function(retorno){var c="checked",ins=[],i,n,temp;if(retorno.data!==undefined){ins.push("<table class=lista2 >");n=retorno.data.length;for(i=0;i<n;i++){ins.push("<tr><td><input size=2 style='border:0px solid white;cursor:pointer' "+c+" name='"+prefixo+"EPSG' type=radio value='"+retorno.data[i].codigo+"' /></td>");c="";ins.push("<td>"+retorno.data[i].nome+"</td></tr>")}ins.push("</table>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"}}funcao(temp)};i3GEO.php.listaEpsg(monta)},comboEpsg:function(idCombo,onde,funcaoOnChange,valorDefault){onde=$i(onde);onde.innerHTML="<span style=color:red;font-size:10px; >buscando...</span>";var monta=function(retorno){var ins=[],i,n;if(retorno.data!==undefined){n=retorno.data.length;ins.push("<select id='"+idCombo+"' onChange='"+funcaoOnChange+"(this)' >");for(i=0;i<n;i++){ins.push("<option value='"+retorno.data[i].codigo+"'>"+retorno.data[i].nome+"</option>")}ins.push("</select>");ins=ins.join('');onde.innerHTML=ins;$i(idCombo).value=valorDefault}else{onde.innerHTML='<div class=erro >Ocorreu um erro</div>'}};i3GEO.php.listaEpsg(monta)},proximoAnterior:function(anterior,proxima,texto,idatual,container,mantem,onde){var temp=$i(idatual),botoes="",ndiv=document.createElement("div"),nids,i,fundo;if(!mantem){mantem=false}if(temp&&mantem==false){$i(container).removeChild(temp)}fundo="#F2F2F2";$i(container).style.backgroundColor="white";botoes="<table style='width:100%;background-color:"+fundo+";' ><tr style='width:100%'>";if(anterior!==""){botoes+="<td style='border:0px solid white;text-align:left;cursor:pointer;background-color:"+fundo+";'><input id='"+idatual+"anterior_' onclick='"+anterior+"' type='button' value=' ' /></td>"}if(proxima!==""){botoes+="<td style='border:0px solid white;text-align:right;cursor:pointer;background-color:"+fundo+";'><input id='"+idatual+"proxima_' onclick='"+proxima+"' type='button' value=' ' /></td>"}botoes+="</tr></table>";var ativaBotoes=function(anterior,proxima,idatual){var i;new YAHOO.widget.Button(idatual+"anterior_",{onclick:{fn:function(){eval(anterior+"()")},lazyloadmenu:true}});new YAHOO.widget.Button(idatual+"proxima_",{onclick:{fn:function(){eval(proxima+"()")},lazyloadmenu:true}});i=$i(idatual+"proxima_-button");if(i){i.style.backgroundImage="url('"+i3GEO.configura.locaplic+"/imagens/player_avanca.png')";i.style.backgroundRepeat="no-repeat";i.style.backgroundPosition="center center"}i=$i(idatual+"anterior_-button");if(i){i.style.backgroundImage="url('"+i3GEO.configura.locaplic+"/imagens/player_volta.png')";i.style.backgroundRepeat="no-repeat";i.style.backgroundPosition="center center"}};if(onde){$i(onde).innerHTML=botoes}else{texto=texto+"<br><br>"+botoes}if(!document.getElementById(idatual)){ndiv.id=idatual;ndiv.innerHTML=texto;$i(container).appendChild(ndiv)}ativaBotoes(anterior,proxima,idatual);temp=$i(container).getElementsByTagName("div");nids=temp.length;for(i=0;i<nids;i++){temp[i].style.display="none"}$i(idatual).style.display="block"},dialogoFerramenta:function(mensagem,dir,nome,nomejs,nomefuncao){if(!nomejs){nomejs="index.js"}if(!nomefuncao){nomefuncao="i3GEOF."+nome+".criaJanelaFlutuante();"}var js=i3GEO.configura.locaplic+"/ferramentas/"+dir+"/"+nomejs;if(!$i("i3GEOF."+nome+"_script")){i3GEO.janela.ESTILOAGUARDE="reduzida";i3GEO.janela.abreAguarde("i3GEOF."+nome+"_script"+"aguarde","Carregando JS");i3GEO.util.scriptTag(js,nomefuncao,"i3GEOF."+nome+"_script")}else{i3GEO.util.scriptTag(js,nomefuncao,"i3GEOF."+nome+"_script")}},intersectaBox:function(box1,box2){box1=box1.split(" ");box2=box2.split(" ");var box1i=box2,box2i=box1,coordx,coordy;coordx=box1[0]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true;coordx=box1[0]*1;coordy=box1[3]*1}if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[3]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}box1=box1i;box2=box2i;coordx=box1[0]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true;coordx=box1[0]*1;coordy=box1[3]*1}if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[3]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}return false},abreColourRamp:function(janelaid,elemento,ncores){var janela,ins,novoel,wdocaiframe,temp,fix=false,wsrc=i3GEO.configura.locaplic+"/ferramentas/colourramp/index.php?ncores="+ncores+"&doc="+janelaid+"&elemento="+elemento+"&locaplic="+i3GEO.configura.locaplic,nx="",texto="",id="i3geo_janelaCorRamp",classe="hd";if($i(id)){janela=YAHOO.i3GEO.janela.manager.find(id);janela.show();janela.bringToTop();return}ins='<div id="'+id+'_cabecalho" class="hd">';ins+="<span><img id='i3geo_janelaCorRamp_imagemCabecalho' style='visibility:hidden;' src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde.gif\' /></span>";if(i3GEO&&i3GEO.arvoreDeCamadas){ins+="<div id='i3geo_janelaCorRampComboCabeca' class='comboTemasCabecalho' style='top:0px;'> ------</div>"}ins+=" "+texto;ins+='</div><div id="i3geo_janelaCorRamp_corpo" class="bd" style="padding:5px">';ins+='<iframe name="'+id+'i" id="i3geo_janelaCorRampi" valign="top" ></iframe>';ins+='</div>';novoel=document.createElement("div");novoel.id="i3geo_janelaCorRamp";novoel.style.display="block";novoel.innerHTML=ins;if($i("i3geo")){$i("i3geo").appendChild(novoel)}else{document.body.appendChild(novoel)}wdocaiframe=$i("i3geo_janelaCorRampi");wdocaiframe.style.display="block";wdocaiframe.src=wsrc;wdocaiframe.style.height="380px";wdocaiframe.style.width="100%";wdocaiframe.style.border="0px solid white";if(nx===""||nx==="center"){fix=true}janela=new YAHOO.widget.Panel(id,{height:"430px",modal:false,width:"280px",fixedcenter:fix,constraintoviewport:true,visible:true,iframe:false});YAHOO.i3GEO.janela.manager.register(janela);janela.render();$i(id+'_cabecalho').className=classe;if($i("i3geo_janelaCorRampComboCabeca")){temp=function(){var p,tema=$i("i3geo_janelaCorRampComboCabecaSel").value,funcao=function(retorno){parent.frames["i3geo_janelaCorRampi"].document.getElementById("ncores").value=retorno.data.length};if(tema!==""){i3GEO.mapa.ativaTema(tema);p=i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=editalegenda&opcao=edita&tema="+tema;i3GEO.util.ajaxGet(p,funcao);cp=new cpaint()}};i3GEO.janela.comboCabecalhoTemas("i3geo_janelaCorRampComboCabeca","i3geo_janelaCorRampComboCabecaSel","none","ligados",temp)}},localizai3GEO:function(){var scriptLocation="",scripts=document.getElementsByTagName('script'),i=0,index,ns=scripts.length,src;for(i=0;i<ns;i++){src=scripts[i].getAttribute('src');if(src){index=src.lastIndexOf("/classesjs/i3geo.js");if((index>-1)&&(index+"/classesjs/i3geo.js".length===src.length)){scriptLocation=src.slice(0,-"/classesjs/i3geo.js".length);break}index=src.lastIndexOf("/classesjs/i3geonaocompacto.js");if((index>-1)&&(index+"/classesjs/i3geonaocompacto.js".length===src.length)){scriptLocation=src.slice(0,-"/classesjs/i3geonaocompacto.js".length);break}}}if(i3GEO.configura){i3GEO.configura.locaplic=scriptLocation}return scriptLocation},removeChild:function(id,el){var j=$i(id);if(j){if(!el){el=j.parentNode}el.removeChild(j)}},defineValor:function(id,prop,valor){try{eval("$i('"+id+"')."+prop+"='"+valor+"';")}catch(e){}},in_array:function(x,matriz){var txt=" "+matriz.join(" ")+" ";var er=new RegExp(" "+x+" ","gim");return((txt.match(er))?true:false)},timedProcessArray:function(items,process,callback){var todo=items.concat();setTimeout(function(){var start=+new Date();do{process(todo.shift())}while(todo.length>0&&(+new date()-start<50));if(todo.length>0){setTimeout(arguments.callee,25)}else{callback(items)}},25)},multiStep:function(steps,args,callback){var tasks=steps.concat();setTimeout(function(){var task=tasks.shift(),a=args.shift();task.apply(null,a||[]);if(tasks.length>0){setTimeout(arguments.callee,25)}else{callback()}},25)},tamanhoBrowser:function(){var viewportwidth,viewportheight;if(typeof window.innerWidth!='undefined'){viewportwidth=window.innerWidth,viewportheight=window.innerHeight}else if(typeof document.documentElement!='undefined'&&typeof document.documentElement.clientWidth!='undefined'&&document.documentElement.clientWidth!=0){viewportwidth=document.documentElement.clientWidth,viewportheight=document.documentElement.clientHeight}else{viewportwidth=document.getElementsByTagName('body')[0].clientWidth,viewportheight=document.getElementsByTagName('body')[0].clientHeight}viewportwidth=viewportwidth-i3GEO.util.getScrollerWidth();return[viewportwidth,viewportheight]},detectaTablet:function(){var p,c=DetectaMobile("DetectTierTablet");if(c===false){return false}p=confirm($trad("x73"));if(p){window.location=i3GEO.configura.locaplic+'/interface/'+i3GEO.Interface.ALTTABLET+'?'+i3GEO.configura.sid;return true}},detectaMobile:function(){var p,c=DetectaMobile("DetectMobileLong");if(c===false){return false}p=confirm($trad("x73"));if(p){window.location=i3GEO.configura.locaplic+'/interface/'+i3GEO.Interface.ALTTABLET+'?'+i3GEO.configura.sid;return true}},calculaDPI:function(){var novoel=document.createElement("div"),valor=72;novoel.style.height="1in";novoel.style.left="-100%";novoel.style.position="absolute";novoel.style.top="-100%";novoel.style.width="1in";document.body.appendChild(novoel);if(novoel.offsetHeight){valor=novoel.offsetHeight}document.body.removeChild(novoel);return valor},ajustaDocType:function(){try{if(document.implementation.createDocumentType){var newDoctype=document.implementation.createDocumentType('html','-//W3C//DTD XHTML 1.0 Transitional//EN','http://www.w3.org/TR/html4/loose.dtd');if(document.doctype){document.doctype.parentNode.replaceChild(newDoctype,document.doctype)}}}catch(e){}},versaoNavegador:function(){if(navm&&navigator.userAgent.toLowerCase().indexOf('msie 8.')>-1){return"IE8"}if(navn&&navigator.userAgent.toLowerCase().indexOf('3.')>-1){return"FF3"}return""},decimalPlaces:function(float,length){var ret="",str=float.toString(),array=str.split("."),i;if(array.length==2){ret+=array[0]+".";for(i=0;i<length;i++){if(i>=array[1].length)ret+='0';else ret+=array[1][i]}}else if(array.length==1){ret+=array[0]+".";for(i=0;i<length;i++){ret+='0'}}return ret},ajaxGet:function(sUrl,funcaoRetorno){sUrl=escape(sUrl);re=new RegExp("%3F","g");sUrl=sUrl.replace(re,'?');re=new RegExp("%3D","g");sUrl=sUrl.replace(re,'=');re=new RegExp("%26","g");sUrl=sUrl.replace(re,'&');re=new RegExp("%3A","g");sUrl=sUrl.replace(re,':');var falhou=function(e){},callback={success:function(o){try{funcaoRetorno.call("",YAHOO.lang.JSON.parse(o.responseText))}catch(e){falhou(e)}},failure:falhou,argument:{foo:"foo",bar:"bar"}};YAHOO.util.Connect.asyncRequest("GET",sUrl,callback)},verifica_html5_storage:function(){if(typeof(Storage)!=="undefined"){return true}else{return false}},pegaDadosLocal:function(item){if(i3GEO.util.verifica_html5_storage()&&localStorage[item]){return window.localStorage[item]}else{return false}},limpaDadosLocal:function(item){if(i3GEO.util.verifica_html5_storage()&&localStorage[item]){window.localStorage.clear(item)}},gravaDadosLocal:function(item,valor){if(i3GEO.util.verifica_html5_storage()){window.localStorage[item]=valor;return true}else{return false}},extGeo2OSM:function(ext){if(i3GEO.Interface.openlayers.googleLike===true){var metrica,point,proj900913,projWGS84,temp=ext.split(" ");if(temp[0]*1<=180&&temp[0]*1>=-180){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");point=new OpenLayers.LonLat(temp[0],temp[1]);metrica=point.transform(projWGS84,proj900913);ext=metrica.lon+" "+metrica.lat;point=new OpenLayers.LonLat(temp[2],temp[3]);metrica=point.transform(projWGS84,proj900913);ext+=" "+metrica.lon+" "+metrica.lat}}return ext},extOSM2Geo:function(ext){if(i3GEO.Interface.openlayers.googleLike===true){var metrica,point,proj900913,projWGS84,temp=ext.split(" ");if(temp[0]*1>=180||temp[0]*1<=-180){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");point=new OpenLayers.LonLat(temp[0],temp[1]);metrica=point.transform(proj900913,projWGS84);ext=metrica.lon+" "+metrica.lat;point=new OpenLayers.LonLat(temp[2],temp[3]);metrica=point.transform(proj900913,projWGS84);ext+=" "+metrica.lon+" "+metrica.lat}}return ext},navegadorDir:function(obj,listaShp,listaImg,listaFig){if(!obj){listaShp=true;listaImg=true;listaFig=true}var temp=function(){i3GEOF.navegarquivos.iniciaDicionario(obj,listaShp,listaImg,listaFig)};i3GEO.util.dialogoFerramenta("i3GEO.util.navegadorDir()","navegarquivos","navegarquivos","index.js",temp)},navegadorPostgis:function(obj,conexao,tipo){if(!obj){conexao=""}if(!tipo){tipo="sql"}var temp=function(){i3GEOF.navegapostgis.iniciaDicionario(obj,conexao,tipo)};i3GEO.util.dialogoFerramenta("i3GEO.util.navegadorPostgis()","navegapostgis","navegapostgis","index.js",temp)},base64encode:function(str){var base64EncodeChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var out,i,len;var c1,c2,c3;len=str.length;i=0;out="";while(i<len){c1=str.charCodeAt(i++)&0xff;if(i==len){out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt((c1&0x3)<<4);out+="==";break}c2=str.charCodeAt(i++);if(i==len){out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt(((c1&0x3)<<4)|((c2&0xF0)>>4));out+=base64EncodeChars.charAt((c2&0xF)<<2);out+="=";break}c3=str.charCodeAt(i++);out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt(((c1&0x3)<<4)|((c2&0xF0)>>4));out+=base64EncodeChars.charAt(((c2&0xF)<<2)|((c3&0xC0)>>6));out+=base64EncodeChars.charAt(c3&0x3F)}return out},base64decode:function(str){var base64DecodeChars=new Array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,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,-1,-1,-1,-1,-1,-1,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,-1,-1,-1,-1,-1);var c1,c2,c3,c4;var i,len,out;len=str.length;i=0;out="";while(i<len){do{c1=base64DecodeChars[str.charCodeAt(i++)&0xff]}while(i<len&&c1==-1);if(c1==-1)break;do{c2=base64DecodeChars[str.charCodeAt(i++)&0xff]}while(i<len&&c2==-1);if(c2==-1)break;out+=String.fromCharCode((c1<<2)|((c2&0x30)>>4));do{c3=str.charCodeAt(i++)&0xff;if(c3==61)return out;c3=base64DecodeChars[c3]}while(i<len&&c3==-1);if(c3==-1)break;out+=String.fromCharCode(((c2&0XF)<<4)|((c3&0x3C)>>2));do{c4=str.charCodeAt(i++)&0xff;if(c4==61)return out;c4=base64DecodeChars[c4]}while(i<len&&c4==-1);if(c4==-1)break;out+=String.fromCharCode(((c3&0x03)<<6)|c4)}return out}};try{YAHOO.namespace("lutsr");YAHOO.lutsr.accordion={properties:{animation:true,animationDuration:10,multipleOpen:false,Id:"sanfona",altura:200,ativa:0},init:function(animation,animationDuration,multipleOpen,Id,altura,ativa){if(animation){this.properties.animation=animation}if(animationDuration){this.properties.animationDuration=animationDuration}if(multipleOpen){this.properties.multipleOpen=multipleOpen}if(Id){this.properties.Id=Id}if(altura){this.properties.altura=altura}if(ativa){this.properties.ativa=ativa}var accordionObject=document.getElementById(this.properties.Id),headers;if(accordionObject){if(accordionObject.nodeName==="DL"){headers=accordionObject.getElementsByTagName("dt");this.attachEvents(headers,0)}}},attachEvents:function(headers,nr){var i,headerProperties,parentObj,header;for(i=0;i<headers.length;i++){headerProperties={objRef:headers[i],nr:i,jsObj:this};YAHOO.util.Event.addListener(headers[i],"click",this.clickHeader,headerProperties)}parentObj=headers[this.properties.ativa].parentNode;headers=parentObj.getElementsByTagName("dd");header=headers[this.properties.ativa];this.expand(header)},clickHeader:function(e,headerProperties){var parentObj=headerProperties.objRef.parentNode,headers=parentObj.getElementsByTagName("dd"),header=headers[headerProperties.nr],i;if(YAHOO.util.Dom.hasClass(header,"open")){headerProperties.jsObj.collapse(header)}else{if(headerProperties.jsObj.properties.multipleOpen){headerProperties.jsObj.expand(header)}else{for(i=0;i<headers.length;i++){if(YAHOO.util.Dom.hasClass(headers[i],"open")){headerProperties.jsObj.collapse(headers[i])}}headerProperties.jsObj.expand(header)}}},collapse:function(header){YAHOO.util.Dom.removeClass(YAHOO.util.Dom.getPreviousSibling(header),"selected");if(!this.properties.animation){YAHOO.util.Dom.removeClass(header,"open")}else{this.initAnimation(header,"close")}},expand:function(header){YAHOO.util.Dom.addClass(YAHOO.util.Dom.getPreviousSibling(header),"selected");if(!this.properties.animation){YAHOO.util.Dom.addClass(header,"open")}else{this.initAnimation(header,"open")}},initAnimation:function(header,dir){var attributes,animation,animationEnd;if(dir==="open"){YAHOO.util.Dom.setStyle(header,"visibility","hidden");YAHOO.util.Dom.setStyle(header,"height",this.properties.altura);YAHOO.util.Dom.addClass(header,"open");attributes={height:{from:0,to:this.properties.altura}};YAHOO.util.Dom.setStyle(header,"height",0);YAHOO.util.Dom.setStyle(header,"visibility","visible");animation=new YAHOO.util.Anim(header,attributes);animationEnd=function(){header.style.height=this.properties.altura+"px"};animation.duration=this.properties.animationDuration;animation.useSeconds=false;animation.onComplete.subscribe(animationEnd);animation.animate()}else if("close"){attributes={height:{to:0}};animationEnd=function(){YAHOO.util.Dom.removeClass(header,"open")};animation=new YAHOO.util.Anim(header,attributes);animation.duration=this.properties.animationDuration;animation.useSeconds=false;animation.onComplete.subscribe(animationEnd);animation.animate()}}}}catch(e){}$im=function(g){return i3GEO.util.$im(g)};$inputText=function(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch){if(arguments.length===6){nome=""}return i3GEO.util.$inputText(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch)};$top=function(id,valor){i3GEO.util.$top(id,valor)};$left=function(id,valor){i3GEO.util.$left(id,valor)}; | |
| 45 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}navm=false;navn=false;chro=navigator.userAgent.toLowerCase().indexOf('chrome')>-1;opera=navigator.userAgent.toLowerCase().indexOf('opera')>-1;if(navigator.appName.substring(0,1)==='N'){navn=true}if(navigator.appName.substring(0,1)==='M'){navm=true}if(opera===true){navn=true}g_operacao="";g_tipoacao="zoomli";$i=function(id){return document.getElementById(id)};Array.prototype.remove=function(s){try{var n=this.length,i;for(i=0;i<n;i++){if(this[i]==s){this.splice(i,1)}}}catch(e){}};i3GEO.util={PINS:[],BOXES:[],escapeURL:function(sUrl){var re;sUrl=escape(sUrl);re=new RegExp("%3F","g");sUrl=sUrl.replace(re,'?');re=new RegExp("%3D","g");sUrl=sUrl.replace(re,'=');re=new RegExp("%26","g");sUrl=sUrl.replace(re,'&');return sUrl},insereCookie:function(nome,valor,expira){if(!expira){expira=10}var exdate=new Date();exdate.setDate(exdate.getDate()+expira);document.cookie=nome+"="+valor+"; expires="+exdate.toUTCString()+";path=/"},pegaCookie:function(nome){var cookies,i,fim;cookies=document.cookie;i=cookies.indexOf(nome);if(i===-1){return null}fim=cookies.indexOf(";",i);if(fim===-1){fim=cookies.length}return(unescape(cookies.substring(i,fim))).split("=")[1]},listaChaves:function(obj){var keys,key="";keys=[];for(key in obj){if(obj[key]){keys.push(key)}}return keys},listaTodasChaves:function(obj){var keys,key="";keys=[];for(key in obj){keys.push(key)}return keys},criaBotaoAplicar:function(nomeFuncao,titulo,classe,obj){try{if(typeof(tempoBotaoAplicar)!=='undefined'){clearTimeout(tempoBotaoAplicar)}}catch(e){}var executar=new Function(nomeFuncao+"().call;clearTimeout(tempoBotaoAplicar);"),novoel,xy;tempoBotaoAplicar=setTimeout(executar,(i3GEO.configura.tempoAplicar));if(arguments.length===1){titulo="Aplicar"}if(arguments.length===1||arguments.length===2){classe="i3geoBotaoAplicar"}if(!document.getElementById("i3geo_aplicar")){novoel=document.createElement("input");novoel.id='i3geo_aplicar';novoel.type='button';novoel.value=titulo;novoel.style.cursor="pointer";novoel.style.fontSize="10px";novoel.style.zIndex=15000;novoel.style.position="absolute";novoel.style.display="none";novoel.onmouseover=function(){this.style.display="block"};novoel.onmouseout=function(){this.style.display="none"};novoel.className=classe;document.body.appendChild(novoel)}else{novoel=document.getElementById("i3geo_aplicar")}novoel.onclick=function(){clearTimeout(i3GEO.parametros.tempo);i3GEO.parametros.tempo="";this.style.display='none';eval(nomeFuncao+"\(\)")};if(arguments.length===4){novoel.style.display="block";xy=YAHOO.util.Dom.getXY(obj);YAHOO.util.Dom.setXY(novoel,xy)}return(novoel)},arvore:function(titulo,onde,obj){var arvore,root,tempNode,d,criaNo;if(!$i(onde)){return}arvore=new YAHOO.widget.TreeView(onde);root=arvore.getRoot();try{tempNode=new YAHOO.widget.TextNode('',root,false);tempNode.isLeaf=false;tempNode.enableHighlight=true}catch(e){}titulo="<table><tr><td><b>"+titulo+"</b></td><td></td></tr></table>";d={html:titulo};tempNode=new YAHOO.widget.HTMLNode(d,root,true,true);tempNode.enableHighlight=true;criaNo=function(obj,noDestino){var trad,i,j,linha,conteudo,temaNode,c=obj.propriedades.length;for(i=0,j=c;i<j;i++){linha=obj.propriedades[i];if(linha.url!==""){trad=$trad(linha.text);if(!trad){trad=linha.text}conteudo="<a href='#' onclick='"+linha.url+"'>"+trad+"</a>"}else{conteudo=linha.text}d={html:conteudo};temaNode=new YAHOO.widget.HTMLNode(d,noDestino,false,true);temaNode.enableHighlight=false;if(obj.propriedades[i].propriedades){criaNo(obj.propriedades[i],temaNode)}}};criaNo(obj,tempNode);arvore.collapseAll();arvore.draw();return arvore},removeAcentos:function(palavra){var re;re=/á|à|ã|â/gi;palavra=palavra.replace(re,"a");re=/é|ê/gi;palavra=palavra.replace(re,"e");re=/í/gi;palavra=palavra.replace(re,"i");re=/ó|õ|ô/gi;palavra=palavra.replace(re,"o");re=/ç/gi;palavra=palavra.replace(re,"c");re=/ú/gi;palavra=palavra.replace(re,"u");return(palavra)},protocolo:function(){var u=window.location.href;u=u.split(":");return(u[0])},pegaPosicaoObjeto:function(obj){if(obj){if(!obj.style){return[0,0]}var curleft=0,curtop=0;if(obj){if(obj.offsetParent){do{curleft+=obj.offsetLeft-obj.scrollLeft;curtop+=obj.offsetTop-obj.scrollTop;obj=obj.offsetParent}while(obj)}}return[curleft+document.body.scrollLeft,curtop+document.body.scrollTop]}else{return[0,0]}},pegaElementoPai:function(e){var targ=document;if(!e){e=window.event}if(e.target){targ=e.target}else{if(e.srcElement){targ=e.srcElement}}if(targ.nodeType===3){targ=targ.parentNode}if(targ.parentNode){tparent=targ.parentNode;return(tparent)}else{return targ}},mudaCursor:function(cursores,tipo,idobjeto,locaplic){var os=[],o,i,c="",n,cursor="",ext=".ff";try{if(navm){ext=".ie"}os.push(document.getElementById(idobjeto));if(i3GEO.Interface.ATUAL==="openlayers"){os=YAHOO.util.Dom.getElementsByClassName('olTileImage','img')}if(i3GEO.Interface.ATUAL==="googlemaps"){os=document.getElementById(idobjeto).firstChild;os=os.getElementsByTagName("div")}n=os.length;if(tipo==="default"||tipo==="pointer"||tipo==="crosshair"||tipo==="help"||tipo==="move"||tipo==="text"){cursor=tipo}else{c=eval("cursores."+tipo+ext)}if(c==="default"||c==="pointer"||c==="crosshair"||c==="help"||c==="move"||c==="text"){cursor=c}if(cursor===""){cursor="URL(\""+locaplic+eval("cursores."+tipo+ext)+"\"),auto"}for(i=0;i<n;i++){o=os[i];if(o){o.style.cursor=cursor}}}catch(e){}},criaBox:function(id){if(arguments.length===0){id="boxg"}if(!$i(id)){var novoel=document.createElement("div");novoel.id=id;novoel.style.zIndex=1;novoel.innerHTML='<font face="Arial" size=0></font>';document.body.appendChild(novoel);novoel.onmouseover=function(){novoel.style.display='none'};novoel.onmouseout=function(){novoel.style.display='block'};i3GEO.util.BOXES.push(id)}else{$i(id).style.display="block"}},escondeBox:function(){var l,i;l=i3GEO.util.BOXES.length;for(i=0;i<l;i++){if($i(i3GEO.util.BOXES[i])){$i(i3GEO.util.BOXES[i]).style.display="none"}}},criaPin:function(id,imagem,w,h,mouseover){if(arguments.length<1||id===""){id="boxpin"}if(arguments.length<2||imagem===""){imagem=i3GEO.configura.locaplic+'/imagens/marker.png'}if(arguments.length<3||w===""){w=21}if(arguments.length<4||h===""){h=25}if(!$i(id)){var novoel=document.createElement("img");novoel.style.zIndex=10000;novoel.style.position="absolute";novoel.style.width=parseInt(w,10)+"px";novoel.style.height=parseInt(h,10)+"px";novoel.style.top="0px";novoel.style.left="0px";novoel.src=imagem;novoel.id=id;if(id==="boxpin"){novoel.onmouseover=function(){$i("boxpin").style.display="none"}}else if(mouseover){novoel.onmouseover=mouseover}document.body.appendChild(novoel);i3GEO.util.PINS.push(id)}$i(id).style.display="block"},posicionaImagemNoMapa:function(id,x,y){var i,mx,my;if(x&&x!=""){objposicaocursor.telax=x}if(y&&y!=""){objposicaocursor.telay=y}i=$i(id);mx=parseInt(i.style.width,10)/2;my=parseInt(i.style.height,10)/2;i.style.top=objposicaocursor.telay-my+"px";i.style.left=objposicaocursor.telax-mx+"px";return[objposicaocursor.telay-my,objposicaocursor.telax-mx]},escondePin:function(){var l,i;l=i3GEO.util.PINS.length;for(i=0;i<l;i++){if($i(i3GEO.util.PINS[i])){$i(i3GEO.util.PINS[i]).style.display="none"}}},$im:function(g){return i3GEO.configura.locaplic+"/imagens/visual/default/"+g},$inputText:function(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch){if(arguments.length===6){nome=""}if(idPai!==""){if(larguraIdPai!==""){$i(idPai).style.width=larguraIdPai+"px"}$i(idPai).style.padding="3";$i(idPai).style.textAlign="center"}if(!onch){onch=""}return"<span class=digitar onmouseover='javascript:this.className=\"digitarOver\";' onmouseout='javascript:this.className=\"digitar\";' ><input onchange=\""+onch+"\" tabindex='0' onclick='javascript:this.select();' id='"+idInput+"' title='"+titulo+"' type='text' size='"+digitos+"' class='digitar' value='"+valor+"' name='"+nome+"' /></span>"},$inputTextMudaCor:function(obj){var n=obj.value.split(" ");obj.style.color="rgb("+n[0]+","+n[1]+","+n[2]+")"},$top:function(id,valor){if(document.getElementById(id).style){if(document.getElementById(id).style.pixelTop){document.getElementById(id).style.pixelTop=valor}else{document.getElementById(id).style.top=valor+"px"}}},$left:function(id,valor){if(document.getElementById(id).style){if(document.getElementById(id).style.pixelLeft){document.getElementById(id).style.pixelLeft=valor}else{document.getElementById(id).style.left=valor+"px"}}},insereMarca:{CONTAINER:[],cria:function(xi,yi,funcaoOnclick,container,texto,srci,w,h){if(!w){w=5}if(!h){h=5}if(!srci||srci===""){srci=i3GEO.configura.locaplic+"/imagens/dot2.gif"}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.insereMarca(texto,xi,yi,container);return}try{var novoel,i,novoimg,temp;if(i3GEO.util.insereMarca.CONTAINER.toString().search(container)<0){i3GEO.util.insereMarca.CONTAINER.push(container)}if(!$i(container)){novoel=document.createElement("div");novoel.id=container;i=novoel.style;i.position="absolute";if($i(i3GEO.Interface.IDCORPO)){i.top=parseInt($i(i3GEO.Interface.IDCORPO).style.top,10)+"px";i.left=parseInt($i(i3GEO.Interface.IDCORPO).style.left,10)+"px"}else{i.top=parseInt($i(i3GEO.Interface.IDMAPA).style.top,10)+"px";i.left=parseInt($i(i3GEO.Interface.IDMAPA).style.left,10)+"px"}document.body.appendChild(novoel)}container=$i(container);novoel=document.createElement("div");i=novoel.style;i.position="absolute";i.zIndex=2000;i.top=(yi-(h/2))+"px";i.left=(xi-(w/2))+"px";i.width=w+"px";i.height=h+"px";novoimg=document.createElement("img");if(funcaoOnclick!==""){novoimg.onclick=funcaoOnclick}else{novoimg.onclick=function(){i3GEO.util.insereMarca.limpa()}}novoimg.src=srci;temp=novoimg.style;temp.width=w+"px";temp.height=h+"px";temp.zIndex=2000;novoel.appendChild(novoimg);container.appendChild(novoel);if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.util.insereMarca.limpa()")<0){i3GEO.eventos.NAVEGAMAPA.push("i3GEO.util.insereMarca.limpa()")}}catch(e){i3GEO.janela.tempoMsg("Ocorreu um erro. inseremarca"+e)}},limpa:function(){try{var n,i;n=i3GEO.util.insereMarca.CONTAINER.length;for(i=0;i<n;i++){if($i(i3GEO.util.insereMarca.CONTAINER[i])){$i(i3GEO.util.insereMarca.CONTAINER[i]).innerHTML=""}}i3GEO.util.insereMarca.CONTAINER=[];i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.util.insereMarca.limpa()")}catch(e){}}},adicionaSHP:function(path){var temp=path.split(".");if((temp[1]==="SHP")||(temp[1]==="shp")){i3GEO.php.adicionaTemaSHP(i3GEO.atualiza,path)}else{i3GEO.php.adicionaTemaIMG(i3GEO.atualiza,path)}},abreCor:function(janelaid,elemento,tipo){if(!i3GEO.configura){i3GEO.configura={locaplic:"../"}}if(arguments.length===2){tipo="rgb"}var janela,ins,novoel,wdocaiframe,wsrc=i3GEO.configura.locaplic+"/ferramentas/colorpicker/index.htm?doc="+janelaid+"&elemento="+elemento+"&tipo="+tipo,texto="Cor",id="i3geo_janelaCor",classe="hd";if($i(id)){YAHOO.i3GEO.janela.manager.find(id).show();return}ins='<div id="'+id+'_cabecalho" class="hd">';ins+="<span><img id='i3geo_janelaCor_imagemCabecalho' style='visibility:hidden;' src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde.gif\' /></span>";ins+=texto;ins+='</div><div id="i3geo_janelaCor_corpo" class="bd" style="padding:5px">';if(wsrc!==""){ins+='<iframe name="'+id+'i" id="i3geo_janelaCori" valign="top" style="height:230px,border:0px white solid"></iframe>'}ins+='</div>';novoel=document.createElement("div");novoel.id="i3geo_janelaCor";novoel.style.display="block";novoel.innerHTML=ins;if($i("i3geo")){$i("i3geo").appendChild(novoel)}else{document.body.appendChild(novoel)}wdocaiframe=$i("i3geo_janelaCori");if(wdocaiframe){wdocaiframe.style.display="block";wdocaiframe.src=wsrc;wdocaiframe.style.height="230px";wdocaiframe.style.width="325px";wdocaiframe.style.border="0px solid white"}janela=new YAHOO.widget.Panel(id,{height:"290px",modal:false,width:"350px",fixedcenter:true,constraintoviewport:false,visible:true,iframe:false});YAHOO.i3GEO.janela.manager.register(janela);janela.render();$i(id+'_cabecalho').className=classe},ajaxhttp:function(){var objhttp1;try{objhttp1=new XMLHttpRequest()}catch(ee){try{objhttp1=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{objhttp1=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){objhttp1=false}}}return(objhttp1)},ajaxexecASXml:function(programa,funcao){var h,ohttp;if(programa.search("http")===0){h=window.location.host;if(programa.search(h)<0){alert("OOps! Nao e possivel chamar um XML de outro host.\nContacte o administrador do sistema.\nConfigure corretamente o ms_configura.php");return}}ohttp=i3GEO.util.ajaxhttp();ohttp.open("GET",programa,true);ohttp.onreadystatechange=function(){var retorno,parser,dom;if(ohttp.readyState===4){retorno=ohttp.responseText;if(retorno!==undefined){if(document.implementation.createDocument){parser=new DOMParser();dom=parser.parseFromString(retorno,"text/xml")}else{dom=new ActiveXObject("Microsoft.XMLDOM");dom.async="false";dom.load(programa)}}else{return"erro"}if(funcao!=="volta"){eval(funcao+'(dom)')}else{return dom}}};ohttp.send(null)},aparece:function(id,tempo,intervalo){var n,obj,opacidade,fadei=0,tempoFadei=null;n=parseInt(tempo/intervalo,10);obj=$i(id);if(n===1){obj.style.display="block";if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}}tempo=n*intervalo;intervalo=(intervalo*100)/tempo;opacidade=0;if(navm){obj.style.filter='alpha(opacity=0)'}else{obj.style.opacity=0}obj.style.display="block";fadei=function(){opacidade+=intervalo;if(navm){obj.style.filter='alpha(opacity='+opacidade+')'}else{obj.style.opacity=opacidade/100}if(opacidade<100){tempoFadei=setTimeout(fadei,tempo)}else{if(tempoFadei){clearTimeout(tempoFadei)}if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}}};tempoFadei=setTimeout(fadei,tempo)},desaparece:function(id,tempo,intervalo,removeobj){var n,obj,opacidade,fade=0,p,tempoFade=null;n=parseInt(tempo/intervalo,10);obj=$i(id);if(n===1){obj.style.display="none";if(removeobj){p=obj.parentNode;if(p){p.removeChild(obj)}}return}tempo=n*intervalo;intervalo=(intervalo*100)/tempo;opacidade=100;if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}obj.style.display="block";fade=function(){opacidade-=intervalo;if(navm){obj.style.filter='alpha(opacity='+opacidade+')'}else{obj.style.opacity=opacidade/100}if(opacidade>0){tempoFade=setTimeout(fade,tempo)}else{if(tempoFade){clearTimeout(tempoFade)}obj.style.display="none";if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}if(removeobj){p=obj.parentNode;if(p){p.removeChild(obj)}}}};tempoFade=setTimeout(fade,tempo)},wkt2ext:function(wkt,tipo){var re,x,y,w,xMin,xMax,yMin,yMax,temp;tipo=tipo.toLowerCase();ext=false;if(tipo==="polygon"){try{re=new RegExp("POLYGON","g");wkt=wkt.replace(re,"");wkt=wkt.split("(")[2].split(")")[0];wkt=wkt.split(",");x=[];y=[];for(w=0;w<wkt.length;w++){temp=wkt[w].split(" ");x.push(temp[0]);y.push(temp[1])}x.sort(i3GEO.util.sortNumber);xMin=x[0];xMax=x[(x.length)-1];y.sort(i3GEO.util.sortNumber);yMin=y[0];yMax=y[(y.length)-1];return xMin+" "+yMin+" "+xMax+" "+yMax}catch(e){}}if(tipo==="point"){try{re=new RegExp("POINT","g");wkt=wkt.replace(re,"");wkt=wkt.split("(")[1].split(")")[0];wkt=wkt.split(" ");return(wkt[0]*1-0.01)+" "+(wkt[1]*1-0.01)+" "+(wkt[0]*1+0.01)+" "+(wkt[1]*1+0.01)}catch(e){}}return ext},sortNumber:function(a,b){return a-b},getScrollerWidth:function(){var scr=null,inn=null,wNoScroll=0,wScroll=0;scr=document.createElement('div');scr.style.position='absolute';scr.style.top='-1000px';scr.style.left='-1000px';scr.style.width='100px';scr.style.height='50px';scr.style.overflow='hidden';inn=document.createElement('div');inn.style.width='100%';inn.style.height='200px';scr.appendChild(inn);document.body.appendChild(scr);wNoScroll=inn.offsetWidth;scr.style.overflow='auto';wScroll=inn.offsetWidth;document.body.removeChild(document.body.lastChild);return(wNoScroll-wScroll)},getScrollHeight:function(){var mx=Math.max,d=document;return mx(mx(d.body.scrollHeight,d.documentElement.scrollHeight),mx(d.body.offsetHeight,d.documentElement.offsetHeight),mx(d.body.clientHeight,d.documentElement.clientHeight))},scriptTag:function(js,ini,id,aguarde){if(!aguarde){aguarde=false}var head,script,tipojanela=i3GEO.janela.ESTILOAGUARDE;if(!$i(id)||id===""){if(i3GEO.janela&&aguarde===true){i3GEO.janela.ESTILOAGUARDE="reduzida";i3GEO.janela.abreAguarde(id+"aguarde","Carregando JS")}head=document.getElementsByTagName('head')[0];script=document.createElement('script');script.type='text/javascript';if(ini!==""){if(navm){script.onreadystatechange=function(){if(this.readyState==='loaded'||this.readyState==='complete'){if(i3GEO.janela){i3GEO.janela.fechaAguarde(id+"aguarde")}if(YAHOO.lang.isFunction(ini)){ini.call()}else{eval(ini)}}}}else{script.onload=function(){if(i3GEO.janela){i3GEO.janela.fechaAguarde(id+"aguarde")}if(YAHOO.lang.isFunction(ini)){ini.call()}else{eval(ini)}}}i3GEO.janela.ESTILOAGUARDE=tipojanela}script.src=js;if(id!==""){script.id=id}head.appendChild(script)}else{if(ini!==""){if(YAHOO.lang.isFunction(ini)){ini.call()}else{eval(ini)}}}},removeScriptTag:function(id){try{old=$i("loadscriptI3GEO");if(old!==null){old.parentNode.removeChild(old);old=null;eval(id+" = null;")}old=$i(id);if(old!==null){old.parentNode.removeChild(old)}}catch(erro){}},verificaScriptTag:function(texto){var s=document.getElementsByTagName("script"),n=s.length,i,t;try{for(i=0;i<n;i++){t=s[i].id;t=t.split(".");if(t[2]&&t[2]=="dicionario_script"){return false}if(t[0]===texto){return true}}return false}catch(e){return false}},mensagemAjuda:function(onde,texto){var ins="<table style='width:100%;padding:2;vertical-align:top;background-color:#ffffff;' ><tr><th style='background-color: #cedff2; font-family:Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; border: 1px solid #B1CDEB; text-align: left; padding-left: 7px;padding-right: 11px;'>";ins+='<div style="float:right"><img src="'+i3GEO.configura.locaplic+'/imagens/question.gif" /></div>';ins+='<div style="text-align:left;">';if(texto===""){texto=$i(onde).innerHTML}ins+=texto;ins+='</div></th></tr></table>';if(onde!==""){$i(onde).innerHTML=ins}else{return(ins)}},randomRGB:function(){var v=Math.random(),r=parseInt(255*v,10),g;v=Math.random();g=parseInt(255*v,10);v=Math.random();b=parseInt(255*v,10);return(r+","+g+","+b)},rgb2hex:function(str){var re=new RegExp(" ","g"),rgb=str.replace(re,',');return YAHOO.util.Dom.Color.toHex("rgb("+rgb+")")},comboTemas:function(id,funcao,onde,nome,multiplo,tipoCombo,estilo,yui){if(onde&&onde!==""){i3GEO.util.defineValor(onde,"innerHTML","<span style=color:red;font-size:10px; >buscando temas...</span>")}if(!nome){nome=""}if(!multiplo){multiplo=false}if(!estilo||estilo==""){estilo="font-size: 12px;width: 95%;"}if(!yui){yui=false}var monta,temp,temp1,temp2;monta=function(retorno){var i,comboTemas='',n,nome="";if(yui===true){comboTemas='<input type="button" name='+id+'_button id="'+id+'" value="'+$trad("x33")+' ">';id=id+"select";nome=id}if(retorno!==undefined){if(retorno.data){retorno=retorno.data}n=retorno.length;if(n>0){if(multiplo){comboTemas+="<select style='"+estilo+"' id='"+id+"' size='4' multiple='multiple' name='"+nome+"'>"}else{comboTemas+="<select style='"+estilo+"' id='"+id+"' name='"+nome+"'>"}if(yui===false){comboTemas+="<option value=''>----</option>"}for(i=0;i<n;i++){if(retorno[i].nome){nome=retorno[i].nome;tema=retorno[i].tema}else{nome=retorno[i].tema;tema=retorno[i].name}if(retorno[i].escondido!=="sim"){comboTemas+="<option value="+tema+" >"+nome+"</option>"}}comboTemas+="</select>";temp={dados:comboTemas,tipo:"dados"}}else{if(tipoCombo==="poligonosSelecionados"||tipoCombo==="selecionados"||tipoCombo==="pontosSelecionados"){temp={dados:'<div class=alerta >Nenhum tema encontrado. <span style=cursor:pointer;color:blue onclick="i3GEO.mapa.dialogo.selecao()" > Selecionar...</span></div>',tipo:"mensagem"}}else{temp={dados:'<div class=alerta >Nenhum tema encontrado. </div>',tipo:"mensagem"}}}}else{temp={dados:"<p style=color:red >Ocorreu um erro<br>",tipo:"erro"}}eval("funcao(temp);")};if(tipoCombo==="ligados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemas(monta,"ligados",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="ligadosComTabela"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS);temp1=i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"menor",temp);temp2=i3GEO.arvoreDeCamadas.filtraCamadas("type",8,"igual",temp);monta(temp1.concat(temp2))}else{i3GEO.php.listaTemas(monta,"ligados",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="locais"){i3GEO.php.listaTemasEditaveis(monta,i3GEO.configura.locaplic,i3GEO.configura.sid)}if(tipoCombo==="editavel"){temp=i3GEO.arvoreDeCamadas.filtraCamadas("editavel","SIM","igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(temp)}if(tipoCombo==="selecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemasComSel(monta,i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="raster"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listatemasTipo(monta,"raster",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="pontosSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="pontos"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="poligonos"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="poligonosSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="naolinearSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",1,"diferente",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="linhaDoTempo"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("linhadotempo","sim","igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo===""){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type","","diferente",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}},checkCombo:function(id,nomes,valores,estilo,funcaoclick,ids,idschecked){var temp,i,combo="",n=valores.length;if(n>0){combo="<div style='"+estilo+"'><table class=lista3 id="+id+" >";for(i=0;i<n;i++){temp="";if(idschecked&&idschecked[i]){temp="checked"}if(!ids){combo+="<tr><td><input "+temp+" onclick="+funcaoclick+" size=2 style='top:1px;cursor:pointer' type=checkbox value='"+valores[i]+"' /></td><td>"+nomes[i]+"</td>"}else{combo+="<tr><td><input "+temp+" id="+ids[i]+" onclick="+funcaoclick+" size=2 style='top:1px;cursor:pointer' type=checkbox value='"+valores[i]+"' /></td><td>"+nomes[i]+"</td>"}}combo+="</table></div>"}return combo},valoresCheckCombo:function(id){var el=$i(id),res=[],n,i;if(el){el=el.getElementsByTagName("input");n=el.length;for(i=0;i<n;i++){if(el[i].checked===true){res.push(el[i].value)}}}return res},checkTemas:function(id,funcao,onde,nome,tipoLista,prefixo,size){if(arguments.length>2){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando temas...</span>"}if(arguments.length===3){nome=""}var monta,temp,temp1,n,i;monta=function(retorno){try{var i,comboTemas,n,nome;if(retorno!==undefined){if(retorno.data){retorno=retorno.data}n=retorno.length;if(n>0){comboTemas="<table class=lista3 >";for(i=0;i<n;i++){if(retorno[i].nome){nome=retorno[i].nome;tema=retorno[i].tema}else{nome=retorno[i].tema;tema=retorno[i].name}comboTemas+="<tr><td><input size=2 style='cursor:pointer' type=checkbox name='"+tema+"' /></td>";comboTemas+="<td> <input style='text-align:left;width:"+size+" cursor:text;' onclick='javascript:this.select();' id='"+prefixo+tema+"' type=text value='"+nome+"' /></td></tr>"}comboTemas+="</table>";temp={dados:comboTemas,tipo:"dados"}}else{temp={dados:'<div class=alerta >Nenhum tema encontrado.</div>',tipo:"mensagem"}}}else{temp={dados:"<p style=color:red >Ocorreu um erro<br>",tipo:"erro"}}eval("funcao(temp);")}catch(e){}};if(tipoLista==="ligados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemas(monta,"ligados",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoLista==="selecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemasComSel(monta,i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoLista==="raster"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listatemasTipo(monta,"raster",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoLista==="polraster"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"igual",i3GEO.arvoreDeCamadas.CAMADAS);temp1=i3GEO.arvoreDeCamadas.filtraCamadas("type",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS);n=temp1.length;for(i=0;i<n;i++){temp.push(temp1[i])}monta(temp)}else{alert($trad("x13"))}}if(tipoLista==="pontosSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{alert($trad("x13"))}}if(tipoLista==="pontos"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{alert($trad("x13"))}}},comboItens:function(id,tema,funcao,onde,nome,alias){if(!alias){alias="sim"}if(arguments.length>3){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando itens...</span>"}if(arguments.length!==5){nome=""}var monta=function(retorno){var ins,temp,i,nm;if(retorno.data!==undefined){ins=[];ins.push("<select id='"+id+"' name='"+nome+"'>");ins.push("<option value='' >---</option>");temp=retorno.data.valores.length;for(i=0;i<temp;i++){if(retorno.data.valores[i].tema===tema){if(alias=="sim"){nm=retorno.data.valores[i].alias;if(nm===""){nm=retorno.data.valores[i].item}}else{nm=retorno.data.valores[i].item}ins.push("<option value='"+retorno.data.valores[i].item+"' >"+nm+"</option>")}}ins.push("</select>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"}}eval("funcao(temp)")};i3GEO.php.listaItensTema(monta,tema)},comboValoresItem:function(id,tema,itemTema,funcao,onde){if(arguments.length===5){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando valores...</span>"}var monta=function(retorno){var ins=[],i,pares,j;if(retorno.data!==undefined){ins.push("<select id="+id+" >");ins.push("<option value='' >---</option>");for(i=0;i<retorno.data[1].registros.length;i++){pares=retorno.data[1].registros[i].valores;for(j=0;j<pares.length;j++){ins.push("<option value='"+pares[j].valor+"' >"+pares[j].valor+"</option>")}}ins.push("</select>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >Ocorreu um erro</erro>',tipo:"erro"}}eval("funcao(temp)")};i3GEO.php.listaValoresItensTema(monta,tema,itemTema)},comboFontes:function(id,onde){$i(onde).innerHTML="<span style=color:red >buscando fontes...</span>";var monta=function(retorno){var ins="",temp,i,dados;if(retorno.data!==undefined){ins+="<select id='"+id+"'>";ins+="<option value='bitmap' >bitmap</option>";dados=retorno.data.split(",");temp=dados.length;for(i=0;i<temp;i++){ins+="<option value='"+dados[i]+"' >"+dados[i]+"</option>"}ins+="</select>"}$i(onde).innerHTML=ins};i3GEO.php.listaFontesTexto(monta)},comboSimNao:function(id,selecionado){var combo="<select name="+id+" id="+id+" >";combo+="<option value='' >---</option>";if(selecionado.toLowerCase()==="sim"){combo+="<option value=TRUE selected >"+$trad("x14")+"</option>"}else{combo+="<option value=TRUE >"+$trad("x14")+"</option>"}if(selecionado==="nao"){combo+="<option value=FALSE selected >"+$trad("x15")+"</option>"}else{combo+="<option value=FALSE >"+$trad("x15")+"</option>"}combo+="</select>";return(combo)},checkItensEditaveis:function(tema,funcao,onde,size,prefixo,ordenacao){if(!ordenacao||ordenacao==""){ordenacao=="nao"}if(onde!==""){$i(onde).innerHTML="<span style=color:red;font-size:10px; >"+$trad("x65")+"</span>"}var monta=function(retorno){var ins=[],i,temp,n;if(retorno.data!==undefined){if(ordenacao==="sim"){ins.push("<table class=lista3 ><tr><td></td><td>"+$trad("x64")+"</td><td>Ordem</td>")}else{ins.push("<table class=lista3 ><tr><td></td><td>"+$trad("x64")+"</td><td></td>")}n=retorno.data.valores.length;for(i=0;i<n;i++){ins.push("<tr><td><input size=2 style='cursor:pointer' name='"+retorno.data.valores[i].tema+"' type=checkbox id='"+prefixo+retorno.data.valores[i].item+"' /></td>");ins.push("<td><input style='text-align:left;cursor:text;width:"+size+"' onclick='javascript:this.select();' id='"+prefixo+retorno.data.valores[i].item+retorno.data.valores[i].tema+"' type=text value='"+retorno.data.valores[i].item+"' /></td>");if(ordenacao==="sim"){ins.push("<td><input style='text-align:left; cursor:text;' id='ordem_"+prefixo+retorno.data.valores[i].item+retorno.data.valores[i].tema+"' type=text size='3' value='"+i+"' /></td>")}else{ins.push("<td></td>")}ins.push("</tr>")}ins.push("</table>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >'+$trad("x66")+'</div>',tipo:"erro"}}funcao.call(this,temp)};i3GEO.php.listaItensTema(monta,tema)},radioEpsg:function(funcao,onde,prefixo){if(arguments.length===2){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando...</span>"}var monta=function(retorno){var c="checked",ins=[],i,n,temp;if(retorno.data!==undefined){ins.push("<table class=lista2 >");n=retorno.data.length;for(i=0;i<n;i++){ins.push("<tr><td><input size=2 style='border:0px solid white;cursor:pointer' "+c+" name='"+prefixo+"EPSG' type=radio value='"+retorno.data[i].codigo+"' /></td>");c="";ins.push("<td>"+retorno.data[i].nome+"</td></tr>")}ins.push("</table>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"}}funcao(temp)};i3GEO.php.listaEpsg(monta)},comboEpsg:function(idCombo,onde,funcaoOnChange,valorDefault){onde=$i(onde);onde.innerHTML="<span style=color:red;font-size:10px; >buscando...</span>";var monta=function(retorno){var ins=[],i,n;if(retorno.data!==undefined){n=retorno.data.length;ins.push("<select id='"+idCombo+"' onChange='"+funcaoOnChange+"(this)' >");for(i=0;i<n;i++){ins.push("<option value='"+retorno.data[i].codigo+"'>"+retorno.data[i].nome+"</option>")}ins.push("</select>");ins=ins.join('');onde.innerHTML=ins;$i(idCombo).value=valorDefault}else{onde.innerHTML='<div class=erro >Ocorreu um erro</div>'}};i3GEO.php.listaEpsg(monta)},proximoAnterior:function(anterior,proxima,texto,idatual,container,mantem,onde){var temp=$i(idatual),botoes="",ndiv=document.createElement("div"),nids,i,fundo;if(!mantem){mantem=false}if(temp&&mantem==false){$i(container).removeChild(temp)}fundo="#F2F2F2";$i(container).style.backgroundColor="white";botoes="<table style='width:100%;background-color:"+fundo+";' ><tr style='width:100%'>";if(anterior!==""){botoes+="<td style='border:0px solid white;text-align:left;cursor:pointer;background-color:"+fundo+";'><input id='"+idatual+"anterior_' onclick='"+anterior+"' type='button' value=' ' /></td>"}if(proxima!==""){botoes+="<td style='border:0px solid white;text-align:right;cursor:pointer;background-color:"+fundo+";'><input id='"+idatual+"proxima_' onclick='"+proxima+"' type='button' value=' ' /></td>"}botoes+="</tr></table>";var ativaBotoes=function(anterior,proxima,idatual){var i;new YAHOO.widget.Button(idatual+"anterior_",{onclick:{fn:function(){eval(anterior+"()")},lazyloadmenu:true}});new YAHOO.widget.Button(idatual+"proxima_",{onclick:{fn:function(){eval(proxima+"()")},lazyloadmenu:true}});i=$i(idatual+"proxima_-button");if(i){i.style.backgroundImage="url('"+i3GEO.configura.locaplic+"/imagens/player_avanca.png')";i.style.backgroundRepeat="no-repeat";i.style.backgroundPosition="center center"}i=$i(idatual+"anterior_-button");if(i){i.style.backgroundImage="url('"+i3GEO.configura.locaplic+"/imagens/player_volta.png')";i.style.backgroundRepeat="no-repeat";i.style.backgroundPosition="center center"}};if(onde){$i(onde).innerHTML=botoes}else{texto=texto+"<br><br>"+botoes}if(!document.getElementById(idatual)){ndiv.id=idatual;ndiv.innerHTML=texto;$i(container).appendChild(ndiv)}ativaBotoes(anterior,proxima,idatual);temp=$i(container).getElementsByTagName("div");nids=temp.length;for(i=0;i<nids;i++){temp[i].style.display="none"}$i(idatual).style.display="block"},dialogoFerramenta:function(mensagem,dir,nome,nomejs,nomefuncao){if(!nomejs){nomejs="index.js"}if(!nomefuncao){nomefuncao="i3GEOF."+nome+".criaJanelaFlutuante();"}var js=i3GEO.configura.locaplic+"/ferramentas/"+dir+"/"+nomejs;if(!$i("i3GEOF."+nome+"_script")){i3GEO.janela.ESTILOAGUARDE="reduzida";i3GEO.janela.abreAguarde("i3GEOF."+nome+"_script"+"aguarde","Carregando JS");i3GEO.util.scriptTag(js,nomefuncao,"i3GEOF."+nome+"_script")}else{i3GEO.util.scriptTag(js,nomefuncao,"i3GEOF."+nome+"_script")}},intersectaBox:function(box1,box2){box1=box1.split(" ");box2=box2.split(" ");var box1i=box2,box2i=box1,coordx,coordy;coordx=box1[0]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true;coordx=box1[0]*1;coordy=box1[3]*1}if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[3]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}box1=box1i;box2=box2i;coordx=box1[0]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true;coordx=box1[0]*1;coordy=box1[3]*1}if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[3]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}return false},abreColourRamp:function(janelaid,elemento,ncores){var janela,ins,novoel,wdocaiframe,temp,fix=false,wsrc=i3GEO.configura.locaplic+"/ferramentas/colourramp/index.php?ncores="+ncores+"&doc="+janelaid+"&elemento="+elemento+"&locaplic="+i3GEO.configura.locaplic,nx="",texto="",id="i3geo_janelaCorRamp",classe="hd";if($i(id)){janela=YAHOO.i3GEO.janela.manager.find(id);janela.show();janela.bringToTop();return}ins='<div id="'+id+'_cabecalho" class="hd">';ins+="<span><img id='i3geo_janelaCorRamp_imagemCabecalho' style='visibility:hidden;' src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde.gif\' /></span>";if(i3GEO&&i3GEO.arvoreDeCamadas){ins+="<div id='i3geo_janelaCorRampComboCabeca' class='comboTemasCabecalho' style='top:0px;'> ------</div>"}ins+=" "+texto;ins+='</div><div id="i3geo_janelaCorRamp_corpo" class="bd" style="padding:5px">';ins+='<iframe name="'+id+'i" id="i3geo_janelaCorRampi" valign="top" ></iframe>';ins+='</div>';novoel=document.createElement("div");novoel.id="i3geo_janelaCorRamp";novoel.style.display="block";novoel.innerHTML=ins;if($i("i3geo")){$i("i3geo").appendChild(novoel)}else{document.body.appendChild(novoel)}wdocaiframe=$i("i3geo_janelaCorRampi");wdocaiframe.style.display="block";wdocaiframe.src=wsrc;wdocaiframe.style.height="380px";wdocaiframe.style.width="100%";wdocaiframe.style.border="0px solid white";if(nx===""||nx==="center"){fix=true}janela=new YAHOO.widget.Panel(id,{height:"430px",modal:false,width:"280px",fixedcenter:fix,constraintoviewport:true,visible:true,iframe:false});YAHOO.i3GEO.janela.manager.register(janela);janela.render();$i(id+'_cabecalho').className=classe;if($i("i3geo_janelaCorRampComboCabeca")){temp=function(){var p,tema=$i("i3geo_janelaCorRampComboCabecaSel").value,funcao=function(retorno){parent.frames["i3geo_janelaCorRampi"].document.getElementById("ncores").value=retorno.data.length};if(tema!==""){i3GEO.mapa.ativaTema(tema);p=i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=editalegenda&opcao=edita&tema="+tema;i3GEO.util.ajaxGet(p,funcao);cp=new cpaint()}};i3GEO.janela.comboCabecalhoTemas("i3geo_janelaCorRampComboCabeca","i3geo_janelaCorRampComboCabecaSel","none","ligados",temp)}},localizai3GEO:function(){var scriptLocation="",scripts=document.getElementsByTagName('script'),i=0,index,ns=scripts.length,src;for(i=0;i<ns;i++){src=scripts[i].getAttribute('src');if(src){index=src.lastIndexOf("/classesjs/i3geo.js");if((index>-1)&&(index+"/classesjs/i3geo.js".length===src.length)){scriptLocation=src.slice(0,-"/classesjs/i3geo.js".length);break}index=src.lastIndexOf("/classesjs/i3geonaocompacto.js");if((index>-1)&&(index+"/classesjs/i3geonaocompacto.js".length===src.length)){scriptLocation=src.slice(0,-"/classesjs/i3geonaocompacto.js".length);break}}}if(i3GEO.configura){i3GEO.configura.locaplic=scriptLocation}return scriptLocation},removeChild:function(id,el){var j=$i(id);if(j){if(!el){el=j.parentNode}el.removeChild(j)}},defineValor:function(id,prop,valor){try{eval("$i('"+id+"')."+prop+"='"+valor+"';")}catch(e){}},in_array:function(x,matriz){var txt=" "+matriz.join(" ")+" ";var er=new RegExp(" "+x+" ","gim");return((txt.match(er))?true:false)},timedProcessArray:function(items,process,callback){var todo=items.concat();setTimeout(function(){var start=+new Date();do{process(todo.shift())}while(todo.length>0&&(+new date()-start<50));if(todo.length>0){setTimeout(arguments.callee,25)}else{callback(items)}},25)},multiStep:function(steps,args,callback){var tasks=steps.concat();setTimeout(function(){var task=tasks.shift(),a=args.shift();task.apply(null,a||[]);if(tasks.length>0){setTimeout(arguments.callee,25)}else{callback()}},25)},tamanhoBrowser:function(){var viewportwidth,viewportheight;if(typeof window.innerWidth!='undefined'){viewportwidth=window.innerWidth,viewportheight=window.innerHeight}else if(typeof document.documentElement!='undefined'&&typeof document.documentElement.clientWidth!='undefined'&&document.documentElement.clientWidth!=0){viewportwidth=document.documentElement.clientWidth,viewportheight=document.documentElement.clientHeight}else{viewportwidth=document.getElementsByTagName('body')[0].clientWidth,viewportheight=document.getElementsByTagName('body')[0].clientHeight}viewportwidth=viewportwidth-i3GEO.util.getScrollerWidth();return[viewportwidth,viewportheight]},detectaTablet:function(){var p,c=DetectaMobile("DetectTierTablet");if(c===false){return false}p=confirm($trad("x73"));if(p){window.location=i3GEO.configura.locaplic+'/interface/'+i3GEO.Interface.ALTTABLET+'?'+i3GEO.configura.sid;return true}},detectaMobile:function(){var p,c=DetectaMobile("DetectMobileLong");if(c===false){return false}p=confirm($trad("x73"));if(p){window.location=i3GEO.configura.locaplic+'/interface/'+i3GEO.Interface.ALTTABLET+'?'+i3GEO.configura.sid;return true}},calculaDPI:function(){var novoel=document.createElement("div"),valor=72;novoel.style.height="1in";novoel.style.left="-100%";novoel.style.position="absolute";novoel.style.top="-100%";novoel.style.width="1in";document.body.appendChild(novoel);if(novoel.offsetHeight){valor=novoel.offsetHeight}document.body.removeChild(novoel);return valor},ajustaDocType:function(){try{if(document.implementation.createDocumentType){var newDoctype=document.implementation.createDocumentType('html','-//W3C//DTD XHTML 1.0 Transitional//EN','http://www.w3.org/TR/html4/loose.dtd');if(document.doctype){document.doctype.parentNode.replaceChild(newDoctype,document.doctype)}}}catch(e){}},versaoNavegador:function(){if(navm&&navigator.userAgent.toLowerCase().indexOf('msie 8.')>-1){return"IE8"}if(navn&&navigator.userAgent.toLowerCase().indexOf('3.')>-1){return"FF3"}return""},decimalPlaces:function(float,length){var ret="",str=float.toString(),array=str.split("."),i;if(array.length==2){ret+=array[0]+".";for(i=0;i<length;i++){if(i>=array[1].length)ret+='0';else ret+=array[1][i]}}else if(array.length==1){ret+=array[0]+".";for(i=0;i<length;i++){ret+='0'}}return ret},ajaxGet:function(sUrl,funcaoRetorno){sUrl=escape(sUrl);re=new RegExp("%3F","g");sUrl=sUrl.replace(re,'?');re=new RegExp("%3D","g");sUrl=sUrl.replace(re,'=');re=new RegExp("%26","g");sUrl=sUrl.replace(re,'&');re=new RegExp("%3A","g");sUrl=sUrl.replace(re,':');var falhou=function(e){},callback={success:function(o){try{funcaoRetorno.call("",YAHOO.lang.JSON.parse(o.responseText))}catch(e){falhou(e)}},failure:falhou,argument:{foo:"foo",bar:"bar"}};YAHOO.util.Connect.asyncRequest("GET",sUrl,callback)},verifica_html5_storage:function(){if(typeof(Storage)!=="undefined"){return true}else{return false}},pegaDadosLocal:function(item){if(i3GEO.util.verifica_html5_storage()&&localStorage[item]){return window.localStorage[item]}else{return false}},limpaDadosLocal:function(item){if(i3GEO.util.verifica_html5_storage()&&localStorage[item]){window.localStorage.clear(item)}},gravaDadosLocal:function(item,valor){if(i3GEO.util.verifica_html5_storage()){window.localStorage[item]=valor;return true}else{return false}},extGeo2OSM:function(ext){if(i3GEO.Interface.openlayers.googleLike===true){var metrica,point,proj900913,projWGS84,temp=ext.split(" ");if(temp[0]*1<=180&&temp[0]*1>=-180){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");point=new OpenLayers.LonLat(temp[0],temp[1]);metrica=point.transform(projWGS84,proj900913);ext=metrica.lon+" "+metrica.lat;point=new OpenLayers.LonLat(temp[2],temp[3]);metrica=point.transform(projWGS84,proj900913);ext+=" "+metrica.lon+" "+metrica.lat}}return ext},extOSM2Geo:function(ext){if(i3GEO.Interface.openlayers.googleLike===true){var metrica,point,proj900913,projWGS84,temp=ext.split(" ");if(temp[0]*1>=180||temp[0]*1<=-180){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");point=new OpenLayers.LonLat(temp[0],temp[1]);metrica=point.transform(proj900913,projWGS84);ext=metrica.lon+" "+metrica.lat;point=new OpenLayers.LonLat(temp[2],temp[3]);metrica=point.transform(proj900913,projWGS84);ext+=" "+metrica.lon+" "+metrica.lat}}return ext},projOSM2Geo:function(obj){if(i3GEO.Interface.openlayers.googleLike===true){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");obj=obj.transform(proj900913,projWGS84)}return obj},navegadorDir:function(obj,listaShp,listaImg,listaFig){if(!obj){listaShp=true;listaImg=true;listaFig=true}var temp=function(){i3GEOF.navegarquivos.iniciaDicionario(obj,listaShp,listaImg,listaFig)};i3GEO.util.dialogoFerramenta("i3GEO.util.navegadorDir()","navegarquivos","navegarquivos","index.js",temp)},navegadorPostgis:function(obj,conexao,tipo){if(!obj){conexao=""}if(!tipo){tipo="sql"}var temp=function(){i3GEOF.navegapostgis.iniciaDicionario(obj,conexao,tipo)};i3GEO.util.dialogoFerramenta("i3GEO.util.navegadorPostgis()","navegapostgis","navegapostgis","index.js",temp)},base64encode:function(str){var base64EncodeChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var out,i,len;var c1,c2,c3;len=str.length;i=0;out="";while(i<len){c1=str.charCodeAt(i++)&0xff;if(i==len){out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt((c1&0x3)<<4);out+="==";break}c2=str.charCodeAt(i++);if(i==len){out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt(((c1&0x3)<<4)|((c2&0xF0)>>4));out+=base64EncodeChars.charAt((c2&0xF)<<2);out+="=";break}c3=str.charCodeAt(i++);out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt(((c1&0x3)<<4)|((c2&0xF0)>>4));out+=base64EncodeChars.charAt(((c2&0xF)<<2)|((c3&0xC0)>>6));out+=base64EncodeChars.charAt(c3&0x3F)}return out},base64decode:function(str){var base64DecodeChars=new Array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,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,-1,-1,-1,-1,-1,-1,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,-1,-1,-1,-1,-1);var c1,c2,c3,c4;var i,len,out;len=str.length;i=0;out="";while(i<len){do{c1=base64DecodeChars[str.charCodeAt(i++)&0xff]}while(i<len&&c1==-1);if(c1==-1)break;do{c2=base64DecodeChars[str.charCodeAt(i++)&0xff]}while(i<len&&c2==-1);if(c2==-1)break;out+=String.fromCharCode((c1<<2)|((c2&0x30)>>4));do{c3=str.charCodeAt(i++)&0xff;if(c3==61)return out;c3=base64DecodeChars[c3]}while(i<len&&c3==-1);if(c3==-1)break;out+=String.fromCharCode(((c2&0XF)<<4)|((c3&0x3C)>>2));do{c4=str.charCodeAt(i++)&0xff;if(c4==61)return out;c4=base64DecodeChars[c4]}while(i<len&&c4==-1);if(c4==-1)break;out+=String.fromCharCode(((c3&0x03)<<6)|c4)}return out}};try{YAHOO.namespace("lutsr");YAHOO.lutsr.accordion={properties:{animation:true,animationDuration:10,multipleOpen:false,Id:"sanfona",altura:200,ativa:0},init:function(animation,animationDuration,multipleOpen,Id,altura,ativa){if(animation){this.properties.animation=animation}if(animationDuration){this.properties.animationDuration=animationDuration}if(multipleOpen){this.properties.multipleOpen=multipleOpen}if(Id){this.properties.Id=Id}if(altura){this.properties.altura=altura}if(ativa){this.properties.ativa=ativa}var accordionObject=document.getElementById(this.properties.Id),headers;if(accordionObject){if(accordionObject.nodeName==="DL"){headers=accordionObject.getElementsByTagName("dt");this.attachEvents(headers,0)}}},attachEvents:function(headers,nr){var i,headerProperties,parentObj,header;for(i=0;i<headers.length;i++){headerProperties={objRef:headers[i],nr:i,jsObj:this};YAHOO.util.Event.addListener(headers[i],"click",this.clickHeader,headerProperties)}parentObj=headers[this.properties.ativa].parentNode;headers=parentObj.getElementsByTagName("dd");header=headers[this.properties.ativa];this.expand(header)},clickHeader:function(e,headerProperties){var parentObj=headerProperties.objRef.parentNode,headers=parentObj.getElementsByTagName("dd"),header=headers[headerProperties.nr],i;if(YAHOO.util.Dom.hasClass(header,"open")){headerProperties.jsObj.collapse(header)}else{if(headerProperties.jsObj.properties.multipleOpen){headerProperties.jsObj.expand(header)}else{for(i=0;i<headers.length;i++){if(YAHOO.util.Dom.hasClass(headers[i],"open")){headerProperties.jsObj.collapse(headers[i])}}headerProperties.jsObj.expand(header)}}},collapse:function(header){YAHOO.util.Dom.removeClass(YAHOO.util.Dom.getPreviousSibling(header),"selected");if(!this.properties.animation){YAHOO.util.Dom.removeClass(header,"open")}else{this.initAnimation(header,"close")}},expand:function(header){YAHOO.util.Dom.addClass(YAHOO.util.Dom.getPreviousSibling(header),"selected");if(!this.properties.animation){YAHOO.util.Dom.addClass(header,"open")}else{this.initAnimation(header,"open")}},initAnimation:function(header,dir){var attributes,animation,animationEnd;if(dir==="open"){YAHOO.util.Dom.setStyle(header,"visibility","hidden");YAHOO.util.Dom.setStyle(header,"height",this.properties.altura);YAHOO.util.Dom.addClass(header,"open");attributes={height:{from:0,to:this.properties.altura}};YAHOO.util.Dom.setStyle(header,"height",0);YAHOO.util.Dom.setStyle(header,"visibility","visible");animation=new YAHOO.util.Anim(header,attributes);animationEnd=function(){header.style.height=this.properties.altura+"px"};animation.duration=this.properties.animationDuration;animation.useSeconds=false;animation.onComplete.subscribe(animationEnd);animation.animate()}else if("close"){attributes={height:{to:0}};animationEnd=function(){YAHOO.util.Dom.removeClass(header,"open")};animation=new YAHOO.util.Anim(header,attributes);animation.duration=this.properties.animationDuration;animation.useSeconds=false;animation.onComplete.subscribe(animationEnd);animation.animate()}}}}catch(e){}$im=function(g){return i3GEO.util.$im(g)};$inputText=function(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch){if(arguments.length===6){nome=""}return i3GEO.util.$inputText(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch)};$top=function(id,valor){i3GEO.util.$top(id,valor)};$left=function(id,valor){i3GEO.util.$left(id,valor)}; | |
| 46 | 46 | /* |
| 47 | 47 | OpenLayers.js -- OpenLayers Map Viewer Library |
| 48 | 48 | Copyright (c) 2006-2013 by OpenLayers Contributors | ... | ... |
mashups/openlayers_compacto.js.php
| ... | ... | @@ -42,7 +42,7 @@ setTimeout(function(){a.removeClass(v,"yui-force-redraw");},0);},toString:functi |
| 42 | 42 | j=this.footer;if(p&&j){j.removeChild(p);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}this.changeContentEvent.fire();},getButtons:function(){return this._aButtons||null;},focusFirst:function(k,i,n){var j=this.firstFormElement,m=false;if(i&&i[1]){b.stopEvent(i[1]);if(i[0]===9&&this.firstElement){j=this.firstElement;}}if(j){try{j.focus();m=true;}catch(l){}}else{if(this.defaultHtmlButton){m=this.focusDefaultButton();}else{m=this.focusFirstButton();}}return m;},focusLast:function(k,i,n){var o=this.cfg.getProperty("buttons"),j=this.lastFormElement,m=false;if(i&&i[1]){b.stopEvent(i[1]);if(i[0]===9&&this.lastElement){j=this.lastElement;}}if(o&&f.isArray(o)){m=this.focusLastButton();}else{if(j){try{j.focus();m=true;}catch(l){}}}return m;},_getButton:function(j){var i=YAHOO.widget.Button;if(i&&j&&j.nodeName&&j.id){j=i.getButton(j.id)||j;}return j;},focusDefaultButton:function(){var i=this._getButton(this.defaultHtmlButton),k=false;if(i){try{i.focus();k=true;}catch(j){}}return k;},blurButtons:function(){var o=this.cfg.getProperty("buttons"),l,n,k,j;if(o&&f.isArray(o)){l=o.length;if(l>0){j=(l-1);do{n=o[j];if(n){k=this._getButton(n.htmlButton);if(k){try{k.blur();}catch(m){}}}}while(j--);}}},focusFirstButton:function(){var m=this.cfg.getProperty("buttons"),k,i,l=false;if(m&&f.isArray(m)){k=m[0];if(k){i=this._getButton(k.htmlButton);if(i){try{i.focus();l=true;}catch(j){}}}}return l;},focusLastButton:function(){var n=this.cfg.getProperty("buttons"),j,l,i,m=false;if(n&&f.isArray(n)){j=n.length;if(j>0){l=n[(j-1)];if(l){i=this._getButton(l.htmlButton);if(i){try{i.focus();m=true;}catch(k){}}}}}return m;},configPostMethod:function(j,i,k){this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){if(this.beforeSubmitEvent.fire()){this.doSubmit();this.submitEvent.fire();if(this.cfg.getProperty("hideaftersubmit")){this.hide();}return true;}else{return false;}}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var A=this.form,k,t,w,m,u,r,q,j,x,l,y,B,p,C,o,z,v;function s(n){var i=n.tagName.toUpperCase();return((i=="INPUT"||i=="TEXTAREA"||i=="SELECT")&&n.name==m);}if(A){k=A.elements;t=k.length;w={};for(z=0;z<t;z++){m=k[z].name;u=e.getElementsBy(s,"*",A);r=u.length;if(r>0){if(r==1){u=u[0];q=u.type;j=u.tagName.toUpperCase();switch(j){case"INPUT":if(q=="checkbox"){w[m]=u.checked;}else{if(q!="radio"){w[m]=u.value;}}break;case"TEXTAREA":w[m]=u.value;break;case"SELECT":x=u.options;l=x.length;y=[];for(v=0;v<l;v++){B=x[v];if(B.selected){o=B.attributes.value;y[y.length]=(o&&o.specified)?B.value:B.text;}}w[m]=y;break;}}else{q=u[0].type;switch(q){case"radio":for(v=0;v<r;v++){p=u[v];if(p.checked){w[m]=p.value;break;}}break;case"checkbox":y=[];for(v=0;v<r;v++){C=u[v];if(C.checked){y[y.length]=C.value;}}w[m]=y;break;}}}}}return w;},destroy:function(i){d.call(this);this._aButtons=null;var j=this.element.getElementsByTagName("form"),k;if(j.length>0){k=j[0];if(k){b.purgeElement(k);if(k.parentNode){k.parentNode.removeChild(k);}this.form=null;}}a.superclass.destroy.call(this,i);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(e,d){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,e,d);};var c=YAHOO.util.Dom,b=YAHOO.widget.SimpleDialog,a={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};b.ICON_BLOCK="blckicon";b.ICON_ALARM="alrticon";b.ICON_HELP="hlpicon";b.ICON_INFO="infoicon";b.ICON_WARN="warnicon";b.ICON_TIP="tipicon";b.ICON_CSS_CLASSNAME="yui-icon";b.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(b,YAHOO.widget.Dialog,{initDefaultConfig:function(){b.superclass.initDefaultConfig.call(this);this.cfg.addProperty(a.ICON.key,{handler:this.configIcon,value:a.ICON.value,suppressEvent:a.ICON.suppressEvent});this.cfg.addProperty(a.TEXT.key,{handler:this.configText,value:a.TEXT.value,suppressEvent:a.TEXT.suppressEvent,supercedes:a.TEXT.supercedes});},init:function(e,d){b.superclass.init.call(this,e);this.beforeInitEvent.fire(b);c.addClass(this.element,b.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(d){this.cfg.applyConfig(d,true);}this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(b);},registerForm:function(){b.superclass.registerForm.call(this);var e=this.form.ownerDocument,d=e.createElement("input");d.type="hidden";d.name=this.id;d.value="";this.form.appendChild(d);},configIcon:function(k,j,h){var d=j[0],e=this.body,f=b.ICON_CSS_CLASSNAME,l,i,g;if(d&&d!="none"){l=c.getElementsByClassName(f,"*",e);if(l.length===1){i=l[0];g=i.parentNode;if(g){g.removeChild(i);i=null;}}if(d.indexOf(".")==-1){i=document.createElement("span");i.className=(f+" "+d);i.innerHTML=" ";}else{i=document.createElement("img");i.src=(this.imageRoot+d);i.className=f;}if(i){e.insertBefore(i,e.firstChild);}}},configText:function(e,d,f){var g=d[0];if(g){this.setBody(g);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(e,h,g,d,f){if(!f){f=YAHOO.util.Anim;}this.overlay=e;this.attrIn=h;this.attrOut=g;this.targetElement=d||e.element;this.animClass=f;};var b=YAHOO.util.Dom,c=YAHOO.util.CustomEvent,a=YAHOO.widget.ContainerEffect;a.FADE=function(d,f){var g=YAHOO.util.Easing,i={attributes:{opacity:{from:0,to:1}},duration:f,method:g.easeIn},e={attributes:{opacity:{to:0}},duration:f,method:g.easeOut},h=new a(d,i,e,d.element);h.handleUnderlayStart=function(){var k=this.overlay.underlay;if(k&&YAHOO.env.ua.ie){var j=(k.filters&&k.filters.length>0);if(j){b.addClass(d.element,"yui-effect-fade");}}};h.handleUnderlayComplete=function(){var j=this.overlay.underlay;if(j&&YAHOO.env.ua.ie){b.removeClass(d.element,"yui-effect-fade");}};h.handleStartAnimateIn=function(k,j,l){l.overlay._fadingIn=true;b.addClass(l.overlay.element,"hide-select");if(!l.overlay.underlay){l.overlay.cfg.refireEvent("underlay"); |
| 43 | 43 | }l.handleUnderlayStart();l.overlay._setDomVisibility(true);b.setStyle(l.overlay.element,"opacity",0);};h.handleCompleteAnimateIn=function(k,j,l){l.overlay._fadingIn=false;b.removeClass(l.overlay.element,"hide-select");if(l.overlay.element.style.filter){l.overlay.element.style.filter=null;}l.handleUnderlayComplete();l.overlay.cfg.refireEvent("iframe");l.animateInCompleteEvent.fire();};h.handleStartAnimateOut=function(k,j,l){l.overlay._fadingOut=true;b.addClass(l.overlay.element,"hide-select");l.handleUnderlayStart();};h.handleCompleteAnimateOut=function(k,j,l){l.overlay._fadingOut=false;b.removeClass(l.overlay.element,"hide-select");if(l.overlay.element.style.filter){l.overlay.element.style.filter=null;}l.overlay._setDomVisibility(false);b.setStyle(l.overlay.element,"opacity",1);l.handleUnderlayComplete();l.overlay.cfg.refireEvent("iframe");l.animateOutCompleteEvent.fire();};h.init();return h;};a.SLIDE=function(f,d){var i=YAHOO.util.Easing,l=f.cfg.getProperty("x")||b.getX(f.element),k=f.cfg.getProperty("y")||b.getY(f.element),m=b.getClientWidth(),h=f.element.offsetWidth,j={attributes:{points:{to:[l,k]}},duration:d,method:i.easeIn},e={attributes:{points:{to:[(m+25),k]}},duration:d,method:i.easeOut},g=new a(f,j,e,f.element,YAHOO.util.Motion);g.handleStartAnimateIn=function(o,n,p){p.overlay.element.style.left=((-25)-h)+"px";p.overlay.element.style.top=k+"px";};g.handleTweenAnimateIn=function(q,p,r){var s=b.getXY(r.overlay.element),o=s[0],n=s[1];if(b.getStyle(r.overlay.element,"visibility")=="hidden"&&o<l){r.overlay._setDomVisibility(true);}r.overlay.cfg.setProperty("xy",[o,n],true);r.overlay.cfg.refireEvent("iframe");};g.handleCompleteAnimateIn=function(o,n,p){p.overlay.cfg.setProperty("xy",[l,k],true);p.startX=l;p.startY=k;p.overlay.cfg.refireEvent("iframe");p.animateInCompleteEvent.fire();};g.handleStartAnimateOut=function(o,n,r){var p=b.getViewportWidth(),s=b.getXY(r.overlay.element),q=s[1];r.animOut.attributes.points.to=[(p+25),q];};g.handleTweenAnimateOut=function(p,o,q){var s=b.getXY(q.overlay.element),n=s[0],r=s[1];q.overlay.cfg.setProperty("xy",[n,r],true);q.overlay.cfg.refireEvent("iframe");};g.handleCompleteAnimateOut=function(o,n,p){p.overlay._setDomVisibility(false);p.overlay.cfg.setProperty("xy",[l,k]);p.animateOutCompleteEvent.fire();};g.init();return g;};a.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=c.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=c.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=c.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=c.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this._stopAnims(this.lastFrameOnStop);this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this._stopAnims(this.lastFrameOnStop);this.beforeAnimateOutEvent.fire();this.animOut.animate();},lastFrameOnStop:true,_stopAnims:function(d){if(this.animOut&&this.animOut.isAnimated()){this.animOut.stop(d);}if(this.animIn&&this.animIn.isAnimated()){this.animIn.stop(d);}},handleStartAnimateIn:function(e,d,f){},handleTweenAnimateIn:function(e,d,f){},handleCompleteAnimateIn:function(e,d,f){},handleStartAnimateOut:function(e,d,f){},handleTweenAnimateOut:function(e,d,f){},handleCompleteAnimateOut:function(e,d,f){},toString:function(){var d="ContainerEffect";if(this.overlay){d+=" ["+this.overlay.toString()+"]";}return d;}};YAHOO.lang.augmentProto(a,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.9.0",build:"2800"}); |
| 44 | 44 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.calculo={metododistancia:"vicenty",dms2dd:function(cd,cm,cs){try{var sinal,spm,mpg,dd;sinal='positivo';if(cd<0){cd=cd*-1;sinal='negativo'}spm=cs/3600;mpg=cm/60;dd=(cd*1)+(mpg*1)+(spm*1);if(sinal==='negativo'){dd=dd*-1}return(dd)}catch(e){return(0)}},dd2tela:function(vx,vy,docmapa,ext,cellsize){try{var pos,xyn,dc,imgext,c,xy;if(i3GEO.Interface.ATUAL==="googlemaps"&&docmapa.id!=="mapaReferencia"){pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));xyn=i3GeoMapOverlay.getProjection().fromLatLngToContainerPixel(new google.maps.LatLng(vy,vx));xy=[];return[(xyn.x)+pos[0],(xyn.y)+pos[1]]}if(i3GEO.Interface.ATUAL==="openlayers"&&docmapa.id!=="mapaReferencia"){pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));xy=i3geoOL.getViewPortPxFromLonLat(new OpenLayers.LonLat(vx,vy));return[(xy.x)+pos[0],(xy.y)+pos[1]]}if(arguments.length===3){ext=i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);cellsize=i3GEO.parametros.pixelsize}if(arguments.length===4){cellsize=i3GEO.parametros.pixelsize}if(!docmapa){docmapa=window.document}dc=docmapa;pos=i3GEO.util.pegaPosicaoObjeto(dc);imgext=ext.split(" ");vx=(vx*1)-(imgext[0]*1);vy=(vy*-1)+(imgext[3]*1);c=cellsize*1;return[(vx/c)+pos[0],(vy/c)+pos[1]]}catch(e){return([])}},dd2dms:function(x,y){var restod=0,sx="00.00",sy="00.00",mx,mm,restos,my,s,dx,dy;dx=parseInt(x,10);if(dx>0){restod=x-dx}if(dx<0){restod=(x*-1)-(dx*-1)}if(restod!==0){mm=restod*60;mx=parseInt(restod*60,10);restos=mm-mx;if(restos!==0){s=restos*60;s=(s+"_").substring(0,5);sx=s}}else{mx="00";sx="00.00"}dy=parseInt(y,10);if(dy>0){restod=y-dy}if(dy<0){restod=(y*-1)-(dy*-1)}if(restod!==0){mm=restod*60;my=parseInt(restod*60,10);restos=mm-my;if(restos!==0){s=restos*60;s=(s+"_").substring(0,5);sy=s}}else{my="00";sy="00.00"}return[dx+" "+mx+" "+sx,dy+" "+my+" "+sy]},tela2dd:function(xfign,yfign,g_celula,imgext,idorigem){try{var amext,longdd,latdd,point;if(i3GEO.Interface.ATUAL==="googlemaps"&&arguments.length===4){amext=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(xfign,yfign));return[amext.lng(),amext.lat()]}if(i3GEO.Interface.openlayers.googleLike===true){amext=i3geoOL.getLonLatFromPixel(new OpenLayers.Pixel(xfign,yfign));point=new OpenLayers.LonLat(amext.lon,amext.lat);amext=point.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection("EPSG:4326"));return[amext.lon,amext.lat]}if(i3GEO.Interface.ATUAL==="openlayers"&&arguments.length===4){amext=i3geoOL.getLonLatFromPixel(new OpenLayers.Pixel(xfign,yfign));return[amext.lon,amext.lat]}if(navm){xfign=xfign-2.2;yfign=yfign-2.7}else{xfign=xfign-0.12;yfign=yfign-1.05}amext=imgext.split(" ");longdd=(amext[0]*1)+(g_celula*xfign);latdd=(amext[3]*1)-(g_celula*yfign);return[longdd,latdd]}catch(e){return(0)}},area:function(x,y,pixel){var n=x.length,$polygon_area,$i;try{if(n>2){x.push(x[0]);y.push(y[0]);$polygon_area=0;for($i=0;$i<n;$i+=1){$polygon_area+=((x[$i]*y[$i+1])-(y[$i]*x[$i+1]))}$polygon_area=Math.abs($polygon_area)/2}else{$polygon_area=0}return $polygon_area*pixel}catch(e){return(0)}},distancia:function(lon1,lat1,lon2,lat2){if(i3GEO.calculo.metododistancia==="haversine"){return i3GEO.calculo.distHaversine(lon1,lat1,lon2,lat2)}if(i3GEO.calculo.metododistancia==="vicenty"){return i3GEO.calculo.distVincenty(lon1,lat1,lon2,lat2)}},distHaversine:function(lon1,lat1,lon2,lat2){var dLat,dLon,a,c,d;dLat=((lat2-lat1))*Math.PI/180;dLon=((lon2-lon1))*Math.PI/180;a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(lat1*Math.PI/180)*Math.cos(lat2*Math.PI/180)*Math.sin(dLon/2)*Math.sin(dLon/2);c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));d=6378.137*c;return d},distVincenty:function(lon1,lat1,lon2,lat2){var rad=function(x){return x*Math.PI/180},ct={a:6378137,b:6356752.3142,f:1/298.257223563},p1={lat:lat1,lon:lon1},p2={lat:lat2,lon:lon2},a=ct.a,b=ct.b,f=ct.f,L=rad(p2.lon-p1.lon),U1=Math.atan((1-f)*Math.tan(rad(p1.lat))),U2=Math.atan((1-f)*Math.tan(rad(p2.lat))),sinU1=Math.sin(U1),cosU1=Math.cos(U1),sinU2=Math.sin(U2),cosU2=Math.cos(U2),lambda=L,lambdaP=2*Math.PI,iterLimit=20,sinLambda,cosLambda,sinSigma=0,cosSigma=0,sigma=0,alpha,cosSqAlpha=0,cos2SigmaM=0,C,uSq,A,B,s,d,deltaSigma;while(Math.abs(lambda-lambdaP)>1e-12&&--iterLimit>0){sinLambda=Math.sin(lambda);cosLambda=Math.cos(lambda);sinSigma=Math.sqrt((cosU2*sinLambda)*(cosU2*sinLambda)+(cosU1*sinU2-sinU1*cosU2*cosLambda)*(cosU1*sinU2-sinU1*cosU2*cosLambda));if(sinSigma===0){return 0}cosSigma=sinU1*sinU2+cosU1*cosU2*cosLambda;sigma=Math.atan2(sinSigma,cosSigma);alpha=Math.asin(cosU1*cosU2*sinLambda/sinSigma);cosSqAlpha=Math.cos(alpha)*Math.cos(alpha);cos2SigmaM=cosSigma-2*sinU1*sinU2/cosSqAlpha;C=f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha));lambdaP=lambda;lambda=L+(1-C)*f*Math.sin(alpha)*(sigma+C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)))}if(iterLimit===0){return NaN}uSq=cosSqAlpha*(a*a-b*b)/(b*b);A=1+uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));B=uSq/1024*(256+uSq*(-128+uSq*(74-47*uSq)));deltaSigma=B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)-B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM)));s=b*A*(sigma-deltaSigma);d=s.toFixed(3)/1000;return d},direcao:function(lon1,lat1,lon2,lat2){var dLon,y,x,r;lat1=lat1*(Math.PI/180);lat2=lat2*(Math.PI/180);dLon=(lon2-lon1)*(Math.PI/180);y=Math.sin(dLon)*Math.cos(lat2);x=Math.cos(lat1)*Math.sin(lat2)-Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon);r=Math.atan2(y,x);r=r*180/Math.PI;r=r+360;return r%360},destinoDD:function(lon,lat,d,direcao){var R,lat1,lon1,brng,lat2,lon2;R=6371;lat1=lat*(Math.PI/180);lon1=lon*(Math.PI/180);brng=direcao*(Math.PI/180);lat2=Math.asin(Math.sin(lat1)*Math.cos(d/R)+Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng));lon2=lon1+Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1),Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2));lon2=(lon2+Math.PI)%(2*Math.PI)-Math.PI;if(isNaN(lat2)||isNaN(lon2)){return null}return[(lon2*180/Math.PI),(lat2*180/Math.PI)]},rect2ext:function(idrect,mapext,pixel){var bx,bxs,xfig,yfig,nx,ny,pos,amext,dy,x1,y1,x2,y2,pix=parseInt(document.getElementById(idrect).style.left,10),piy=parseInt(document.getElementById(idrect).style.top,10);if($i(idrect)){bx=$i(idrect);bxs=bx.style}else{i3GEO.janela.tempoMsg("Box nao encontrado");return}pos=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));xfig=pix+(parseInt(bxs.width,10))-pos[0];yfig=piy+(parseInt(bxs.height,10))-pos[1];amext=mapext.split(" ");dy=((amext[1]*1)-(amext[3]*1))/-1;if(dy<0){dy=dy*-1}nx=pixel*xfig;ny=pixel*yfig;x1=(amext[0]*1)+nx;y1=(amext[3]*1)-ny;xfig=pix-pos[0];yfig=piy-pos[1];if(dy<0){dy=dy*-1}nx=pixel*xfig;ny=pixel*yfig;x2=(amext[0]*1)+nx;y2=(amext[3]*1)-ny;return[x2+" "+y2+" "+x1+" "+y1,x1,y1,x2,y2]},ext2rect:function(idrect,mapext,boxext,pixel,documento){var rectbox,xyMin,xyMax,w,h,tl,pos,t,l,d,box;rectbox=boxext.split(" ");xyMin=i3GEO.calculo.dd2tela(rectbox[0],rectbox[1],documento,boxext,pixel);xyMax=i3GEO.calculo.dd2tela(rectbox[2],rectbox[3],documento,boxext,pixel);w=xyMax[0]-xyMin[0];h=xyMin[1]-xyMax[1];tl=i3GEO.calculo.dd2tela(rectbox[0],rectbox[3],documento,mapext,pixel);pos=i3GEO.util.pegaPosicaoObjeto(documento);t=tl[1]-pos[1];l=tl[0]-pos[0];d="block";if($i(idrect)){box=$i(idrect);box.style.width=w+"px";box.style.height=h+"px";box.style.top=t+"px";box.style.left=l+"px";box.style.display=d}return[w,h,xyMax[1],xyMin[0]]}}; |
| 45 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}navm=false;navn=false;chro=navigator.userAgent.toLowerCase().indexOf('chrome')>-1;opera=navigator.userAgent.toLowerCase().indexOf('opera')>-1;if(navigator.appName.substring(0,1)==='N'){navn=true}if(navigator.appName.substring(0,1)==='M'){navm=true}if(opera===true){navn=true}g_operacao="";g_tipoacao="zoomli";$i=function(id){return document.getElementById(id)};Array.prototype.remove=function(s){try{var n=this.length,i;for(i=0;i<n;i++){if(this[i]==s){this.splice(i,1)}}}catch(e){}};i3GEO.util={PINS:[],BOXES:[],escapeURL:function(sUrl){var re;sUrl=escape(sUrl);re=new RegExp("%3F","g");sUrl=sUrl.replace(re,'?');re=new RegExp("%3D","g");sUrl=sUrl.replace(re,'=');re=new RegExp("%26","g");sUrl=sUrl.replace(re,'&');return sUrl},insereCookie:function(nome,valor,expira){if(!expira){expira=10}var exdate=new Date();exdate.setDate(exdate.getDate()+expira);document.cookie=nome+"="+valor+"; expires="+exdate.toUTCString()+";path=/"},pegaCookie:function(nome){var cookies,i,fim;cookies=document.cookie;i=cookies.indexOf(nome);if(i===-1){return null}fim=cookies.indexOf(";",i);if(fim===-1){fim=cookies.length}return(unescape(cookies.substring(i,fim))).split("=")[1]},listaChaves:function(obj){var keys,key="";keys=[];for(key in obj){if(obj[key]){keys.push(key)}}return keys},listaTodasChaves:function(obj){var keys,key="";keys=[];for(key in obj){keys.push(key)}return keys},criaBotaoAplicar:function(nomeFuncao,titulo,classe,obj){try{if(typeof(tempoBotaoAplicar)!=='undefined'){clearTimeout(tempoBotaoAplicar)}}catch(e){}var executar=new Function(nomeFuncao+"().call;clearTimeout(tempoBotaoAplicar);"),novoel,xy;tempoBotaoAplicar=setTimeout(executar,(i3GEO.configura.tempoAplicar));if(arguments.length===1){titulo="Aplicar"}if(arguments.length===1||arguments.length===2){classe="i3geoBotaoAplicar"}if(!document.getElementById("i3geo_aplicar")){novoel=document.createElement("input");novoel.id='i3geo_aplicar';novoel.type='button';novoel.value=titulo;novoel.style.cursor="pointer";novoel.style.fontSize="10px";novoel.style.zIndex=15000;novoel.style.position="absolute";novoel.style.display="none";novoel.onmouseover=function(){this.style.display="block"};novoel.onmouseout=function(){this.style.display="none"};novoel.className=classe;document.body.appendChild(novoel)}else{novoel=document.getElementById("i3geo_aplicar")}novoel.onclick=function(){clearTimeout(i3GEO.parametros.tempo);i3GEO.parametros.tempo="";this.style.display='none';eval(nomeFuncao+"\(\)")};if(arguments.length===4){novoel.style.display="block";xy=YAHOO.util.Dom.getXY(obj);YAHOO.util.Dom.setXY(novoel,xy)}return(novoel)},arvore:function(titulo,onde,obj){var arvore,root,tempNode,d,criaNo;if(!$i(onde)){return}arvore=new YAHOO.widget.TreeView(onde);root=arvore.getRoot();try{tempNode=new YAHOO.widget.TextNode('',root,false);tempNode.isLeaf=false;tempNode.enableHighlight=true}catch(e){}titulo="<table><tr><td><b>"+titulo+"</b></td><td></td></tr></table>";d={html:titulo};tempNode=new YAHOO.widget.HTMLNode(d,root,true,true);tempNode.enableHighlight=true;criaNo=function(obj,noDestino){var trad,i,j,linha,conteudo,temaNode,c=obj.propriedades.length;for(i=0,j=c;i<j;i++){linha=obj.propriedades[i];if(linha.url!==""){trad=$trad(linha.text);if(!trad){trad=linha.text}conteudo="<a href='#' onclick='"+linha.url+"'>"+trad+"</a>"}else{conteudo=linha.text}d={html:conteudo};temaNode=new YAHOO.widget.HTMLNode(d,noDestino,false,true);temaNode.enableHighlight=false;if(obj.propriedades[i].propriedades){criaNo(obj.propriedades[i],temaNode)}}};criaNo(obj,tempNode);arvore.collapseAll();arvore.draw();return arvore},removeAcentos:function(palavra){var re;re=/á|à|ã|â/gi;palavra=palavra.replace(re,"a");re=/é|ê/gi;palavra=palavra.replace(re,"e");re=/í/gi;palavra=palavra.replace(re,"i");re=/ó|õ|ô/gi;palavra=palavra.replace(re,"o");re=/ç/gi;palavra=palavra.replace(re,"c");re=/ú/gi;palavra=palavra.replace(re,"u");return(palavra)},protocolo:function(){var u=window.location.href;u=u.split(":");return(u[0])},pegaPosicaoObjeto:function(obj){if(obj){if(!obj.style){return[0,0]}var curleft=0,curtop=0;if(obj){if(obj.offsetParent){do{curleft+=obj.offsetLeft-obj.scrollLeft;curtop+=obj.offsetTop-obj.scrollTop;obj=obj.offsetParent}while(obj)}}return[curleft+document.body.scrollLeft,curtop+document.body.scrollTop]}else{return[0,0]}},pegaElementoPai:function(e){var targ=document;if(!e){e=window.event}if(e.target){targ=e.target}else{if(e.srcElement){targ=e.srcElement}}if(targ.nodeType===3){targ=targ.parentNode}if(targ.parentNode){tparent=targ.parentNode;return(tparent)}else{return targ}},mudaCursor:function(cursores,tipo,idobjeto,locaplic){var os=[],o,i,c="",n,cursor="",ext=".ff";try{if(navm){ext=".ie"}os.push(document.getElementById(idobjeto));if(i3GEO.Interface.ATUAL==="openlayers"){os=YAHOO.util.Dom.getElementsByClassName('olTileImage','img')}if(i3GEO.Interface.ATUAL==="googlemaps"){os=document.getElementById(idobjeto).firstChild;os=os.getElementsByTagName("div")}n=os.length;if(tipo==="default"||tipo==="pointer"||tipo==="crosshair"||tipo==="help"||tipo==="move"||tipo==="text"){cursor=tipo}else{c=eval("cursores."+tipo+ext)}if(c==="default"||c==="pointer"||c==="crosshair"||c==="help"||c==="move"||c==="text"){cursor=c}if(cursor===""){cursor="URL(\""+locaplic+eval("cursores."+tipo+ext)+"\"),auto"}for(i=0;i<n;i++){o=os[i];if(o){o.style.cursor=cursor}}}catch(e){}},criaBox:function(id){if(arguments.length===0){id="boxg"}if(!$i(id)){var novoel=document.createElement("div");novoel.id=id;novoel.style.zIndex=1;novoel.innerHTML='<font face="Arial" size=0></font>';document.body.appendChild(novoel);novoel.onmouseover=function(){novoel.style.display='none'};novoel.onmouseout=function(){novoel.style.display='block'};i3GEO.util.BOXES.push(id)}else{$i(id).style.display="block"}},escondeBox:function(){var l,i;l=i3GEO.util.BOXES.length;for(i=0;i<l;i++){if($i(i3GEO.util.BOXES[i])){$i(i3GEO.util.BOXES[i]).style.display="none"}}},criaPin:function(id,imagem,w,h,mouseover){if(arguments.length<1||id===""){id="boxpin"}if(arguments.length<2||imagem===""){imagem=i3GEO.configura.locaplic+'/imagens/marker.png'}if(arguments.length<3||w===""){w=21}if(arguments.length<4||h===""){h=25}if(!$i(id)){var novoel=document.createElement("img");novoel.style.zIndex=10000;novoel.style.position="absolute";novoel.style.width=parseInt(w,10)+"px";novoel.style.height=parseInt(h,10)+"px";novoel.style.top="0px";novoel.style.left="0px";novoel.src=imagem;novoel.id=id;if(id==="boxpin"){novoel.onmouseover=function(){$i("boxpin").style.display="none"}}else if(mouseover){novoel.onmouseover=mouseover}document.body.appendChild(novoel);i3GEO.util.PINS.push(id)}$i(id).style.display="block"},posicionaImagemNoMapa:function(id,x,y){var i,mx,my;if(x&&x!=""){objposicaocursor.telax=x}if(y&&y!=""){objposicaocursor.telay=y}i=$i(id);mx=parseInt(i.style.width,10)/2;my=parseInt(i.style.height,10)/2;i.style.top=objposicaocursor.telay-my+"px";i.style.left=objposicaocursor.telax-mx+"px";return[objposicaocursor.telay-my,objposicaocursor.telax-mx]},escondePin:function(){var l,i;l=i3GEO.util.PINS.length;for(i=0;i<l;i++){if($i(i3GEO.util.PINS[i])){$i(i3GEO.util.PINS[i]).style.display="none"}}},$im:function(g){return i3GEO.configura.locaplic+"/imagens/visual/default/"+g},$inputText:function(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch){if(arguments.length===6){nome=""}if(idPai!==""){if(larguraIdPai!==""){$i(idPai).style.width=larguraIdPai+"px"}$i(idPai).style.padding="3";$i(idPai).style.textAlign="center"}if(!onch){onch=""}return"<span class=digitar onmouseover='javascript:this.className=\"digitarOver\";' onmouseout='javascript:this.className=\"digitar\";' ><input onchange=\""+onch+"\" tabindex='0' onclick='javascript:this.select();' id='"+idInput+"' title='"+titulo+"' type='text' size='"+digitos+"' class='digitar' value='"+valor+"' name='"+nome+"' /></span>"},$inputTextMudaCor:function(obj){var n=obj.value.split(" ");obj.style.color="rgb("+n[0]+","+n[1]+","+n[2]+")"},$top:function(id,valor){if(document.getElementById(id).style){if(document.getElementById(id).style.pixelTop){document.getElementById(id).style.pixelTop=valor}else{document.getElementById(id).style.top=valor+"px"}}},$left:function(id,valor){if(document.getElementById(id).style){if(document.getElementById(id).style.pixelLeft){document.getElementById(id).style.pixelLeft=valor}else{document.getElementById(id).style.left=valor+"px"}}},insereMarca:{CONTAINER:[],cria:function(xi,yi,funcaoOnclick,container,texto,srci,w,h){if(!w){w=5}if(!h){h=5}if(!srci||srci===""){srci=i3GEO.configura.locaplic+"/imagens/dot2.gif"}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.insereMarca(texto,xi,yi,container);return}try{var novoel,i,novoimg,temp;if(i3GEO.util.insereMarca.CONTAINER.toString().search(container)<0){i3GEO.util.insereMarca.CONTAINER.push(container)}if(!$i(container)){novoel=document.createElement("div");novoel.id=container;i=novoel.style;i.position="absolute";if($i(i3GEO.Interface.IDCORPO)){i.top=parseInt($i(i3GEO.Interface.IDCORPO).style.top,10)+"px";i.left=parseInt($i(i3GEO.Interface.IDCORPO).style.left,10)+"px"}else{i.top=parseInt($i(i3GEO.Interface.IDMAPA).style.top,10)+"px";i.left=parseInt($i(i3GEO.Interface.IDMAPA).style.left,10)+"px"}document.body.appendChild(novoel)}container=$i(container);novoel=document.createElement("div");i=novoel.style;i.position="absolute";i.zIndex=2000;i.top=(yi-(h/2))+"px";i.left=(xi-(w/2))+"px";i.width=w+"px";i.height=h+"px";novoimg=document.createElement("img");if(funcaoOnclick!==""){novoimg.onclick=funcaoOnclick}else{novoimg.onclick=function(){i3GEO.util.insereMarca.limpa()}}novoimg.src=srci;temp=novoimg.style;temp.width=w+"px";temp.height=h+"px";temp.zIndex=2000;novoel.appendChild(novoimg);container.appendChild(novoel);if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.util.insereMarca.limpa()")<0){i3GEO.eventos.NAVEGAMAPA.push("i3GEO.util.insereMarca.limpa()")}}catch(e){i3GEO.janela.tempoMsg("Ocorreu um erro. inseremarca"+e)}},limpa:function(){try{var n,i;n=i3GEO.util.insereMarca.CONTAINER.length;for(i=0;i<n;i++){if($i(i3GEO.util.insereMarca.CONTAINER[i])){$i(i3GEO.util.insereMarca.CONTAINER[i]).innerHTML=""}}i3GEO.util.insereMarca.CONTAINER=[];i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.util.insereMarca.limpa()")}catch(e){}}},adicionaSHP:function(path){var temp=path.split(".");if((temp[1]==="SHP")||(temp[1]==="shp")){i3GEO.php.adicionaTemaSHP(i3GEO.atualiza,path)}else{i3GEO.php.adicionaTemaIMG(i3GEO.atualiza,path)}},abreCor:function(janelaid,elemento,tipo){if(!i3GEO.configura){i3GEO.configura={locaplic:"../"}}if(arguments.length===2){tipo="rgb"}var janela,ins,novoel,wdocaiframe,wsrc=i3GEO.configura.locaplic+"/ferramentas/colorpicker/index.htm?doc="+janelaid+"&elemento="+elemento+"&tipo="+tipo,texto="Cor",id="i3geo_janelaCor",classe="hd";if($i(id)){YAHOO.i3GEO.janela.manager.find(id).show();return}ins='<div id="'+id+'_cabecalho" class="hd">';ins+="<span><img id='i3geo_janelaCor_imagemCabecalho' style='visibility:hidden;' src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde.gif\' /></span>";ins+=texto;ins+='</div><div id="i3geo_janelaCor_corpo" class="bd" style="padding:5px">';if(wsrc!==""){ins+='<iframe name="'+id+'i" id="i3geo_janelaCori" valign="top" style="height:230px,border:0px white solid"></iframe>'}ins+='</div>';novoel=document.createElement("div");novoel.id="i3geo_janelaCor";novoel.style.display="block";novoel.innerHTML=ins;if($i("i3geo")){$i("i3geo").appendChild(novoel)}else{document.body.appendChild(novoel)}wdocaiframe=$i("i3geo_janelaCori");if(wdocaiframe){wdocaiframe.style.display="block";wdocaiframe.src=wsrc;wdocaiframe.style.height="230px";wdocaiframe.style.width="325px";wdocaiframe.style.border="0px solid white"}janela=new YAHOO.widget.Panel(id,{height:"290px",modal:false,width:"350px",fixedcenter:true,constraintoviewport:false,visible:true,iframe:false});YAHOO.i3GEO.janela.manager.register(janela);janela.render();$i(id+'_cabecalho').className=classe},ajaxhttp:function(){var objhttp1;try{objhttp1=new XMLHttpRequest()}catch(ee){try{objhttp1=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{objhttp1=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){objhttp1=false}}}return(objhttp1)},ajaxexecASXml:function(programa,funcao){var h,ohttp;if(programa.search("http")===0){h=window.location.host;if(programa.search(h)<0){alert("OOps! Nao e possivel chamar um XML de outro host.\nContacte o administrador do sistema.\nConfigure corretamente o ms_configura.php");return}}ohttp=i3GEO.util.ajaxhttp();ohttp.open("GET",programa,true);ohttp.onreadystatechange=function(){var retorno,parser,dom;if(ohttp.readyState===4){retorno=ohttp.responseText;if(retorno!==undefined){if(document.implementation.createDocument){parser=new DOMParser();dom=parser.parseFromString(retorno,"text/xml")}else{dom=new ActiveXObject("Microsoft.XMLDOM");dom.async="false";dom.load(programa)}}else{return"erro"}if(funcao!=="volta"){eval(funcao+'(dom)')}else{return dom}}};ohttp.send(null)},aparece:function(id,tempo,intervalo){var n,obj,opacidade,fadei=0,tempoFadei=null;n=parseInt(tempo/intervalo,10);obj=$i(id);if(n===1){obj.style.display="block";if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}}tempo=n*intervalo;intervalo=(intervalo*100)/tempo;opacidade=0;if(navm){obj.style.filter='alpha(opacity=0)'}else{obj.style.opacity=0}obj.style.display="block";fadei=function(){opacidade+=intervalo;if(navm){obj.style.filter='alpha(opacity='+opacidade+')'}else{obj.style.opacity=opacidade/100}if(opacidade<100){tempoFadei=setTimeout(fadei,tempo)}else{if(tempoFadei){clearTimeout(tempoFadei)}if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}}};tempoFadei=setTimeout(fadei,tempo)},desaparece:function(id,tempo,intervalo,removeobj){var n,obj,opacidade,fade=0,p,tempoFade=null;n=parseInt(tempo/intervalo,10);obj=$i(id);if(n===1){obj.style.display="none";if(removeobj){p=obj.parentNode;if(p){p.removeChild(obj)}}return}tempo=n*intervalo;intervalo=(intervalo*100)/tempo;opacidade=100;if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}obj.style.display="block";fade=function(){opacidade-=intervalo;if(navm){obj.style.filter='alpha(opacity='+opacidade+')'}else{obj.style.opacity=opacidade/100}if(opacidade>0){tempoFade=setTimeout(fade,tempo)}else{if(tempoFade){clearTimeout(tempoFade)}obj.style.display="none";if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}if(removeobj){p=obj.parentNode;if(p){p.removeChild(obj)}}}};tempoFade=setTimeout(fade,tempo)},wkt2ext:function(wkt,tipo){var re,x,y,w,xMin,xMax,yMin,yMax,temp;tipo=tipo.toLowerCase();ext=false;if(tipo==="polygon"){try{re=new RegExp("POLYGON","g");wkt=wkt.replace(re,"");wkt=wkt.split("(")[2].split(")")[0];wkt=wkt.split(",");x=[];y=[];for(w=0;w<wkt.length;w++){temp=wkt[w].split(" ");x.push(temp[0]);y.push(temp[1])}x.sort(i3GEO.util.sortNumber);xMin=x[0];xMax=x[(x.length)-1];y.sort(i3GEO.util.sortNumber);yMin=y[0];yMax=y[(y.length)-1];return xMin+" "+yMin+" "+xMax+" "+yMax}catch(e){}}if(tipo==="point"){try{re=new RegExp("POINT","g");wkt=wkt.replace(re,"");wkt=wkt.split("(")[1].split(")")[0];wkt=wkt.split(" ");return(wkt[0]*1-0.01)+" "+(wkt[1]*1-0.01)+" "+(wkt[0]*1+0.01)+" "+(wkt[1]*1+0.01)}catch(e){}}return ext},sortNumber:function(a,b){return a-b},getScrollerWidth:function(){var scr=null,inn=null,wNoScroll=0,wScroll=0;scr=document.createElement('div');scr.style.position='absolute';scr.style.top='-1000px';scr.style.left='-1000px';scr.style.width='100px';scr.style.height='50px';scr.style.overflow='hidden';inn=document.createElement('div');inn.style.width='100%';inn.style.height='200px';scr.appendChild(inn);document.body.appendChild(scr);wNoScroll=inn.offsetWidth;scr.style.overflow='auto';wScroll=inn.offsetWidth;document.body.removeChild(document.body.lastChild);return(wNoScroll-wScroll)},getScrollHeight:function(){var mx=Math.max,d=document;return mx(mx(d.body.scrollHeight,d.documentElement.scrollHeight),mx(d.body.offsetHeight,d.documentElement.offsetHeight),mx(d.body.clientHeight,d.documentElement.clientHeight))},scriptTag:function(js,ini,id,aguarde){if(!aguarde){aguarde=false}var head,script,tipojanela=i3GEO.janela.ESTILOAGUARDE;if(!$i(id)||id===""){if(i3GEO.janela&&aguarde===true){i3GEO.janela.ESTILOAGUARDE="reduzida";i3GEO.janela.abreAguarde(id+"aguarde","Carregando JS")}head=document.getElementsByTagName('head')[0];script=document.createElement('script');script.type='text/javascript';if(ini!==""){if(navm){script.onreadystatechange=function(){if(this.readyState==='loaded'||this.readyState==='complete'){if(i3GEO.janela){i3GEO.janela.fechaAguarde(id+"aguarde")}if(YAHOO.lang.isFunction(ini)){ini.call()}else{eval(ini)}}}}else{script.onload=function(){if(i3GEO.janela){i3GEO.janela.fechaAguarde(id+"aguarde")}if(YAHOO.lang.isFunction(ini)){ini.call()}else{eval(ini)}}}i3GEO.janela.ESTILOAGUARDE=tipojanela}script.src=js;if(id!==""){script.id=id}head.appendChild(script)}else{if(ini!==""){if(YAHOO.lang.isFunction(ini)){ini.call()}else{eval(ini)}}}},removeScriptTag:function(id){try{old=$i("loadscriptI3GEO");if(old!==null){old.parentNode.removeChild(old);old=null;eval(id+" = null;")}old=$i(id);if(old!==null){old.parentNode.removeChild(old)}}catch(erro){}},verificaScriptTag:function(texto){var s=document.getElementsByTagName("script"),n=s.length,i,t;try{for(i=0;i<n;i++){t=s[i].id;t=t.split(".");if(t[2]&&t[2]=="dicionario_script"){return false}if(t[0]===texto){return true}}return false}catch(e){return false}},mensagemAjuda:function(onde,texto){var ins="<table style='width:100%;padding:2;vertical-align:top;background-color:#ffffff;' ><tr><th style='background-color: #cedff2; font-family:Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; border: 1px solid #B1CDEB; text-align: left; padding-left: 7px;padding-right: 11px;'>";ins+='<div style="float:right"><img src="'+i3GEO.configura.locaplic+'/imagens/question.gif" /></div>';ins+='<div style="text-align:left;">';if(texto===""){texto=$i(onde).innerHTML}ins+=texto;ins+='</div></th></tr></table>';if(onde!==""){$i(onde).innerHTML=ins}else{return(ins)}},randomRGB:function(){var v=Math.random(),r=parseInt(255*v,10),g;v=Math.random();g=parseInt(255*v,10);v=Math.random();b=parseInt(255*v,10);return(r+","+g+","+b)},rgb2hex:function(str){var re=new RegExp(" ","g"),rgb=str.replace(re,',');return YAHOO.util.Dom.Color.toHex("rgb("+rgb+")")},comboTemas:function(id,funcao,onde,nome,multiplo,tipoCombo,estilo,yui){if(onde&&onde!==""){i3GEO.util.defineValor(onde,"innerHTML","<span style=color:red;font-size:10px; >buscando temas...</span>")}if(!nome){nome=""}if(!multiplo){multiplo=false}if(!estilo||estilo==""){estilo="font-size: 12px;width: 95%;"}if(!yui){yui=false}var monta,temp,temp1,temp2;monta=function(retorno){var i,comboTemas='',n,nome="";if(yui===true){comboTemas='<input type="button" name='+id+'_button id="'+id+'" value="'+$trad("x33")+' ">';id=id+"select";nome=id}if(retorno!==undefined){if(retorno.data){retorno=retorno.data}n=retorno.length;if(n>0){if(multiplo){comboTemas+="<select style='"+estilo+"' id='"+id+"' size='4' multiple='multiple' name='"+nome+"'>"}else{comboTemas+="<select style='"+estilo+"' id='"+id+"' name='"+nome+"'>"}if(yui===false){comboTemas+="<option value=''>----</option>"}for(i=0;i<n;i++){if(retorno[i].nome){nome=retorno[i].nome;tema=retorno[i].tema}else{nome=retorno[i].tema;tema=retorno[i].name}if(retorno[i].escondido!=="sim"){comboTemas+="<option value="+tema+" >"+nome+"</option>"}}comboTemas+="</select>";temp={dados:comboTemas,tipo:"dados"}}else{if(tipoCombo==="poligonosSelecionados"||tipoCombo==="selecionados"||tipoCombo==="pontosSelecionados"){temp={dados:'<div class=alerta >Nenhum tema encontrado. <span style=cursor:pointer;color:blue onclick="i3GEO.mapa.dialogo.selecao()" > Selecionar...</span></div>',tipo:"mensagem"}}else{temp={dados:'<div class=alerta >Nenhum tema encontrado. </div>',tipo:"mensagem"}}}}else{temp={dados:"<p style=color:red >Ocorreu um erro<br>",tipo:"erro"}}eval("funcao(temp);")};if(tipoCombo==="ligados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemas(monta,"ligados",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="ligadosComTabela"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS);temp1=i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"menor",temp);temp2=i3GEO.arvoreDeCamadas.filtraCamadas("type",8,"igual",temp);monta(temp1.concat(temp2))}else{i3GEO.php.listaTemas(monta,"ligados",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="locais"){i3GEO.php.listaTemasEditaveis(monta,i3GEO.configura.locaplic,i3GEO.configura.sid)}if(tipoCombo==="editavel"){temp=i3GEO.arvoreDeCamadas.filtraCamadas("editavel","SIM","igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(temp)}if(tipoCombo==="selecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemasComSel(monta,i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="raster"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listatemasTipo(monta,"raster",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="pontosSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="pontos"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="poligonos"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="poligonosSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="naolinearSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",1,"diferente",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="linhaDoTempo"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("linhadotempo","sim","igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo===""){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type","","diferente",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}},checkCombo:function(id,nomes,valores,estilo,funcaoclick,ids,idschecked){var temp,i,combo="",n=valores.length;if(n>0){combo="<div style='"+estilo+"'><table class=lista3 id="+id+" >";for(i=0;i<n;i++){temp="";if(idschecked&&idschecked[i]){temp="checked"}if(!ids){combo+="<tr><td><input "+temp+" onclick="+funcaoclick+" size=2 style='top:1px;cursor:pointer' type=checkbox value='"+valores[i]+"' /></td><td>"+nomes[i]+"</td>"}else{combo+="<tr><td><input "+temp+" id="+ids[i]+" onclick="+funcaoclick+" size=2 style='top:1px;cursor:pointer' type=checkbox value='"+valores[i]+"' /></td><td>"+nomes[i]+"</td>"}}combo+="</table></div>"}return combo},valoresCheckCombo:function(id){var el=$i(id),res=[],n,i;if(el){el=el.getElementsByTagName("input");n=el.length;for(i=0;i<n;i++){if(el[i].checked===true){res.push(el[i].value)}}}return res},checkTemas:function(id,funcao,onde,nome,tipoLista,prefixo,size){if(arguments.length>2){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando temas...</span>"}if(arguments.length===3){nome=""}var monta,temp,temp1,n,i;monta=function(retorno){try{var i,comboTemas,n,nome;if(retorno!==undefined){if(retorno.data){retorno=retorno.data}n=retorno.length;if(n>0){comboTemas="<table class=lista3 >";for(i=0;i<n;i++){if(retorno[i].nome){nome=retorno[i].nome;tema=retorno[i].tema}else{nome=retorno[i].tema;tema=retorno[i].name}comboTemas+="<tr><td><input size=2 style='cursor:pointer' type=checkbox name='"+tema+"' /></td>";comboTemas+="<td> <input style='text-align:left;width:"+size+" cursor:text;' onclick='javascript:this.select();' id='"+prefixo+tema+"' type=text value='"+nome+"' /></td></tr>"}comboTemas+="</table>";temp={dados:comboTemas,tipo:"dados"}}else{temp={dados:'<div class=alerta >Nenhum tema encontrado.</div>',tipo:"mensagem"}}}else{temp={dados:"<p style=color:red >Ocorreu um erro<br>",tipo:"erro"}}eval("funcao(temp);")}catch(e){}};if(tipoLista==="ligados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemas(monta,"ligados",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoLista==="selecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemasComSel(monta,i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoLista==="raster"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listatemasTipo(monta,"raster",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoLista==="polraster"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"igual",i3GEO.arvoreDeCamadas.CAMADAS);temp1=i3GEO.arvoreDeCamadas.filtraCamadas("type",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS);n=temp1.length;for(i=0;i<n;i++){temp.push(temp1[i])}monta(temp)}else{alert($trad("x13"))}}if(tipoLista==="pontosSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{alert($trad("x13"))}}if(tipoLista==="pontos"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{alert($trad("x13"))}}},comboItens:function(id,tema,funcao,onde,nome,alias){if(!alias){alias="sim"}if(arguments.length>3){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando itens...</span>"}if(arguments.length!==5){nome=""}var monta=function(retorno){var ins,temp,i,nm;if(retorno.data!==undefined){ins=[];ins.push("<select id='"+id+"' name='"+nome+"'>");ins.push("<option value='' >---</option>");temp=retorno.data.valores.length;for(i=0;i<temp;i++){if(retorno.data.valores[i].tema===tema){if(alias=="sim"){nm=retorno.data.valores[i].alias;if(nm===""){nm=retorno.data.valores[i].item}}else{nm=retorno.data.valores[i].item}ins.push("<option value='"+retorno.data.valores[i].item+"' >"+nm+"</option>")}}ins.push("</select>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"}}eval("funcao(temp)")};i3GEO.php.listaItensTema(monta,tema)},comboValoresItem:function(id,tema,itemTema,funcao,onde){if(arguments.length===5){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando valores...</span>"}var monta=function(retorno){var ins=[],i,pares,j;if(retorno.data!==undefined){ins.push("<select id="+id+" >");ins.push("<option value='' >---</option>");for(i=0;i<retorno.data[1].registros.length;i++){pares=retorno.data[1].registros[i].valores;for(j=0;j<pares.length;j++){ins.push("<option value='"+pares[j].valor+"' >"+pares[j].valor+"</option>")}}ins.push("</select>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >Ocorreu um erro</erro>',tipo:"erro"}}eval("funcao(temp)")};i3GEO.php.listaValoresItensTema(monta,tema,itemTema)},comboFontes:function(id,onde){$i(onde).innerHTML="<span style=color:red >buscando fontes...</span>";var monta=function(retorno){var ins="",temp,i,dados;if(retorno.data!==undefined){ins+="<select id='"+id+"'>";ins+="<option value='bitmap' >bitmap</option>";dados=retorno.data.split(",");temp=dados.length;for(i=0;i<temp;i++){ins+="<option value='"+dados[i]+"' >"+dados[i]+"</option>"}ins+="</select>"}$i(onde).innerHTML=ins};i3GEO.php.listaFontesTexto(monta)},comboSimNao:function(id,selecionado){var combo="<select name="+id+" id="+id+" >";combo+="<option value='' >---</option>";if(selecionado.toLowerCase()==="sim"){combo+="<option value=TRUE selected >"+$trad("x14")+"</option>"}else{combo+="<option value=TRUE >"+$trad("x14")+"</option>"}if(selecionado==="nao"){combo+="<option value=FALSE selected >"+$trad("x15")+"</option>"}else{combo+="<option value=FALSE >"+$trad("x15")+"</option>"}combo+="</select>";return(combo)},checkItensEditaveis:function(tema,funcao,onde,size,prefixo,ordenacao){if(!ordenacao||ordenacao==""){ordenacao=="nao"}if(onde!==""){$i(onde).innerHTML="<span style=color:red;font-size:10px; >"+$trad("x65")+"</span>"}var monta=function(retorno){var ins=[],i,temp,n;if(retorno.data!==undefined){if(ordenacao==="sim"){ins.push("<table class=lista3 ><tr><td></td><td>"+$trad("x64")+"</td><td>Ordem</td>")}else{ins.push("<table class=lista3 ><tr><td></td><td>"+$trad("x64")+"</td><td></td>")}n=retorno.data.valores.length;for(i=0;i<n;i++){ins.push("<tr><td><input size=2 style='cursor:pointer' name='"+retorno.data.valores[i].tema+"' type=checkbox id='"+prefixo+retorno.data.valores[i].item+"' /></td>");ins.push("<td><input style='text-align:left;cursor:text;width:"+size+"' onclick='javascript:this.select();' id='"+prefixo+retorno.data.valores[i].item+retorno.data.valores[i].tema+"' type=text value='"+retorno.data.valores[i].item+"' /></td>");if(ordenacao==="sim"){ins.push("<td><input style='text-align:left; cursor:text;' id='ordem_"+prefixo+retorno.data.valores[i].item+retorno.data.valores[i].tema+"' type=text size='3' value='"+i+"' /></td>")}else{ins.push("<td></td>")}ins.push("</tr>")}ins.push("</table>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >'+$trad("x66")+'</div>',tipo:"erro"}}funcao.call(this,temp)};i3GEO.php.listaItensTema(monta,tema)},radioEpsg:function(funcao,onde,prefixo){if(arguments.length===2){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando...</span>"}var monta=function(retorno){var c="checked",ins=[],i,n,temp;if(retorno.data!==undefined){ins.push("<table class=lista2 >");n=retorno.data.length;for(i=0;i<n;i++){ins.push("<tr><td><input size=2 style='border:0px solid white;cursor:pointer' "+c+" name='"+prefixo+"EPSG' type=radio value='"+retorno.data[i].codigo+"' /></td>");c="";ins.push("<td>"+retorno.data[i].nome+"</td></tr>")}ins.push("</table>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"}}funcao(temp)};i3GEO.php.listaEpsg(monta)},comboEpsg:function(idCombo,onde,funcaoOnChange,valorDefault){onde=$i(onde);onde.innerHTML="<span style=color:red;font-size:10px; >buscando...</span>";var monta=function(retorno){var ins=[],i,n;if(retorno.data!==undefined){n=retorno.data.length;ins.push("<select id='"+idCombo+"' onChange='"+funcaoOnChange+"(this)' >");for(i=0;i<n;i++){ins.push("<option value='"+retorno.data[i].codigo+"'>"+retorno.data[i].nome+"</option>")}ins.push("</select>");ins=ins.join('');onde.innerHTML=ins;$i(idCombo).value=valorDefault}else{onde.innerHTML='<div class=erro >Ocorreu um erro</div>'}};i3GEO.php.listaEpsg(monta)},proximoAnterior:function(anterior,proxima,texto,idatual,container,mantem,onde){var temp=$i(idatual),botoes="",ndiv=document.createElement("div"),nids,i,fundo;if(!mantem){mantem=false}if(temp&&mantem==false){$i(container).removeChild(temp)}fundo="#F2F2F2";$i(container).style.backgroundColor="white";botoes="<table style='width:100%;background-color:"+fundo+";' ><tr style='width:100%'>";if(anterior!==""){botoes+="<td style='border:0px solid white;text-align:left;cursor:pointer;background-color:"+fundo+";'><input id='"+idatual+"anterior_' onclick='"+anterior+"' type='button' value=' ' /></td>"}if(proxima!==""){botoes+="<td style='border:0px solid white;text-align:right;cursor:pointer;background-color:"+fundo+";'><input id='"+idatual+"proxima_' onclick='"+proxima+"' type='button' value=' ' /></td>"}botoes+="</tr></table>";var ativaBotoes=function(anterior,proxima,idatual){var i;new YAHOO.widget.Button(idatual+"anterior_",{onclick:{fn:function(){eval(anterior+"()")},lazyloadmenu:true}});new YAHOO.widget.Button(idatual+"proxima_",{onclick:{fn:function(){eval(proxima+"()")},lazyloadmenu:true}});i=$i(idatual+"proxima_-button");if(i){i.style.backgroundImage="url('"+i3GEO.configura.locaplic+"/imagens/player_avanca.png')";i.style.backgroundRepeat="no-repeat";i.style.backgroundPosition="center center"}i=$i(idatual+"anterior_-button");if(i){i.style.backgroundImage="url('"+i3GEO.configura.locaplic+"/imagens/player_volta.png')";i.style.backgroundRepeat="no-repeat";i.style.backgroundPosition="center center"}};if(onde){$i(onde).innerHTML=botoes}else{texto=texto+"<br><br>"+botoes}if(!document.getElementById(idatual)){ndiv.id=idatual;ndiv.innerHTML=texto;$i(container).appendChild(ndiv)}ativaBotoes(anterior,proxima,idatual);temp=$i(container).getElementsByTagName("div");nids=temp.length;for(i=0;i<nids;i++){temp[i].style.display="none"}$i(idatual).style.display="block"},dialogoFerramenta:function(mensagem,dir,nome,nomejs,nomefuncao){if(!nomejs){nomejs="index.js"}if(!nomefuncao){nomefuncao="i3GEOF."+nome+".criaJanelaFlutuante();"}var js=i3GEO.configura.locaplic+"/ferramentas/"+dir+"/"+nomejs;if(!$i("i3GEOF."+nome+"_script")){i3GEO.janela.ESTILOAGUARDE="reduzida";i3GEO.janela.abreAguarde("i3GEOF."+nome+"_script"+"aguarde","Carregando JS");i3GEO.util.scriptTag(js,nomefuncao,"i3GEOF."+nome+"_script")}else{i3GEO.util.scriptTag(js,nomefuncao,"i3GEOF."+nome+"_script")}},intersectaBox:function(box1,box2){box1=box1.split(" ");box2=box2.split(" ");var box1i=box2,box2i=box1,coordx,coordy;coordx=box1[0]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true;coordx=box1[0]*1;coordy=box1[3]*1}if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[3]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}box1=box1i;box2=box2i;coordx=box1[0]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true;coordx=box1[0]*1;coordy=box1[3]*1}if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[3]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}return false},abreColourRamp:function(janelaid,elemento,ncores){var janela,ins,novoel,wdocaiframe,temp,fix=false,wsrc=i3GEO.configura.locaplic+"/ferramentas/colourramp/index.php?ncores="+ncores+"&doc="+janelaid+"&elemento="+elemento+"&locaplic="+i3GEO.configura.locaplic,nx="",texto="",id="i3geo_janelaCorRamp",classe="hd";if($i(id)){janela=YAHOO.i3GEO.janela.manager.find(id);janela.show();janela.bringToTop();return}ins='<div id="'+id+'_cabecalho" class="hd">';ins+="<span><img id='i3geo_janelaCorRamp_imagemCabecalho' style='visibility:hidden;' src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde.gif\' /></span>";if(i3GEO&&i3GEO.arvoreDeCamadas){ins+="<div id='i3geo_janelaCorRampComboCabeca' class='comboTemasCabecalho' style='top:0px;'> ------</div>"}ins+=" "+texto;ins+='</div><div id="i3geo_janelaCorRamp_corpo" class="bd" style="padding:5px">';ins+='<iframe name="'+id+'i" id="i3geo_janelaCorRampi" valign="top" ></iframe>';ins+='</div>';novoel=document.createElement("div");novoel.id="i3geo_janelaCorRamp";novoel.style.display="block";novoel.innerHTML=ins;if($i("i3geo")){$i("i3geo").appendChild(novoel)}else{document.body.appendChild(novoel)}wdocaiframe=$i("i3geo_janelaCorRampi");wdocaiframe.style.display="block";wdocaiframe.src=wsrc;wdocaiframe.style.height="380px";wdocaiframe.style.width="100%";wdocaiframe.style.border="0px solid white";if(nx===""||nx==="center"){fix=true}janela=new YAHOO.widget.Panel(id,{height:"430px",modal:false,width:"280px",fixedcenter:fix,constraintoviewport:true,visible:true,iframe:false});YAHOO.i3GEO.janela.manager.register(janela);janela.render();$i(id+'_cabecalho').className=classe;if($i("i3geo_janelaCorRampComboCabeca")){temp=function(){var p,tema=$i("i3geo_janelaCorRampComboCabecaSel").value,funcao=function(retorno){parent.frames["i3geo_janelaCorRampi"].document.getElementById("ncores").value=retorno.data.length};if(tema!==""){i3GEO.mapa.ativaTema(tema);p=i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=editalegenda&opcao=edita&tema="+tema;i3GEO.util.ajaxGet(p,funcao);cp=new cpaint()}};i3GEO.janela.comboCabecalhoTemas("i3geo_janelaCorRampComboCabeca","i3geo_janelaCorRampComboCabecaSel","none","ligados",temp)}},localizai3GEO:function(){var scriptLocation="",scripts=document.getElementsByTagName('script'),i=0,index,ns=scripts.length,src;for(i=0;i<ns;i++){src=scripts[i].getAttribute('src');if(src){index=src.lastIndexOf("/classesjs/i3geo.js");if((index>-1)&&(index+"/classesjs/i3geo.js".length===src.length)){scriptLocation=src.slice(0,-"/classesjs/i3geo.js".length);break}index=src.lastIndexOf("/classesjs/i3geonaocompacto.js");if((index>-1)&&(index+"/classesjs/i3geonaocompacto.js".length===src.length)){scriptLocation=src.slice(0,-"/classesjs/i3geonaocompacto.js".length);break}}}if(i3GEO.configura){i3GEO.configura.locaplic=scriptLocation}return scriptLocation},removeChild:function(id,el){var j=$i(id);if(j){if(!el){el=j.parentNode}el.removeChild(j)}},defineValor:function(id,prop,valor){try{eval("$i('"+id+"')."+prop+"='"+valor+"';")}catch(e){}},in_array:function(x,matriz){var txt=" "+matriz.join(" ")+" ";var er=new RegExp(" "+x+" ","gim");return((txt.match(er))?true:false)},timedProcessArray:function(items,process,callback){var todo=items.concat();setTimeout(function(){var start=+new Date();do{process(todo.shift())}while(todo.length>0&&(+new date()-start<50));if(todo.length>0){setTimeout(arguments.callee,25)}else{callback(items)}},25)},multiStep:function(steps,args,callback){var tasks=steps.concat();setTimeout(function(){var task=tasks.shift(),a=args.shift();task.apply(null,a||[]);if(tasks.length>0){setTimeout(arguments.callee,25)}else{callback()}},25)},tamanhoBrowser:function(){var viewportwidth,viewportheight;if(typeof window.innerWidth!='undefined'){viewportwidth=window.innerWidth,viewportheight=window.innerHeight}else if(typeof document.documentElement!='undefined'&&typeof document.documentElement.clientWidth!='undefined'&&document.documentElement.clientWidth!=0){viewportwidth=document.documentElement.clientWidth,viewportheight=document.documentElement.clientHeight}else{viewportwidth=document.getElementsByTagName('body')[0].clientWidth,viewportheight=document.getElementsByTagName('body')[0].clientHeight}viewportwidth=viewportwidth-i3GEO.util.getScrollerWidth();return[viewportwidth,viewportheight]},detectaTablet:function(){var p,c=DetectaMobile("DetectTierTablet");if(c===false){return false}p=confirm($trad("x73"));if(p){window.location=i3GEO.configura.locaplic+'/interface/'+i3GEO.Interface.ALTTABLET+'?'+i3GEO.configura.sid;return true}},detectaMobile:function(){var p,c=DetectaMobile("DetectMobileLong");if(c===false){return false}p=confirm($trad("x73"));if(p){window.location=i3GEO.configura.locaplic+'/interface/'+i3GEO.Interface.ALTTABLET+'?'+i3GEO.configura.sid;return true}},calculaDPI:function(){var novoel=document.createElement("div"),valor=72;novoel.style.height="1in";novoel.style.left="-100%";novoel.style.position="absolute";novoel.style.top="-100%";novoel.style.width="1in";document.body.appendChild(novoel);if(novoel.offsetHeight){valor=novoel.offsetHeight}document.body.removeChild(novoel);return valor},ajustaDocType:function(){try{if(document.implementation.createDocumentType){var newDoctype=document.implementation.createDocumentType('html','-//W3C//DTD XHTML 1.0 Transitional//EN','http://www.w3.org/TR/html4/loose.dtd');if(document.doctype){document.doctype.parentNode.replaceChild(newDoctype,document.doctype)}}}catch(e){}},versaoNavegador:function(){if(navm&&navigator.userAgent.toLowerCase().indexOf('msie 8.')>-1){return"IE8"}if(navn&&navigator.userAgent.toLowerCase().indexOf('3.')>-1){return"FF3"}return""},decimalPlaces:function(float,length){var ret="",str=float.toString(),array=str.split("."),i;if(array.length==2){ret+=array[0]+".";for(i=0;i<length;i++){if(i>=array[1].length)ret+='0';else ret+=array[1][i]}}else if(array.length==1){ret+=array[0]+".";for(i=0;i<length;i++){ret+='0'}}return ret},ajaxGet:function(sUrl,funcaoRetorno){sUrl=escape(sUrl);re=new RegExp("%3F","g");sUrl=sUrl.replace(re,'?');re=new RegExp("%3D","g");sUrl=sUrl.replace(re,'=');re=new RegExp("%26","g");sUrl=sUrl.replace(re,'&');re=new RegExp("%3A","g");sUrl=sUrl.replace(re,':');var falhou=function(e){},callback={success:function(o){try{funcaoRetorno.call("",YAHOO.lang.JSON.parse(o.responseText))}catch(e){falhou(e)}},failure:falhou,argument:{foo:"foo",bar:"bar"}};YAHOO.util.Connect.asyncRequest("GET",sUrl,callback)},verifica_html5_storage:function(){if(typeof(Storage)!=="undefined"){return true}else{return false}},pegaDadosLocal:function(item){if(i3GEO.util.verifica_html5_storage()&&localStorage[item]){return window.localStorage[item]}else{return false}},limpaDadosLocal:function(item){if(i3GEO.util.verifica_html5_storage()&&localStorage[item]){window.localStorage.clear(item)}},gravaDadosLocal:function(item,valor){if(i3GEO.util.verifica_html5_storage()){window.localStorage[item]=valor;return true}else{return false}},extGeo2OSM:function(ext){if(i3GEO.Interface.openlayers.googleLike===true){var metrica,point,proj900913,projWGS84,temp=ext.split(" ");if(temp[0]*1<=180&&temp[0]*1>=-180){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");point=new OpenLayers.LonLat(temp[0],temp[1]);metrica=point.transform(projWGS84,proj900913);ext=metrica.lon+" "+metrica.lat;point=new OpenLayers.LonLat(temp[2],temp[3]);metrica=point.transform(projWGS84,proj900913);ext+=" "+metrica.lon+" "+metrica.lat}}return ext},extOSM2Geo:function(ext){if(i3GEO.Interface.openlayers.googleLike===true){var metrica,point,proj900913,projWGS84,temp=ext.split(" ");if(temp[0]*1>=180||temp[0]*1<=-180){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");point=new OpenLayers.LonLat(temp[0],temp[1]);metrica=point.transform(proj900913,projWGS84);ext=metrica.lon+" "+metrica.lat;point=new OpenLayers.LonLat(temp[2],temp[3]);metrica=point.transform(proj900913,projWGS84);ext+=" "+metrica.lon+" "+metrica.lat}}return ext},navegadorDir:function(obj,listaShp,listaImg,listaFig){if(!obj){listaShp=true;listaImg=true;listaFig=true}var temp=function(){i3GEOF.navegarquivos.iniciaDicionario(obj,listaShp,listaImg,listaFig)};i3GEO.util.dialogoFerramenta("i3GEO.util.navegadorDir()","navegarquivos","navegarquivos","index.js",temp)},navegadorPostgis:function(obj,conexao,tipo){if(!obj){conexao=""}if(!tipo){tipo="sql"}var temp=function(){i3GEOF.navegapostgis.iniciaDicionario(obj,conexao,tipo)};i3GEO.util.dialogoFerramenta("i3GEO.util.navegadorPostgis()","navegapostgis","navegapostgis","index.js",temp)},base64encode:function(str){var base64EncodeChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var out,i,len;var c1,c2,c3;len=str.length;i=0;out="";while(i<len){c1=str.charCodeAt(i++)&0xff;if(i==len){out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt((c1&0x3)<<4);out+="==";break}c2=str.charCodeAt(i++);if(i==len){out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt(((c1&0x3)<<4)|((c2&0xF0)>>4));out+=base64EncodeChars.charAt((c2&0xF)<<2);out+="=";break}c3=str.charCodeAt(i++);out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt(((c1&0x3)<<4)|((c2&0xF0)>>4));out+=base64EncodeChars.charAt(((c2&0xF)<<2)|((c3&0xC0)>>6));out+=base64EncodeChars.charAt(c3&0x3F)}return out},base64decode:function(str){var base64DecodeChars=new Array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,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,-1,-1,-1,-1,-1,-1,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,-1,-1,-1,-1,-1);var c1,c2,c3,c4;var i,len,out;len=str.length;i=0;out="";while(i<len){do{c1=base64DecodeChars[str.charCodeAt(i++)&0xff]}while(i<len&&c1==-1);if(c1==-1)break;do{c2=base64DecodeChars[str.charCodeAt(i++)&0xff]}while(i<len&&c2==-1);if(c2==-1)break;out+=String.fromCharCode((c1<<2)|((c2&0x30)>>4));do{c3=str.charCodeAt(i++)&0xff;if(c3==61)return out;c3=base64DecodeChars[c3]}while(i<len&&c3==-1);if(c3==-1)break;out+=String.fromCharCode(((c2&0XF)<<4)|((c3&0x3C)>>2));do{c4=str.charCodeAt(i++)&0xff;if(c4==61)return out;c4=base64DecodeChars[c4]}while(i<len&&c4==-1);if(c4==-1)break;out+=String.fromCharCode(((c3&0x03)<<6)|c4)}return out}};try{YAHOO.namespace("lutsr");YAHOO.lutsr.accordion={properties:{animation:true,animationDuration:10,multipleOpen:false,Id:"sanfona",altura:200,ativa:0},init:function(animation,animationDuration,multipleOpen,Id,altura,ativa){if(animation){this.properties.animation=animation}if(animationDuration){this.properties.animationDuration=animationDuration}if(multipleOpen){this.properties.multipleOpen=multipleOpen}if(Id){this.properties.Id=Id}if(altura){this.properties.altura=altura}if(ativa){this.properties.ativa=ativa}var accordionObject=document.getElementById(this.properties.Id),headers;if(accordionObject){if(accordionObject.nodeName==="DL"){headers=accordionObject.getElementsByTagName("dt");this.attachEvents(headers,0)}}},attachEvents:function(headers,nr){var i,headerProperties,parentObj,header;for(i=0;i<headers.length;i++){headerProperties={objRef:headers[i],nr:i,jsObj:this};YAHOO.util.Event.addListener(headers[i],"click",this.clickHeader,headerProperties)}parentObj=headers[this.properties.ativa].parentNode;headers=parentObj.getElementsByTagName("dd");header=headers[this.properties.ativa];this.expand(header)},clickHeader:function(e,headerProperties){var parentObj=headerProperties.objRef.parentNode,headers=parentObj.getElementsByTagName("dd"),header=headers[headerProperties.nr],i;if(YAHOO.util.Dom.hasClass(header,"open")){headerProperties.jsObj.collapse(header)}else{if(headerProperties.jsObj.properties.multipleOpen){headerProperties.jsObj.expand(header)}else{for(i=0;i<headers.length;i++){if(YAHOO.util.Dom.hasClass(headers[i],"open")){headerProperties.jsObj.collapse(headers[i])}}headerProperties.jsObj.expand(header)}}},collapse:function(header){YAHOO.util.Dom.removeClass(YAHOO.util.Dom.getPreviousSibling(header),"selected");if(!this.properties.animation){YAHOO.util.Dom.removeClass(header,"open")}else{this.initAnimation(header,"close")}},expand:function(header){YAHOO.util.Dom.addClass(YAHOO.util.Dom.getPreviousSibling(header),"selected");if(!this.properties.animation){YAHOO.util.Dom.addClass(header,"open")}else{this.initAnimation(header,"open")}},initAnimation:function(header,dir){var attributes,animation,animationEnd;if(dir==="open"){YAHOO.util.Dom.setStyle(header,"visibility","hidden");YAHOO.util.Dom.setStyle(header,"height",this.properties.altura);YAHOO.util.Dom.addClass(header,"open");attributes={height:{from:0,to:this.properties.altura}};YAHOO.util.Dom.setStyle(header,"height",0);YAHOO.util.Dom.setStyle(header,"visibility","visible");animation=new YAHOO.util.Anim(header,attributes);animationEnd=function(){header.style.height=this.properties.altura+"px"};animation.duration=this.properties.animationDuration;animation.useSeconds=false;animation.onComplete.subscribe(animationEnd);animation.animate()}else if("close"){attributes={height:{to:0}};animationEnd=function(){YAHOO.util.Dom.removeClass(header,"open")};animation=new YAHOO.util.Anim(header,attributes);animation.duration=this.properties.animationDuration;animation.useSeconds=false;animation.onComplete.subscribe(animationEnd);animation.animate()}}}}catch(e){}$im=function(g){return i3GEO.util.$im(g)};$inputText=function(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch){if(arguments.length===6){nome=""}return i3GEO.util.$inputText(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch)};$top=function(id,valor){i3GEO.util.$top(id,valor)};$left=function(id,valor){i3GEO.util.$left(id,valor)}; | |
| 45 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}navm=false;navn=false;chro=navigator.userAgent.toLowerCase().indexOf('chrome')>-1;opera=navigator.userAgent.toLowerCase().indexOf('opera')>-1;if(navigator.appName.substring(0,1)==='N'){navn=true}if(navigator.appName.substring(0,1)==='M'){navm=true}if(opera===true){navn=true}g_operacao="";g_tipoacao="zoomli";$i=function(id){return document.getElementById(id)};Array.prototype.remove=function(s){try{var n=this.length,i;for(i=0;i<n;i++){if(this[i]==s){this.splice(i,1)}}}catch(e){}};i3GEO.util={PINS:[],BOXES:[],escapeURL:function(sUrl){var re;sUrl=escape(sUrl);re=new RegExp("%3F","g");sUrl=sUrl.replace(re,'?');re=new RegExp("%3D","g");sUrl=sUrl.replace(re,'=');re=new RegExp("%26","g");sUrl=sUrl.replace(re,'&');return sUrl},insereCookie:function(nome,valor,expira){if(!expira){expira=10}var exdate=new Date();exdate.setDate(exdate.getDate()+expira);document.cookie=nome+"="+valor+"; expires="+exdate.toUTCString()+";path=/"},pegaCookie:function(nome){var cookies,i,fim;cookies=document.cookie;i=cookies.indexOf(nome);if(i===-1){return null}fim=cookies.indexOf(";",i);if(fim===-1){fim=cookies.length}return(unescape(cookies.substring(i,fim))).split("=")[1]},listaChaves:function(obj){var keys,key="";keys=[];for(key in obj){if(obj[key]){keys.push(key)}}return keys},listaTodasChaves:function(obj){var keys,key="";keys=[];for(key in obj){keys.push(key)}return keys},criaBotaoAplicar:function(nomeFuncao,titulo,classe,obj){try{if(typeof(tempoBotaoAplicar)!=='undefined'){clearTimeout(tempoBotaoAplicar)}}catch(e){}var executar=new Function(nomeFuncao+"().call;clearTimeout(tempoBotaoAplicar);"),novoel,xy;tempoBotaoAplicar=setTimeout(executar,(i3GEO.configura.tempoAplicar));if(arguments.length===1){titulo="Aplicar"}if(arguments.length===1||arguments.length===2){classe="i3geoBotaoAplicar"}if(!document.getElementById("i3geo_aplicar")){novoel=document.createElement("input");novoel.id='i3geo_aplicar';novoel.type='button';novoel.value=titulo;novoel.style.cursor="pointer";novoel.style.fontSize="10px";novoel.style.zIndex=15000;novoel.style.position="absolute";novoel.style.display="none";novoel.onmouseover=function(){this.style.display="block"};novoel.onmouseout=function(){this.style.display="none"};novoel.className=classe;document.body.appendChild(novoel)}else{novoel=document.getElementById("i3geo_aplicar")}novoel.onclick=function(){clearTimeout(i3GEO.parametros.tempo);i3GEO.parametros.tempo="";this.style.display='none';eval(nomeFuncao+"\(\)")};if(arguments.length===4){novoel.style.display="block";xy=YAHOO.util.Dom.getXY(obj);YAHOO.util.Dom.setXY(novoel,xy)}return(novoel)},arvore:function(titulo,onde,obj){var arvore,root,tempNode,d,criaNo;if(!$i(onde)){return}arvore=new YAHOO.widget.TreeView(onde);root=arvore.getRoot();try{tempNode=new YAHOO.widget.TextNode('',root,false);tempNode.isLeaf=false;tempNode.enableHighlight=true}catch(e){}titulo="<table><tr><td><b>"+titulo+"</b></td><td></td></tr></table>";d={html:titulo};tempNode=new YAHOO.widget.HTMLNode(d,root,true,true);tempNode.enableHighlight=true;criaNo=function(obj,noDestino){var trad,i,j,linha,conteudo,temaNode,c=obj.propriedades.length;for(i=0,j=c;i<j;i++){linha=obj.propriedades[i];if(linha.url!==""){trad=$trad(linha.text);if(!trad){trad=linha.text}conteudo="<a href='#' onclick='"+linha.url+"'>"+trad+"</a>"}else{conteudo=linha.text}d={html:conteudo};temaNode=new YAHOO.widget.HTMLNode(d,noDestino,false,true);temaNode.enableHighlight=false;if(obj.propriedades[i].propriedades){criaNo(obj.propriedades[i],temaNode)}}};criaNo(obj,tempNode);arvore.collapseAll();arvore.draw();return arvore},removeAcentos:function(palavra){var re;re=/á|à|ã|â/gi;palavra=palavra.replace(re,"a");re=/é|ê/gi;palavra=palavra.replace(re,"e");re=/í/gi;palavra=palavra.replace(re,"i");re=/ó|õ|ô/gi;palavra=palavra.replace(re,"o");re=/ç/gi;palavra=palavra.replace(re,"c");re=/ú/gi;palavra=palavra.replace(re,"u");return(palavra)},protocolo:function(){var u=window.location.href;u=u.split(":");return(u[0])},pegaPosicaoObjeto:function(obj){if(obj){if(!obj.style){return[0,0]}var curleft=0,curtop=0;if(obj){if(obj.offsetParent){do{curleft+=obj.offsetLeft-obj.scrollLeft;curtop+=obj.offsetTop-obj.scrollTop;obj=obj.offsetParent}while(obj)}}return[curleft+document.body.scrollLeft,curtop+document.body.scrollTop]}else{return[0,0]}},pegaElementoPai:function(e){var targ=document;if(!e){e=window.event}if(e.target){targ=e.target}else{if(e.srcElement){targ=e.srcElement}}if(targ.nodeType===3){targ=targ.parentNode}if(targ.parentNode){tparent=targ.parentNode;return(tparent)}else{return targ}},mudaCursor:function(cursores,tipo,idobjeto,locaplic){var os=[],o,i,c="",n,cursor="",ext=".ff";try{if(navm){ext=".ie"}os.push(document.getElementById(idobjeto));if(i3GEO.Interface.ATUAL==="openlayers"){os=YAHOO.util.Dom.getElementsByClassName('olTileImage','img')}if(i3GEO.Interface.ATUAL==="googlemaps"){os=document.getElementById(idobjeto).firstChild;os=os.getElementsByTagName("div")}n=os.length;if(tipo==="default"||tipo==="pointer"||tipo==="crosshair"||tipo==="help"||tipo==="move"||tipo==="text"){cursor=tipo}else{c=eval("cursores."+tipo+ext)}if(c==="default"||c==="pointer"||c==="crosshair"||c==="help"||c==="move"||c==="text"){cursor=c}if(cursor===""){cursor="URL(\""+locaplic+eval("cursores."+tipo+ext)+"\"),auto"}for(i=0;i<n;i++){o=os[i];if(o){o.style.cursor=cursor}}}catch(e){}},criaBox:function(id){if(arguments.length===0){id="boxg"}if(!$i(id)){var novoel=document.createElement("div");novoel.id=id;novoel.style.zIndex=1;novoel.innerHTML='<font face="Arial" size=0></font>';document.body.appendChild(novoel);novoel.onmouseover=function(){novoel.style.display='none'};novoel.onmouseout=function(){novoel.style.display='block'};i3GEO.util.BOXES.push(id)}else{$i(id).style.display="block"}},escondeBox:function(){var l,i;l=i3GEO.util.BOXES.length;for(i=0;i<l;i++){if($i(i3GEO.util.BOXES[i])){$i(i3GEO.util.BOXES[i]).style.display="none"}}},criaPin:function(id,imagem,w,h,mouseover){if(arguments.length<1||id===""){id="boxpin"}if(arguments.length<2||imagem===""){imagem=i3GEO.configura.locaplic+'/imagens/marker.png'}if(arguments.length<3||w===""){w=21}if(arguments.length<4||h===""){h=25}if(!$i(id)){var novoel=document.createElement("img");novoel.style.zIndex=10000;novoel.style.position="absolute";novoel.style.width=parseInt(w,10)+"px";novoel.style.height=parseInt(h,10)+"px";novoel.style.top="0px";novoel.style.left="0px";novoel.src=imagem;novoel.id=id;if(id==="boxpin"){novoel.onmouseover=function(){$i("boxpin").style.display="none"}}else if(mouseover){novoel.onmouseover=mouseover}document.body.appendChild(novoel);i3GEO.util.PINS.push(id)}$i(id).style.display="block"},posicionaImagemNoMapa:function(id,x,y){var i,mx,my;if(x&&x!=""){objposicaocursor.telax=x}if(y&&y!=""){objposicaocursor.telay=y}i=$i(id);mx=parseInt(i.style.width,10)/2;my=parseInt(i.style.height,10)/2;i.style.top=objposicaocursor.telay-my+"px";i.style.left=objposicaocursor.telax-mx+"px";return[objposicaocursor.telay-my,objposicaocursor.telax-mx]},escondePin:function(){var l,i;l=i3GEO.util.PINS.length;for(i=0;i<l;i++){if($i(i3GEO.util.PINS[i])){$i(i3GEO.util.PINS[i]).style.display="none"}}},$im:function(g){return i3GEO.configura.locaplic+"/imagens/visual/default/"+g},$inputText:function(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch){if(arguments.length===6){nome=""}if(idPai!==""){if(larguraIdPai!==""){$i(idPai).style.width=larguraIdPai+"px"}$i(idPai).style.padding="3";$i(idPai).style.textAlign="center"}if(!onch){onch=""}return"<span class=digitar onmouseover='javascript:this.className=\"digitarOver\";' onmouseout='javascript:this.className=\"digitar\";' ><input onchange=\""+onch+"\" tabindex='0' onclick='javascript:this.select();' id='"+idInput+"' title='"+titulo+"' type='text' size='"+digitos+"' class='digitar' value='"+valor+"' name='"+nome+"' /></span>"},$inputTextMudaCor:function(obj){var n=obj.value.split(" ");obj.style.color="rgb("+n[0]+","+n[1]+","+n[2]+")"},$top:function(id,valor){if(document.getElementById(id).style){if(document.getElementById(id).style.pixelTop){document.getElementById(id).style.pixelTop=valor}else{document.getElementById(id).style.top=valor+"px"}}},$left:function(id,valor){if(document.getElementById(id).style){if(document.getElementById(id).style.pixelLeft){document.getElementById(id).style.pixelLeft=valor}else{document.getElementById(id).style.left=valor+"px"}}},insereMarca:{CONTAINER:[],cria:function(xi,yi,funcaoOnclick,container,texto,srci,w,h){if(!w){w=5}if(!h){h=5}if(!srci||srci===""){srci=i3GEO.configura.locaplic+"/imagens/dot2.gif"}if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.insereMarca(texto,xi,yi,container);return}try{var novoel,i,novoimg,temp;if(i3GEO.util.insereMarca.CONTAINER.toString().search(container)<0){i3GEO.util.insereMarca.CONTAINER.push(container)}if(!$i(container)){novoel=document.createElement("div");novoel.id=container;i=novoel.style;i.position="absolute";if($i(i3GEO.Interface.IDCORPO)){i.top=parseInt($i(i3GEO.Interface.IDCORPO).style.top,10)+"px";i.left=parseInt($i(i3GEO.Interface.IDCORPO).style.left,10)+"px"}else{i.top=parseInt($i(i3GEO.Interface.IDMAPA).style.top,10)+"px";i.left=parseInt($i(i3GEO.Interface.IDMAPA).style.left,10)+"px"}document.body.appendChild(novoel)}container=$i(container);novoel=document.createElement("div");i=novoel.style;i.position="absolute";i.zIndex=2000;i.top=(yi-(h/2))+"px";i.left=(xi-(w/2))+"px";i.width=w+"px";i.height=h+"px";novoimg=document.createElement("img");if(funcaoOnclick!==""){novoimg.onclick=funcaoOnclick}else{novoimg.onclick=function(){i3GEO.util.insereMarca.limpa()}}novoimg.src=srci;temp=novoimg.style;temp.width=w+"px";temp.height=h+"px";temp.zIndex=2000;novoel.appendChild(novoimg);container.appendChild(novoel);if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.util.insereMarca.limpa()")<0){i3GEO.eventos.NAVEGAMAPA.push("i3GEO.util.insereMarca.limpa()")}}catch(e){i3GEO.janela.tempoMsg("Ocorreu um erro. inseremarca"+e)}},limpa:function(){try{var n,i;n=i3GEO.util.insereMarca.CONTAINER.length;for(i=0;i<n;i++){if($i(i3GEO.util.insereMarca.CONTAINER[i])){$i(i3GEO.util.insereMarca.CONTAINER[i]).innerHTML=""}}i3GEO.util.insereMarca.CONTAINER=[];i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.util.insereMarca.limpa()")}catch(e){}}},adicionaSHP:function(path){var temp=path.split(".");if((temp[1]==="SHP")||(temp[1]==="shp")){i3GEO.php.adicionaTemaSHP(i3GEO.atualiza,path)}else{i3GEO.php.adicionaTemaIMG(i3GEO.atualiza,path)}},abreCor:function(janelaid,elemento,tipo){if(!i3GEO.configura){i3GEO.configura={locaplic:"../"}}if(arguments.length===2){tipo="rgb"}var janela,ins,novoel,wdocaiframe,wsrc=i3GEO.configura.locaplic+"/ferramentas/colorpicker/index.htm?doc="+janelaid+"&elemento="+elemento+"&tipo="+tipo,texto="Cor",id="i3geo_janelaCor",classe="hd";if($i(id)){YAHOO.i3GEO.janela.manager.find(id).show();return}ins='<div id="'+id+'_cabecalho" class="hd">';ins+="<span><img id='i3geo_janelaCor_imagemCabecalho' style='visibility:hidden;' src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde.gif\' /></span>";ins+=texto;ins+='</div><div id="i3geo_janelaCor_corpo" class="bd" style="padding:5px">';if(wsrc!==""){ins+='<iframe name="'+id+'i" id="i3geo_janelaCori" valign="top" style="height:230px,border:0px white solid"></iframe>'}ins+='</div>';novoel=document.createElement("div");novoel.id="i3geo_janelaCor";novoel.style.display="block";novoel.innerHTML=ins;if($i("i3geo")){$i("i3geo").appendChild(novoel)}else{document.body.appendChild(novoel)}wdocaiframe=$i("i3geo_janelaCori");if(wdocaiframe){wdocaiframe.style.display="block";wdocaiframe.src=wsrc;wdocaiframe.style.height="230px";wdocaiframe.style.width="325px";wdocaiframe.style.border="0px solid white"}janela=new YAHOO.widget.Panel(id,{height:"290px",modal:false,width:"350px",fixedcenter:true,constraintoviewport:false,visible:true,iframe:false});YAHOO.i3GEO.janela.manager.register(janela);janela.render();$i(id+'_cabecalho').className=classe},ajaxhttp:function(){var objhttp1;try{objhttp1=new XMLHttpRequest()}catch(ee){try{objhttp1=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{objhttp1=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){objhttp1=false}}}return(objhttp1)},ajaxexecASXml:function(programa,funcao){var h,ohttp;if(programa.search("http")===0){h=window.location.host;if(programa.search(h)<0){alert("OOps! Nao e possivel chamar um XML de outro host.\nContacte o administrador do sistema.\nConfigure corretamente o ms_configura.php");return}}ohttp=i3GEO.util.ajaxhttp();ohttp.open("GET",programa,true);ohttp.onreadystatechange=function(){var retorno,parser,dom;if(ohttp.readyState===4){retorno=ohttp.responseText;if(retorno!==undefined){if(document.implementation.createDocument){parser=new DOMParser();dom=parser.parseFromString(retorno,"text/xml")}else{dom=new ActiveXObject("Microsoft.XMLDOM");dom.async="false";dom.load(programa)}}else{return"erro"}if(funcao!=="volta"){eval(funcao+'(dom)')}else{return dom}}};ohttp.send(null)},aparece:function(id,tempo,intervalo){var n,obj,opacidade,fadei=0,tempoFadei=null;n=parseInt(tempo/intervalo,10);obj=$i(id);if(n===1){obj.style.display="block";if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}}tempo=n*intervalo;intervalo=(intervalo*100)/tempo;opacidade=0;if(navm){obj.style.filter='alpha(opacity=0)'}else{obj.style.opacity=0}obj.style.display="block";fadei=function(){opacidade+=intervalo;if(navm){obj.style.filter='alpha(opacity='+opacidade+')'}else{obj.style.opacity=opacidade/100}if(opacidade<100){tempoFadei=setTimeout(fadei,tempo)}else{if(tempoFadei){clearTimeout(tempoFadei)}if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}}};tempoFadei=setTimeout(fadei,tempo)},desaparece:function(id,tempo,intervalo,removeobj){var n,obj,opacidade,fade=0,p,tempoFade=null;n=parseInt(tempo/intervalo,10);obj=$i(id);if(n===1){obj.style.display="none";if(removeobj){p=obj.parentNode;if(p){p.removeChild(obj)}}return}tempo=n*intervalo;intervalo=(intervalo*100)/tempo;opacidade=100;if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}obj.style.display="block";fade=function(){opacidade-=intervalo;if(navm){obj.style.filter='alpha(opacity='+opacidade+')'}else{obj.style.opacity=opacidade/100}if(opacidade>0){tempoFade=setTimeout(fade,tempo)}else{if(tempoFade){clearTimeout(tempoFade)}obj.style.display="none";if(navm){obj.style.filter='alpha(opacity=100)'}else{obj.style.opacity=1}if(removeobj){p=obj.parentNode;if(p){p.removeChild(obj)}}}};tempoFade=setTimeout(fade,tempo)},wkt2ext:function(wkt,tipo){var re,x,y,w,xMin,xMax,yMin,yMax,temp;tipo=tipo.toLowerCase();ext=false;if(tipo==="polygon"){try{re=new RegExp("POLYGON","g");wkt=wkt.replace(re,"");wkt=wkt.split("(")[2].split(")")[0];wkt=wkt.split(",");x=[];y=[];for(w=0;w<wkt.length;w++){temp=wkt[w].split(" ");x.push(temp[0]);y.push(temp[1])}x.sort(i3GEO.util.sortNumber);xMin=x[0];xMax=x[(x.length)-1];y.sort(i3GEO.util.sortNumber);yMin=y[0];yMax=y[(y.length)-1];return xMin+" "+yMin+" "+xMax+" "+yMax}catch(e){}}if(tipo==="point"){try{re=new RegExp("POINT","g");wkt=wkt.replace(re,"");wkt=wkt.split("(")[1].split(")")[0];wkt=wkt.split(" ");return(wkt[0]*1-0.01)+" "+(wkt[1]*1-0.01)+" "+(wkt[0]*1+0.01)+" "+(wkt[1]*1+0.01)}catch(e){}}return ext},sortNumber:function(a,b){return a-b},getScrollerWidth:function(){var scr=null,inn=null,wNoScroll=0,wScroll=0;scr=document.createElement('div');scr.style.position='absolute';scr.style.top='-1000px';scr.style.left='-1000px';scr.style.width='100px';scr.style.height='50px';scr.style.overflow='hidden';inn=document.createElement('div');inn.style.width='100%';inn.style.height='200px';scr.appendChild(inn);document.body.appendChild(scr);wNoScroll=inn.offsetWidth;scr.style.overflow='auto';wScroll=inn.offsetWidth;document.body.removeChild(document.body.lastChild);return(wNoScroll-wScroll)},getScrollHeight:function(){var mx=Math.max,d=document;return mx(mx(d.body.scrollHeight,d.documentElement.scrollHeight),mx(d.body.offsetHeight,d.documentElement.offsetHeight),mx(d.body.clientHeight,d.documentElement.clientHeight))},scriptTag:function(js,ini,id,aguarde){if(!aguarde){aguarde=false}var head,script,tipojanela=i3GEO.janela.ESTILOAGUARDE;if(!$i(id)||id===""){if(i3GEO.janela&&aguarde===true){i3GEO.janela.ESTILOAGUARDE="reduzida";i3GEO.janela.abreAguarde(id+"aguarde","Carregando JS")}head=document.getElementsByTagName('head')[0];script=document.createElement('script');script.type='text/javascript';if(ini!==""){if(navm){script.onreadystatechange=function(){if(this.readyState==='loaded'||this.readyState==='complete'){if(i3GEO.janela){i3GEO.janela.fechaAguarde(id+"aguarde")}if(YAHOO.lang.isFunction(ini)){ini.call()}else{eval(ini)}}}}else{script.onload=function(){if(i3GEO.janela){i3GEO.janela.fechaAguarde(id+"aguarde")}if(YAHOO.lang.isFunction(ini)){ini.call()}else{eval(ini)}}}i3GEO.janela.ESTILOAGUARDE=tipojanela}script.src=js;if(id!==""){script.id=id}head.appendChild(script)}else{if(ini!==""){if(YAHOO.lang.isFunction(ini)){ini.call()}else{eval(ini)}}}},removeScriptTag:function(id){try{old=$i("loadscriptI3GEO");if(old!==null){old.parentNode.removeChild(old);old=null;eval(id+" = null;")}old=$i(id);if(old!==null){old.parentNode.removeChild(old)}}catch(erro){}},verificaScriptTag:function(texto){var s=document.getElementsByTagName("script"),n=s.length,i,t;try{for(i=0;i<n;i++){t=s[i].id;t=t.split(".");if(t[2]&&t[2]=="dicionario_script"){return false}if(t[0]===texto){return true}}return false}catch(e){return false}},mensagemAjuda:function(onde,texto){var ins="<table style='width:100%;padding:2;vertical-align:top;background-color:#ffffff;' ><tr><th style='background-color: #cedff2; font-family:Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; border: 1px solid #B1CDEB; text-align: left; padding-left: 7px;padding-right: 11px;'>";ins+='<div style="float:right"><img src="'+i3GEO.configura.locaplic+'/imagens/question.gif" /></div>';ins+='<div style="text-align:left;">';if(texto===""){texto=$i(onde).innerHTML}ins+=texto;ins+='</div></th></tr></table>';if(onde!==""){$i(onde).innerHTML=ins}else{return(ins)}},randomRGB:function(){var v=Math.random(),r=parseInt(255*v,10),g;v=Math.random();g=parseInt(255*v,10);v=Math.random();b=parseInt(255*v,10);return(r+","+g+","+b)},rgb2hex:function(str){var re=new RegExp(" ","g"),rgb=str.replace(re,',');return YAHOO.util.Dom.Color.toHex("rgb("+rgb+")")},comboTemas:function(id,funcao,onde,nome,multiplo,tipoCombo,estilo,yui){if(onde&&onde!==""){i3GEO.util.defineValor(onde,"innerHTML","<span style=color:red;font-size:10px; >buscando temas...</span>")}if(!nome){nome=""}if(!multiplo){multiplo=false}if(!estilo||estilo==""){estilo="font-size: 12px;width: 95%;"}if(!yui){yui=false}var monta,temp,temp1,temp2;monta=function(retorno){var i,comboTemas='',n,nome="";if(yui===true){comboTemas='<input type="button" name='+id+'_button id="'+id+'" value="'+$trad("x33")+' ">';id=id+"select";nome=id}if(retorno!==undefined){if(retorno.data){retorno=retorno.data}n=retorno.length;if(n>0){if(multiplo){comboTemas+="<select style='"+estilo+"' id='"+id+"' size='4' multiple='multiple' name='"+nome+"'>"}else{comboTemas+="<select style='"+estilo+"' id='"+id+"' name='"+nome+"'>"}if(yui===false){comboTemas+="<option value=''>----</option>"}for(i=0;i<n;i++){if(retorno[i].nome){nome=retorno[i].nome;tema=retorno[i].tema}else{nome=retorno[i].tema;tema=retorno[i].name}if(retorno[i].escondido!=="sim"){comboTemas+="<option value="+tema+" >"+nome+"</option>"}}comboTemas+="</select>";temp={dados:comboTemas,tipo:"dados"}}else{if(tipoCombo==="poligonosSelecionados"||tipoCombo==="selecionados"||tipoCombo==="pontosSelecionados"){temp={dados:'<div class=alerta >Nenhum tema encontrado. <span style=cursor:pointer;color:blue onclick="i3GEO.mapa.dialogo.selecao()" > Selecionar...</span></div>',tipo:"mensagem"}}else{temp={dados:'<div class=alerta >Nenhum tema encontrado. </div>',tipo:"mensagem"}}}}else{temp={dados:"<p style=color:red >Ocorreu um erro<br>",tipo:"erro"}}eval("funcao(temp);")};if(tipoCombo==="ligados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemas(monta,"ligados",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="ligadosComTabela"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS);temp1=i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"menor",temp);temp2=i3GEO.arvoreDeCamadas.filtraCamadas("type",8,"igual",temp);monta(temp1.concat(temp2))}else{i3GEO.php.listaTemas(monta,"ligados",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="locais"){i3GEO.php.listaTemasEditaveis(monta,i3GEO.configura.locaplic,i3GEO.configura.sid)}if(tipoCombo==="editavel"){temp=i3GEO.arvoreDeCamadas.filtraCamadas("editavel","SIM","igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(temp)}if(tipoCombo==="selecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemasComSel(monta,i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="raster"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listatemasTipo(monta,"raster",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoCombo==="pontosSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="pontos"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="poligonos"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="poligonosSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="naolinearSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",1,"diferente",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo==="linhaDoTempo"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("linhadotempo","sim","igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}if(tipoCombo===""){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type","","diferente",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.janela.tempoMsg($trad("x13"))}}},checkCombo:function(id,nomes,valores,estilo,funcaoclick,ids,idschecked){var temp,i,combo="",n=valores.length;if(n>0){combo="<div style='"+estilo+"'><table class=lista3 id="+id+" >";for(i=0;i<n;i++){temp="";if(idschecked&&idschecked[i]){temp="checked"}if(!ids){combo+="<tr><td><input "+temp+" onclick="+funcaoclick+" size=2 style='top:1px;cursor:pointer' type=checkbox value='"+valores[i]+"' /></td><td>"+nomes[i]+"</td>"}else{combo+="<tr><td><input "+temp+" id="+ids[i]+" onclick="+funcaoclick+" size=2 style='top:1px;cursor:pointer' type=checkbox value='"+valores[i]+"' /></td><td>"+nomes[i]+"</td>"}}combo+="</table></div>"}return combo},valoresCheckCombo:function(id){var el=$i(id),res=[],n,i;if(el){el=el.getElementsByTagName("input");n=el.length;for(i=0;i<n;i++){if(el[i].checked===true){res.push(el[i].value)}}}return res},checkTemas:function(id,funcao,onde,nome,tipoLista,prefixo,size){if(arguments.length>2){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando temas...</span>"}if(arguments.length===3){nome=""}var monta,temp,temp1,n,i;monta=function(retorno){try{var i,comboTemas,n,nome;if(retorno!==undefined){if(retorno.data){retorno=retorno.data}n=retorno.length;if(n>0){comboTemas="<table class=lista3 >";for(i=0;i<n;i++){if(retorno[i].nome){nome=retorno[i].nome;tema=retorno[i].tema}else{nome=retorno[i].tema;tema=retorno[i].name}comboTemas+="<tr><td><input size=2 style='cursor:pointer' type=checkbox name='"+tema+"' /></td>";comboTemas+="<td> <input style='text-align:left;width:"+size+" cursor:text;' onclick='javascript:this.select();' id='"+prefixo+tema+"' type=text value='"+nome+"' /></td></tr>"}comboTemas+="</table>";temp={dados:comboTemas,tipo:"dados"}}else{temp={dados:'<div class=alerta >Nenhum tema encontrado.</div>',tipo:"mensagem"}}}else{temp={dados:"<p style=color:red >Ocorreu um erro<br>",tipo:"erro"}}eval("funcao(temp);")}catch(e){}};if(tipoLista==="ligados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemas(monta,"ligados",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoLista==="selecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listaTemasComSel(monta,i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoLista==="raster"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{i3GEO.php.listatemasTipo(monta,"raster",i3GEO.configura.locaplic,i3GEO.configura.sid)}}if(tipoLista==="polraster"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",3,"igual",i3GEO.arvoreDeCamadas.CAMADAS);temp1=i3GEO.arvoreDeCamadas.filtraCamadas("type",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS);n=temp1.length;for(i=0;i<n;i++){temp.push(temp1[i])}monta(temp)}else{alert($trad("x13"))}}if(tipoLista==="pontosSelecionados"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){temp=i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS);monta(i3GEO.arvoreDeCamadas.filtraCamadas("sel","sim","igual",temp))}else{alert($trad("x13"))}}if(tipoLista==="pontos"){if(i3GEO.arvoreDeCamadas.CAMADAS!==""){monta(i3GEO.arvoreDeCamadas.filtraCamadas("type",0,"igual",i3GEO.arvoreDeCamadas.CAMADAS))}else{alert($trad("x13"))}}},comboItens:function(id,tema,funcao,onde,nome,alias){if(!alias){alias="sim"}if(arguments.length>3){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando itens...</span>"}if(arguments.length!==5){nome=""}var monta=function(retorno){var ins,temp,i,nm;if(retorno.data!==undefined){ins=[];ins.push("<select id='"+id+"' name='"+nome+"'>");ins.push("<option value='' >---</option>");temp=retorno.data.valores.length;for(i=0;i<temp;i++){if(retorno.data.valores[i].tema===tema){if(alias=="sim"){nm=retorno.data.valores[i].alias;if(nm===""){nm=retorno.data.valores[i].item}}else{nm=retorno.data.valores[i].item}ins.push("<option value='"+retorno.data.valores[i].item+"' >"+nm+"</option>")}}ins.push("</select>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"}}eval("funcao(temp)")};i3GEO.php.listaItensTema(monta,tema)},comboValoresItem:function(id,tema,itemTema,funcao,onde){if(arguments.length===5){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando valores...</span>"}var monta=function(retorno){var ins=[],i,pares,j;if(retorno.data!==undefined){ins.push("<select id="+id+" >");ins.push("<option value='' >---</option>");for(i=0;i<retorno.data[1].registros.length;i++){pares=retorno.data[1].registros[i].valores;for(j=0;j<pares.length;j++){ins.push("<option value='"+pares[j].valor+"' >"+pares[j].valor+"</option>")}}ins.push("</select>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >Ocorreu um erro</erro>',tipo:"erro"}}eval("funcao(temp)")};i3GEO.php.listaValoresItensTema(monta,tema,itemTema)},comboFontes:function(id,onde){$i(onde).innerHTML="<span style=color:red >buscando fontes...</span>";var monta=function(retorno){var ins="",temp,i,dados;if(retorno.data!==undefined){ins+="<select id='"+id+"'>";ins+="<option value='bitmap' >bitmap</option>";dados=retorno.data.split(",");temp=dados.length;for(i=0;i<temp;i++){ins+="<option value='"+dados[i]+"' >"+dados[i]+"</option>"}ins+="</select>"}$i(onde).innerHTML=ins};i3GEO.php.listaFontesTexto(monta)},comboSimNao:function(id,selecionado){var combo="<select name="+id+" id="+id+" >";combo+="<option value='' >---</option>";if(selecionado.toLowerCase()==="sim"){combo+="<option value=TRUE selected >"+$trad("x14")+"</option>"}else{combo+="<option value=TRUE >"+$trad("x14")+"</option>"}if(selecionado==="nao"){combo+="<option value=FALSE selected >"+$trad("x15")+"</option>"}else{combo+="<option value=FALSE >"+$trad("x15")+"</option>"}combo+="</select>";return(combo)},checkItensEditaveis:function(tema,funcao,onde,size,prefixo,ordenacao){if(!ordenacao||ordenacao==""){ordenacao=="nao"}if(onde!==""){$i(onde).innerHTML="<span style=color:red;font-size:10px; >"+$trad("x65")+"</span>"}var monta=function(retorno){var ins=[],i,temp,n;if(retorno.data!==undefined){if(ordenacao==="sim"){ins.push("<table class=lista3 ><tr><td></td><td>"+$trad("x64")+"</td><td>Ordem</td>")}else{ins.push("<table class=lista3 ><tr><td></td><td>"+$trad("x64")+"</td><td></td>")}n=retorno.data.valores.length;for(i=0;i<n;i++){ins.push("<tr><td><input size=2 style='cursor:pointer' name='"+retorno.data.valores[i].tema+"' type=checkbox id='"+prefixo+retorno.data.valores[i].item+"' /></td>");ins.push("<td><input style='text-align:left;cursor:text;width:"+size+"' onclick='javascript:this.select();' id='"+prefixo+retorno.data.valores[i].item+retorno.data.valores[i].tema+"' type=text value='"+retorno.data.valores[i].item+"' /></td>");if(ordenacao==="sim"){ins.push("<td><input style='text-align:left; cursor:text;' id='ordem_"+prefixo+retorno.data.valores[i].item+retorno.data.valores[i].tema+"' type=text size='3' value='"+i+"' /></td>")}else{ins.push("<td></td>")}ins.push("</tr>")}ins.push("</table>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >'+$trad("x66")+'</div>',tipo:"erro"}}funcao.call(this,temp)};i3GEO.php.listaItensTema(monta,tema)},radioEpsg:function(funcao,onde,prefixo){if(arguments.length===2){$i(onde).innerHTML="<span style=color:red;font-size:10px; >buscando...</span>"}var monta=function(retorno){var c="checked",ins=[],i,n,temp;if(retorno.data!==undefined){ins.push("<table class=lista2 >");n=retorno.data.length;for(i=0;i<n;i++){ins.push("<tr><td><input size=2 style='border:0px solid white;cursor:pointer' "+c+" name='"+prefixo+"EPSG' type=radio value='"+retorno.data[i].codigo+"' /></td>");c="";ins.push("<td>"+retorno.data[i].nome+"</td></tr>")}ins.push("</table>");ins=ins.join('');temp={dados:ins,tipo:"dados"}}else{temp={dados:'<div class=erro >Ocorreu um erro</div>',tipo:"erro"}}funcao(temp)};i3GEO.php.listaEpsg(monta)},comboEpsg:function(idCombo,onde,funcaoOnChange,valorDefault){onde=$i(onde);onde.innerHTML="<span style=color:red;font-size:10px; >buscando...</span>";var monta=function(retorno){var ins=[],i,n;if(retorno.data!==undefined){n=retorno.data.length;ins.push("<select id='"+idCombo+"' onChange='"+funcaoOnChange+"(this)' >");for(i=0;i<n;i++){ins.push("<option value='"+retorno.data[i].codigo+"'>"+retorno.data[i].nome+"</option>")}ins.push("</select>");ins=ins.join('');onde.innerHTML=ins;$i(idCombo).value=valorDefault}else{onde.innerHTML='<div class=erro >Ocorreu um erro</div>'}};i3GEO.php.listaEpsg(monta)},proximoAnterior:function(anterior,proxima,texto,idatual,container,mantem,onde){var temp=$i(idatual),botoes="",ndiv=document.createElement("div"),nids,i,fundo;if(!mantem){mantem=false}if(temp&&mantem==false){$i(container).removeChild(temp)}fundo="#F2F2F2";$i(container).style.backgroundColor="white";botoes="<table style='width:100%;background-color:"+fundo+";' ><tr style='width:100%'>";if(anterior!==""){botoes+="<td style='border:0px solid white;text-align:left;cursor:pointer;background-color:"+fundo+";'><input id='"+idatual+"anterior_' onclick='"+anterior+"' type='button' value=' ' /></td>"}if(proxima!==""){botoes+="<td style='border:0px solid white;text-align:right;cursor:pointer;background-color:"+fundo+";'><input id='"+idatual+"proxima_' onclick='"+proxima+"' type='button' value=' ' /></td>"}botoes+="</tr></table>";var ativaBotoes=function(anterior,proxima,idatual){var i;new YAHOO.widget.Button(idatual+"anterior_",{onclick:{fn:function(){eval(anterior+"()")},lazyloadmenu:true}});new YAHOO.widget.Button(idatual+"proxima_",{onclick:{fn:function(){eval(proxima+"()")},lazyloadmenu:true}});i=$i(idatual+"proxima_-button");if(i){i.style.backgroundImage="url('"+i3GEO.configura.locaplic+"/imagens/player_avanca.png')";i.style.backgroundRepeat="no-repeat";i.style.backgroundPosition="center center"}i=$i(idatual+"anterior_-button");if(i){i.style.backgroundImage="url('"+i3GEO.configura.locaplic+"/imagens/player_volta.png')";i.style.backgroundRepeat="no-repeat";i.style.backgroundPosition="center center"}};if(onde){$i(onde).innerHTML=botoes}else{texto=texto+"<br><br>"+botoes}if(!document.getElementById(idatual)){ndiv.id=idatual;ndiv.innerHTML=texto;$i(container).appendChild(ndiv)}ativaBotoes(anterior,proxima,idatual);temp=$i(container).getElementsByTagName("div");nids=temp.length;for(i=0;i<nids;i++){temp[i].style.display="none"}$i(idatual).style.display="block"},dialogoFerramenta:function(mensagem,dir,nome,nomejs,nomefuncao){if(!nomejs){nomejs="index.js"}if(!nomefuncao){nomefuncao="i3GEOF."+nome+".criaJanelaFlutuante();"}var js=i3GEO.configura.locaplic+"/ferramentas/"+dir+"/"+nomejs;if(!$i("i3GEOF."+nome+"_script")){i3GEO.janela.ESTILOAGUARDE="reduzida";i3GEO.janela.abreAguarde("i3GEOF."+nome+"_script"+"aguarde","Carregando JS");i3GEO.util.scriptTag(js,nomefuncao,"i3GEOF."+nome+"_script")}else{i3GEO.util.scriptTag(js,nomefuncao,"i3GEOF."+nome+"_script")}},intersectaBox:function(box1,box2){box1=box1.split(" ");box2=box2.split(" ");var box1i=box2,box2i=box1,coordx,coordy;coordx=box1[0]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true;coordx=box1[0]*1;coordy=box1[3]*1}if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[3]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}box1=box1i;box2=box2i;coordx=box1[0]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true;coordx=box1[0]*1;coordy=box1[3]*1}if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[3]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}coordx=box1[2]*1;coordy=box1[1]*1;if(coordx>=box2[0]*1&&coordx<=box2[2]*1&&coordy>=box2[1]*1&&coordy<=box2[3]*1){return true}return false},abreColourRamp:function(janelaid,elemento,ncores){var janela,ins,novoel,wdocaiframe,temp,fix=false,wsrc=i3GEO.configura.locaplic+"/ferramentas/colourramp/index.php?ncores="+ncores+"&doc="+janelaid+"&elemento="+elemento+"&locaplic="+i3GEO.configura.locaplic,nx="",texto="",id="i3geo_janelaCorRamp",classe="hd";if($i(id)){janela=YAHOO.i3GEO.janela.manager.find(id);janela.show();janela.bringToTop();return}ins='<div id="'+id+'_cabecalho" class="hd">';ins+="<span><img id='i3geo_janelaCorRamp_imagemCabecalho' style='visibility:hidden;' src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde.gif\' /></span>";if(i3GEO&&i3GEO.arvoreDeCamadas){ins+="<div id='i3geo_janelaCorRampComboCabeca' class='comboTemasCabecalho' style='top:0px;'> ------</div>"}ins+=" "+texto;ins+='</div><div id="i3geo_janelaCorRamp_corpo" class="bd" style="padding:5px">';ins+='<iframe name="'+id+'i" id="i3geo_janelaCorRampi" valign="top" ></iframe>';ins+='</div>';novoel=document.createElement("div");novoel.id="i3geo_janelaCorRamp";novoel.style.display="block";novoel.innerHTML=ins;if($i("i3geo")){$i("i3geo").appendChild(novoel)}else{document.body.appendChild(novoel)}wdocaiframe=$i("i3geo_janelaCorRampi");wdocaiframe.style.display="block";wdocaiframe.src=wsrc;wdocaiframe.style.height="380px";wdocaiframe.style.width="100%";wdocaiframe.style.border="0px solid white";if(nx===""||nx==="center"){fix=true}janela=new YAHOO.widget.Panel(id,{height:"430px",modal:false,width:"280px",fixedcenter:fix,constraintoviewport:true,visible:true,iframe:false});YAHOO.i3GEO.janela.manager.register(janela);janela.render();$i(id+'_cabecalho').className=classe;if($i("i3geo_janelaCorRampComboCabeca")){temp=function(){var p,tema=$i("i3geo_janelaCorRampComboCabecaSel").value,funcao=function(retorno){parent.frames["i3geo_janelaCorRampi"].document.getElementById("ncores").value=retorno.data.length};if(tema!==""){i3GEO.mapa.ativaTema(tema);p=i3GEO.configura.locaplic+"/ferramentas/legenda/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=editalegenda&opcao=edita&tema="+tema;i3GEO.util.ajaxGet(p,funcao);cp=new cpaint()}};i3GEO.janela.comboCabecalhoTemas("i3geo_janelaCorRampComboCabeca","i3geo_janelaCorRampComboCabecaSel","none","ligados",temp)}},localizai3GEO:function(){var scriptLocation="",scripts=document.getElementsByTagName('script'),i=0,index,ns=scripts.length,src;for(i=0;i<ns;i++){src=scripts[i].getAttribute('src');if(src){index=src.lastIndexOf("/classesjs/i3geo.js");if((index>-1)&&(index+"/classesjs/i3geo.js".length===src.length)){scriptLocation=src.slice(0,-"/classesjs/i3geo.js".length);break}index=src.lastIndexOf("/classesjs/i3geonaocompacto.js");if((index>-1)&&(index+"/classesjs/i3geonaocompacto.js".length===src.length)){scriptLocation=src.slice(0,-"/classesjs/i3geonaocompacto.js".length);break}}}if(i3GEO.configura){i3GEO.configura.locaplic=scriptLocation}return scriptLocation},removeChild:function(id,el){var j=$i(id);if(j){if(!el){el=j.parentNode}el.removeChild(j)}},defineValor:function(id,prop,valor){try{eval("$i('"+id+"')."+prop+"='"+valor+"';")}catch(e){}},in_array:function(x,matriz){var txt=" "+matriz.join(" ")+" ";var er=new RegExp(" "+x+" ","gim");return((txt.match(er))?true:false)},timedProcessArray:function(items,process,callback){var todo=items.concat();setTimeout(function(){var start=+new Date();do{process(todo.shift())}while(todo.length>0&&(+new date()-start<50));if(todo.length>0){setTimeout(arguments.callee,25)}else{callback(items)}},25)},multiStep:function(steps,args,callback){var tasks=steps.concat();setTimeout(function(){var task=tasks.shift(),a=args.shift();task.apply(null,a||[]);if(tasks.length>0){setTimeout(arguments.callee,25)}else{callback()}},25)},tamanhoBrowser:function(){var viewportwidth,viewportheight;if(typeof window.innerWidth!='undefined'){viewportwidth=window.innerWidth,viewportheight=window.innerHeight}else if(typeof document.documentElement!='undefined'&&typeof document.documentElement.clientWidth!='undefined'&&document.documentElement.clientWidth!=0){viewportwidth=document.documentElement.clientWidth,viewportheight=document.documentElement.clientHeight}else{viewportwidth=document.getElementsByTagName('body')[0].clientWidth,viewportheight=document.getElementsByTagName('body')[0].clientHeight}viewportwidth=viewportwidth-i3GEO.util.getScrollerWidth();return[viewportwidth,viewportheight]},detectaTablet:function(){var p,c=DetectaMobile("DetectTierTablet");if(c===false){return false}p=confirm($trad("x73"));if(p){window.location=i3GEO.configura.locaplic+'/interface/'+i3GEO.Interface.ALTTABLET+'?'+i3GEO.configura.sid;return true}},detectaMobile:function(){var p,c=DetectaMobile("DetectMobileLong");if(c===false){return false}p=confirm($trad("x73"));if(p){window.location=i3GEO.configura.locaplic+'/interface/'+i3GEO.Interface.ALTTABLET+'?'+i3GEO.configura.sid;return true}},calculaDPI:function(){var novoel=document.createElement("div"),valor=72;novoel.style.height="1in";novoel.style.left="-100%";novoel.style.position="absolute";novoel.style.top="-100%";novoel.style.width="1in";document.body.appendChild(novoel);if(novoel.offsetHeight){valor=novoel.offsetHeight}document.body.removeChild(novoel);return valor},ajustaDocType:function(){try{if(document.implementation.createDocumentType){var newDoctype=document.implementation.createDocumentType('html','-//W3C//DTD XHTML 1.0 Transitional//EN','http://www.w3.org/TR/html4/loose.dtd');if(document.doctype){document.doctype.parentNode.replaceChild(newDoctype,document.doctype)}}}catch(e){}},versaoNavegador:function(){if(navm&&navigator.userAgent.toLowerCase().indexOf('msie 8.')>-1){return"IE8"}if(navn&&navigator.userAgent.toLowerCase().indexOf('3.')>-1){return"FF3"}return""},decimalPlaces:function(float,length){var ret="",str=float.toString(),array=str.split("."),i;if(array.length==2){ret+=array[0]+".";for(i=0;i<length;i++){if(i>=array[1].length)ret+='0';else ret+=array[1][i]}}else if(array.length==1){ret+=array[0]+".";for(i=0;i<length;i++){ret+='0'}}return ret},ajaxGet:function(sUrl,funcaoRetorno){sUrl=escape(sUrl);re=new RegExp("%3F","g");sUrl=sUrl.replace(re,'?');re=new RegExp("%3D","g");sUrl=sUrl.replace(re,'=');re=new RegExp("%26","g");sUrl=sUrl.replace(re,'&');re=new RegExp("%3A","g");sUrl=sUrl.replace(re,':');var falhou=function(e){},callback={success:function(o){try{funcaoRetorno.call("",YAHOO.lang.JSON.parse(o.responseText))}catch(e){falhou(e)}},failure:falhou,argument:{foo:"foo",bar:"bar"}};YAHOO.util.Connect.asyncRequest("GET",sUrl,callback)},verifica_html5_storage:function(){if(typeof(Storage)!=="undefined"){return true}else{return false}},pegaDadosLocal:function(item){if(i3GEO.util.verifica_html5_storage()&&localStorage[item]){return window.localStorage[item]}else{return false}},limpaDadosLocal:function(item){if(i3GEO.util.verifica_html5_storage()&&localStorage[item]){window.localStorage.clear(item)}},gravaDadosLocal:function(item,valor){if(i3GEO.util.verifica_html5_storage()){window.localStorage[item]=valor;return true}else{return false}},extGeo2OSM:function(ext){if(i3GEO.Interface.openlayers.googleLike===true){var metrica,point,proj900913,projWGS84,temp=ext.split(" ");if(temp[0]*1<=180&&temp[0]*1>=-180){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");point=new OpenLayers.LonLat(temp[0],temp[1]);metrica=point.transform(projWGS84,proj900913);ext=metrica.lon+" "+metrica.lat;point=new OpenLayers.LonLat(temp[2],temp[3]);metrica=point.transform(projWGS84,proj900913);ext+=" "+metrica.lon+" "+metrica.lat}}return ext},extOSM2Geo:function(ext){if(i3GEO.Interface.openlayers.googleLike===true){var metrica,point,proj900913,projWGS84,temp=ext.split(" ");if(temp[0]*1>=180||temp[0]*1<=-180){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");point=new OpenLayers.LonLat(temp[0],temp[1]);metrica=point.transform(proj900913,projWGS84);ext=metrica.lon+" "+metrica.lat;point=new OpenLayers.LonLat(temp[2],temp[3]);metrica=point.transform(proj900913,projWGS84);ext+=" "+metrica.lon+" "+metrica.lat}}return ext},projOSM2Geo:function(obj){if(i3GEO.Interface.openlayers.googleLike===true){projWGS84=new OpenLayers.Projection("EPSG:4326");proj900913=new OpenLayers.Projection("EPSG:900913");obj=obj.transform(proj900913,projWGS84)}return obj},navegadorDir:function(obj,listaShp,listaImg,listaFig){if(!obj){listaShp=true;listaImg=true;listaFig=true}var temp=function(){i3GEOF.navegarquivos.iniciaDicionario(obj,listaShp,listaImg,listaFig)};i3GEO.util.dialogoFerramenta("i3GEO.util.navegadorDir()","navegarquivos","navegarquivos","index.js",temp)},navegadorPostgis:function(obj,conexao,tipo){if(!obj){conexao=""}if(!tipo){tipo="sql"}var temp=function(){i3GEOF.navegapostgis.iniciaDicionario(obj,conexao,tipo)};i3GEO.util.dialogoFerramenta("i3GEO.util.navegadorPostgis()","navegapostgis","navegapostgis","index.js",temp)},base64encode:function(str){var base64EncodeChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var out,i,len;var c1,c2,c3;len=str.length;i=0;out="";while(i<len){c1=str.charCodeAt(i++)&0xff;if(i==len){out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt((c1&0x3)<<4);out+="==";break}c2=str.charCodeAt(i++);if(i==len){out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt(((c1&0x3)<<4)|((c2&0xF0)>>4));out+=base64EncodeChars.charAt((c2&0xF)<<2);out+="=";break}c3=str.charCodeAt(i++);out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt(((c1&0x3)<<4)|((c2&0xF0)>>4));out+=base64EncodeChars.charAt(((c2&0xF)<<2)|((c3&0xC0)>>6));out+=base64EncodeChars.charAt(c3&0x3F)}return out},base64decode:function(str){var base64DecodeChars=new Array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,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,-1,-1,-1,-1,-1,-1,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,-1,-1,-1,-1,-1);var c1,c2,c3,c4;var i,len,out;len=str.length;i=0;out="";while(i<len){do{c1=base64DecodeChars[str.charCodeAt(i++)&0xff]}while(i<len&&c1==-1);if(c1==-1)break;do{c2=base64DecodeChars[str.charCodeAt(i++)&0xff]}while(i<len&&c2==-1);if(c2==-1)break;out+=String.fromCharCode((c1<<2)|((c2&0x30)>>4));do{c3=str.charCodeAt(i++)&0xff;if(c3==61)return out;c3=base64DecodeChars[c3]}while(i<len&&c3==-1);if(c3==-1)break;out+=String.fromCharCode(((c2&0XF)<<4)|((c3&0x3C)>>2));do{c4=str.charCodeAt(i++)&0xff;if(c4==61)return out;c4=base64DecodeChars[c4]}while(i<len&&c4==-1);if(c4==-1)break;out+=String.fromCharCode(((c3&0x03)<<6)|c4)}return out}};try{YAHOO.namespace("lutsr");YAHOO.lutsr.accordion={properties:{animation:true,animationDuration:10,multipleOpen:false,Id:"sanfona",altura:200,ativa:0},init:function(animation,animationDuration,multipleOpen,Id,altura,ativa){if(animation){this.properties.animation=animation}if(animationDuration){this.properties.animationDuration=animationDuration}if(multipleOpen){this.properties.multipleOpen=multipleOpen}if(Id){this.properties.Id=Id}if(altura){this.properties.altura=altura}if(ativa){this.properties.ativa=ativa}var accordionObject=document.getElementById(this.properties.Id),headers;if(accordionObject){if(accordionObject.nodeName==="DL"){headers=accordionObject.getElementsByTagName("dt");this.attachEvents(headers,0)}}},attachEvents:function(headers,nr){var i,headerProperties,parentObj,header;for(i=0;i<headers.length;i++){headerProperties={objRef:headers[i],nr:i,jsObj:this};YAHOO.util.Event.addListener(headers[i],"click",this.clickHeader,headerProperties)}parentObj=headers[this.properties.ativa].parentNode;headers=parentObj.getElementsByTagName("dd");header=headers[this.properties.ativa];this.expand(header)},clickHeader:function(e,headerProperties){var parentObj=headerProperties.objRef.parentNode,headers=parentObj.getElementsByTagName("dd"),header=headers[headerProperties.nr],i;if(YAHOO.util.Dom.hasClass(header,"open")){headerProperties.jsObj.collapse(header)}else{if(headerProperties.jsObj.properties.multipleOpen){headerProperties.jsObj.expand(header)}else{for(i=0;i<headers.length;i++){if(YAHOO.util.Dom.hasClass(headers[i],"open")){headerProperties.jsObj.collapse(headers[i])}}headerProperties.jsObj.expand(header)}}},collapse:function(header){YAHOO.util.Dom.removeClass(YAHOO.util.Dom.getPreviousSibling(header),"selected");if(!this.properties.animation){YAHOO.util.Dom.removeClass(header,"open")}else{this.initAnimation(header,"close")}},expand:function(header){YAHOO.util.Dom.addClass(YAHOO.util.Dom.getPreviousSibling(header),"selected");if(!this.properties.animation){YAHOO.util.Dom.addClass(header,"open")}else{this.initAnimation(header,"open")}},initAnimation:function(header,dir){var attributes,animation,animationEnd;if(dir==="open"){YAHOO.util.Dom.setStyle(header,"visibility","hidden");YAHOO.util.Dom.setStyle(header,"height",this.properties.altura);YAHOO.util.Dom.addClass(header,"open");attributes={height:{from:0,to:this.properties.altura}};YAHOO.util.Dom.setStyle(header,"height",0);YAHOO.util.Dom.setStyle(header,"visibility","visible");animation=new YAHOO.util.Anim(header,attributes);animationEnd=function(){header.style.height=this.properties.altura+"px"};animation.duration=this.properties.animationDuration;animation.useSeconds=false;animation.onComplete.subscribe(animationEnd);animation.animate()}else if("close"){attributes={height:{to:0}};animationEnd=function(){YAHOO.util.Dom.removeClass(header,"open")};animation=new YAHOO.util.Anim(header,attributes);animation.duration=this.properties.animationDuration;animation.useSeconds=false;animation.onComplete.subscribe(animationEnd);animation.animate()}}}}catch(e){}$im=function(g){return i3GEO.util.$im(g)};$inputText=function(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch){if(arguments.length===6){nome=""}return i3GEO.util.$inputText(idPai,larguraIdPai,idInput,titulo,digitos,valor,nome,onch)};$top=function(id,valor){i3GEO.util.$top(id,valor)};$left=function(id,valor){i3GEO.util.$left(id,valor)}; | |
| 46 | 46 | /* |
| 47 | 47 | OpenLayers.js -- OpenLayers Map Viewer Library |
| 48 | 48 | Copyright (c) 2006-2013 by OpenLayers Contributors | ... | ... |