
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.605151,5.888672), 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(45.564868,5.920891);
	bounds.extend(point);
	var marker = createMarker(point, "The Old Town", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Old Town</b><br/>Chambery was once the capital of Savoy, before that honour was passed<br>to Turin in the 16th century. Nonetheless, much of its old glory remains,<br>with the central Place Saint Leger opening up into a spider web of<br>thirteenth-century streets. Majestic mansions and elegant fountains<br>protrude around the pedestrianised square.</p>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Old Town</b><br/>Chambery was once the capital of Savoy, before that honour was passed<br>to Turin in the 16th century. Nonetheless, much of its old glory remains,<br>with the central Place Saint Leger opening up into a spider web of<br>thirteenth-century streets. Majestic mansions and elegant fountains<br>protrude around the pedestrianised square.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.564605,5.918198);
	bounds.extend(point);
	var marker = createMarker(point, "Castle of the Dukes of Savoy", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Castle of the Dukes of Savoy</b><br>Located in the old town is the iconic Castle of the Dukes of Savoy.<br>The oldest of this group of buildings date back to the middle ages,<br>and yet the complex is still used to house the Prefecture and Savoy<br>County Council. Historic documents and a Savoy family tree are on<br>view for visitors.</p>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Castle of the Dukes of Savoy</b><br>Located in the old town is the iconic Castle of the Dukes of Savoy.<br>The oldest of this group of buildings date back to the middle ages,<br>and yet the complex is still used to house the Prefecture and Savoy<br>County Council. Historic documents and a Savoy family tree are on<br>view for visitors.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.56661,5.922951);
	bounds.extend(point);
	var marker = createMarker(point, "The Elephants Fountain", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Elephants Fountain</b><br>The Fontaine des Elephants is surely the most famous landmark in Chambery.<br>It was built in 1838 to honour Benoit de Boigne's feats when he was in India.</p>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Elephants Fountain</b><br>The Fontaine des Elephants is surely the most famous landmark in Chambery.<br>It was built in 1838 to honour Benoit de Boigne's feats when he was in India.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.653408,5.881119);
	bounds.extend(point);
	var marker = createMarker(point, "Lac du Bourget", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Lac du Bourget</b><br>One of Europe's most beautiful lakes, Lac du Bourget, can be found just<br>north of Chambery. The 18-kilometre stretch of water is surrounded by the<br>Jura mountains and has retained its untouched beauty thanks to continuous<br>investment.</p>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Lac du Bourget</b><br>One of Europe's most beautiful lakes, Lac du Bourget, can be found just<br>north of Chambery. The 18-kilometre stretch of water is surrounded by the<br>Jura mountains and has retained its untouched beauty thanks to continuous<br>investment.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.5552,5.929699);
	bounds.extend(point);
	var marker = createMarker(point, "Museum of Charmettes - Jean-Jacques Rousseau House", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museum of Charmettes - Jean-Jacques Rousseau House</b><br>The Charmettes Museum provides an interesting interlude as it was where<br>the great philosopher Rousseau spent his summers. Today it is a museum<br>which serves to shed a light on how it must have been during the eighteenth<br>century during those glorious summer months.</p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museum of Charmettes - Jean-Jacques Rousseau House</b><br>The Charmettes Museum provides an interesting interlude as it was where<br>the great philosopher Rousseau spent his summers. Today it is a museum<br>which serves to shed a light on how it must have been during the eighteenth<br>century during those glorious summer months.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.559978,5.930042);
	bounds.extend(point);
	var marker = createMarker(point, "Andre Malraux Cultural Centre", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Andre Malraux Cultural Centre</b><br>French writer and politician Andre Malraux (1901-1976) was generally<br>regarded as one of the most distinguished novelists of the 20th century.<br>Malraux holds the distinction of having been France's first minister of<br>culture, serving from 1959-69.</p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Andre Malraux Cultural Centre</b><br>French writer and politician Andre Malraux (1901-1976) was generally<br>regarded as one of the most distinguished novelists of the 20th century.<br>Malraux holds the distinction of having been France's first minister of<br>culture, serving from 1959-69.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.568075,5.919367);
	bounds.extend(point);
	var marker = createMarker(point, "Fine Arts Museum", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fine Arts Museum</b><br>The Fine Arts Museum is home to a large collection of Italian paintings.<br>Works from the Quattrocentro and the Renaissance are among those<br>displayed. Sculptures, ivory, and Chinese pieces are also located here,<br>as are works from the French and Northern Schools. Guided tours are<br>available.</p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fine Arts Museum</b><br>The Fine Arts Museum is home to a large collection of Italian paintings.<br>Works from the Quattrocentro and the Renaissance are among those<br>displayed. Sculptures, ivory, and Chinese pieces are also located here,<br>as are works from the French and Northern Schools. Guided tours are<br>available.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(45.563057,5.909722);
	bounds.extend(point);
	var marker = createMarker(point, "Natural History Museum", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Natural History Museum</b><br>The Natural History Museum is home to rare botancial, geological, and<br>zoological specimens. Among these are a Lebanon cedar, a huge Laricio<br>pine tree, female gingko, and a botanical garden with rose flower beds.</p>", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Natural History Museum</b><br>The Natural History Museum is home to rare botancial, geological, and<br>zoological specimens. Among these are a Lebanon cedar, a huge Laricio<br>pine tree, female gingko, and a botanical garden with rose flower beds.</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]);
}
