﻿
function wagmp_map_1() {
  if(GBrowserIsCompatible()) {
    if(!document.getElementById('wagmp_map_1')) return false;
    var map = new GMap2(document.getElementById('wagmp_map_1'));
    map.enableContinuousZoom();
    map.enableDoubleClickZoom();
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.addControl(new GOverviewMapControl());
    var geocoder = new GClientGeocoder();
    
    var fromAddress = {
      enabled: false,
      street: '',
      city: '',
      state: '',
      zip: '',
      country: '',
      full: ''
    };

    var icon_0 = new GIcon();
    icon_0.image = 'http://www.tomelloso.in/images/mapas/yosemite.png';
    icon_0.shadow = 'http://www.tomelloso.in/images/mapas/shadow.png';
    icon_0.iconSize = new GSize(40,41);
    icon_0.shadowSize = new GSize(40,41);
    icon_0.iconAnchor = new GPoint(7,38);
    icon_0.infoWindowAnchor = new GPoint(26,4);
    icon_0.printImage = 'http://www.tomelloso.in/images/mapas/yosemite.gif';
    icon_0.mozPrintImage = 'http://www.tomelloso.in/images/mapas/yosemite_mozprint.png';
    icon_0.printShadow = 'http://www.tomelloso.in/images/mapas/shadow.gif';
    icon_0.transparent = 'http://www.tomelloso.in/images/mapas/yosemite_transparent.png';
    
    var address_0 = {
      street: 'Pintor Rivera, 14',
      city: 'Tomelloso',
      state: 'Ciudad Real',
      zip: '13700',
      country: 'ES',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Mudanzas y transportes Serna</strong><br /><a href="http://www.tomelloso.in/mudanzas/">Mudanzas Tomelloso</a><br />Pintor Rivera, 14<br />Tomelloso, Ciudad Real 13700 ES</span>',
      full: 'Pintor Rivera, 14, Tomelloso, Ciudad Real, 13700, ES',
      isdefault: false,
      addressType: 'address',
      loop: '',
      latitude: '',
      longitude: '',
      markerStyle: 'Push-Pin',
      markerColor: 'Yosemite'      
    };
    
    geocoder.getLatLng (
      address_0.full,
      function(point) {
        if(point) {
          var marker = new GMarker(point, icon_0);
          GEvent.addListener(marker, 'click', function() {
            marker.openInfoWindowHtml(address_0.infowindowtext);
          });
          if(!fromAddress.enabled || 'address_0' != 'address_5') {
            map.setCenter(point, 13);
            map.addOverlay(marker);
          }
        }
        else {
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        }
      }
    );

    var icon_1 = new GIcon();
    icon_1.image = 'http://www.tomelloso.in/images/mapas/yosemite.png';
    icon_1.shadow = 'http://www.tomelloso.in/images/mapas/shadow.png';
    icon_1.iconSize = new GSize(40,41);
    icon_1.shadowSize = new GSize(40,41);
    icon_1.iconAnchor = new GPoint(7,38);
    icon_1.infoWindowAnchor = new GPoint(26,4);
    icon_1.printImage = 'http://www.tomelloso.in/images/mapas/yosemite.gif';
    icon_1.mozPrintImage = 'http://www.tomelloso.in/images/mapas/yosemite_mozprint.png';
    icon_1.printShadow = 'http://www.tomelloso.in/images/mapas/shadow.gif';
    icon_1.transparent = 'http://www.tomelloso.in/images/mapas/yosemite_transparent.png';
    
    var address_1 = {
      street: 'Campo, 7',
      city: 'Tomelloso',
      state: 'Ciudad Real',
      zip: '13700',
      country: 'ES',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>JCP Servicios financieros</strong><br />Campo, 7<br />Tomelloso, Ciudad Real 13700 ES</span>',
      full: 'Campo, 7, Tomelloso, Ciudad Real, 13700, ES',
      isdefault: false,
      addressType: 'address',
      loop: '',
      latitude: '',
      longitude: '',
      markerStyle: 'Push-Pin',
      markerColor: 'Yosemite'      
    };
    
    geocoder.getLatLng (
      address_1.full,
      function(point) {
        if(point) {
          var marker = new GMarker(point, icon_1);
          GEvent.addListener(marker, 'click', function() {
            marker.openInfoWindowHtml(address_1.infowindowtext);
          });
          if(!fromAddress.enabled || 'address_1' != 'address_5') {
            map.setCenter(point, 13);
            map.addOverlay(marker);
          }
        }
        else {
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        }
      }
    );

    var icon_2 = new GIcon();
    icon_2.image = 'http://www.tomelloso.in/images/mapas/yosemite.png';
    icon_2.shadow = 'http://www.tomelloso.in/images/mapas/shadow.png';
    icon_2.iconSize = new GSize(40,41);
    icon_2.shadowSize = new GSize(40,41);
    icon_2.iconAnchor = new GPoint(7,38);
    icon_2.infoWindowAnchor = new GPoint(26,4);
    icon_2.printImage = 'http://www.tomelloso.in/images/mapas/yosemite.gif';
    icon_2.mozPrintImage = 'http://www.tomelloso.in/images/mapas/yosemite_mozprint.png';
    icon_2.printShadow = 'http://www.tomelloso.in/images/mapas/shadow.gif';
    icon_2.transparent = 'http://www.tomelloso.in/images/mapas/yosemite_transparent.png';
    
    var address_2 = {
      street: 'Pintor El Greco, 2',
      city: 'Tomelloso',
      state: 'Ciudad Real',
      zip: '13700',
      country: 'ES',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Multiasistencia Alvarez</strong><br /><a href="http://www.tomelloso.in/mutiasistencia-hogar/">Multiasistencia del hogar y la empresa</a><br />Pintor El Greco, 2<br />Tomelloso, Ciudad Real 13700 ES</span>',
      full: 'Pintor El Greco, 2, Tomelloso, Ciudad Real, 13700, ES',
      isdefault: false,
      addressType: 'address',
      loop: '',
      latitude: '',
      longitude: '',
      markerStyle: 'Push-Pin',
      markerColor: 'Yosemite'      
    };
    
    geocoder.getLatLng (
      address_2.full,
      function(point) {
        if(point) {
          var marker = new GMarker(point, icon_2);
          GEvent.addListener(marker, 'click', function() {
            marker.openInfoWindowHtml(address_2.infowindowtext);
          });
          if(!fromAddress.enabled || 'address_2' != 'address_5') {
            map.setCenter(point, 13);
            map.addOverlay(marker);
          }
        }
        else {
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        }
      }
    );

    var icon_3 = new GIcon();
    icon_3.image = 'http://www.tomelloso.in/images/mapas/yosemite.png';
    icon_3.shadow = 'http://www.tomelloso.in/images/mapas/shadow.png';
    icon_3.iconSize = new GSize(40,41);
    icon_3.shadowSize = new GSize(40,41);
    icon_3.iconAnchor = new GPoint(7,38);
    icon_3.infoWindowAnchor = new GPoint(26,4);
    icon_3.printImage = 'http://www.tomelloso.in/images/mapas/yosemite.gif';
    icon_3.mozPrintImage = 'http://www.tomelloso.in/images/mapas/yosemite_mozprint.png';
    icon_3.printShadow = 'http://www.tomelloso.in/images/mapas/shadow.gif';
    icon_3.transparent = 'http://www.tomelloso.in/images/mapas/yosemite_transparent.png';
    
    var address_3 = {
      street: 'Paseo San Isidro, 8',
      city: 'Tomelloso',
      state: 'Ciudad Real',
      zip: '13700',
      country: 'ES',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Grupo Iberco</strong><br /><a href="http://www.tomelloso.in/promociones/">Promociones de viviendas</a><br />Paseo San Isidro, 8<br />Tomelloso, Ciudad Real 13700 ES</span>',
      full: 'Paseo San Isidro, 8, Tomelloso, Ciudad Real, 13700, ES',
      isdefault: false,
      addressType: 'address',
      loop: '',
      latitude: '',
      longitude: '',
      markerStyle: 'Push-Pin',
      markerColor: 'Yosemite'      
    };
    
    geocoder.getLatLng (
      address_3.full,
      function(point) {
        if(point) {
          var marker = new GMarker(point, icon_3);
          GEvent.addListener(marker, 'click', function() {
            marker.openInfoWindowHtml(address_3.infowindowtext);
          });
          if(!fromAddress.enabled || 'address_3' != 'address_5') {
            map.setCenter(point, 13);
            map.addOverlay(marker);
          }
        }
        else {
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        }
      }
    );

    var icon_4 = new GIcon();
    icon_4.image = 'http://www.tomelloso.in/images/mapas/yosemite.png';
    icon_4.shadow = 'http://www.tomelloso.in/images/mapas/shadow.png';
    icon_4.iconSize = new GSize(40,41);
    icon_4.shadowSize = new GSize(40,41);
    icon_4.iconAnchor = new GPoint(7,38);
    icon_4.infoWindowAnchor = new GPoint(26,4);
    icon_4.printImage = 'http://www.tomelloso.in/images/mapas/yosemite.gif';
    icon_4.mozPrintImage = 'http://www.tomelloso.in/images/mapas/yosemite_mozprint.png';
    icon_4.printShadow = 'http://www.tomelloso.in/images/mapas/shadow.gif';
    icon_4.transparent = 'http://www.tomelloso.in/images/mapas/yosemite_transparent.png';
    
    var address_4 = {
      street: 'Valle de Alcudia',
      city: 'Tomelloso',
      state: 'Ciudad Real',
      zip: '13700',
      country: 'ES',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>Ingeniería Caballero</strong><br /><a href="http://www.tomelloso.in/ingenieria/">Ingeniería Tomelloso</a><br />Valle de Alcudia, Ed. CLIPE, despacho 8<br />Tomelloso, Ciudad Real 13700 ES</span>',
      full: 'Valle de Alcudia, Tomelloso, Ciudad Real, 13700, ES',
      isdefault: false,
      addressType: 'address',
      loop: '',
      latitude: '',
      longitude: '',
      markerStyle: 'Push-Pin',
      markerColor: 'Yosemite'      
    };
    
    geocoder.getLatLng (
      address_4.full,
      function(point) {
        if(point) {
          var marker = new GMarker(point, icon_4);
          GEvent.addListener(marker, 'click', function() {
            marker.openInfoWindowHtml(address_4.infowindowtext);
          });
          if(!fromAddress.enabled || 'address_4' != 'address_5') {
            map.setCenter(point, 13);
            map.addOverlay(marker);
          }
        }
        else {
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        }
      }
    );

    var icon_5 = new GIcon();
    icon_5.image = 'http://www.tomelloso.in/images/mapas/yosemite.png';
    icon_5.shadow = 'http://www.tomelloso.in/images/mapas/shadow.png';
    icon_5.iconSize = new GSize(40,41);
    icon_5.shadowSize = new GSize(40,41);
    icon_5.iconAnchor = new GPoint(7,38);
    icon_5.infoWindowAnchor = new GPoint(26,4);
    icon_5.printImage = 'http://www.tomelloso.in/images/mapas/yosemite.gif';
    icon_5.mozPrintImage = 'http://www.tomelloso.in/images/mapas/yosemite_mozprint.png';
    icon_5.printShadow = 'http://www.tomelloso.in/images/mapas/shadow.gif';
    icon_5.transparent = 'http://www.tomelloso.in/images/mapas/yosemite_transparent.png';
    
    var address_5 = {
      street: 'Don Victor Peñasco, 128',
      city: 'Tomelloso',
      state: 'Ciudad Real',
      zip: '13700',
      country: 'ES',
      infowindow: 'custom',
      infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>foXman network</strong><br /><a href="http://www.foxman.net/">Diseño  Tomelloso</a><br /><strong>Servicios Internet</strong><br />Don Victor Peñasco, 128<br />Tomelloso, Ciudad Real 13700 ES</span>',
      full: 'Don Victor Peñasco, 128, Tomelloso, Ciudad Real, 13700, ES',
      isdefault: true,
      addressType: 'address',
      loop: '',
      latitude: '',
      longitude: '',
      markerStyle: 'Push-Pin',
      markerColor: 'Yosemite'      
    };
    
    geocoder.getLatLng (
      address_5.full,
      function(point) {
        if(point) {
          var marker = new GMarker(point, icon_5);
          GEvent.addListener(marker, 'click', function() {
            marker.openInfoWindowHtml(address_5.infowindowtext);
          });
          if(!fromAddress.enabled || 'address_5' != 'address_5') {
            map.setCenter(point, 13);
            map.addOverlay(marker);
            marker.openInfoWindowHtml(address_5.infowindowtext);
          }
        }
        else {
          map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        }
      }
    );


  }
}