      var map;
      var kml;
      var marker1;
      var marker2;
      var marker3;
      var marker4;
      var marker5;
      var marker6;
      var marker7;
      var marker8;
      var marker9;
      var marker10;
      var marker11;
      var marker12;
      var marker12;
      var zoomLevel=10;
      var mapCenter=new GLatLng(21.531014668261573,-105.13504028320312);

      function addMarkers(){
          marker1 = new GMarker(new GLatLng(21.417276156993662,-105.14328002929688));
          GEvent.addListener(marker1, "click", function() {
            marker1.openInfoWindowHtml("Tecuitata - El Cora - El Llano<br><a target='_blank' href='http://sanblasbici.com/bici1.htm'>See more details/Ver mas detailles.</a><br><img src='http://sanblasbici.com/images/smallBici1Profile.png'/> ");
          });
          GEvent.addListener(marker1, "infowindowclose", function() {
            biciLogData("marClk bici1");
            map.setCenter(new GLatLng(21.531014668261573,-105.13504028320312),10,G_HYBRID_MAP);
          });
          map.addOverlay(marker1);

          marker2 = new GMarker(new GLatLng(21.514406720030294,-105.27374267578125));
          GEvent.addListener(marker2, "click", function() {
            biciLogData("marClk bici2");
            marker2.openInfoWindowHtml("Puerto de San Blas<br><a target='_blank' href='http://sanblasbici.com/bici2.htm'>See more details/Ver mas detailles.</a><br><img src='http://sanblasbici.com/images/smallBici2Profile.png'/> ");
          });
          GEvent.addListener(marker2, "infowindowclose", function() {
            map.setCenter(new GLatLng(21.531014668261573,-105.13504028320312),10,G_HYBRID_MAP);
          });
          map.addOverlay(marker2);

          marker3 = new GMarker(new GLatLng(21.492685770347027,-105.19821166992188));
          GEvent.addListener(marker3, "click", function() {
            biciLogData("marClk bici3");
            marker3.openInfoWindowHtml("Cocodrilario - Aticama<br><a target='_blank' href='http://sanblasbici.com/bici3.htm'>See more details/Ver mas detailles.</a><br><img src='http://sanblasbici.com/images/smallBici3Profile.png'/> ");
          });
          GEvent.addListener(marker3, "infowindowclose", function() {
            map.setCenter(new GLatLng(21.531014668261573,-105.13504028320312),10,G_HYBRID_MAP);
          });
          map.addOverlay(marker3);

          marker4 = new GMarker(new GLatLng(21.555284406923192,-105.16525268554688));
          GEvent.addListener(marker4, "click", function() {
            biciLogData("marClk bici4");
            marker4.openInfoWindowHtml("Cocodrilario - Jose Maria Mercado alias Enfernillo - Cocodrilario<br><a target='_blank' href='http://sanblasbici.com/bici4.htm'>See more details/Ver mas detailles.</a><br><img src='http://sanblasbici.com/images/smallBici4Profile.png'/>");
          });
          GEvent.addListener(marker4, "infowindowclose", function() {
            map.setCenter(new GLatLng(21.531014668261573,-105.13504028320312),10,G_HYBRID_MAP);
          });
          map.addOverlay(marker4);

          marker5 = new GMarker(new GLatLng(21.653599107538813,-105.2874755859375));
          GEvent.addListener(marker5, "click", function() {
            biciLogData("marClk bici5");
            marker5.openInfoWindowHtml("San Blas - Chacalilla - Gpe. Victoria<br><a target='_blank' href='http://sanblasbici.com/bici5.htm'>See more details/Ver mas detailles.</a><br><img src='http://sanblasbici.com/images/smallBici5Profile.png'/>");
          });
          GEvent.addListener(marker5, "infowindowclose", function() {
            map.setCenter(new GLatLng(21.531014668261573,-105.13504028320312),10,G_HYBRID_MAP);
          });
          map.addOverlay(marker5);
          
          marker6 = new GMarker(new GLatLng(21.562947691539307,-105.216064453125));
          GEvent.addListener(marker6, "click", function() {
            biciLogData("marClk bici6");
            marker6.openInfoWindowHtml("San Blas - Singayta - La Libertad - San Blas<br><a target='_blank' href='http://sanblasbici.com/bici6.htm'>See more details/Ver mas detailles.</a><br><img src='http://sanblasbici.com/images/smallBici6Profile.png'/>");
          });
          GEvent.addListener(marker6, "infowindowclose", function() {
            map.setCenter(new GLatLng(21.531014668261573,-105.13504028320312),10,G_HYBRID_MAP);
          });
          map.addOverlay(marker6);

          marker7 = new GMarker(new GLatLng(21.607322912176354,-105.23391723632812));
          GEvent.addListener(marker7, "click", function() {
            biciLogData("marClk bici7");
            marker7.openInfoWindowHtml("San Blas - Singayta - La Libertad<br><a target='_blank' href='http://sanblasbici.com/bici7.htm'>See more details/Ver mas detailles.</a><br><img src='http://sanblasbici.com/images/smallBici7Profile.png'/>");
          });
          GEvent.addListener(marker7, "infowindowclose", function() {
            map.setCenter(new GLatLng(21.531014668261573,-105.13504028320312),10,G_HYBRID_MAP);
          });
          map.addOverlay(marker7);

          marker8 = new GMarker(new GLatLng(21.622962732592985,-105.15975952148438));
          GEvent.addListener(marker8, "click", function() {
            biciLogData("marClk bici8");
            marker7.openInfoWindowHtml("San Blas - Crucero - Tepic<br><a target='_blank' href='http://sanblasbici.com/bici8.htm'>See more details/Ver mas detailles.</a><br><img src='http://sanblasbici.com/images/smallBici8Profile.png'/>");
          });
          GEvent.addListener(marker8, "infowindowclose", function() {
            map.setCenter(new GLatLng(21.531014668261573,-105.13504028320312),10,G_HYBRID_MAP);
          });
          map.addOverlay(marker8);

          marker9 = new GMarker(new GLatLng(21.63636694623738,-105.01968383789062));
          GEvent.addListener(marker9, "click", function() {
            biciLogData("marClk bici9");
            marker9.openInfoWindowHtml("Cocodrilario - La Palma<br><a target='_blank' href='http://sanblasbici.com/bici9.htm'>See more details/Ver mas detailles.</a><br><img src='http://sanblasbici.com/images/smallBici9Profile.png'/>");
          });
          GEvent.addListener(marker9, "infowindowclose", function() {
            map.setCenter(new GLatLng(21.531014668261573,-105.13504028320312),10,G_HYBRID_MAP);
          });
          map.addOverlay(marker9);

          marker10 = new GMarker(new GLatLng(21.535485714513065,-105.11890411376953));
          GEvent.addListener(marker10, "click", function() {
            biciLogData("marClk bici10");
            marker10.openInfoWindowHtml("Cocodrilario - Mecatan - La Libertad<br><a target='_blank' href='http://sanblasbici.com/bici10.htm'>See more details/Ver mas detailles.</a><br><img src='http://sanblasbici.com/images/smallBici10Profile.png'/>");
          });
          GEvent.addListener(marker10, "infowindowclose", function() {
            map.setCenter(new GLatLng(21.531014668261573,-105.13504028320312),10,G_HYBRID_MAP);
          });
          map.addOverlay(marker10);

          marker11 = new GMarker(new GLatLng(21.53820021113882,-105.24816513061523));
          GEvent.addListener(marker11, "click", function() {
            biciLogData("marClk bici11");
            marker10.openInfoWindowHtml("Cattle Ranch<br><a target='_blank' href='http://sanblasbici.com/bici11.htm'>See more details/Ver mas detailles.</a><br><img src='http://sanblasbici.com/images/smallBici11Profile.png'/>");
          });
          GEvent.addListener(marker11, "infowindowclose", function() {
            map.setCenter(new GLatLng(21.531014668261573,-105.13504028320312),10,G_HYBRID_MAP);
          });
          map.addOverlay(marker11);
          
          marker12 = new GMarker(new GLatLng(21.5557633740754,-105.23923873901367));
          GEvent.addListener(marker12, "click", function() {
            biciLogData("marClk bici12");
            marker12.openInfoWindowHtml("Banco de Materiales<br><a target='_blank' href='http://sanblasbici.com/bici12.htm'>See more details/Ver mas detailles.</a><br><img src='http://sanblasbici.com/images/smallBici12Profile.png'/>");
          });
          GEvent.addListener(marker12, "infowindowclose", function() {
            map.setCenter(new GLatLng(21.531014668261573,-105.13504028320312),10,G_HYBRID_MAP);
          });
          map.addOverlay(marker12);
          
          marker13 = new GMarker(new GLatLng(21.582024317609154,-105.22825241088867));
          GEvent.addListener(marker13, "click", function() {
            biciLogData("marClk bici13");
            marker12.openInfoWindowHtml("Singayta<br><a target='_blank' href='http://sanblasbici.com/bici13.htm'>See more details/Ver mas detailles.</a><br><img src='http://sanblasbici.com/images/smallBici13Profile.png'/>");
          });
          GEvent.addListener(marker13, "infowindowclose", function() {
            map.setCenter(new GLatLng(21.531014668261573,-105.13504028320312),10,G_HYBRID_MAP);
          });
          map.addOverlay(marker13);

      }

      function changeMarkers(){
        if(document.getElementById("showMarkersID").checked){
          showMarkers();
        }else{
          hideMarkers();
        }
      }

      function showMarkers(){
        biciLogData("markers on");
        marker1.show();
        marker2.show();
        marker3.show();
        marker4.show();
        marker5.show();
        marker6.show();
        marker7.show();
        marker8.show();
        marker9.show();
        marker10.show();
        marker11.show();
        marker12.show();
        marker13.show();
      }

      function hideMarkers(){
        biciLogData("markers off");        
        marker1.hide();
        marker2.hide();
        marker3.hide();
        marker4.hide();
        marker5.hide();
        marker6.hide();
        marker7.hide();
        marker8.hide();
        marker9.hide();
        marker10.hide();
        marker11.hide();
        marker12.hide();
        marker13.hide();
      }

      function loadMap(){
          //log the page start
        biciLogData("start bici");      
          //check browser compatibility 
        if (GBrowserIsCompatible()) {
          map = new GMap2(document.getElementById("mapCanvas"));
          map.addControl(new GLargeMapControl());
          map.addControl(new GMapTypeControl());
	  map.addControl(new GScaleControl());
          map.setCenter(mapCenter,zoomLevel,G_HYBRID_MAP);
          kml = new GGeoXml("http://dcbrown.org/kml/bici1.kml");
          map.addOverlay(kml);
          kml = new GGeoXml("http://dcbrown.org/kml/bici2.kml");
          map.addOverlay(kml);
          kml = new GGeoXml("http://dcbrown.org/kml/bici3.kml");
          map.addOverlay(kml);
          kml = new GGeoXml("http://dcbrown.org/kml/bici4.kml");
          map.addOverlay(kml);
          kml = new GGeoXml("http://dcbrown.org/kml/bici5.kml");
          map.addOverlay(kml);
          kml = new GGeoXml("http://dcbrown.org/kml/bici6.kml");
          map.addOverlay(kml);
          kml = new GGeoXml("http://dcbrown.org/kml/bici7.kml");
          map.addOverlay(kml);
          kml = new GGeoXml("http://dcbrown.org/kml/bici8.kml");
          map.addOverlay(kml);
          kml = new GGeoXml("http://dcbrown.org/kml/bici9.kml");
          map.addOverlay(kml);
          kml = new GGeoXml("http://dcbrown.org/kml/bici10.kml");
          map.addOverlay(kml);
          kml = new GGeoXml("http://dcbrown.org/kml/bici11.kml");
          map.addOverlay(kml);
          kml = new GGeoXml("http://dcbrown.org/kml/bici12.kml");
          map.addOverlay(kml);
          kml = new GGeoXml("http://dcbrown.org/kml/bici13.kml");
          map.addOverlay(kml);
          addMarkers();
          document.getElementById("showMarkersID").checked=true;


          departMap = new GMap2(document.getElementById("departMapCanvas"));
          departMap.setCenter(new GLatLng(21.542471448645223,-105.28391361236572),16);
          var departMarker= new GMarker(new GLatLng(21.54203235525866,-105.28372049331665));
          departMap.addOverlay(departMarker);
          var label = new ELabel(new GLatLng(21.542671036109063,-105.28426766395569),"Minisuper El Puerto II", "style1");
          departMap.addOverlay(label);

        } //end browser compatibility if statement
    
          //browser not compatible
        else {
          alert("Sorry, the Google Maps API is not compatible with this browser");
        }
    }
