function MyMap(B,A,D,F,E,C){this.id=B;this.map=A;this.exml=D;this.exml_txt=F;this.zoomGrande=E;this.tieneOverlayAmpliar=C;this.kml}function LoadGmaps(B,A,C){if(GBrowserIsCompatible()){B.map=new GMap2(document.getElementById(B.id));B.map.setCenter(new GLatLng(45.274886,0.8789065),4);if(B.zoomGrande){B.map.addControl(new GLargeMapControl())}else{B.map.addControl(new GSmallZoomControl())}B.map.addControl(new GMenuMapTypeControl());B.map.addControl(new GScaleControl());B.exml=new EGeoXml(B.exml_txt,B.map,A,{myoverlayactive:true,directions:true,icontype:"style"});B.exml.parse();if(B.tieneOverlayAmpliar){B.map.addControl(new AmpliarMapa(B,C,PopUpMapaAmpliado))}}}function PopUpMapaAmpliado(){var B=$.browser.msie&&/MSIE 6.0/.test(navigator.userAgent);if(B){window.open("mapa.aspx")}else{var C=$("<div></div>");var D=$('<div style="width:100%; height:90%; backgorund-color:red; position: absolute; top:20px; left:0;" id="mapAmpliado"></div>');var A=$('<div style="margin-left:20px;"> <a href="#">Cerrar</a></div>').find("a").click(function(){$.unblockUI();return false});C.append(D);C.append(A);$.blockUI({message:C,css:{width:"80%",height:"80%",top:"10%",left:"10%"}});LoadGmaps(mapa2,mapa1.kml,txtAmplia);GEvent.addListener(mapa2.exml,"parsed",function(){var E=parseInt(this.map.getZoom());if(E>zMin){this.map.setZoom(zMin)}})}}var MyOverlay=function(A,B,C){this.marker=A;this.html=B;this.map=C};MyOverlay.prototype=new GOverlay();MyOverlay.prototype.initialize=function(A){var B=document.createElement("div");B.className="mywindow";B.style.position="absolute";B.innerHTML=this.html;offsetX=0;offsetY=0;B.style.top=(A.fromLatLngToDivPixel(this.marker.getPoint()).y-offsetY)+"px";B.style.left=(A.fromLatLngToDivPixel(this.marker.getPoint()).x-offsetX)+"px";B.onclick=closeOverlay;A.getPane(G_MAP_FLOAT_PANE).appendChild(B);this._map=A;this._div=B};MyOverlay.prototype.remove=function(){this._div.parentNode.removeChild(this._div)};MyOverlay.prototype.redraw=function(){};function closeOverlay(){if(this.map.currentMarker){this.map.removeOverlay(this.map.currentMarker.overlay);this.map.currentMarker.show()}}function AmpliarMapa(C,B,A){this.map=C.map;this.html=B;if(A){this.e_click=A}}AmpliarMapa.prototype=new GControl();AmpliarMapa.prototype.initialize=function(){var A=document.createElement("div");A.style.position="absolute";A.innerHTML=this.html;this._setDivStyle(A);if(this.e_click){GEvent.addDomListener(A,"click",this.e_click)}this._map=this.map;this._div=A;this.map.getContainer().appendChild(A);return A};AmpliarMapa.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(7,18))};AmpliarMapa.prototype._setDivStyle=function(A){A.style.textDecoration="underline";A.style.color="#0000cc";A.style.backgroundColor="white";A.style.border="1px solid #333";A.style.padding="4px 6px";A.style.textAlign="center";A.style.cursor="pointer"};