google.load("maps", "5");
google.load("search", "1");

function OnLoad() {

  var Items = [
	{
	 name: "Vital Aparthotel",
	 address: "Mariana Langiewicza 12, 31-358 Kraków",
	 coords: [50.080092, 19.948726]
	}
	];

//ll=50.080092,19.948726
  
	// Create a map control
	var map = new GMap2(document.getElementById("gmap"));
	map.setCenter(new GLatLng(Items[0]["coords"][0], Items[0]["coords"][1]), 15);
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());
	//map.setZoom(14);

	// Add in a full set of icons
	var itemIcon = new GIcon();
	itemIcon.image = 'templates/images/gmap/fl_wroc.png';
	itemIcon.shadow = 'templates/images/gmap/cien.png';
	itemIcon.transparent = 'templates/images/gmap/alpha_fl_wroc.png';
	itemIcon.iconSize = new GSize(29, 30);
	itemIcon.shadowSize = new GSize(44, 30);
	itemIcon.iconAnchor = new GPoint(2, 30);
	itemIcon.infoWindowAnchor = new GPoint(13, 14);

  // Create array of markers
	var markers = new Array();

//  for (var i = 0; i < Items.length; i++)
//	{
	 markers[0] = new GMarker(new GLatLng(Items[0]["coords"][0], Items[0]["coords"][1]), itemIcon);
	 markers[0].hotelData = Items[0];
	 map.addOverlay(markers[0]);
	 GEvent.addListener(map, "click",
	   function (marker, point)
	   {
	     if (marker && marker.hotelData)
		    marker.openInfoWindowHtml("<b>"+marker.hotelData['name']+"</b><br /><br />"+marker.hotelData['address']);
	   }
	 );
//	}
}
google.setOnLoadCallback(OnLoad);
