
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.950594,4.803579), 15);
	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(43.951351,4.80647);
	bounds.extend(point);
	var marker = createMarker(point, "Palais des Papes", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Palais des Papes</b><br/>Palace of the Popes; one of the largest and most important<br/>medieval Gothic buildings in Europe. Open to the public<br/>it also houses a large convention center and the archives<br/>of the departement of Vaucluse.", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Palais des Papes</b><br/>Palace of the Popes; one of the largest and most important<br/>medieval Gothic buildings in Europe. Open to the public<br/>it also houses a large convention center and the archives<br/>of the departement of Vaucluse.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(43.953614,4.804931);
	bounds.extend(point);
	var marker = createMarker(point, "Pont St Benezet", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Pont St Benezet</b><br>The medieval bridge, which achieved worldwide fame through the<br/>song 'Sur le pont d'Avignon', originally spanned the Rhone River<br/>between Avignon and Villeneuve-les-Avignon. After suffering<br/>frequent collapses and several attempts at reconstruction it was<br/>finally put out of use by a catastrophic flood in 1668.", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Pont St Benezet</b><br>The medieval bridge, which achieved worldwide fame through the<br/>song 'Sur le pont d'Avignon', originally spanned the Rhone River<br/>between Avignon and Villeneuve-les-Avignon. After suffering<br/>frequent collapses and several attempts at reconstruction it was<br/>finally put out of use by a catastrophic flood in 1668.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(43.952865,4.805692);
	bounds.extend(point);
	var marker = createMarker(point, "Musee du Petit Palais", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Musee du Petit Palais</b><br>Originally the bishop's palace, where the first two Avignon popes<br>lived before the Palais des Papes was constructed. Today, the Petit<br>Palais houses an outstanding collection of 13th to 16th century<br>Italian religious paintings, including works from Florence, Venice,<br>Siena, and Lombardy.<br>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Musee du Petit Palais</b><br>Originally the bishop's palace, where the first two Avignon popes<br>lived before the Palais des Papes was constructed. Today, the Petit<br>Palais houses an outstanding collection of 13th to 16th century<br>Italian religious paintings, including works from Florence, Venice,<br>Siena, and Lombardy.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(43.950919,4.806454);
	bounds.extend(point);
	var marker = createMarker(point, "Notre-Dame des Doms", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Notre-Dame des Doms</b><br>The Notre-Dame des Doms was first built in a pure Provencal Romanesque<br>style in the 12th century The Baroque galleries were added in the 17th<br>century and crowning the top of the cathedral is a huge gilded Virgin Mary<br>lantern from the 19th century, whose glow can be seen for miles around.<br>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Notre-Dame des Doms</b><br>The Notre-Dame des Doms was first built in a pure Provencal Romanesque<br>style in the 12th century The Baroque galleries were added in the 17th<br>century and crowning the top of the cathedral is a huge gilded Virgin Mary<br>lantern from the 19th century, whose glow can be seen for miles around.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(43.947041,4.803386);
	bounds.extend(point);
	var marker = createMarker(point, "Musee Calvet", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Musee Calvet</b><br>Founded in 1810, by the collector Esprit Calvet, houses a<br>collection of 17th and 18th century paintings, a collection<br>of 14th and 15th century wrought iron works, as well as<br>many other pieces.<br>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Musee Calvet</b><br>Founded in 1810, by the collector Esprit Calvet, houses a<br>collection of 17th and 18th century paintings, a collection<br>of 14th and 15th century wrought iron works, as well as<br>many other pieces.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(43.949188,4.80581);
	bounds.extend(point);
	var marker = createMarker(point, "Place de l'Horloge", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Place de l'Horloge</b><br>Avignon's central square is the center of Avignon life.<br>Surrounded by numerous street cafes and several buildings<br>of interest including the Hotel de Ville, and the Opera House.<br>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Place de l'Horloge</b><br>Avignon's central square is the center of Avignon life.<br>Surrounded by numerous street cafes and several buildings<br>of interest including the Hotel de Ville, and the Opera House.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(43.947319,4.80094);
	bounds.extend(point);
	var marker = createMarker(point, "Musee Louis-Vouland", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Musee Louis-Vouland</b><br>Located within a 19th century mansion and gardens, the<br>museum houses numerous 17th and 18th century antiques<br>and art objects.<br>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Musee Louis-Vouland</b><br>Located within a 19th century mansion and gardens, the<br>museum houses numerous 17th and 18th century antiques<br>and art objects.<br>";
	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]);
}
