// JavaScript Document
//ABQIAAAA864_Sat9SyNYi2scOQHwmhRN_lOvlC__t-QbwqLsCIf5UiKQSxQYvx4zOMqJLuh8gr1JTeD0TrgoXg servidor
			//ABQIAAAA864_Sat9SyNYi2scOQHwmhQaRokC_536-Z8Ofy-L9Nhh35heFxSEKweNIZgsTUS8UKSKnZtXhSr3qw locol
			var map;
			var street;
			var gMarcas = new Array(); 
			var gTexto = new Array();
			var mark = new Array();
			
			function Inicio() {
      	if (GBrowserIsCompatible()) {
					gMarcas[0] = new GLatLng(40.42509, -3.69774); // CPEC
					gMarcas[1] = new GLatLng(40.42669, -3.7); // Barceló
					gMarcas[2] = new GLatLng(40.42409, -3.6948); // Las Salesas
					posCentro = new GLatLng(40.42549, -3.69774); // Centro para la vista general
					gTexto[0] ="<strong>Core pilates Energy Center</strong><br />C/ Hortaleza 104<br />Metro: Alonso Martínez<br />91 702 53 84"; 
					gTexto[1] = "<strong>Parking Barceló</strong><br />C/ Barceló S/N<br />28004 Madrid<br />91 521 79 95";
					gTexto[2] = "<strong>Parking Las Salesas</strong>";
					// Creación del mapa
					map = new GMap2(document.getElementById('mapa'));
					//map.addMapType(G_PHYSICAL_MAP); // Para añadir el tipo de mapa 'Relieve'
					//map.setMapType(G_HYBRID_MAP); // Para fijar otro tipo de mapa por defecto
        			map.setCenter(posCentro, 16); // Se inicia el mapa en la posición central
					map.enableContinuousZoom();
					//map.enableScrollWheelZoom();
					
					// Adición de controles al mapa
					var mapControl = new GHierarchicalMapTypeControl();
					// Configura las relaciones del menú de tipos de mapas
					mapControl.clearRelationships();
					mapControl.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Callejero", true);					
					// Añade el control después de especificar las relaciones
					map.addControl(mapControl);
					map.addControl(new ExtLargeMapControl()); // Nuevos controles de movimiento
					//map.addControl(new GMapTypeControl()); // Controles de tipo de mapa
					//map.addControl(new GSmallMapControl()); // Controles de movimiento pequeños
					
					// Nuevo icono para las marcas de mapa
					var icono = new GIcon(G_DEFAULT_ICON);
					icono.iconSize = new GSize(20, 20);
					icono.image = 'img/parking.png';
					icono.shadowSize = new GSize(0, 0);

					opIcono = {icon:icono};
					
					// Adición de las marcas de mapa
					for (i = 0; i < gMarcas.length; i++) {
						var marca = CrearMarcas(gMarcas[i], gTexto[i], i);
						map.addOverlay(marca);
					}
				}
    	}
		function CrearMarcas(punto, texto, index) {
				if(index != 0){
					mark[index] = new GMarker(punto, opIcono);
				}else{
					mark[index] = new GMarker(punto);
				}
				
				GEvent.addListener(mark[index], "click", function() {
					mark[index].openInfoWindowHtml(texto);
				});
				return mark[index];
			}
			window.onload = Inicio;
			window.onunload = GUnload;