
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.087547,14.4417), 12);
	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.086542,14.41141);
	bounds.extend(point);
	var marker = createMarker(point, "Charles Bridge", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Charles Bridge</b><br>Old Town, Prague 1</b> 0113 2863084<br></p>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Charles Bridge</b><br>One of Prague's most romantic sights, this a famous<br /> historical bridge that crosses the Vltava river in <br />Prague, is one of the most visited sights in Prague.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.083238,14.394987);
	bounds.extend(point);
	var marker = createMarker(point, "Petrin Park", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Petrin Park</b><br /> Ujezd Street<br />Prague 110 00<br /> Czech Republic<br/>Petrin Park is the largest park in Prague and a <br/>walk up here affords great views over the city <br/>as well as a chance to take a breather from all<br/>the architecture overload in the town<p>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Petrin Park</b><br/>Petrin Park is the largest park in Prague and a <br/>walk up here affords great views over the city <br/>as well as a chance to take a breather from all<br/>the architecture overload in the town</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.088731,14.405737);
	bounds.extend(point);
	var marker = createMarker(point, "St Nicholas Church", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>St Nicholas Church</b><br />The most magnificent baroque building in Prague,<br /> its construction was finished in 1756, and features<br/> a dominant cupola and bell tower, as well as one <br/>of the largest paintings in Europe depicting<br/>  St Nicholas in various guises</p>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>St Nicholas Church</b><br />The most magnificent baroque building in Prague,<br /> its construction was finished in 1756, and features<br/> a dominant cupola and bell tower, as well as one <br/>of the  largest paintings in Europe depicting<br/>  St Nicholas in various guises</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.064805,14.418021);
	bounds.extend(point);
	var marker = createMarker(point, "Vysehrad Castle", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Vysehrad Castle</b><br />V Pevnosti 159/5b<br />CZ 128 00 Prague 2<br />Czech Republic<br />Vysehrad or the “Castle on the heights” is a beautiful<br /> place to visit any time of day or season, from which<br /> you can admire a fabulous view over Prague</p>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Vysehrad Castle</b><br />Vysehrad or the &quot;Castle on the heights&quot; is a beautiful<br /> place to visit any time of day or season, from which<br /> you can admire a fabulous view over Prague</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.087533,14.421262);
	bounds.extend(point);
	var marker = createMarker(point, "Old Town Square", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Old Town Square</b></p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Old Town Square</b><br />Old Town Square in Prague. With it's origins in the <br />12th century, the Old Town Square is one of the most<br /> beautiful historical sights in Europe.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.118397,14.407346);
	bounds.extend(point);
	var marker = createMarker(point, "Prague Zoo", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Prague Zoo</b></p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Prague Zoo</b><br/>Prague Zoo is said to be one of the best in Europe<br />and could easily keep your kids busy for one entire<br />day. The Zoo does its best to be a pleasant and<br />interesting place for everybody and if you take a few<br />minutes and organize your trip it can really be an<br />unforgettable experience.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.081572,14.427119);
	bounds.extend(point);
	var marker = createMarker(point, "Wenceslas Square", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Wenceslas Square</b><br />Wenceslas Square in Prague. Prague's main boulevard<br/> is a vibrant centre for apartments, hotels, bars, clubs,<br/> restaurants and shops</p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Wenceslas Square</b><br />Wenceslas Square in Prague. Prague's main boulevard<br/> is a vibrant centre for apartments, hotels, bars, clubs,<br/> restaurants and shops.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.07552,14.414202);
	bounds.extend(point);
	var marker = createMarker(point, "Dancing House", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Dancing House</b> Dancing House cuts a fine figure <br />alongside the river, a strikingly modern contrast<br /> to Prague's historic attractions.></p>", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Dancing House</b><br/>The Dancing House cuts a fine figure <br />alongside the river, a strikingly modern contrast<br /> to Prague's historic attractions.</p>";
	map.addOverlay(marker);
	

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.087279,14.428192);
	bounds.extend(point);
	var marker = createMarker(point, "Powder Gate", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Powder Gate</b><br/>Powder Gate in Prague. Dates back to the 11th century, <br />when the original gate was one of 13 entrances to <br />Prague's Old Town.</p>", 9);
	gmarkers[8] = marker;
	htmls[8] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Powder Gate</b><br/>Powder Gate in Prague. Dates back to the 11th century,<br />when the original gate was one of 13 entrances to<br />Prague's Old Town.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(50.083444,14.413333);
	bounds.extend(point);
	var marker = createMarker(point, "Prague Castle", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Prague Castle</b></p>", 10);
	gmarkers[9] = marker;
	htmls[9] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Prague Castle</b><br /> is the castle in Prague where the Czech kings,<br /> Holy Roman Emperors and presidents of<br />Czechoslovakia and the Czech Republic have had <br />their offices. The crown jewels of the Bohemian<br /> Kingdom are kept here. </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]);
}
