<!--
    var map;
    var CenterLat = 32;
    var CenterLon = 35;
    var Markers = [];
    var numPoints = 0;
    var myEmpire = "";
    var myPeriod = "";
    var icnRedDot;

    //---------------------------------------------------------------------------------
    function init() 
    {
    changeDivSizes();
    if (GBrowserIsCompatible()) 
    {
       // Setup the map options
       map = new GMap2(document.getElementById("map"));
       map.addControl(new GLargeMapControl());
       map.addControl(new GScaleControl());
       map.enableScrollWheelZoom();
       map.addMapType(G_PHYSICAL_MAP); 
       map.addControl(new GHierarchicalMapTypeControl());

       IcnRedDot = new GIcon; 
       IcnRedDot.image = "../images/RedDot.png";
       IcnRedDot.iconSize = new GSize(13,13);
       IcnRedDot.iconAnchor = new GPoint(7,7);
       IcnRedDot.infoWindowAnchor = new GPoint(7,7); 

       // Create the copyright collection
       var copyCollection = new GCopyrightCollection('PEF Maps Overlay ');
       var copyright = new GCopyright(1, new GLatLngBounds(new GLatLng(32.5468132, 34.4531250), new GLatLng(33.7243397, 35.8593750)), 0, "Created by the GAIA Lab");
       copyCollection.addCopyright(copyright);

       // Setup the tile layers
       var tilelayers = new Array();
       tilelayers[0] = G_SATELLITE_MAP.getTileLayers()[0];
       tilelayers[1] = new GTileLayer(copyCollection, 9, 15 );
       tilelayers[1].getTileUrl = CustomGetTileUrl
       tilelayers[1].getOpacity = function () {return 1.0;};//of the non transparent part
       tilelayers[1].isPng = function() {return true;}; 

       // Setup the options for our map layer
       var GMapTypeOptions = new Object();
       GMapTypeOptions.minResolution = 8;
       GMapTypeOptions.maxResolution = 15;
       GMapTypeOptions.errorMessage = "No map data available";

       // Create our custom map layer
       var custommap = new GMapType(tilelayers, new GMercatorProjection(22), "PEF Maps", GMapTypeOptions);
       custommap.getTextColor = function() {return "#000000";};
       map.addMapType(custommap);
       map.setCenter( new GLatLng(CenterLat, CenterLon), 9, custommap );

       icnRedDot = new GIcon; 
       icnRedDot.image = "../images/RedDot.png";
       icnRedDot.iconSize = new GSize(13,13);
       icnRedDot.iconAnchor = new GPoint(7,7);
       icnRedDot.infoWindowAnchor = new GPoint(7,7); 

       // Turn on the site points in the view window...
       updateMarkers();
       GEvent.addListener(map,'moveend',function() { removeMarkers(); updateMarkers(); });
    }
    }

    //----------------------------------------------------------
    // changeDivSizes -- Changes the div sizes to match screen
    //----------------------------------------------------------
    function changeDivSizes() {
      var myWidth = screen.width;
      var myHeight = screen.height;
      if (myWidth > 1280) {
          s = document.getElementById('wrapper');
          s.style.width= myWidth - 50;
          s = document.getElementById('side-a');
          s.style.width= myWidth - 730;
          s = document.getElementById('mapBlock');
          s.style.height= myHeight - 450;
          s = document.getElementById('columnRight');
          s.style.height= myHeight - 340;
      }
    }

    //-----------------------------------------------------------------------------------------
    // Get the map tiles needed...
    //-----------------------------------------------------------------------------------------
    function CustomGetTileUrl(a,b)
    {
        if ( b == 9 && a.x >= 304 && a.x <= 307 && a.y >= 205 && a.y <= 209 )
        {
            return "http://gaialab.asu.edu/DAAHL/PEF/Z" + b + "/" + a.y + "_" + a.x + ".png"; // replace that with a "real" URL
        }
        else if ( b == 10 && a.x >= 609 && a.x <= 614 && a.y >= 411 && a.y <= 418 )
        {
            return "http://gaialab.asu.edu/DAAHL/PEF/Z" + b + "/" + a.y + "_" + a.x + ".png"; // replace that with a "real" URL
        }
        else if ( b == 11 && a.x >= 1218 && a.x <= 1229 && a.y >= 822 && a.y <= 837 )
        {
            return "http://gaialab.asu.edu/DAAHL/PEF/Z" + b + "/" + a.y + "_" + a.x + ".png"; // replace that with a "real" URL
        }
        else if ( b == 12 && a.x >= 2437 && a.x <= 2458 && a.y >= 1644 && a.y <= 1674 )
        {
            return "http://gaialab.asu.edu/DAAHL/PEF/Z" + b + "/" + a.y + "_" + a.x + ".png"; // replace that with a "real" URL
        }
        else if ( b == 13 && a.x >= 4874 && a.x <= 4917 && a.y >= 3288 && a.y <= 3348 )
        {
            return "http://gaialab.asu.edu/DAAHL/PEF/Z" + b + "/" + a.y + "_" + a.x + ".png"; // replace that with a "real" URL
        }
        else if ( b == 14 && a.x >= 9748 && a.x <= 9834 && a.y >= 6576 && a.y <= 6697 )
        {
            return "http://gaialab.asu.edu/DAAHL/PEF/Z" + b + "/" + a.y + "_" + a.x + ".png"; // replace that with a "real" URL
        }
        else if ( b == 15 && a.x >= 19496 && a.x <= 19669 && a.y >= 13153 && a.y <= 13395 )
        {
            return "http://gaialab.asu.edu/DAAHL/PEF/Z" + b + "/" + a.y + "_" + a.x + ".png"; // replace that with a "real" URL
        }
        return G_SATELLITE_MAP.getTileLayers()[0].getTileUrl(a,b);
    }

    //-----------------------------------------------------------------------------------------
    // remove the existing Site Points
    //-----------------------------------------------------------------------------------------
    function removeMarkers() {
        if (numPoints>0) {
        for (var x=0;x<numPoints;x++) 
        {
        map.removeOverlay(Markers.pop());
        }
        Markers = [];
            numPoints = 0;
        }
    }

    //-----------------------------------------------------------------------------------------
    // Displays site points if the map is zoomed in enough.
    //-----------------------------------------------------------------------------------------
    function updateMarkers() 
    { map.clearOverlays();  
     if (map.getZoom() > 10) {
        //create the boundary for the data
            var bounds = map.getBounds();
            var southWest = bounds.getSouthWest();
            var northEast = bounds.getNorthEast();
            var getVars = 'ne=' + northEast.toUrlValue() + '&sw=' + southWest.toUrlValue() + '&empire=' + myEmpire + '&p=' + myPeriod; 
            //log the URL for testing
            //GLog.writeUrl('GMShowSites.php?'+getVars);

            //retrieve the points using Ajax
            var request = GXmlHttp.create();
            request.open('GET', 'GMShowSites.php?'+getVars, true);
            request.onreadystatechange = function() {
            if (request.readyState == 4) {
                var jscript = request.responseText;
                eval(jscript);
                var points;
                //create each point from the list
                numPoints=0;
                for (i in points)  {
                     var point = new GLatLng(points[i].lat,points[i].lng);
                     var marker = createMarker(point,points[i].Site,points[i].Name);
                     Markers[numPoints] = marker;
                     map.addOverlay(Markers[numPoints]);
                     numPoints++;
                   } // end for
            } // end if
        } // end internal function call
            request.send(null);
    } // end if map.getZoom block
    }

    //-----------------------------------------------------------------------------------------
    // Creates a marker whose info window displays the given site name
    //-----------------------------------------------------------------------------------------
    function createMarker(point, html, siteName) 
    {
      var marker = new GMarker(point, {title:siteName, icon:icnRedDot});
      GEvent.addListener(marker, 'click', function() {var markerHTML = html; marker.openInfoWindowHtml(markerHTML); });
      return marker;
    }

-->