				function cargaMapa (idMapa,URLDatos,autoCentra,norte,sur,este,oeste,tenemosFronteras) {

      				
					var totalPuntos = 0;
				    if (GBrowserIsCompatible()) {
						function creaIcono(imagenIcono) {
							var iconoTmp = new GIcon();
							iconoTmp.image = imagenIcono;						
							return iconoTmp;
						}	
					    var iconRojo = new GIcon(); 
					    iconRojo.image = 'http://www.viamedius.com/img/_mapa/icono_rojo.png';
						iconRojo.iconSize = new GSize(12, 21);
					    iconRojo.iconAnchor = new GPoint(6, 20);
					    iconRojo.infoWindowAnchor = new GPoint(5, 1);

					    var iconAmarillo = new GIcon(); 
					    iconAmarillo.image = 'http://www.viamedius.com/img/_mapa/icono_amarillo.png';
						iconAmarillo.iconSize = new GSize(12, 21);
					    iconAmarillo.iconAnchor = new GPoint(6, 20);
					    iconAmarillo.infoWindowAnchor = new GPoint(5, 1);

					    var icon4 = new GIcon(); 
					    icon4.image = 'http://www.viamedius.com/img/_mapa/icono_4.png';
						icon4.iconSize = new GSize(20, 31);
					    icon4.iconAnchor = new GPoint(6, 20);
					    icon4.infoWindowAnchor = new GPoint(5, 1);
						
						var icon12 = new GIcon(); 
					    icon12.image = 'http://www.viamedius.com/img/_mapa/icono_12.png';
						icon12.iconSize = new GSize(20, 31);
					    icon12.iconAnchor = new GPoint(6, 20);
					    icon12.infoWindowAnchor = new GPoint(5, 1);
						
						var icon74 = new GIcon(); 
						
					    icon74.image = 'http://www.viamedius.com/img/_mapa/icono_74.png';
						icon74.iconSize = new GSize(20, 31);
					    icon74.iconAnchor = new GPoint(6, 20);
					    icon74.infoWindowAnchor = new GPoint(5, 1);
						
						var icon3 = new GIcon(); 
					    icon3.image = 'http://www.viamedius.com/img/_mapa/icono_3.png';
						icon3.iconSize = new GSize(20, 31);
					    icon3.iconAnchor = new GPoint(6, 20);
					    icon3.infoWindowAnchor = new GPoint(5, 1);

						var icon2 = new GIcon(); 
					    icon2.image = 'http://www.viamedius.com/img/_mapa/icono_2.png';
						icon2.iconSize = new GSize(20, 31);
					    icon2.iconAnchor = new GPoint(6, 20);
					    icon2.infoWindowAnchor = new GPoint(5, 1);						

						var icon1 = new GIcon(); 
					    icon1.image = 'http://www.viamedius.com/img/_mapa/icono_1.png';
						icon1.iconSize = new GSize(20, 31);
					    icon1.iconAnchor = new GPoint(6, 20);
					    icon1.infoWindowAnchor = new GPoint(5, 1);	
						
						var gicons = [];
						gicons["rojo"] = iconRojo;
						gicons["amarillo"] = iconAmarillo;
						gicons["12"] = icon12;
						gicons["4"] = icon4;
						gicons["74"] = icon74;
						gicons["3"] = icon3;
						gicons["2"] = icon2;
						gicons["1"] = icon1;
									
						var baseIcon = new GIcon();
						baseIcon.image = "/img/_mapa/icono_rojo.png";
						//baseIcon.iconSize = new GSize(20, 32);
						baseIcon.iconAnchor = new GPoint(6, 20);
						baseIcon.infoWindowAnchor = new GPoint(5, 1);
				      				      
						var map = new GMap2(document.getElementById(idMapa));
						map.addControl(new GSmallMapControl());

						
						//var miniSize=new GSize(100, 80)
						//var miniMap=new GOverviewMapControl(miniSize);
						//map.addControl(miniMap);
						//var mini=miniMap.getOverviewMap();
						map.addControl(new GMapTypeControl());
						map.setCenter(new GLatLng(0,0), 9);
						if (tenemosFronteras == true) {
							var bounds = new GLatLngBounds(new GLatLng(norte,oeste), new GLatLng(sur,este));
						} else {
							if (autoCentra == true) {
								var bounds = new GLatLngBounds();
							}
						}
						GDownloadUrl(URLDatos, function(data, responseCode) {
							
							parseJson(data);
							if (autoCentra == true) {
								var center = bounds.getCenter();
								if (totalPuntos > 1 || tenemosFronteras == true) {
									map.setZoom(map.getBoundsZoomLevel(bounds));
								} else {
									map.setZoom(11);
								}
								map.setCenter(center);									
							}
						});	
	
			
						function createMarker(input) {
							if (input.icono != null) {
								icono = gicons[input.icono];
							} else {
								icono = baseIcon;
							}
							var marker = new GMarker(input.point, icono );
							if (autoCentra == true) {							
								bounds.extend(marker.getPoint());
							}
							GEvent.addListener(marker, "click", function() {
								marker.openInfoWindowHtml( formatWindow(input));
							});
							return marker;
						}
						function parseJson (doc) {

							var jsonData = eval("(" + doc + ")");
							totalPuntos = jsonData.markers.length;
							for (var i = 0; i < jsonData.markers.length; i++) {
							var marker = createMarker(jsonData.markers[i]);
								map.addOverlay(marker);
							}
						}

						function formatWindow (input) {
							var html = "<div class=\"burbujaMapa\">";
							if(input.enlace != null) {
								html += "<h4><a href=\""+ input.enlace +"\">" + input.lugar + "</a></h4>";
							} else {
								html += "<h4>" + input.lugar + "</h4>";	
							}
							if(input.htmlExtra != null) {
								html += "<p>" + input.htmlExtra + "</p>";
							}
							html += "</div>";
							return html;
						}		
		
		
				    } else {
						alert("Lo sentimos, Google Maps no es compatible con tu navegador.");
				    }
				}