
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(46.090355,-1.17691), 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(46.01282,-1.172447);
	bounds.extend(point);
	var marker = createMarker(point, "Ile-d'Aix", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Ile-d'Aix</b><br>A popular place for tourist day-trips during<br>the summer months, Ile-d'Aix is in the Atlantic.<br>It is also the name of the commune of the Charente-Maritime<br>département which occupies the territory of the island.<br>It has a population of only 186 (1999) and an<br>area of about 300 acres.<br>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Ile-d'Aix</b><br>A popular place for tourist day-trips during<br>the summer months, Ile-d'Aix is in the Atlantic.<br>It is also the name of the commune of the Charente-Maritime<br>département which occupies the territory of the island.<br>It has a population of only 186 (1999) and an<br>area of about 300 acres.<br>";
	map.addOverlay(marker);


	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.999734,-1.213903);
	bounds.extend(point);
	var marker = createMarker(point, "Fort Boyard", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fort Boyard</b><br>Fort Boyard is a fort located between the<br>Ile-d'Aix and the Ile d'Oléron in the Pertuis d'Antioche straits.<br>Its accessible from La Rochelle since its<br>restoration and remains as the set for the popular tv show<br>of the same name.<br>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fort Boyard</b><br>Fort Boyard is a fort located between the<br>Ile-d'Aix and the Ile d'Oléron in the Pertuis d'Antioche straits.<br>Its accessible from La Rochelle since its<br>restoration and remains as the set for the popular tv show<br>of the same name.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(46.15424,-1.14982);
	bounds.extend(point);
	var marker = createMarker(point, "Aquarium de La Rochelle", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Aquarium de La Rochelle</b><br>This first class aquarium is located at the very<br>heart of the old port in La Rochelle. The<br>centre is close to the sea, and holds over 10,000<br>samples of flora, forna and of course sea and water<br>life.<br>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Aquarium de La Rochelle</b><br>This first class aquarium is located at the very<br>heart of the old port in La Rochelle. The<br>centre is close to the sea, and holds over 10,000<br>samples of flora, forna and of course sea and water<br>life.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(46.152293,-1.156547);
	bounds.extend(point);
	var marker = createMarker(point, "Atlantic Museum", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Atlantic Museum</b><br>The Atlantic Museum is situated just a few hundred<br>yards from the coast of the Atlantic Ocean,<br>the body of water that makes La Rochelle what it is,<br>an historic place of interest, a fortified port and<br>a significant place in France.<br>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Atlantic Museum</b><br>The Atlantic Museum is situated just a few hundred<br>yards from the coast of the Atlantic Ocean,<br>the body of water that makes La Rochelle what it is,<br>an historic place of interest, a fortified port and<br>a significant place in France.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(46.156329,-1.17264);
	bounds.extend(point);
	var marker = createMarker(point, "Franck Delmas Park", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Franck Delmas Park</b><br>A little way out of the immediate historic<br>town centre, this large public park is a particular<br>favourite with local people.<br>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Franck Delmas Park</b><br>A little way out of the immediate historic<br>town centre, this large public park is a particular<br>favourite with local people.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(46.160282,-1.152245);
	bounds.extend(point);
	var marker = createMarker(point, "Town Hall", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Town Hall</b><br>La Rochelle Town Hall is one of the more flamboyant<br>buildings in the town. It has a large majestic outer<br>wall which has been constructed in a Gothic style,<br>making the building seem even grander than it<br>already looks.<br></p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Town Hall</b><br>La Rochelle Town Hall is one of the more flamboyant<br>buildings in the town. It has a large majestic outer<br>wall which has been constructed in a Gothic style,<br>making the building seem even grander than it<br>already looks.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(46.155407,-1.151236);
	bounds.extend(point);
	var marker = createMarker(point, "The Gabut Quarter Tour", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Gabut Quarter Tour</b><br>The Gabut Quarter is one of the oldest areas of La<br>Rochelle and looks out onto the Vieux Port. It is a<br>popular place for tourists to go who are looking to get a feel<br>for the real social history behind the town.<br></p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Gabut Quarter Tour</b><br>The Gabut Quarter is one of the oldest areas of La<br>Rochelle and looks out onto the Vieux Port. It is a<br>popular place for tourists to go who are looking to get a feel<br>for the real social history behind the town.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(46.147499,-1.155839);
	bounds.extend(point);
	var marker = createMarker(point, "Mega CGR", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Mega CGR</b><br>This fine cinema is noted as being one of the best places<br>to watch a film in the La Rochelle area. It caters to the needs of<br>the large tourist population in the area and therefore shows a good selection<br>of films from around the world.<br></p>", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Mega CGR</b><br>This fine cinema is noted as being one of the best places<br>to watch a film in the La Rochelle area. It caters to the needs of<br>the large tourist population in the area and therefore shows a good selection<br>of films from around the world.<br></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]);
}

