jQuery(document).ready(function() {
  initialize();
});

jQuery("body").unload(function() {
  GUnload(); 
});

var map = null;

function initialize() {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map_canvas"), { size : new GSize(270, 330) });
		
		var point = new GLatLng(60.790209, 10.69775);
		map.setCenter(point, 14);
		addMarker(point);
		map.addControl(new GSmallMapControl());
  }
}

function addMarker(point) {
	var icon = new GIcon();
	icon.image = "/wp-content/themes/sebas/img/map-marker.png";
	icon.shadow = "/wp-content/themes/sebas/img/map-marker-shadow.png";
	icon.iconSize = new GSize(148, 52);
	icon.shadowSize = new GSize(175, 52);
	icon.iconAnchor = new GPoint(33, 52);
	icon.infoWindowAnchor = new GPoint(2, 2);
	var marker = new GMarker(point, icon);
	map.addOverlay(marker);
	/*GEvent.addListener(marker, "click", function() {
            marker.openInfoWindowHtml("Marker <b>yo</b>");
          });*/

}
