
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(45.474577,9.159508), 13);
	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(45.463946,9.192746);
	bounds.extend(point);
	var marker = createMarker(point, "Duomo", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Duomo</b><br>At the heart of the city, Milan's Duomo is the world's largest Gothic<br/>cathedral, begun in 1386 and added to each century thereafter. The<br/>best time to visit is in bright sunshine, when the windows create a<br/>kaleidoscope of colour through the cavernous interior.</p>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Duomo</b><br>At the heart of the city, Milan's Duomo is the world's largest Gothic<br/>cathedral, begun in 1386 and added to each century thereafter. The<br/>best time to visit is in bright sunshine, when the windows create a<br/>kaleidoscope of colour through the cavernous interior.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.465603,9.190804);
	bounds.extend(point);
	var marker = createMarker(point, "Galleria Vittorio Emanuele II", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Galleria Vittorio Emanuele II</b><br>Entered from the Piazza in front of the Cathedral, the glass-domed cruciform<br/>Vittorio Emanuele II Gallery is a vast Belle Epoque shopping arcade. It was<br/>built to link the Piazza del Duomo to the Piazza della Scala and soon became<br/>Milan's conservatory. Winter and summer, Milanesi can be seen here,<br/>escaping the rain, browsing the exclusive shops and sipping Campari and<br/>soda in the bars.</p>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Galleria Vittorio Emanuele II</b><br>Entered from the Piazza in front of the Cathedral, the glass-domed cruciform<br/>Vittorio Emanuele II Gallery is a vast Belle Epoque shopping arcade. It was<br/>built to link the Piazza del Duomo to the Piazza della Scala and soon became<br/>Milan's conservatory. Winter and summer, Milanesi can be seen here,<br/>escaping the rain, browsing the exclusive shops and sipping Campari and<br/>soda in the bars.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.4674,9.188304);
	bounds.extend(point);
	var marker = createMarker(point, "Museo Teatrale alla Scala", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museo Teatrale alla Scala</b><br>Opera lovers should visit this museum, crammed with rich mementoes of the<br/>celebrated opera house, La Scala. Two collections are devoted to Milan's<br>darling Verdi, whose 'Slaves Chorus' from Nabucco remains the unofficial<br/>Italian anthem. Memorabilia include the spinet on which he learned to play,<br/>scores in his own hand and the jewel-encrusted baton presented to him after<br/>the triumphal reception of Aida. Rossini, Puccini and Toscanini are honoured<br/>alongside him.</p>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museo Teatrale alla Scala</b><br>Opera lovers should visit this museum, crammed with rich mementoes of the<br/>celebrated opera house, La Scala. Two collections are devoted to Milan's<br>darling Verdi, whose 'Slaves Chorus' from Nabucco remains the unofficial<br/>Italian anthem. Memorabilia include the spinet on which he learned to play,<br/>scores in his own hand and the jewel-encrusted baton presented to him after<br/>the triumphal reception of Aida. Rossini, Puccini and Toscanini are honoured<br/>alongside him.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.466,9.170687);
	bounds.extend(point);
	var marker = createMarker(point, "Santa Maria delle Grazie", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Santa Maria delle Grazie</b><br>The Church and Convent of Santa Maria delle Grazie were built between 1465<br/>and 1482 to designs by Guiniforte Solari. The church's original architectonic<br/>layout, now only visible in the form of the nave and aisles, was a typical<br/>example of Late Gothic Lombard art of which Solari was a well-known exponent.<br/>The church is also famous for the mural of the Last Supper by Leonardo da<br/>Vinci, which is in the refectory of the convent.</p>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Santa Maria delle Grazie</b><br>The Church and Convent of Santa Maria delle Grazie were built between 1465<br/>and 1482 to designs by Guiniforte Solari. The church's original architectonic<br/>layout, now only visible in the form of the nave and aisles, was a typical<br/>example of Late Gothic Lombard art of which Solari was a well-known exponent.<br/>The church is also famous for the mural of the Last Supper by Leonardo da<br/>Vinci, which is in the refectory of the convent.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.469943,9.180064);
	bounds.extend(point);
	var marker = createMarker(point, "Museo d'Arte Antica del Castello Sforzesco", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museo d'Arte Antica del Castello Sforzesco</b><br>Three municipal museums compete for attention within the redbrick<br/>15th-century Sforza Castle. The Museum of Historic Art; where<br/>visitors come to see Michelangelo's last work, the unfinished Pieta<br/>Rondanina, the extensive sculpture galleries, and the large collection<br/>of paintings. The Museum of Applied Arts, and the Archaeological<br/>Museum, which are housed in the fortress (Rocchetta).</p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museo d'Arte Antica del Castello Sforzesco</b><br>Three municipal museums compete for attention within the redbrick<br/>15th-century Sforza Castle. The Museum of Historic Art; where<br/>visitors come to see Michelangelo's last work, the unfinished Pieta<br/>Rondanina, the extensive sculpture galleries, and the large collection<br/>of paintings. The Museum of Applied Arts, and the Archaeological<br/>Museum, which are housed in the fortress (Rocchetta).</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.471959,9.188111);
	bounds.extend(point);
	var marker = createMarker(point, "Pinacoteca di Brera", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Pinacoteca di Brera</b><br>Brera Picture Gallery. Napoleon, whose statue by Canova stands in the courtyard,<br/>opened the Brera Picture Gallery in 1809. A collection that was enriched with objects<br/>confiscated on his Italian campaigns. The collection is best known for its Venetian<br/>and Lombard masters.</p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Pinacoteca di Brera</b><br>Brera Picture Gallery. Napoleon, whose statue by Canova stands in the courtyard,<br/>opened the Brera Picture Gallery in 1809. A collection that was enriched with objects<br/>confiscated on his Italian campaigns. The collection is best known for its Venetian<br/>and Lombard masters.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.465157,9.182532);
	bounds.extend(point);
	var marker = createMarker(point, "Museo Nazionale della Scienza e della Tecnica Leonardo da Vinci", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museo Nazionale della Scienza e della Tecnica Leonardo da Vinci</b><br>Most visitors come to this museum, devoted to the history of science,<br/>to see the Leonardo Gallery, with its host of models (both static and<br/>functioning) that illustrate da Vinci's intuitive genius. His designs for<br/>war machines, flying machines, architecture and production awaken<br/>admiration for a man whose ideas, even when not 100% successful,<br/>display incredible foresight.</p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museo Nazionale della Scienza e della Tecnica Leonardo da Vinci</b><br>Most visitors come to this museum, devoted to the history of science,<br/>to see the Leonardo Gallery, with its host of models (both static and<br/>functioning) that illustrate da Vinci's intuitive genius. His designs for<br/>war machines, flying machines, architecture and production awaken<br/>admiration for a man whose ideas, even when not 100% successful,<br/>display incredible foresight.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.462132,9.17485);
	bounds.extend(point);
	var marker = createMarker(point, "Basilica de Sant'Ambrogio", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Basilica de Sant'Ambrogio</b><br>Built by Saint Ambrose, the patron saint of Milan, the original basilica<br/>dates back to the fourth century. The Sant'Ambrogio basilica (ninth-12th<br/>centuries) is one of Milan's finest churches, a monumental building in the<br/>mature Lombard Romanesque style, The Chapel of St Victor, at the end of<br/>the south aisle, is a vaulted funerary chapel built in the church cemetery<br/>in the fourth century.</p>", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Basilica de Sant'Ambrogio</b><br>Built by Saint Ambrose, the patron saint of Milan, the original basilica<br/>dates back to the fourth century. The Sant'Ambrogio basilica (ninth-12th<br/>centuries) is one of Milan's finest churches, a monumental building in the<br/>mature Lombard Romanesque style, The Chapel of St Victor, at the end of<br/>the south aisle, is a vaulted funerary chapel built in the church cemetery<br/>in the fourth century.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.469251,9.196115);
	bounds.extend(point);
	var marker = createMarker(point, "Quadrilatero della Moda", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Quadrilatero della Moda</b><br>Milan is a temple of high fashion, home of Armani and Versace, and<br/>naturally sure to delight the high priests and priestesses of style. The<br/>so-called Quadrilateral of fashion, formed by Via Montenapoleone,<br/>Via Sant'Andrea, Via Monzani and Via della Spiga north of the<br/>Cathedral, is top of the list.</p>", 9);
	gmarkers[8] = marker;
	htmls[8] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Quadrilatero della Moda</b><br>Milan is a temple of high fashion, home of Armani and Versace, and<br/>naturally sure to delight the high priests and priestesses of style. The<br/>so-called Quadrilateral of fashion, formed by Via Montenapoleone,<br/>Via Sant'Andrea, Via Monzani and Via della Spiga north of the<br/>Cathedral, is top of the list.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.477827,9.123523);
	bounds.extend(point);
	var marker = createMarker(point, "Stadio San Siro", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Stadio San Siro</b><br>The home stadium for two of the three most successful Italian Football<br/>League clubs: A.C. Milan and F.C. Internazionale, and one of the most<br/>famous football stadia in the world. Although it has been officially<br/>renamed in honour of Giuseppe Meazza, the Inter and Milan player of<br/>the 1930s and 1940s, it is still commonly called the San Siro.</p>", 10);
	gmarkers[9] = marker;
	htmls[9] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Stadio San Siro</b><br>The home stadium for two of the three most successful Italian Football<br/>League clubs: A.C. Milan and F.C. Internazionale, and one of the most<br/>famous football stadia in the world. Although it has been officially<br/>renamed in honour of Giuseppe Meazza, the Inter and Milan player of<br/>the 1930s and 1940s, it is still commonly called the San Siro.</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]);
}
