
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(55.921123,-3.204918), 6);
	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(55.948611,-3.200833);
	bounds.extend(point);
	var marker = createMarker(point, "Edinburgh Castle", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Edinburgh Castle</b><br>Edinburgh Castle is Scotland's most famous castle,<br>it is the number one visitor attraction. The<br>number of visitors to this medieval-like<br>fortress reaches approximately one million people<br>every year.<br>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Edinburgh Castle</b><br>Edinburgh Castle is Scotland's most famous castle,<br>it is the number one visitor attraction. The<br>number of visitors to this medieval-like<br>fortress reaches approximately one million people<br>every year.<br>";
	map.addOverlay(marker);


	var icon = new GIcon(baseIcon);
	var point = new GLatLng(55.952158,-3.175204);
	bounds.extend(point);
	var marker = createMarker(point, "Scottish Parliament Building", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Scottish Parliament Building</b><br>The Scottish Parliament Building is the home<br>of the Scottish Parliament at Holyrood, within<br>the UNESCO World Heritage Site.<br>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Scottish Parliament Building</b><br>The Scottish Parliament Building is the home<br>of the Scottish Parliament at Holyrood, within<br>the UNESCO World Heritage Site.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(55.982222,-3.176528);
	bounds.extend(point);
	var marker = createMarker(point, "HMY Britannia", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>HMY Britannia</b><br>Her Majesty's Yacht Britannia was the<br>83rd Royal Yacht since the restoration<br>of King Charles II in 1660. She is the<br>2nd Royal yacht to bear the name. She is<br>now permanently moored as an exhibition<br>ship at Ocean Terminal, Leith, Edinburgh.<br>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>HMY Britannia</b><br>Her Majesty's Yacht Britannia was the<br>83rd Royal Yacht since the restoration<br>of King Charles II in 1660. She is the<br>2nd Royal yacht to bear the name. She is<br>now permanently moored as an exhibition<br>ship at Ocean Terminal, Leith, Edinburgh.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(55.946941,-3.190541);
	bounds.extend(point);
	var marker = createMarker(point, "Museum of Scotland", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museum of Scotland</b><br>Museum of Scotland, Edinburgh, is a building<br>which, together with the adjacent Royal<br>Museum, comprises the National<br>Museum of Scotland. It is dedicated<br>to the history, people and culture of<br>Scotland.<br>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museum of Scotland</b><br>Museum of Scotland, Edinburgh, is a building<br>which, together with the adjacent Royal<br>Museum, comprises the National<br>Museum of Scotland. It is dedicated<br>to the history, people and culture of<br>Scotland.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(55.966101,-3.207536);
	bounds.extend(point);
	var marker = createMarker(point, "Royal Botanic Garden", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Royal Botanic Garden</b><br>The Royal Botanic Garden Edinburgh is<br>both a scientific institution and a<br>tourist attraction. It was originally founded<br>in 1670 as a physic garden to grow medicinal<br>plants. Today, is showcases its own specialist<br>collection.<br></p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Royal Botanic Garden</b><br>The Royal Botanic Garden Edinburgh is<br>both a scientific institution and a<br>tourist attraction. It was originally founded<br>in 1670 as a physic garden to grow medicinal<br>plants. Today, is showcases its own specialist<br>collection.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(55.955423,-3.18007);
	bounds.extend(point);
	var marker = createMarker(point, "Calton Hill", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Calton Hill</b><br>Calton Hill is one of Edinburgh's main<br>hills, set right in the city centre. It<br>is unmistakable with its Athenian<br>acropolis dominating the skyline.<br>It's now a popular landmark and it's a lot<br>of fun crawling up and down its giant steps.<br></p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Calton Hill</b><br>Calton Hill is one of Edinburgh's main<br>hills, set right in the city centre. It<br>is unmistakable with its Athenian<br>acropolis dominating the skyline.<br>It's now a popular landmark and it's a lot<br>of fun crawling up and down its giant steps.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(55.856624,-3.16093);
	bounds.extend(point);
	var marker = createMarker(point, "Rosslyn Chapel", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Rosslyn Chapel</b><br>Built in 1446, the chapel is steeped in<br>symbolism, mysticism and references to the<br>Knights of the Templar, Freemasonary and the<br>pagan Green Man. The neighbouring Rosslyn Glen, a<br>rambling, stretch of mature woodland, with<br>fairly deep caves, is also well<br>worth a visit.<br></p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Rosslyn Chapel</b><br>Built in 1446, the chapel is steeped in<br>symbolism, mysticism and references to the<br>Knights of the Templar, Freemasonary and the<br>pagan Green Man. The neighbouring Rosslyn Glen, a<br>rambling, stretch of mature woodland, with<br>fairly deep caves, is also well<br>worth a visit.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(55.950708,-3.175886);
	bounds.extend(point);
	var marker = createMarker(point, "Dynamic Earth", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Dynamic Earth</b><br>Brand new purpose built exhibition tented<br>amphitheatre that attempts to chart the<br>evolution of the earth from early<br>beginnings using art earthscapes. Exhibitions<br>at Scotland's millennium dome take in volcanos,<br>tropical rainforest settings and the<br>freezing polar regions.<br></p>", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Dynamic Earth</b><br>Brand new purpose built exhibition tented<br>amphitheatre that attempts to chart the<br>evolution of the earth from early<br>beginnings using art earthscapes. Exhibitions<br>at Scotland's millennium dome take in volcanos,<br>tropical rainforest settings and the<br>freezing polar regions.<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]);
}
