google.load("maps", "2.x");
google.setOnLoadCallback(initialize);

/**
The call-back function to initialize and display the map
*/
function initialize()
{

		var map = new GMap2(document.getElementById("gmap_container"));

		typ_mapy = G_HYBRID_MAP;

		// set the map type and the control type
		map.addMapType(G_PHYSICAL_MAP);
		map.addControl(new GLargeMapControl());

		// Move the center of the map to where your location is
		var center = new GLatLng(lat,lon);

		// the zoom level
		var zoom = 7;
		map.setCenter(center, zoom, typ_mapy);

		// Create the point of your location
		var pnt= new GLatLng(lat,lon);
		// And insert the red marker on the map to indicate your position
		map.addOverlay(createMarker(pnt,1,map));

}

/**
The function to create a red marker on the Google Map
*/
function createMarker(point, number,map) {
	var marker = new GMarker(point);
	marker.value = number;

	/*
	Add a listener for mouseover event, when the user has the mouse
	over, it will have a little pop-up to show the user's own location */
	GEvent.addListener(marker, 'mouseover', function() {
			var myHtml = '<font style="font-size:8pt;">You are in '+addr+' (latitude :'+lat+', longitude:'+lon+')</font>';
			map.openInfoWindowHtml(point, myHtml);});
	return marker;
}
