﻿
        var map; 

        function initMap()
        {
            loadMap();
            map.checkResize();
        }
        
        function createMarker(point, html, iconPath, shadowPath) 
        { 
            //alert(iconPath);
            if (iconPath == '')
            {
                var icon = new GIcon(G_DEFAULT_ICON); 
            }
            else
            {   
                var icon = new GIcon(G_DEFAULT_ICON);
                icon.image = iconPath;
                icon.iconSize = new GSize(32, 32);
                icon.shadow = shadowPath;
                icon.shadowSize = new GSize(59, 32);
            }
            
            var marker = new GMarker(point, icon); 
            return marker; 
        } 
        
        //var baseIcon = new GIcon();
        //baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
        //baseIcon.iconSize = new GSize(20, 34);
        //baseIcon.shadowSize = new GSize(37, 34);
        //baseIcon.iconAnchor = new GPoint(9, 34);
        //baseIcon.infoWindowAnchor = new GPoint(9, 2);
        //baseIcon.infoShadowAnchor = new GPoint(18, 25);
        
        function createHotelMarker(point, index, html)
        {     
            // create icon
            var letter = String.fromCharCode("A".charCodeAt(0) + index);
            var letteredIcon = new GIcon(baseIcon);
            letteredIcon.image = "http://www.google.com/mapfiles/marker" + letter + ".png";
            
            // create and return marker
            var marker = new GMarker(point, letteredIcon); 
            GEvent.addListener(marker, "click", function() {html; map.openInfoWindowHtml(point, html);  });
            return marker;
        }

        function getWeatherMarkers(n) {
          var batch = [];
          for (var i = 0; i < n; ++i) {
            batch.push(new GMarker(getRandomPoint(), 
              { icon: getWeatherIcon() }));
          }
          return batch;
        }

        function setupWeatherMarkers() {
          mgr = new GMarkerManager(map);
          mgr.addMarkers(getWeatherMarkers(20), 3);
          mgr.addMarkers(getWeatherMarkers(200), 6);
          mgr.addMarkers(getWeatherMarkers(1000), 8);
          mgr.refresh();
        }
        
        function getRandomPoint() {
            var lat = 48.25 + (Math.random() - 0.5)*14.5;
            var lng = 11.00 + (Math.random() - 0.5)*36.0;
            return new GLatLng(Math.round(lat*10)/10, Math.round(lng*10)/10);
        }

