
googleMap = true;

var map;
var baseIcon;
var gmarkers = [];
var htmls = [];
function ShowMap(){
	var bounds = new GLatLngBounds();

	map = new GMap2(document.getElementById("map"));
	map.setCenter(new GLatLng(50.055155,19.926624), 6);
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());

	baseIcon = new GIcon();
	baseIcon.image = "../Images/Markers/marker.png";
	baseIcon.shadow = "../Images/Markers/shadow50.png";
	baseIcon.iconSize = new GSize(20, 34);
	baseIcon.shadowSize = new GSize(37, 34);
	baseIcon.iconAnchor = new GPoint(9, 34);
	baseIcon.infoWindowAnchor = new GPoint(9, 2);
	baseIcon.infoShadowAnchor = new GPoint(18, 25);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.05851,19.937659);
	bounds.extend(point);
	var marker = createMarker(point, "Wawel Royal Castle", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Wawel Royal Castle</b><br>This castle is home to much Polish culture<br>and heritage. Home to Polish monarchs<br>find an exqusite building filled<br>with priceless art and rare ancient<br>objects.<br>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Wawel Royal Castle</b><br>This castle is home to much Polish culture<br>and heritage. Home to Polish monarchs<br>find an exqusite building filled<br>with priceless art and rare ancient<br>objects.<br>";
	map.addOverlay(marker);


	var icon = new GIcon(baseIcon);
	var point = new GLatLng(49.977997,20.061722);
	bounds.extend(point);
	var marker = createMarker(point, "Wieliczka Salt Mine", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Wieliczka Salt Mine</b><br>This is Europe's oldest salt mine and<br>was placed on UNESCO's world list in 1978.<br>Many famous tourists have visited, including<br>Copernicus {1493}, Goethe {1790}, political leaders,<br>scientists, and artists.", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Wieliczka Salt Mine</b><br>This is Europe's oldest salt mine and<br>was placed on UNESCO's world list in 1978.<br>Many famous tourists have visited, including<br>Copernicus {1493}, Goethe {1790}, political leaders,<br>scientists, and artists.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.05552,19.935057);
	bounds.extend(point);
	var marker = createMarker(point, "Wawel Cathedral", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Wawel Cathedral</b><br>Poland's impressive national shrine shelters plenty of<br>superb church art. Among its 18 chapels<br>are true architectural masterpieces.<br>The giant bell Zygmunt of 1520 ranks with<br>the world's largest. Most Polish kings<br>and their family members are buried<br>in the cathedral, its chapels and crypts, together<br>with the greatest national heroes, two<br>poets, four saints and numerous bishops.<br>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Wawel Cathedral</b><br>Poland's impressive national shrine shelters plenty of<br>superb church art. Among its 18 chapels<br>are true architectural masterpieces.<br>The giant bell Zygmunt of 1520 ranks with<br>the world's largest. Most Polish kings<br>and their family members are buried<br>in the cathedral, its chapels and crypts, together<br>with the greatest national heroes, two<br>poets, four saints and numerous bishops.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.061203,19.938201);
	bounds.extend(point);
	var marker = createMarker(point, "Cloth Hall", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Cloth Hall</b><br>The world's oldest shopping mall has<br>been in business for 700 years. The present<br>Renaissance edifice dates from 1555.<br>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Cloth Hall</b><br>The world's oldest shopping mall has<br>been in business for 700 years. The present<br>Renaissance edifice dates from 1555.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.065445,19.941945);
	bounds.extend(point);
	var marker = createMarker(point, "The Great Barbican", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Great Barbican</b><br>Krakow's main city gate, Brama Florianska,<br>was made insurmountable in the beginning of the l6th<br>century thanks to Europe's mightiest barbican.<br>The circular marvel of military architecture<br>surrounds space 24.4 meter in diameter.<br>Nowadays the 500-year-old fortification serves<br>occasionally for a summer concert hall, theater etc.<br></p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Great Barbican</b><br>Krakow's main city gate, Brama Florianska,<br>was made insurmountable in the beginning of the l6th<br>century thanks to Europe's mightiest barbican.<br>The circular marvel of military architecture<br>surrounds space 24.4 meter in diameter.<br>Nowadays the 500-year-old fortification serves<br>occasionally for a summer concert hall, theater etc.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.065686,19.938866);
	bounds.extend(point);
	var marker = createMarker(point, "Planty Garden Ring", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Planty Garden Ring</b><br>Krakow's medieval city walls were largely demolished<br>after 1807 save the part with the main gate,<br>its adjoining towers and the great barbican.<br>Fortunately, a green belt of public parks called<br>Planty took up the emptied area of 52 acres<br>in the 1820s. It takes an hour to two<br>hours to walk around the Old Town historical<br>district down the leafy alleys<br>among old trees.<br></p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Planty Garden Ring</b><br>Krakow's medieval city walls were largely demolished<br>after 1807 save the part with the main gate,<br>its adjoining towers and the great barbican.<br>Fortunately, a green belt of public parks called<br>Planty took up the emptied area of 52 acres<br>in the 1820s. It takes an hour to two<br>hours to walk around the Old Town historical<br>district down the leafy alleys<br>among old trees.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.057139,19.854527);
	bounds.extend(point);
	var marker = createMarker(point, "Las Wolski Zoo", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Las Wolski Zoo</b><br>This zoo is situated inside a huge forest<br>(Las Wolski). There are about a thousand or<br>so animals inside and there is a feeding<br>show between 1pm and 3pm (enquire for details of<br>which animals are to be fed when). <br></p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Las Wolski Zoo</b><br>This zoo is situated inside a huge forest<br>(Las Wolski). There are about a thousand or<br>so animals inside and there is a feeding<br>show between 1pm and 3pm (enquire for details of<br>which animals are to be fed when). <br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.059887,19.920284);
	bounds.extend(point);
	var marker = createMarker(point, "National Museum", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>National Museum</b><br>Main building of Poland's richest museum, with<br>branches scattered all around Krakow's downtown, is the<br>chief venue for temporary exhibitions-sometimes<br>sensational, always interesting. The gallery<br>of the 20th-century Polish art upstairs houses<br>nearly 500 outstanding works by Poland's<br>modern artists, with a tilt towards those most<br>important for Krakow.<br></p>", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>National Museum</b><br>Main building of Poland's richest museum, with<br>branches scattered all around Krakow's downtown, is the<br>chief venue for temporary exhibitions-sometimes<br>sensational, always interesting. The gallery<br>of the 20th-century Polish art upstairs houses<br>nearly 500 outstanding works by Poland's<br>modern artists, with a tilt towards those most<br>important for Krakow.<br></p>";
	map.addOverlay(marker);
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.061843,19.936559);
	bounds.extend(point);
	var marker = createMarker(point, "Town Hall Tower", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Town Hall Tower</b><br>Krakow has its own leaning tower. In fact, the 70-m-tall<br>Town Hall Tower at the city's central Grand Square<br>leans just 55 cm. Visitors ready to climb<br>the tower up its 100-step narrow and steep stairs<br>can enjoy the panoramic view from the top. They<br>may also see the exhibition of the City of Krakow<br>Historical Museum pertaining to the history of<br>the municipality.<br></p>", 9);
	gmarkers[8] = marker;
	htmls[8] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Town Hall Tower</b><br>Krakow has its own leaning tower. In fact, the 70-m-tall<br>Town Hall Tower at the city's central Grand Square<br>leans just 55 cm. Visitors ready to climb<br>the tower up its 100-step narrow and steep stairs<br>can enjoy the panoramic view from the top. They<br>may also see the exhibition of the City of Krakow<br>Historical Museum pertaining to the history of<br>the municipality.<br></p>";
	map.addOverlay(marker);

var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.061664,19.939005);
	bounds.extend(point);
	var marker = createMarker(point, "Basilica of the Virgin Mary's", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Basilica of the Virgin Mary's</b><br>The basilica of the Virgin Mary's (or Kosciol,<br>Mariacki) at Krakow's central Grand Square has<br>been traditionally the temple of choice of the city's<br>burghers. Sepulchral monuments of the Krakow rich<br>and worthy fill every corner of the basilica and its<br>twelve chapels. Ornate stalls in the chancel appear<br>an outstanding achievement of the early-Baroque<br>woodwork. The wall-paintings by famous Jan Matejko date back<br>to the 1888-1891 renovation. The treasure-house of<br>the basilica of the Virgin Mary's is rich<br>in priceless objects of art, including some 300<br>masterly embroidered ancient vestments.<br></p>", 10);
	gmarkers[9] = marker;
	htmls[9] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Basilica of the Virgin Mary's</b></b><br>The basilica of the Virgin Mary's (or Kosciol,<br>Mariacki) at Krakow's central Grand Square has<br>been traditionally the temple of choice of the city's<br>burghers. Sepulchral monuments of the Krakow rich<br>and worthy fill every corner of the basilica and its<br>twelve chapels. Ornate stalls in the chancel appear<br>an outstanding achievement of the early-Baroque<br>woodwork. The wall-paintings by famous Jan Matejko date back<br>to the 1888-1891 renovation. The treasure-house of<br>the basilica of the Virgin Mary's is rich<br>in priceless objects of art, including some 300<br>masterly embroidered ancient vestments.<br></p>";
	map.addOverlay(marker);
	
	map.setZoom(map.getBoundsZoomLevel(bounds));
	map.savePosition();
}

function createMarker(point, title, text, index){
	var icon = new GIcon(baseIcon);
	icon.image = "../images/icons/" + index + ".png";
	var marker = new GMarker(point, icon);
	marker.title = "" + title + "";
	GEvent.addListener(marker, "click", function() {
	  marker.openInfoWindowHtml("" + text + "");
	});
	return marker;
}

function myclick(i) {
	gmarkers[i].openInfoWindowHtml(htmls[i]);
}
