var map;
var customIcon = new GIcon();
customIcon.iconSize = new GSize(26, 26);
customIcon.iconAnchor = new GPoint(3, 20);
function loadMap() {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map"));
		setLocation(40, 0, 1);
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		addMarkers();
	}
}
function createMarker(point, info, notice) {
	var marker = new GMarker(point);
	var infoTabs = [];
	infoTabs[0] = new GInfoWindowTab('Location', info);
	if(notice != undefined && notice.length) infoTabs[1] = new GInfoWindowTab('Notice', notice);
	GEvent.addListener(marker, "click", function() {map.openInfoWindowTabsHtml(point, infoTabs);});
	return marker;
}
function createCustomMarker(point) {
	var userIcon = new GIcon(customIcon);
	userIcon.image = "/images/map-location.png";
	markerOptions = {icon:userIcon};
	var marker = new GMarker(point, markerOptions);
	return marker;
}
function setLocation(t, g, z) {
	map.setCenter(new GLatLng(t, g), z);
}

