
var baseIcon = null;
var geocoder = null;
var map = null;

function createMarker(point, title, link) {
    // Create a lettered icon for this point using our icon class
    var letteredIcon = new GIcon(baseIcon);
    letteredIcon.image = "http://www.enggaard.dk/theme/aenggaard/img/marker.png";
    
    // Set up our GMarkerOptions object
    markerOptions = { icon:letteredIcon };
    var marker = new GMarker(point, markerOptions);
    
    GEvent.addListener(marker, "click", function() {
    	marker.openInfoWindowHtml(title+"<br/><b><a href='"+link+"'>Se lejemålet</a></b>");
    });
    return marker;
  }
function initializeGmap(){
	if (GBrowserIsCompatible()) {
	  	geocoder = new GClientGeocoder();
	  	
	    map = new GMap2(document.getElementById("map_canvas"));
	    map.setCenter(new GLatLng(56.183189, 9.551722), 7);
	    map.setUIToDefault();
	
	    // Create a base icon for all of our markers that specifies the
	    // shadow, icon dimensions, etc.
	    baseIcon = new GIcon(G_DEFAULT_ICON);
	    baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
	    baseIcon.iconSize = new GSize(30, 40);
	    baseIcon.shadowSize = new GSize(37, 34);
	    baseIcon.iconAnchor = new GPoint(9, 34);
	    baseIcon.infoWindowAnchor = new GPoint(9, 2);
	}
}
