
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(43.712929,10.401134), 8);
	map.addControl(new GLargeMapControl());

	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(43.722587,10.394996);
	bounds.extend(point);
	var marker = createMarker(point, "Piazza del Duomo", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Piazza del Duomo</b><br/>Piazza del Duomo<br/ >Pisa<br/ > Italy <br/>Standing in a large green expanse, Piazza del Duomo<br/>  houses a group of monuments known the world over. <br />These four masterpieces of medieval architecture - <br />the cathedral, the baptistry, the campanile <br />(the 'Leaning Tower') and the cemetery - had a great<br /> influence on monumental art in Italy from the<br /> 11th to the 14th century.</p>", 1);
	gmarkers[0] = marker;
	htmls[0] ="<p style='font-size: smaller; padding: 0; margin: 0;'><b>Piazza del Duomo</b><br/>Standing in a large green expanse, Piazza del Duomo<br/>  houses a group of monuments known the world over. <br />These four masterpieces of medieval architecture - <br />the cathedral, the baptistry, the campanile <br />(the 'Leaning Tower') and the cemetery - had a great<br /> influence on monumental art in Italy from the<br /> 11th to the 14th century.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(43.723266,10.393828);
	bounds.extend(point);
	var marker = createMarker(point, "Baptistery", "<p style='font-size: smaller; padding: 0; margin: 0;'><br/ >Baptistery<br/ >The largest baptistry in Italy. An example of the transition from the<br />Romanesque style to the Gothic style: the lower registers are<br />in the Romanesque style, with rounded arches, while the upper<br />registers are in the Gothic style, with pointed arches. The Baptistry is<br />constructed of marble, plentiful and often used in Italian architecture.</p>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Baptistery</b><br/>The largest baptistry in Italy. An example of the transition from the<br />Romanesque style to the Gothic style: the lower registers are<br />in the Romanesque style, with rounded arches, while the upper<br />registers are in the Gothic style, with pointed arches. The Baptistry is<br />constructed of marble, plentiful and often used in Italian architecture.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(43.723521,10.398474);
	bounds.extend(point);
	var marker = createMarker(point, "Teatro Comunale Verdi", "<p style='font-size: smaller; padding: 0; margin: 0;'>Teatro Comunale<br /> Verdi Via Palestro, 40,<br /> 56127 Pisa PI,<br /> Italy One of the main centres of cultural life in a city that lives and breathes culture, the Teatro Verdi hosts ballet and theatre performances, concerts, opera and a wide range of related activities</p>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Teatro Comunale Verdi</b><br />One of the main centres of cultural life in a city <br /> that lives and breathes culture, the Teatro Verdi hosts<br /> ballet and theatre performances, concerts, <br />opera and a wide range of related activities</p></p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(43.716403,10.404428);
	bounds.extend(point);
	var marker = createMarker(point, "Piazza Vettovaglie", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Piazza Vettovaglie</b><br/>There are excellent, friendly and reasonably priced<br/> cafeterias in the busy small vegetable market, Piazza delle Vettovaglie</p>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Piazza Vettovaglie</b><br/>Rhere are excellent, friendly and reasonably priced<br/> cafeterias in the busy small vegetable market</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(43.717217,10.402122);
	bounds.extend(point);
	var marker = createMarker(point, "Parco Naturale di Migliarino", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Parco Naturale di Migliarino</b><br/>Italy<br/><strong>Parco regionale di  Migliarino San Rossore Massaciuccoli</strong> covers an area of about 24.000 hectares in   the<br/> provinces of Pisa and Lucca. The Park area stretches along<br/> the Tyrrheanian   coast between Livorno in the<br/> south and Viareggio in the north and reaches the   hills of Monte Quiesa. During the Roman colonization, the territory was   characterized by large maquis and forests of the delta area of the system </p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Parco Naturale di Migliarino</b><br />Parco regionale di Migliarino San Rossore<br/> Massaciuccoli covers an area of about 24.000<br/> hectares in the provinces of Pisa and Lucca.<br/> The Park area stretches along the Tyrrheanian coast<br/> between Livorno in the south and Viareggio<br/> in the north and reaches the hills of Monte Quiesa.</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]);
}
