addLoadListener(init);
addLoadListener(showMap);




 function showMap()
        {
      if (GBrowserIsCompatible()) { 
        
      function createMarker(point,html) {
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        return marker;
      }

      // Display the map, with some controls and set the initial location 
      var map = new GMap2(document.getElementById("map"));
     map.addControl(new GSmallMapControl());	
     map.addControl(new GMapTypeControl());
     map.setCenter(new GLatLng(-16.922863374534437, 145.7701849937439),15);
    
      // Set up three markers with info windows 
    
   

      var point = new GLatLng(-16.922863374534437, 145.7701849937439);
   var marker = createMarker(point,'<div class="map-info-desc"><img src="' + base + 'images/map-sml.jpg" height="82" width="55"><h4>Southern Cross Atrium Apartments</h4><p>3-11 Water Street<br/ >Cairns<br/ > Queensland<br />4870</p></div>');
     map.addOverlay(marker);
      
      
      GEvent.addListener(map, "moveend", function() {
          var center = map.getCenter();
          //document.getElementById("message").innerHTML = center.toString();
        });

    }
    
    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }

    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/   
    // http://econym.googlepages.com/index.htm

    //]]>
        }
    //]]>
  


function init()
{
   
    //<![CDATA[
   

  return true;
};

function addLoadListener(fn)
{
  if (typeof window.addEventListener != 'undefined')
  {
    window.addEventListener('load', fn, false);
  }
  else if (typeof document.addEventListener != 'undefined')
  {
    document.addEventListener('load', fn, false);
  }
  else if (typeof window.attachEvent != 'undefined')
  {
    window.attachEvent('onload', fn);
  }
  else
  {
    var oldfn = window.onload;
    if (typeof window.onload != 'function')
    {
      window.onload = fn;
    }
    else
    {
      window.onload = function()
      {
        oldfn();
        fn();
      };
    }
  }
};
