
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(47.498242,19.042311), 14);
	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(47.507331,19.045959);
	bounds.extend(point);
	var marker = createMarker(point, "The Houses of Parliament", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Houses of Parliament</b><br/>The 19th century Parliament Building is situated<br>at Pest's riverbank. The magnificent structure is<br>a symbol of Hungary's independence.</p>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Houses of Parliament</b><br/>The 19th century Parliament Building is situated<br>at Pest's riverbank. The magnificent structure is<br>a symbol of Hungary's independence.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(47.49598,19.040562);
	bounds.extend(point);
	var marker = createMarker(point, "Buda Castle", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Buda Castle</b><br>Rising 48 meters above the Danube, the Castle Hill or Varhegy<br>nevertheless dominates the city. This hill is the place where<br>Budapest was founded. It is a small, densely built rock, with<br>the Buda Castle as the most prominent building.</p>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Buda Castle</b><br>Rising 48 meters above the Danube, the Castle Hill or Varhegy<br>nevertheless dominates the city. This hill is the place where<br>Budapest was founded. It is a small, densely built rock, with<br>the Buda Castle as the most prominent building.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(47.501844,19.033996);
	bounds.extend(point);
	var marker = createMarker(point, "Matthias Church", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Matthias Church</b><br>Officially known as The Church of Our Lady, Budapest's St.<br>Matthias Church, like many of the city's ecclesiastical structures,<br>has a long and complicated history. Once inside a favorite stopping<br>place of most visitors is the Ecclesiastical Art Museum.</p>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Matthias Church</b><br>Officially known as The Church of Our Lady, Budapest's St.<br>Matthias Church, like many of the city's ecclesiastical structures,<br>has a long and complicated history. Once inside a favorite stopping<br>place of most visitors is the Ecclesiastical Art Museum.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(47.502315,19.058747);
	bounds.extend(point);
	var marker = createMarker(point, "Hungarian National State Opera House", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Hungarian National State Opera House</b><br>The building of the Hungarian State Opera House is a splendid example<br>of neorenaissaince architecture. The auditorium holds 1261 seats. It is<br>horseshue shaped and has the 3rd best acoustics in Europe. Although<br>many opera houses have been built since, the Budapest Opera House<br>is still among the best in terms of the acoustics.</p>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Hungarian National State Opera House</b><br>The building of the Hungarian State Opera House is a splendid example<br>of neorenaissaince architecture. The auditorium holds 1261 seats. It is<br>horseshue shaped and has the 3rd best acoustics in Europe. Although<br>many opera houses have been built since, the Budapest Opera House<br>is still among the best in terms of the acoustics.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(47.490732,19.048855);
	bounds.extend(point);
	var marker = createMarker(point, "Elizabeth Bridge", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Elizabeth Bridge</b><br>The second newest bridge and one of the most elegant ones of Budapest,<br>Hungary, connecting Buda and Pest across the River Danube. It is situated<br>at the narrowest part of the Danube, the bridge spanning only 290 m.</p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Elizabeth Bridge</b><br>The second newest bridge and one of the most elegant ones of Budapest,<br>Hungary, connecting Buda and Pest across the River Danube. It is situated<br>at the narrowest part of the Danube, the bridge spanning only 290 m.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(47.498749,19.042504);
	bounds.extend(point);
	var marker = createMarker(point, "The Chain Bridge", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Chain Bridge</b><br>A suspension bridge that spans the River Danube between Buda and<br>Pest, the western and eastern sides of Budapest, the capital of Hungary.<br>It was the first permanent bridge across the Danube in Budapest, and<br>was opened in 1849.</p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Chain Bridge</b><br>A suspension bridge that spans the River Danube between Buda and<br>Pest, the western and eastern sides of Budapest, the capital of Hungary.<br>It was the first permanent bridge across the Danube in Budapest, and<br>was opened in 1849.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(47.491377,19.054134);
	bounds.extend(point);
	var marker = createMarker(point, "Vaci Street", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Vaci Street</b><br>This was the first street in Budapest to be pedestrianized, but it was one<br>of the best places for shopping long before this change. The street was<br>formed in the 18th century but most houses date back to the 19th and<br>early 20th century.</p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Vaci Street</b><br>This was the first street in Budapest to be pedestrianized, but it was one<br>of the best places for shopping long before this change. The street was<br>formed in the 18th century but most houses date back to the 19th and<br>early 20th century.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(47.49664,19.050089);
	bounds.extend(point);
	var marker = createMarker(point, "Vorosmarty Square", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Vorosmarty Square</b><br>Named after a favorite patriotic Hungarian poet, Mihaly Vorosmarty Square<br>is centrally located and easy to reach from most areas of Budapest, making<br>it an ideal location for shopping or just strolling.</p>", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Vorosmarty Square</b><br>Named after a favorite patriotic Hungarian poet, Mihaly Vorosmarty Square<br>is centrally located and easy to reach from most areas of Budapest, making<br>it an ideal location for shopping or just strolling.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(47.491631,19.061558);
	bounds.extend(point);
	var marker = createMarker(point, "The Hungarian National Museum", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Hungarian National Museum</b><br>The Hungaryan National Museum is the most significant, and one of the<br>oldest collection of Hungary. As the first museum of Hungary, it was<br>founded by a highly educated peer, count Ferenc Szechenyi, in 1802,<br>who offered his manuscript, map, numismatic and print collection to<br>form a core material for a national museum to be built.</p>", 9);
	gmarkers[8] = marker;
	htmls[8] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Hungarian National Museum</b><br>The Hungaryan National Museum is the most significant, and one of the<br>oldest collection of Hungary. As the first museum of Hungary, it was<br>founded by a highly educated peer, count Ferenc Szechenyi, in 1802,<br>who offered his manuscript, map, numismatic and print collection to<br>form a core material for a national museum to be built.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(47.484011,19.051591);
	bounds.extend(point);
	var marker = createMarker(point, "Gellert Bath", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Gellert Bath</b><br>The Gellert is the oldest Hungarian spa hotel. The springs that<br>supply the baths with hot healing waters have been flowing for<br>at least 2,000 years.</p>", 10);
	gmarkers[9] = marker;
	htmls[9] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Gellert Bath</b><br>The Gellert is the oldest Hungarian spa hotel. The springs that<br>supply the baths with hot healing waters have been flowing for<br>at least 2,000 years.</p>";
	map.addOverlay(marker);


}

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]);
}
